aboutsummaryrefslogtreecommitdiff
path: root/src/test/miner_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* really s/Doge/Dis/g this timeTomo Ueda2021-09-021-1/+1
|
* really s/doge/dis/g this timeTomo Ueda2021-09-021-1/+1
|
* Remove relay-only roundingRoss Nicoll2021-08-171-2/+2
| | | | | Remove rounding of transaction sizes when calculating fee minimums for relaying, to simplify fee logic.
* Update or eliminate remaining tests (#1483)Ross Nicoll2018-09-191-1/+3
| | | | | * Change amount tests to use rounded values * Disable legacy tests
* Sync mining code from Namecore to resolve unit test failures (#1385)Ross Nicoll2018-09-191-19/+19
|
* Merge AuxPoW support from NamecoreRoss Nicoll2018-09-191-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes are as below: Wrap CBlockHeader::nVersion into a new class (CBlockVersion). This allows to take care of interpreting the field into a base version, auxpow flag and the chain ID. Update getauxblock.py for new 'generate' RPC call. Add 'auxpow' to block JSON. Accept auxpow as PoW verification. Add unit tests for auxpow verification. Add check for memory-layout of CBlockVersion. Weaken auxpow chain ID checks for the testnet. Allow Params() to overrule when to check the auxpow chain ID and for legacy blocks. Use this to disable the checks on testnet. Introduce CPureBlockHeader. Split the block header part that is used by auxpow and the "real" block header (that uses auxpow) to resolve the cyclic dependency between the two. Differentiate between uint256 and arith_uint256. This change was done upstream, modify the auxpow code. Add missing lock in auxpow_tests. Fix REST header check for auxpow headers. Those can be longer, thus take that into account. Also perform the check actually on an auxpow header. Correctly set the coinbase for getauxblock results. Call IncrementExtraNonce in getauxblock so that the coinbase is actually initialised with the stuff it should be. (BIP30 block height and COINBASE_FLAGS.) Implement getauxblock plus regression test. Turn auxpow test into FIXTURE test. This allows using of the Params() calls. Move CMerkleTx code to auxpow.cpp. Otherwise we get linker errors when building without wallet. Fix rebase with BIP66. Update the code to handle BIP66's nVersion=3. Enforce that auxpow parent blocks have no auxpow block version. This is for compatibility with namecoind. See also https://github.com/namecoin/namecoin/pull/199. Move auxpow-related parameters to Consensus::Params.
* Replace test data with Dogecoin valuesRoss Nicoll2018-09-191-32/+36
| | | | | | | | | | | | | | | | | | | Replace test data with Dogecoin equivalents in the folowing tests: * base58 * bip32 * keys * miner * pow Replace RPC and deterministic signatures in unit tests with Dogecoin values. While conventionally I'd use an alternative implementation for these, as RFC 6979 compliant signature generation isn't terribly common, and there's no reason to suspect we've modified this code, I'm going to assert that it's good enough to test that the code doesn't provide different values. Disabled Bitcoin PoW tests, but left code in place to simplify later merges. These are replaced by the Dogecoin PoW tests.
* Fix to have miner test aware of new separate block min tx feeAlex Morcos2017-01-191-4/+7
|
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Remove unused CDiskBlockPos* argument from ProcessNewBlockMatt Corallo2016-12-041-1/+1
|
* Switch pblock in ProcessNewBlock to a shared_ptrMatt Corallo2016-12-041-1/+2
| | | | | This (finally) fixes a performance regression in b3b3c2a5623d5c942d2b3565cc2d833c65105555
* Rename the remaining main.{h,cpp} to validation.{h,cpp}Matt Corallo2016-12-021-1/+1
|
* Always add default_witness_commitment with GBT client supportPieter Wuille2016-11-211-0/+1
|
* Introduce convenience type CTransactionRefPieter Wuille2016-11-191-3/+3
|
* Make CBlock::vtx a vector of shared_ptr<CTransaction>Pieter Wuille2016-11-191-18/+15
|
* Replace CValidationState param in ProcessNewBlock with BlockCheckedMatt Corallo2016-11-091-3/+1
|
* Remove pfrom parameter from ProcessNewBlockMatt Corallo2016-11-091-1/+1
| | | | This further decouples ProcessNewBlock from networking/peer logic.
* Fix compact block handling to not ban if block is invalidSuhas Daftuar2016-11-031-1/+1
|
* Make removed and conflicted arguments optional to removePieter Wuille2016-10-211-2/+1
|
* Merge #8865: Decouple peer-processing-logic from block-connection-logicWladimir J. van der Laan2016-10-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | a9aec5c Use BlockChecked signal to send reject messages from mapBlockSource (Matt Corallo) 7565e03 Remove SyncWithWallets wrapper function (Matt Corallo) 12ee1fe Always call UpdatedBlockTip, even if blocks were only disconnected (Matt Corallo) f5efa28 Remove CConnman parameter from ProcessNewBlock/ActivateBestChain (Matt Corallo) fef1010 Use CValidationInterface from chain logic to notify peer logic (Matt Corallo) aefcb7b Move net-processing logic definitions together in main.h (Matt Corallo) 0278fb5 Remove duplicate nBlocksEstimate cmp (we already checked IsIBD()) (Matt Corallo) 87e7d72 Make validationinterface.UpdatedBlockTip more verbose (Matt Corallo)
| * Remove CConnman parameter from ProcessNewBlock/ActivateBestChainMatt Corallo2016-10-041-1/+1
| |
* | Merge #8223: [c++11] Use std::unique_ptr for block creation.Wladimir J. van der Laan2016-10-181-11/+4
|\ \ | |/ |/| | | 9fce062 [c++11] Use std::unique_ptr for block creation. (Daniel Kraft)
| * [c++11] Use std::unique_ptr for block creation.Daniel Kraft2016-06-181-11/+4
| | | | | | | | | | | | CreateNewBlock returns a pointer for which the caller takes ownership. Use std::unique_ptr to make this explicit and simplify handling of these objects in getblocktemplate.
* | net: Pass CConnman around as neededCory Fields2016-09-081-1/+1
| |
* | Enable size accounting in mining unit testsSuhas Daftuar2016-07-281-3/+1
| |
* | BIP141: Other consensus critical limits, and BIP145Pieter Wuille2016-06-221-1/+4
|/ | | | Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
* Add unit tests for ancestor feerate miningSuhas Daftuar2016-06-161-0/+109
|
* Merge #7598: Refactor CreateNewBlock to be a method of the BlockAssembler classWladimir J. van der Laan2016-06-131-14/+14
|\ | | | | | | | | | | c2dd5a3 FIX: correctly measure size of priority block (Alex Morcos) a278764 FIX: Account for txs already added to block in addPriorityTxs (Alex Morcos) 4dc94d1 Refactor CreateNewBlock to be a method of the BlockAssembler class (Alex Morcos)
| * Refactor CreateNewBlock to be a method of the BlockAssembler classAlex Morcos2016-05-181-14/+14
| |
* | Do not shadow local variablesPavel Janík2016-06-071-2/+2
|/
* Corrected valuesinstagibbs2016-04-071-2/+2
|
* Gave miner test values constants for less error-prone values.instagibbs2016-04-071-24/+29
|
* BIP9 ImplementationPieter Wuille2016-03-151-3/+30
| | | | | Inspired by former implementations by Eric Lombrozo and Rusty Russell, and based on code by Jorge Timon.
* Merge #7184: Implement SequenceLocks functions for BIP 68Wladimir J. van der Laan2016-02-121-31/+95
|\ | | | | | | | | | | | | b043c4b fix sdaftuar's nits again (Alex Morcos) a51c79b Bug fix to RPC test (Alex Morcos) da6ad5f Add RPC test exercising BIP68 (mempool only) (Suhas Daftuar) c6c2f0f Implement SequenceLocks functions (Alex Morcos)
| * Implement SequenceLocks functionsAlex Morcos2016-02-101-31/+95
| | | | | | | | | | | | | | SequenceLocks functions are used to evaluate sequence lock times or heights per BIP 68. The majority of this code is copied from maaku in #6312 Further credit: btcdrak, sipa, NicolasDorier
* | Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|/
* Rewrite CreateNewBlockAlex Morcos2015-12-011-24/+36
| | | | | | | | | | Use the score index on the mempool to only add sorted txs in order. Remove much of the validation while building the block, relying on mempool to be consistent and only contain txs that can be mined. The mempool is assumed to be consistent as far as not containing txs which spend non-existent outputs or double spends, and scripts are valid. Finality of txs is still checked (except not coinbase maturity, assumed in mempool). Still TestBlockValidity in case mempool consistency breaks and return error state if an invalid block was created. Unit tests are modified to realize that invalid blocks can now be constructed if the mempool breaks its consistency assumptions and also updated to have the right fees, since the cached value is now used for block construction. Conflicts: src/miner.cpp
* Merge pull request #6915Wladimir J. van der Laan2015-12-011-11/+13
|\ | | | | | | | | | | | | | | | | | | | | 2d8860e Fix removeForReorg to use MedianTimePast (Suhas Daftuar) b7fa4aa Don't call removeForReorg if DisconnectTip fails (Suhas Daftuar) 7e49f5f Track coinbase spends in CTxMemPoolEntry (Suhas Daftuar) bb8ea1f removeForReorg calls once-per-disconnect-> once-per-reorg (Matt Corallo) 474b84a Make indentation in ActivateBestChainStep readable (Matt Corallo) b0a064c Fix comment in removeForReorg (Matt Corallo) 9b060e5 Fix removal of time-locked transactions during reorg (Matt Corallo) 0c9959a Add failing test checking timelocked-txn removal during reorg (Matt Corallo)
| * Track coinbase spends in CTxMemPoolEntrySuhas Daftuar2015-11-301-11/+13
| | | | | | | | This allows us to optimize CTxMemPool::removeForReorg.
* | Merge pull request #6914Wladimir J. van der Laan2015-12-011-1/+1
|\ \ | |/ |/| | | 114b581 Prevector type (Pieter Wuille)
| * Prevector typePieter Wuille2015-11-131-1/+1
| |
* | Switch blocks to a constant-space Merkle root/branch algorithm.Pieter Wuille2015-11-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | This switches the Merkle tree logic for blocks to one that runs in constant (small) space. The old code is moved to tests, and a new test is added that for various combinations of block sizes, transaction positions to compute a branch for, and mutations: * Verifies that the old code and new code agree for the Merkle root. * Verifies that the old code and new code agree for the Merkle branch. * Verifies that the computed Merkle branch is valid. * Verifies that mutations don't change the Merkle root. * Verifies that mutations are correctly detected.
* | Implement helper class for CTxMemPoolEntry constructorAlex Morcos2015-11-161-12/+16
| | | | | | | | This is only for unit tests.
* | Chainparams: Explicit CChainParams arg for miner:Jorge Timón2015-11-111-13/+13
| | | | | | | | | | | | | | -BitcoinMiner -CreateNewBlock -GenerateBitcoins -ProcessBlockFound
* | Chainparams: Explicit CChainParams arg for main (pre miner):Jorge Timón2015-11-111-1/+2
|/ | | | | -ProcessNewBlock -TestBlockValidity
* Revert "Revert "Enable policy enforcing GetMedianTimePast as the end point ↵Gregory Maxwell2015-11-031-3/+4
| | | | | | of lock-time constraints"" This reverts commit 8537ecdfc40181249ec37556015a99cfae4b21fd.
* Revert "Enable policy enforcing GetMedianTimePast as the end point of ↵Gregory Maxwell2015-11-011-4/+3
| | | | | | lock-time constraints" This reverts commit dea8d21fc63e9f442299c97010e4740558f4f037.
* Enable policy enforcing GetMedianTimePast as the end point of lock-time ↵Mark Friedenbach2015-10-231-3/+4
| | | | | | constraints Transactions are not allowed in the memory pool or selected for inclusion in a block until their lock times exceed chainActive.Tip()->GetMedianTimePast(). However blocks including transactions which are only mature under the old rules are still accepted; this is *not* the soft-fork required to actually rely on the new constraint in production.
* Do not store Merkle branches in the wallet.Pieter Wuille2015-09-221-1/+1
| | | | | | | | | | Assume that when a wallet transaction has a valid block hash and transaction position in it, the transaction is actually there. We're already trusting wallet data in a much more fundamental way anyway. To prevent backward compatibility issues, a new record is used for storing the block locator in the wallet. Old wallets will see a wallet file synchronized up to the genesis block, and rescan automatically.
* TRIVIAL: Missing includesJorge Timón2015-07-231-0/+5
|