* [NOD-1105] Don't use a database transaction when recovering acceptance index.
* Revert "[NOD-1105] Don't use a database transaction when recovering acceptance index."
This reverts commit da550f8e
* [NOD-1105] When recovering acceptance index, use a database transaction per block instead of for the entire recovery.
commit e303efef4209b8d62f1aac2cb57ac79829411556
Author: stasatdaglabs <stas@daglabs.com>
Date: Mon Jun 29 11:59:36 2020 +0300
[NOD-1063] Rename a test.
commit bfecd57470ec8aeb0a1b0ef82c051dde364c536e
Author: stasatdaglabs <stas@daglabs.com>
Date: Mon Jun 29 11:57:36 2020 +0300
[NOD-1063] Fix a comment.
commit b969e5922da16a3734806c03075fe2e45e64958b
Author: stasatdaglabs <stas@daglabs.com>
Date: Sun Jun 28 18:14:44 2020 +0300
[NOD-1063] Convert modifiedTreeNode to an out param.
commit 170f9872f432b2f7177cb099149c9959031e4f1e
Author: stasatdaglabs <stas@daglabs.com>
Date: Sun Jun 28 17:05:01 2020 +0300
[NOD-1063] Fix a bug in which a block is added to the selected parent chain below the reindex root.
* [NOD-1063] Fix a bug in which a block is added to the selected parent chain below the reindex root.
* [NOD-1063] Convert modifiedTreeNode to an out param.
* [NOD-1063] Fix a comment.
* [NOD-1063] Rename a test.
* [NOD-1055] Give higher priority for requesting missing ancestors when sending a getdata message (#767)
* [NOD-1063] Remove the remainingInterval field.
* [NOD-1063] Add helper functions to reachabilityTreeNode.
* [NOD-1063] Add reachabilityReindexRoot.
* [NOD-1063] Start implementing findNextReachabilityReindexRoot.
* [NOD-1063] Implement findCommonAncestor.
* [NOD-1063] Implement findReachabilityTreeAncestorInChildren.
* [NOD-1063] Add reachabilityReindexWindow.
* [NOD-1063] Fix findReachabilityTreeAncestorInChildren.
* [NOD-1063] Remove BlockDAG reference in findReachabilityTreeAncestorInChildren.
* [NOD-1063] Extract updateReachabilityReindexRoot to a separate function.
* [NOD-1063] Add reachabilityReindexSlack.
* [NOD-1063] Implement splitReindexRootChildrenAroundChosen.
* [NOD-1063] Implement calcReachabilityTreeNodeSizes.
* [NOD-1063] Implement propagateChildIntervals.
* [NOD-1063] Extract tightenReachabilityTreeIntervalsBeforeChosenReindexRootChild and tightenReachabilityTreeIntervalsAfterChosenReindexRootChild to separate functions.
* [NOD-1063] Implement expandReachabilityTreeIntervalInChosenReindexRootChild.
* [NOD-1063] Finished implementing concentrateReachabilityTreeIntervalAroundReindexRootChild.
* [NOD-1063] Begin implementing reindexIntervalsBeforeReindexRoot.
* [NOD-1063] Implement top-level logic of reindexIntervalsBeforeReindexRoot.
* [NOD-1063] Implement reclaimIntervalBeforeChosenChild.
* [NOD-1063] Add a debug log for reindexIntervalsBeforeReindexRoot.
* [NOD-1063] Rename reindexIntervalsBeforeReindexRoot to reindexIntervalsEarlierThanReindexRoot.
* [NOD-1063] Implement reclaimIntervalAfterChosenChild.
* [NOD-1063] Add a debug log for updateReachabilityReindexRoot.
* [NOD-1063] Convert modifiedTreeNodes from slices to sets.
* [NOD-1063] Fix findCommonAncestor.
* [NOD-1063] Fix reindexIntervalsEarlierThanReindexRoot.`
* [NOD-1063] Remove redundant nil conditions.
* [NOD-1063] Make map[*reachabilityTreeNode]struct{} into a type alias with a copyAllFrom method.
* [NOD-1063] Remove setInterval.
* [NOD-1063] Create a new struct to hold reachability stuff called reachabilityTree.
* [NOD-1063] Rename functions under reachabilityTree.
* [NOD-1063] Move reachabilityStore into reachabilityTree.
* [NOD-1063] Move the rest of the functions in reachability.go into the reachabilityTree struct.
* [NOD-1063] Update newReachabilityTree to take an instance of reachabilityStore.
* [NOD-1063] Fix merge errors.
* [NOD-1063] Fix merge errors.
* [NOD-1063] Pass a reference to the dag into reachabilityTree.
* [NOD-1063] Use Wrapf instead of Errorf.
* [NOD-1063] Merge assignments.
* [NOD-1063] Disambiguate a varaible name.
* [NOD-1063] Add a test case for intervalBefore.
* [NOD-1063] Simplify splitChildrenAroundChosenChild.
* [NOD-1063] Fold temporary variables into newReachabilityInterval.
* [NOD-1063] Fold more temporary variables into newReachabilityInterval.
* [NOD-1063] Fix a bug in expandIntervalInReindexRootChosenChild.
* [NOD-1063] Remove blockNode from futureCoveringBlock.
* [NOD-1063] Get rid of futureCoveringBlock.
* [NOD-1063] Use findIndex directly in findAncestorAmongChildren.
* [NOD-1063] Make findIndex a bit nicer to use. Also rename it to findAncestorIndexOfNode.
* [NOD-1063] Rename childIntervalAllocationRange to intervalRangeForChildAllocation.
* [NOD-1063] Optimize findCommonAncestor.
* [NOD-1063] In reindexIntervalsBeforeChosenChild, use chosenChild.interval.start - 1 instead of childrenBeforeChosen[len(childrenBeforeChosen)-1].interval.end + 1.
* [NOD-1063] Rename reindexIntervalsBeforeChosenChild to reindexIntervalsBeforeNode.
* [NOD-1063] Add a comment explain what "the chosen child" is.
* [NOD-1063] In concentrateIntervalAroundReindexRootChosenChild, rename modifiedTreeNodes to allModifiedTreeNodes.
* [NOD-1063] Extract propagateIntervals to a function.
* [NOD-1063] Extract interval "contains" logic to a separate function.
* [NOD-1063] Simplify "looping up" logic in reclaimIntervalXXXChosenChild.
* [NOD-1063] Add comments to reclaimIntervalXXXChosenChild.
* [NOD-1063] Rename copyAllFrom to addAll.
* [NOD-1063] Rename reachabilityStore (the variable) to just store.
* [NOD-1063] Fix an error message.
* [NOD-1063] Reword a comment.
* [NOD-1063] Don't return -1 from findAncestorIndexOfNode.
* [NOD-1063] Extract slackReachabilityIntervalForReclaiming to a constant.
* [NOD-1063] Add a missing condition.
* [NOD-1063] Call isAncestorOf directly in insertNode.
* [NOD-1063] Rename chosenReindexRootChild to reindexRootChosenChild.
* [NOD-1063] Rename treeNodeSet to orderedTreeNodeSet.
* [NOD-1063] Add a disclaimer to orderedTreeNodeSet.
* [NOD-1063] Implement StoreReachabilityReindexRoot and FetchReachabilityReindexRoot.
* [NOD-1063] Move storing the reindex root to within reachabilityTree.
* [NOD-1063] Remove isAncestorOf from reachabilityInterval.
* [NOD-1063] Add a comment about graph theory conventions.
* [NOD-1063] Fix tests.
* [NOD-1063] Change inclusion in isAncestorOf functions.
* [NOD-1063] Rename a test.
* [NOD-1063] Implement TestIsInFuture.
* [NOD-1063] Fix error messages in TestIsInFuture.
* [NOD-1063] Fix error messages in TestIsInFuture.
* [NOD-1063] Rename isInSelectedParentChain to isInSelectedParentChainOf.
* [NOD-1063] Rename isInFuture to isInPast.
* [NOD-1063] Expand on a comment.
* [NOD-1063] Rename modifiedTreeNodes.
* [NOD-1063] Implement test: TestReindexIntervalsEarlierThanReindexRoot.
* [NOD-1063] Implement test: TestUpdateReindexRoot.
* [NOD-1063] Explain a check.
* [NOD-1063] Use a method instead of calling reachabilityStore.loaded directly.
* [NOD-1063] Lowercasified an error message.
* [NOD-1063] Fix failing test.
Co-authored-by: Ori Newman <orinewman1@gmail.com>
* [NOD-1034] Use reachability to check finality
* [NOD-1034] Add comments and rename variables
* [NOD-1034] Fix comments
* [NOD-1034] Rename checkFinalityRules->checkFinalityViolation
* [NOD-1034] Change isAncestorOf to be exclusive
* [NOD-1034] Make isAncestorOf exclusive and also more explicit, and add TestReachabilityTreeNodeIsAncestorOf
* [NOD-530] Remove coinbase inputs and add blue score to payload
* [NOD-1042] Ignore very high orphans
* [NOD-1042] Add ban score to an orphan with malformed blue score
* [NOD-1042] Fix log
* [NOD-614] Copy bitcoin-core ban score policy
* [NOD-614] Add ban score to disconnects
* [NOD-614] Fix wrong branch of AddBanScore
* [NOD-614] Add ban score on sending too many addresses
* [NOD-614] Add comments
* [NOD-614] Remove redundant reject messages
* [NOD-614] Fix log message
* [NOD-614] Ban every node that sends invalid invs
* [NOD-614] Make constants for ban scores
* [NOD-1007] Split checkBlockSanity subroutines.
* [NOD-1007] Put back the comments about performance.
* [NOD-1007] Make all the functions in checkBlockSanity take a *util.Block.
* [NOD-1007] Rename checkBlockTransactionsOrderedBySubnetwork to checkBlockTransactionOrder.
* [NOD-1007] Move a comment up a scope level.
* [NOD-1048] Make leveldb compaction much less frequent. Also, allocate an entire gigabyte for leveldb's blockCache and writeBuffer.
* [NOD-1048] Implement changing the options for testing purposes.
* [NOD-1048] Rename originalOptions to originalLDBOptions.
* [NOD-1048] Add a comment.
* [NOD-1040] Don't remove DAG tips from the diffStore's loaded set
* [NOD-1040] Fix TestClearOldEntries.
* Revert "[NOD-1040] Fix TestClearOldEntries."
This reverts commit e0705814
* Revert "[NOD-1040] Don't remove DAG tips from the diffStore's loaded set"
This reverts commit d3eba1c1
* [NOD-1040] Increase maxBlueScoreDifferenceToKeepLoaded to 1500.
* [NOD-1012] Disallow non-native/coinbase transactions.
* [NOD-1012] Fix logic error.
* [NOD-1012] Fix/skip tests and remove --subnetwork.
* [NOD-1012] Disconnect from non-native peers.
* [NOD-1012] Don't skip subnetwork tests.
* [NOD-1012] Use EnableNonNativeSubnetworks in peer.go.
* [NOD-1012] Set EnableNonNativeSubnetworks = true in the tests that need them rather than by default in Simnet.
* [NOD-965] Make dag.index.LookupNode return false if node is not found
* [NOD-965] Rename blockDAG->dag
* [NOD-965] Remove irrelevant test
* [NOD-965] Use bi.index's ok in LookupNode
* [NOD-975] Don't include block transactions inside its UTXO commitment (#711)
* [NOD-975] Don't include block transactions inside its UTXO commitment.
* Revert "[NOD-975] Don't include block transactions inside its UTXO commitment."
This reverts commit b1a2ae66
* [NOD-975] Implement a (currently failing) TestUTXOCommitment.
* [NOD-975] Remove the block's own transactions from calcMultiset.
* [NOD-975] Simplify calcMultiset.
* [NOD-975] Add a comment on top of selectedParentMultiset.
* [NOD-975] Use pastUTXO instead of selectedParentUTXO in calcMultiset.
* [NOD-975] Use selected parent's pastUTXO instead of this block's pastUTXO in calcMultiset.
* [NOD-975] Extract selectedParentPastUTXO to a separate function.
* [NOD-975] Remove selectedParentUTXO from pastUTXO's return values.
* [NOD-975] Add txs to TestUTXOCommitment.
* [NOD-975] Remove debug code.
* [NOD-975] In pastUTXOMultiSet, copy the multiset to avoid modifying the original.
* [NOD-975] Add a test: TestPastUTXOMultiSet.
* [NOD-975] Improve TestPastUTXOMultiSet.
* [NOD-976] Implement tests for UTXO commitments (#715)
* [NOD-975] Don't include block transactions inside its UTXO commitment.
* Revert "[NOD-975] Don't include block transactions inside its UTXO commitment."
This reverts commit b1a2ae66
* [NOD-975] Implement a (currently failing) TestUTXOCommitment.
* [NOD-975] Remove the block's own transactions from calcMultiset.
* [NOD-975] Simplify calcMultiset.
* [NOD-975] Add a comment on top of selectedParentMultiset.
* [NOD-975] Use pastUTXO instead of selectedParentUTXO in calcMultiset.
* [NOD-975] Use selected parent's pastUTXO instead of this block's pastUTXO in calcMultiset.
* [NOD-975] Extract selectedParentPastUTXO to a separate function.
* [NOD-975] Remove selectedParentUTXO from pastUTXO's return values.
* [NOD-975] Add txs to TestUTXOCommitment.
* [NOD-976] Generate new blockDB blocks for tests.
* [NOD-976] Fix TestBlueBlockWindow.
* [NOD-976] Fix TestIsKnownBlock.
* [NOD-976] Fix TestGHOSTDAG.
* [NOD-976] Fix TestUTXOCommitment.
* [NOD-976] Remove kaka.
* [NOD-990] Save utxo diffs of past UTXO (#724)
* [NOD-990] Save UTXO diffs of past UTXO
* [NOD-990] Check for block double spends with its past instead of building its UTXO
* [NOD-990] Call resetExtraNonceForTest in TestUTXOCommitment
* [NOD-990] Remove redundant functions diffFromTx and diffFromAcceptedTx
* [NOD-990] Rename i->j to avoid confusion
* [NOD-990] Break long lines
* [NOD-990] Rename ErrDoubleSpendsWithBlockTransaction -> ErrDoubleSpendInSameBlock
* [NOD-990] Make ErrDoubleSpendInSameBlock more detailed
* [NOD-990] Add testProcessBlockRuleError
* [NOD-990] Fix comment
* [NOD-990] Add test for duplicate transactions on the same block
* [NOD-990] Use pkg/errors on panic
* [NOD-990] Make cloneWithoutBase method
* [NOD-990] Break long lines
* [NOD-990] Fix comment
* [NOD-990] Fix wrong variable names
* [NOD-990] Fix comment
* [NOD-974] Generate new test blocks.
* [NOD-974] Fix TestIsKnownBlock and TestGHOSTDAG.
* [NOD-974] Fix TestUTXOCommitment.
* [NOD-974] Fix comments
Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
Co-authored-by: stasatdaglabs <stas@daglabs.com>
Co-authored-by: Ori Newman <orinewman1@gmail.com>