* [NOD-700] Convert blockSet to map[*blockNode]struct{}.
* [NOD-700] Rename bluestNode to bluestBlock in bluest().
* [NOD-700] Make IsInSelectedParentChain not use the now-slower containsHash.
* [NOD-700] Rename block to node in blockset.go.
* [NOD-700] Remove containsHash and hashesEqual.
* [NOD-700] Add a comment to IsInSelectedParentChain about how it'll fail if the given blockHash is not within the block index.
* [NOD-629] Change GHOSTDAG K to a a single byte using type
* [NOD-629] Rename variable
* [NOD-629] Rename K to KSize
* [NOD-629] Remove redundant casting
* [NOD-629] Add test for KSize
* [NOD-629] Seperate block serialization and db store
* [NOD-629] Make sure K is serialized as uint8
* [NOD-629] Rename KSize to KType
* [NOD-629] Comment for test
* [NOD-629] Change fail message
* [NOD-629] Remove newlines
* [NOD-629] Fix test
* [NOD-629] Do not use maxuint8, but !0 instead
* [NOD-629] Fix test
* [NOD-629] Merge conflict
* [NOD-629] Fix test; Update comment
* [NOD-652] Add selectedTip and getSelectedTip messages
* [NOD-652] Remove peerSyncState.isSelectedTipKnown
* [NOD-652] Do nothing on OnSelectedTip if the peer selected tip hasn't changed
* [NOD-652] Handle selected tip message with block handler
* [NOD-652] Add comments
* [NOD-652] go mod tidy
* [NOD-652] Fix TestVersion
* [NOD-652] Use dag.AdjustedTime instead of dag.timeSource.AdjustedTime
* [NOD-652] Create shouldQueryPeerSelectedTips and queueMsgGetSelectedTip functions
* [NOD-652] Change selectedTip to selectedTipHash where needed
* [NOD-652] add minDAGTimeDelay constant
* [NOD-652] add comments
* [NOD-652] Fix names and comments
* [NOD-652] Put msg.reply push in the right place
* [NOD-652] Fix comments and names
* [NOD-616] Remove unused methods from BlockDAG.
* [NOD-616] Remove Height from GetRawMempoolVerboseResult and TxDesc.
* [NOD-616] Replaced BlockDAG.ChainHeight with SelectedTipBlueScore.
* [NOD-616] Remove the unused BlockChainHeightByHash.
* [NOD-616] Remove the unused blockChainHeight from checkBlockHeaderContext.
* [NOD-616] Remove chainHeight from util.Block.
* [NOD-616] Remove TestChainHeight.
* [NOD-616] Update unknown rule activation warning to use blueScore.
* [NOD-616] Update thresholdState to use blueScore instead of chainHeight.
* [NOD-616] Update blockLocator to use blueScore instead of chainHeight.
* [NOD-616] Remove blockNode.chainHeight.
* [NOD-616] Fix comments and variable names.
* [NOD-616] Replace a weird for loop with a while loop.
* [NOD-616] Fix a comment.
* [NOD-616] Remove pre-allocation in blockLocator.
* [NOD-616] Coalesce checks that startHash and stopHash are not the same into the same condition.
* [NOD-616] Fix a comment.
* [NOD-616] Remove weird blueScore logic around childHashStrings.
* [NOD-616] Fix hash pointer comparison.
* [NOD-616] Fix a comment.
* [NOD-616] Add ban score to peers misusing GetBlockLocator.
* [NOD-616] Replace adding ban score with disconnecting.
* [NOD-616] Add blueScore to FilteredBlockAddedNtfn.
* [NOD-540] Implement reachability (#545)
* [NOD-540] Begin implementing reachability.
* [NOD-540] Finish implementing reachability.
* [NOD-540] Implement TestIsFutureBlock.
* [NOD-540] Implement TestInsertFutureBlock.
* [NOD-540] Add comments.
* [NOD-540] Add comment for interval in blockNode.
* [NOD-540] Updated comments over insertFutureBlock and isFutureBlock.
* [NOD-540] Implement interval splitting methods.
* [NOD-540] Begin implementing tree manipulation in blockNode.
* [NOD-540] Implement countSubtreesUp.
* [NOD-540] Add a comment explaining an impossible condition.
* [NOD-540] Implement applyIntervalDown.
* [NOD-540] Moved the reachability tree stuff into reachability.go.
* [NOD-540] Add some comments.
* [NOD-540] Add more comments, implement isInPast.
* [NOD-540] Fix comments.
* [NOD-540] Implement TestSplitFraction.
* [NOD-540] Implement TestSplitExact.
* [NOD-540] Implement TestSplit.
* [NOD-540] Add comments to structs.
* [NOD-540] Implement TestAddTreeChild.
* [NOD-540] Fix a comment.
* [NOD-540] Rename isInPast to isAncestorOf.
* [NOD-540] Rename futureBlocks to futureCoveringSet.
* [NOD-540] Rename isFutureBlock to isInFuture.
* [NOD-540] move reachabilityInterval to the top of reachability.go.
* [NOD-540] Change "s.t." to "such that" in a comment.
* [NOD-540] Fix indentation.
* [NOD-540] Fix a potential bug involving float inaccuracy.
* [NOD-540] Wrote a more descriptive error message.
* [NOD-540] Fix error messsage.
* [NOD-540] Fix the recursive countSubtreesUp.
* [NOD-540] Rename countSubtreesUp to countSubtrees and applyIntervalDown to propagateInterval.
* [NOD-540] Implement updating reachability for a valid new block.
* [NOD-540] Implement a disk storage for reachability data.
* [NOD-540] Fix not all tree nodes being written to the database.
* [NOD-540] Implement serialization for reachabilityData.
* [NOD-540] Implement some deserialization for reachabilityData.
* [NOD-540] Implement restoring the reachabilityStore on node restart.
* [NOD-540] Made interval and remainingInterval pointers.
* [NOD-540] Rename setTreeInterval to setInterval.
* [NOD-540] Rename reindexTreeIntervals to reindexIntervals and fixed the comment above it.
* [NOD-540] Expand the comment above reindexIntervals.
* [NOD-540] Fix comment above countSubtrees.
* [NOD-540] Fix comment above countSubtrees some more.
* [NOD-540] Fix comment above split.
* [NOD-540] Fix comment above isAncestorOf.
* [NOD-540] Fix comment above reachabilityTreeNode.
* [NOD-540] Fix weird condition in addTreeChild.
* [NOD-540] Rename addTreeChild to addChild.
* [NOD-540] Fix weird condition in splitFraction.
* [NOD-540] Reverse the lines in reachabilityTreeNode.String().
* [NOD-540] Renamed f to fraction and x to size.
* [NOD-540] Fix comment above bisect.
* [NOD-540] Implement rtn.isAncestorOf().
* [NOD-540] Use treeNode isAncestorOf instead of treeInterval isAncestorOf.
* [NOD-540] Use newReachabilityInterval instead of struct initialization.
* [NOD-540] Make reachabilityTreeNode.String() use strings.Join.
* [NOD-540] Use sync.RWMutex instead of locks.PriorityMutex.
* [NOD-540] Rename thisTreeNode to newTreeNode.
* [NOD-540] Rename setTreeNode to addTreeNode.
* [NOD-540] Extracted selectedParentAnticone to a separate function.
* [NOD-540] Rename node to this.
* [NOD-540] Move updateReachability and isAncestorOf from dag.go to reachability.go.
* [NOD-540] Add whitespace after multiline function signatures in reachability.go.
* [NOD-540] Make splitFraction return an error on empty interval.
* [NOD-540] Add a comment about rounding to splitFraction.
* [NOD-540] Replace sneaky tabs with spaces.
* [NOD-540] Rename split to splitExponential.
* [NOD-540] Extract exponentialFractions to a separate function.
* [NOD-540] Rename bisect to findIndex.
* [NOD-540] Add call to reachabilityStore.clearDirtyEntries at the end of saveChangesFromBlock.
* [NOD-540] Explain the dirty hack in reachabilityStore.init().
* [NOD-540] Split the function signature for deserializeReachabilityData to two lines.
* [NOD-540] Add a comment about float precision loss to exponentialFractions.
* [NOD-540] Corrected a comment about float precision loss to exponentialFractions.
* [NOD-540] Fixed a comment about float precision loss to exponentialFractions some more.
* [NOD-540] Added further comments above futureCoveringBlockSet.
* [NOD-540] Rename addTreeNode to setTreeNode.
* [NOD-540] Rename splitExponential to splitWithExponentialBias.
* [NOD-540] Fix object references in reachabilityData deserialization (#563)
* [NOD-540] Fix broken references in deserialization.
* [NOD-540] Fix broken references in futureCoveringSet deserialization. Also add comments.
* [NOD-540] Don't deserialize on the first pass in reachabilityStore.init().
* [NOD-540] Remove redundant assignment to loaded[hash].
* [NOD-540] Use NewHash instead of SetBytes. Rename data to destination.
* [NOD-540] Preallocate futureCoveringSet.
* [NOD-541] Implement GHOSTDAG (#560)
* [NOD-541] Implement GHOSTDAG
* [NOD-541] Replace the old PHANTOM variant with GHOSTDAG
* [NOD-541] Move dag.updateReachability to the top of dag.applyDAGChanges to update reachability before the virtual block is updated
* [NOD-541] Fix blueAnticoneSize
* [NOD-541] Initialize node.bluesAnticoneSizes
* [NOD-541] Fix pastUTXO and applyBlueBlocks blues order
* [NOD-541] Add serialization logic to node.bluesAnticoneSizes
* [NOD-541] Fix GHOSTDAG to not count the new block and the blue candidates anticone, add selected parent to blues, and save to node.bluesAnticoneSizes properly
* [NOD-541] Fix test names in inner strings
* [NOD-541] Writing TestGHOSTDAG
* [NOD-541] In blueAnticoneSize change node->current
* [NOD-541] name ghostdag return values
* [NOD-541] fix ghostdag to return slice
* [NOD-541] Split k-cluster violation rules
* [NOD-541] Add missing space
* [NOD-541] Add comment to ghostdag
* [NOD-541] In selectedParentAnticone rename past->selectedParentPast
* [NOD-541] Fix misrefernces to TestChainUpdates
* [NOD-541] Fix ghostdag comment
* [NOD-541] Make PrepareBlockForTest in blockdag package
* [NOD-541] Make PrepareBlockForTest in blockdag package
* [NOD-541] Assign to selectedParentAnticone[i] instead of appending
* [NOD-541] Remove redundant forceTransactions arguments from PrepareBlockForTEST
* [NOD-541] Add non-selected parents to anticoneHeap
* [NOD-541] add test for ghostdag
* [NOD-541] Add comments
* [NOD-541] Use adjusted time for initializing blockNode
* [NOD-541] Rename isAncestorOf -> isAncestorOfBlueCandidate
* [NOD-541] Remove params from PrepareBlockForTest
* [NOD-541] Fix TestChainHeight
* [NOD-541] Remove recursive lock
* [NOD-541] Fix TestTxIndexConnectBlock
* [NOD-541] Fix TestBlueBlockWindow
* [NOD-541] Put prepareAndProcessBlock in common_test.go
* [NOD-541] Fix TestConfirmations
* [NOD-541] Fix TestAcceptingBlock
* [NOD-541] Fix TestDifficulty
* [NOD-541] Fix TestVirtualBlock
* [NOD-541] Fix TestSelectedPath
* [NOD-541] Fix TestChainUpdates
* [NOD-541] Shorten TestDifficulty test time
* [NOD-541] Make PrepareBlockForTest use minimal valid block time
* [NOD-541] Remove TODO comment
* [NOD-541] Move blockdag related mining functions to mining.go
* [NOD-541] Use NextBlockCoinbaseTransaction instead of NextBlockCoinbaseTransactionNoLock in NextCoinbaseFromAddress
* [NOD-541] Remove useMinimalTime from BlockForMining
* [NOD-541] Make MedianAdjustedTime a *BlockDAG method
* [NOD-541] Fix ghostdag to use anticone slice instead of heap
* [NOD-541] Fix NewBlockTemplate locks
* [NOD-541] Fix ghostdag comments
* [NOD-541] Convert MedianAdjustedTime to NextBlockTime
* [NOD-541] Fix ghostdag comment
* [NOD-541] Fix TestGHOSTDAG comment
* [NOD-541] Add comment before sanity check
* [NOD-541] Explicitly initialize .blues in ghostdag
* [NOD-541] Rename *blockNode.lessThan to *blockNode.less
* [NOD-541] Remove redundant check if block != chainBlock
* [NOD-541] Fix comment
* [NOD-541] Fix comment
* [NOD-497] Add comment; General refactoring
* [NOD-497] General refactoring.
* [NOD-497] Use isAncestor of the tree rather than the node
* [NOD-497] Remove reachability mutex lock as it is redundant (dag lock is held so no need); General refactoring.
* [NOD-497] Update comment
* [NOD-497] Undo test blocktimestamp
* [NOD-497] Update comments; Use BlockNode.less for blockset;
* [NOD-497] Change processBlock to return boolean and not the delay duration (merge conflict)
* [NOD-497] Undo change for bluest to use less; Change blocknode less to use daghash.Less
Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
Co-authored-by: Dan Aharoni <dereeno@protonmail.com>
* [NOD-532] Change chain to DAG in the root package.
* [NOD-532] Change chain to DAG in checkpoints.go.
* [NOD-532] Change chain to DAG in blockdag.
* [NOD-532] Change chain to DAG in cmd.
* [NOD-532] Change chain to DAG in dagconfig.
* [NOD-532] Change chain to DAG in database.
* [NOD-532] Change chain to DAG in mempool.
* [NOD-532] Change chain to DAG in mempool.
* [NOD-532] Change chain to DAG in netsync.
* [NOD-532] Change chain to DAG in rpcclient.
* [NOD-532] Change chain to DAG in server.
* [NOD-532] Change chain to DAG in txscript.
* [NOD-532] Change chain to DAG in util.
* [NOD-532] Change chain to DAG in wire.
* [NOD-532] Remove block heights in dagio.go examples.
* [NOD-532] Rename fakeChain to fakeDAG.
* [NOD-532] Fix comments, remove unused EnableBCInfoHacks flag.
* [NOD-532] Fix comments and variable names.
* [NOD-532] Fix comments.
* [NOD-532] Fix merge errors.
* [NOD-532] Formatted project.
* change finality interval to 1000 ( ~16.6 minutes interval)
* [NOD-357] define finality interval in dagParams instead of using a constant.
* use dagParams for FinalityInterval instead of constant
* override parameter so test would pass on CI (Jenkins machine runs out of memory if we use 1000)
* formating the code
* [NOD-225] Finalize nodes below finality point
* [NOD-225] finalizeNodesBelowFinalityPoint only if dag.lastFinalityPoint is changed
* [NOD-225] change comment in validateParents
* [NOD-225] add string to ErrInvalidParentsRelation error
* [NOD-225] Change comment in validateParents
* [NOD-225] Change comment in validateParents
* [NOD-225] change comment in validateParents
* [NOD-225] Delete diff data from db directly from finalizeNodesBelowFinalityPoint
* [NOD-225] Refactor updateFinalityPoint
* [NOD-208] Added blockBlueScore to UTXOEntry.
* [NOD-208] Added blueBlockScore to NewUTXOEntry.
* [NOD-208] Fixed compilation errors in policy, utxoset, and dag tests.
* [NOD-208] Changed validateBlockRewardMaturity and CheckTransactionInputsAndCalulateFee to use blueScore.
* [NOD-208] Changed CalcBlockSubsidy to use blueScore.
* [NOD-208] Changed SequenceLockActive to use blueScore.
* [NOD-208] Removed ExtractCoinbaseHeight.
* [NOD-208] Removed reference to block height in ensureNoDuplicateTx.
* [NOD-208] Changed IsFinalizedTransaction to use blueScore.
* [NOD-208] Fixed merge errors.
* [NOD-208] Made UTXOEntry serialization use blueScore.
* [NOD-208] Changed CalcPriority and calcInputValueAge to use blueScore.
* [NOD-208] Changed calcSequenceLock to use blueScore.
* [NOD-208] Removed blockChainHeight from UTXOEntry.
* [NOD-208] Fixed compilation errors in feeEstimator. Fixed a bug in the test pool hardness.
* [NOD-208] Fixed oldestChainBlockWithBlueScoreGreaterThan not handling an extreme case.
* [NOD-208] Fixed TestDiffFromTx.
* [NOD-208] Got rid of priority and support of free transactions.
* [NOD-208] Fixed TestProcessTransaction.
* [NOD-208] Fixed TestTxFeePrioHeap.
* [NOD-208] Fixed TestAddrIndex and TestFeeEstimatorCfg.
* [NOD-208] Removed unused rateLimit parameter from ProcessTransaction.
* [NOD-208] Fixed tests that rely on CreateTxChain.
* [NOD-208] Fixed tests that rely on CreateSignedTxForSubnetwork.
* [NOD-208] Fixed TestFetchTransaction.
* [NOD-208] Fixed TestHandleNewBlock. Fixed HandleNewBlock erroneously processing fee transactions.
* [NOD-208] Fixed TestTxIndexConnectBlock.
* [NOD-208] Removed the use of Height() from the fee estimator.
* [NOD-208] Removed unused methods from rpcwebsocket.go.
* [NOD-208] Removed Height from util.Block.
* [NOD-208] Removed ErrForkTooOld. It doesn't make sense in a DAG.
* [NOD-208] Made blockHeap use blueScore instead of height.
* [NOD-208] Removed fee estimator.
* [NOD-208] Removed DAG.Height.
* [NOD-208] Made TestAncestorErrors test chainHeight instead of height.
* [NOD-208] Fixed a couple of comments that were still speaking about block height.
* [NOD-208] Replaced all uses of HighestTipHash with SelectedTipHash.
* [NOD-208] Remove blockNode highest and some remaining erroneous uses of height.
* [NOD-208] Fixed a couple of comments. Fixed outPoint -> outpoint merge error.
* [NOD-208] Fixed a couple more comments.
* [NOD-208] Used calcMinRequiredTxRelayFee instead of DefaultMinRelayTxFee for mempool tests.
* [NOD-208] Renamed mempool Config BestHeight to DAGChainHeight.
* [NOD-208] Fixed a bug in oldestChainBlockWithBlueScoreGreaterThan. Made calcSequenceLock use the node's selected parent chain rather than the virtual block's.
* [NOD-208] Removed chainHeight from blockNode String().
Renamed checkpointsByHeight to checkpointsByChainHeight and prevCheckpointHeight to prevCheckpointChainHeight.
Removed reference to chainHeight in blockIndexKey.
Fixed comments in dagio.go.
* [NOD-208] Removed indexers/blocklogger.go, as no one was using it.
* [NOD-208] Made blocklogger.go log blueScore instead of height.
* [NOD-208] Fixed typo.
* [NOD-208] Fixed comments, did minor renaming.
* [NOD-208] Made a "common sense" wrapper around sort.Search.
* [NOD-208] Fixed comment in SearchSlice.
* [NOD-195] Made fee tx implicit
* [NOD-195] Removed redundant checks for fee transactions
* [NOD-195] Add fee tx data into acceptence data and fee data
* [NOD-195] Fix some tests
* [NOD-195] Update Block100000 with new data
* [NOD-195] Fixed remaining tests
* [NOD-195] Save and load feeTx to/from database
* [NOD-195] Remove DisconnectBlock methods from indexers, since they are not used anywhere
* [NOD-195] Add fee tx to addrindex
* [NOD-195] Don't populate inputs for fee transactions
* [NOD-195] Delete feeTxBucket in removeDAGState
* [NOD-195] Got rid of util.FeeTRansactionIndex
* [NOD-177] Removed references to idMerkleRoot.
* [NOD-177] Generated new genesis hashes.
* [NOD-177] Generated new blk_ blocks.
* [NOD-177] Fixed TestHaveBlock.
* [NOD-177] Fixed The rest of the tests.
* [NOD-177] Fixed a couple of comments and a duplicate test.
* [NOD-177] Fixed blocks1-256.bz2.
* [NOD-144] Use chainHeight in SelectedAncestor, and update all logic that uses it
* [NOD-144] Moved UnminedHeight to blockdag, and updated all references
* [NOD-142] Updated util.FastLog2Floor to work on uint64
* [NOD-142] Convert height and chainHeight to uint64
* [NOD-142] A couple fixes in comments of TestFastLog2Floor
* [NOD-142] Make spendableOutOffset uint64 too
* [NOD-83] Modify block parents' children only after validation
* [NOD-83] Creating CheckConnectBlockTemplateWithLock with RLock
* [NOD-83] Put updateParentsChildren inside updateParents
* [NOD-83] create updateParentsDiffs function
* [NOD-56] Created devnet
* [NOD-56] Fixed tests
* [NOD-56] Fixed go vet errors
* [NOD-56] Added TestSolveGenesisBlock function
* [NOD-56] Created command line tool for solving genesis blocks
* [DEV-379] Refactored checkBlockContext: Mainly extracted methods and re-organized variable use to minimize clutter
* [DEV-379] Simplify the condition according to which we increment blockCount
* [DEV-379] Move all logic to save new block data to separate method
* [DEV-379] Refactored the checking of finality point
* [DEV-379] Minor styling changes
* [DEV-379] Extracted method in applyUTXOChanges subroutines
* [NOD-41] Moved update of finality point to after block was validated + some minor style fixes
* [NOD-41] call dag.checkFinalityRulesAndGetFinalityPoint(node) even if fastAdd
* [NOD-41] Fix in a comment
* [NOD-41] Some methods of dag that could have been just functions converted to function
* [DEV-364] Add fee transactions validation
* [DEV-364] make NextBlockFeeTransactions for creating block templates
* [DEV-364] apply coinbase rules to fee transaction is some cases
* [DEV-364] Add comments
* [DEV-364] put getTXO as separate function
* [DEV-364] Make getParentsFeeData a separate function
* [DEV-364] fix calculateFees
* [DEV-364] force maximum sequence for fee transactions
* [DEV-364] add TestValidateFeeTransactions
* [DEV-364] change fee transaction to be one tx per block rather than one tx for each blue
* [DEV-364] fix tests
* [DEV-364] Use constants instead of inline numbers
* [DEV-338] Remove provisional nodes, and panic in case there's an error after verifying the block is valid
* [DEV-338] Improved deffered blockNode cleanup and cosmetic changes
* [DEV-338] Fixed dag.index.SetStatusFlags for parents + cosmetic changes
* [DEV-338] Fixed build
* [DEV-338] Fixed comments
* [DEV-303] Implement block finality
* [DEV-303] Add finality tests
* [DEV-303] Make finality tests use maybeAcceptBlock
* [DEV-303] Only check finality rules if we are fastAdd mode
* [DEV-303] replace hasBiggerFinalityScoreThan checks with .finalityScore()
* [DEV-301] implement blockNode.chainHeight as the height of the selected parent chain
* [DEV-301] add description to TestChainHeight
* [DEV-301] Delete comment on TestChainHeight and expalain about the dag