* [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>
* [NOD-877] In UTXOEntry serialization, extract packedFlags out to a separate Uint8.
* [NOD-877] Generate new test blocks.
* [NOD-877] Fix TestIsKnownBlock.
* [NOD-877] Fix TestBlueBlockWindow.
* [NOD-877] Fix TestUTXOSerialization and TestGHOSTDAG.
* [NOD-877] Fix TestVirtualBlock.
* [NOD-848] Optimize allocations when serializing UTXO diffs
* [NOD-848] Use same UTXO serialization everywhere, and use compression as well
* [NOD-848] Fix usage of wrong buffer
* [NOD-848] Fix tests
* [NOD-848] Fix wire tests
* [NOD-848] Fix tests
* [NOD-848] Remove VLQ
* [NOD-848] Fix comments
* [NOD-848] Add varint for big endian encoding
* [NOD-848] In TestVarIntWire, assume the expected decoded value is the same as the serialization input
* [NOD-848] Serialize outpoint index with big endian varint
* [NOD-848] Remove p2pk from compression support
* [NOD-848] Fix comments
* [NOD-848] Remove p2pk from decompression support
* [NOD-848] Make entry compression optional
* [NOD-848] Fix tests
* [NOD-848] Fix comments and var names
* [NOD-848] Remove UTXO compression
* [NOD-848] Fix tests
* [NOD-848] Remove big endian varint
* [NOD-848] Fix comments
* [NOD-848] Rename ReadVarIntLittleEndian->ReadVarInt and fix WriteVarInt comment
* [NOD-848] Add outpointIndexByteOrder variable
* [NOD-848] Remove redundant comment
* [NOD-848] Fix outpointMaxSerializeSize to the correct value
* [NOD-848] Move subBuffer to utils
* [NOD-570] Separate genesis variables for different netwroks
* [NOD-570] Make Testnet genesis
* [NOD-570] Make simnet and regtest genesis
* [NOD-570] Remake devnet genesis
* [NOD-570] Rename regNet -> regTest testnet->testNet
* [NOD-570] Change network names to one word instead of camel case
* [NOD-570] Change network names to one word instead of camel case
* [NOD-570] Fix test names
* [NOD-570] Fix TestGHOSTDAG
Co-authored-by: Dan Aharoni <dereeno@protonmail.com>
* [NOD-222] Added constant: UnacceptedBlueScore.
* [NOD-222] Made it so that block transactions always have UnacceptedBlueScore.
* [NOD-222] Implemented updating unaccepted UTXO entries with accepted ones in the virtual.
* [NOD-222] Fixed an unclear comment.
* [NOD-222] Fixed diffFromAcceptanceData not receiving the right blue score.
* [NOD-222] Fixed various issues with the implementation. It appears to work now.
* [NOD-222] Removed debug logs.
* [NOD-222] Fixed tests that relied on utxoCollection.String().
* [NOD-222] Fixed TestChainedTransactions.
* [NOD-222] Fixed tests that relied on GetVirtualFromParentsForTest.
* [NOD-222] Fixed having identical entries in toAdd and toRemove.
* [NOD-222] Fixed logic in diffFrom that I previously broke.
* [NOD-222] Fixed a wrong check.
* [NOD-222] Figured out the magical invocation to make everything work.
* [NOD-222] Fixed blockDB tests.
* [NOD-222] Removed debug method.
* [NOD-222] Fixed comments related to setting coinbase maturity to 0.
* [NOD-222] Fixed a typo in a comment.
* [NOD-222] Added a comment that explains the new addition in GetVirtualFromParentsForTest.
* [NOD-222] Added a comment to DiffUTXOSet.Get().
* [NOD-222] Fixed a nuance in DiffUTXOSet.containsInputs.
* [NOD-222] Replaced nonsense in GetVirtualFromParentsForTest with diffFromAcceptanceData.
* [NOD-222] Renamed newVirtualUTXO -> newVirtualPastUTXO.
* [NOD-222] Fixed a comment.
* [NOD-222] Extracted checking utxoCollection with blueScore to a method.
* [NOD-222] Added tests where the same entry is in both toAdd and toRemove.
* [NOD-222] Used Add/RemoveEntry inside diffFromAcceptedTx.
* [NOD-222] Removed superfluous test for UnacceptedBlueScore.
* [NOD-222] Added/Updated comments.
* [NOD-222] Added tests to TestUTXODiffRules.
* [NOD-222] Added appropriate protection against impossible "from"s in diffFrom.
* [NOD-222] Added a comment explaining why we diffFrom acceptanceData in verifyAndBuildUTXO.
* [NOD-222] Fixed comments and equal() in utxoset.
* [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-172] Port EMCH from bchd
* [NOD-172] Fix hdkeychain.TestErrors and add btcec.TestRecoverCompact
* [NOD-172] Make ECMH immutable
* [NOD-172] Fix gofmt errors
* [NOD-172] Add TestMultiset_NewMultisetFromDataSlice and fix Point to be immutable
* [NOD-172] Fix gofmt errors
* [NOD-172] Add test for checking that the Union of a multiset and its inverse is zero
* [NOD-179] Add ECMH Point to all UTXO-structs
* [NOD-179] Fix utxo set tests
* [NOD-179] Fix mempool tests
* [NOD-179] Remove RemoveTxOuts
* [NOD-179] Move serializeBlockUTXODiffData to the top of the file
* [NOD-179] Fix serializeBlockUTXODiffData comment format
* [NOD-179] Fix AddTx comment and name return values
* [NOD-180] Validate utxo commitments
* [NOD-179] Fix TestAcceptingBlock and TestConfirmations to not use the block hash as phantom break even
* [NOD-180] Fix typo
* [NOD-180] move most of the logic in calcUTXOCommitment to UTXOSet.WithTransactions
* [NOD-180] Optionally return error when a transaction in WithTransactions is double spent
* [NOD-180] Rename allowDoubleSpends to ignoreDoubleSpends
* [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-164] Added validation routine
* [NOD-167] Extracted acceptedIDMerkleRoot calculation to its own method and implemented NextAcceptedIDMerkleRoot.
* [NOD-164] Fixed TestValidateFeeTransaction.
* [NOD-164] Fixed TestFinality.
* [NOD-164] Fixed blk_ tests.
* [NOD-164] Fixed if -> iff in a comment.
* [NOD-164] Minor style changes in comments.
* [NOD-164] Moved validateAcceptedIDMerkleRoot to before its population with the block's own transactions.
Replaced heavy call to verifyAndBuildUTXO in NextBlockFeeTransaction and NextAcceptedIDMerkleRoot with a call to pastUTXO on the virtual.
* [NOD-164] Fixed erroneous comment.
* [NOD-164] Inserted the logic from buildAndSortAcceptedTxs into calculateAcceptedIDMerkleRoot, since the former was meaningless on its own.
* [NOD-164] Changed looping over txsAcceptanceData instead of over node.blues.
* [DEV-259] Allow to spend genesis coinbase, and use ProcessBlock to add genesis to the DAG like any other block
* [DEV-259] fix IsCurrent to check genesis timestamp if needed
* [DEV-259] add genesisPastUTXO as separate 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-149] Add test case for CVE-2018-17144 (Bitcoin DoS/Double Spend bug)
* [DEV-149] change t.Errorf + return to t.Fatalf
* [DEV-149] fix malformed blocks
* [DEV-149] change test blocks to use simnet genesis
* [DEV-107] Disallow situation where a parent is also an ancestor of another parent
* [DEV-107] Add comment for validateParents
* [DEV-107] move validateParents to checkBlockContext
* [DEV-107] break validateParents error to 2 lines
* [DEV-107] remove TestProcessBlock
* [DEV-107] fix comment that explains block 3c test
* [DEV-107] remove blk_3C from TestCheckConnectBlockTemplate
* [DEV-45] Updated the BlockDB files to contain blocks that could be deserialized.
* [DEV-45] Fixed TestHaveBlock (finally)
* [DEV-45] Fixed TestLocateInventory and everything that's reliant on chainview_test::chainedNodes.
* [DEV-45] Fixed TestChainViewNil.
* [DEV-45] Fixed TestNotifications.
* [DEV-45] Fixed ExampleBlockChain_ProcessBlock.
* [DEV-45] Fixed TestCheckBlockScripts.
* [DEV-45] Fixed TestCheckConnectBlockTemplate.
* [DEV-45] Renamed the BlockDBs to their original names.
* [DEV-45] Skipping TestFullBlocks for until we have implemented Phantom.
* [DEV-45] Deleted a couple of methods that are no longer used. (They were previously used for reorganization)