aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Move wallet callbacks into cs_main (this effectively reverts #7946)Matt Corallo2017-01-191-9/+8
| |/ / |/| |
* | | Merge #9499: Use recent-rejects, orphans, and recently-replaced txn for ↵Wladimir J. van der Laan2017-01-191-7/+11
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compact-block-reconstruction c594580 Add braces around AddToCompactExtraTransactions (Matt Corallo) 1ccfe9b Clarify comment about mempool/extra conflicts (Matt Corallo) fac4c78 Make PartiallyDownloadedBlock::InitData's second param const (Matt Corallo) b55b416 Add extra_count lower bound to compact reconstruction debug print (Matt Corallo) 863edb4 Consider all (<100k memusage) txn for compact-block-extra-txn cache (Matt Corallo) 7f8c8ca Consider all orphan txn for compact-block-extra-txn cache (Matt Corallo) 93380c5 Use replaced transactions in compact block reconstruction (Matt Corallo) 1531652 Keep shared_ptrs to recently-replaced txn for compact blocks (Matt Corallo) edded80 Make ATMP optionally return the CTransactionRefs it replaced (Matt Corallo) c735540 Move ORPHAN constants from validation.h to net_processing.h (Matt Corallo)
| * | | Make ATMP optionally return the CTransactionRefs it replacedMatt Corallo2017-01-091-7/+11
| |/ /
* | | Merge #9484: Introduce assumevalid setting to skip validation presumed valid ↵Pieter Wuille2017-01-161-9/+26
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | scripts. 7b5e3fe Add assumevalid testcase (John Newbery) e440ac7 Introduce assumevalid setting to skip presumed valid scripts. (Gregory Maxwell)
| * | | Introduce assumevalid setting to skip presumed valid scripts.Gregory Maxwell2017-01-131-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This disentangles the script validation skipping from checkpoints. A new option is introduced "assumevalid" which specifies a block whos ancestors we assume all have valid scriptsigs and so we do not check them when they are also burried under the best header by two weeks worth of work. Unlike checkpoints this has no influence on consensus unless you set it to a block with an invalid history. Because of this it can be easily be updated without risk of influencing the network consensus. This results in a massive IBD speedup. This approach was independently recommended by Peter Todd and Luke-Jr since POW based signature skipping (see PR#9180) does not have the verifiable properties of a specific hash and may create bad incentives. The downside is that, like checkpoints, the defaults bitrot and older releases will sync slower. On the plus side users can provide their own value here, and if they set it to something crazy all that will happen is more time will be spend validating signatures. Checkblocks and checklevel are also moved to the hidden debug options: Especially now that checkblocks has a low default there is little need to change these settings, and users frequently misunderstand them as influencing security or IBD speed. By hiding them we offset the space added by this new option.
* | | | Merge #9490: Replace FindLatestBefore used by importmuti with ↵Pieter Wuille2017-01-131-0/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FindEarliestAtLeast. 4b06e41 Add unit test for FindEarliestAtLeast (Suhas Daftuar) 997a98a Replace FindLatestBefore used by importmuti with FindEarliestAtLeast. (Gregory Maxwell)
| * | | | Replace FindLatestBefore used by importmuti with FindEarliestAtLeast.Gregory Maxwell2017-01-121-0/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In spite of the name FindLatestBefore used std::lower_bound to try to find the earliest block with a nTime greater or equal to the the requested value. But lower_bound uses bisection and requires the input to be ordered with respect to the comparison operation. Block times are not well ordered. I don't know what lower_bound is permitted to do when the data is not sufficiently ordered, but it's probably not good. (I could construct an implementation which would infinite loop...) To resolve the issue this commit introduces a maximum-so-far to the block indexes and searches that. For clarity the function is renamed to reflect what it actually does. An issue that remains is that there is no grace period in importmulti: If a address is created at time T and a send is immediately broadcast and included by a miner with a slow clock there may not yet have been any block with at least time T. The normal rescan has a grace period of 7200 seconds, but importmulti does not.
* | | | Merge #9375: Relay compact block messages prior to full block connectionPieter Wuille2017-01-131-10/+28
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 02ee4eb Make most_recent_compact_block a pointer to a const (Matt Corallo) 73666ad Add comment to describe callers to ActivateBestChain (Matt Corallo) 962f7f0 Call ActivateBestChain without cs_main/with most_recent_block (Matt Corallo) 0df777d Use a temp pindex to avoid a const_cast in ProcessNewBlockHeaders (Matt Corallo) c1ae4fc Avoid holding cs_most_recent_block while calling ReadBlockFromDisk (Matt Corallo) 9eb67f5 Ensure we meet the BIP 152 old-relay-types response requirements (Matt Corallo) 5749a85 Cache most-recently-connected compact block (Matt Corallo) 9eaec08 Cache most-recently-announced block's shared_ptr (Matt Corallo) c802092 Relay compact block messages prior to full block connection (Matt Corallo) 6987219 Add a CValidationInterface::NewPoWValidBlock callback (Matt Corallo) 180586f Call AcceptBlock with the block's shared_ptr instead of CBlock& (Matt Corallo) 8baaba6 [qa] Avoid race in preciousblock test. (Matt Corallo) 9a0b2f4 [qa] Make compact blocks test construction using fetch methods (Matt Corallo) 8017547 Make CBlockIndex*es in net_processing const (Matt Corallo)
| * | | Add comment to describe callers to ActivateBestChainMatt Corallo2017-01-121-0/+5
| | | |
| * | | Use a temp pindex to avoid a const_cast in ProcessNewBlockHeadersMatt Corallo2017-01-111-3/+5
| | | |
| * | | Add a CValidationInterface::NewPoWValidBlock callbackMatt Corallo2017-01-051-0/+5
| | | |
| * | | Call AcceptBlock with the block's shared_ptr instead of CBlock&Matt Corallo2017-01-041-8/+12
| | | |
| * | | Make CBlockIndex*es in net_processing constMatt Corallo2017-01-041-2/+4
| | | |
* | | | Merge #9472: Disentangle progress estimation from checkpoints and update itWladimir J. van der Laan2017-01-121-2/+20
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | df36371 Update estimated transaction count data (Pieter Wuille) e356d9a Shorten variable names and switch to tx/s (Pieter Wuille) 6dd8116 Remove SIGCHECK_VERIFICATION_FACTOR (Pieter Wuille) 3641141 Move tx estimation data out of CCheckPointData (Pieter Wuille) a4bac66 [MOVEONLY] Move progress estimation out of checkpoints (Pieter Wuille)
| * | | Shorten variable names and switch to tx/sPieter Wuille2017-01-111-3/+3
| | | |
| * | | Remove SIGCHECK_VERIFICATION_FACTORPieter Wuille2017-01-041-28/+6
| | | |
| * | | Move tx estimation data out of CCheckPointDataPieter Wuille2017-01-041-3/+3
| | | |
| * | | [MOVEONLY] Move progress estimation out of checkpointsPieter Wuille2017-01-041-2/+42
| |/ /
* | / Add pruneblockchain RPC to enable manual block file pruning.mrbandrews2017-01-101-5/+39
| |/ |/|
* | Merge #9408: Allow shutdown during LoadMempool, dump only when necessaryPieter Wuille2017-01-061-0/+2
|\ \ | | | | | | | | | | | | 325e400 [Qt] Do proper shutdown (Jonas Schnelli) 9479f8d Allow shutdown during LoadMempool, dump only when necessary (Jonas Schnelli)
| * | Allow shutdown during LoadMempool, dump only when necessaryJonas Schnelli2016-12-231-0/+2
| | |
* | | Merge #9138: Improve fee estimationPieter Wuille2017-01-051-3/+21
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 44b64b9 Fix edge case with stale fee estimates (Alex Morcos) 78ae62d Add clarifying comments to fee estimation (Alex Morcos) 5fe0f47 Add extra logging to processBlock in fee estimation. (Alex Morcos) dc008c4 Add IsCurrentForFeeEstimatation (Alex Morcos) ebafdca Pass pointers to existing CTxMemPoolEntries to fee estimation (Alex Morcos) d825838 Always update fee estimates on new blocks. (Alex Morcos) 6f06b26 rename bool to validFeeEstimate (Alex Morcos) 84f7ab0 Remove member variable hadNoDependencies from CTxMemPoolEntry (Alex Morcos) 60ac00d Don't track transactions at all during IBD. (Alex Morcos) 4df4479 Remove extraneous LogPrint from fee estimation (Alex Morcos)
| * | | Add IsCurrentForFeeEstimatationAlex Morcos2017-01-041-1/+18
| | | | | | | | | | | | | | | | Make a more conservative notion of whether the node is caught up to the rest of the network and only count transactions as fee estimation data points if the node is caught up.
| * | | Always update fee estimates on new blocks.Alex Morcos2017-01-041-1/+1
| | | | | | | | | | | | | | | | All decisions about whether the transactions are valid data points are made at the time the transaction arrives. Updating on blocks all the time will now cause stale fee estimates to decay quickly when we restart a node.
| * | | Remove member variable hadNoDependencies from CTxMemPoolEntryAlex Morcos2017-01-041-2/+1
| | | | | | | | | | | | | | | | Fee estimation can just check its own mapMemPoolTxs to determine the same information. Note that now fee estimation for block processing must happen before those transactions are removed, but this shoudl be a speedup.
| * | | Don't track transactions at all during IBD.Alex Morcos2017-01-041-1/+3
| | | | | | | | | | | | | | | | This was an oversight, where blocks and mempool tracking were ignored during IBD, but transactions that arrived during IBD but were included in blocks after IBD were not ignored.
* | | | Merge #8610: Share unused mempool memory with coincachePieter Wuille2017-01-051-4/+7
|\ \ \ \ | |_|_|/ |/| | | | | | | ba3cecf Share unused mempool memory with coincache (Pieter Wuille)
| * | | Share unused mempool memory with coincachePieter Wuille2016-12-221-4/+7
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | If the mempool is not completely full, treat the difference between the maximum size and the actual usage as available for the coin cache. This also changes the early flush trigger from (usage > 0.9 * space) to (usage > 0.9 * space && usage > space - 100MB). This means we're not permanently leaving 10% of the space unused when the space is large.
* | | Merge #9107: Safer modify new coinsPieter Wuille2017-01-041-1/+1
|\ \ \ | |_|/ |/| | | | | b50cd7a Fix dangerous condition in ModifyNewCoins. (Alex Morcos)
| * | Fix dangerous condition in ModifyNewCoins.Alex Morcos2017-01-041-1/+1
| |/ | | | | | | | | | | | | We were marking coins FRESH before being sure they were not overwriting dirty undo data. This condition was never reached in existing code because undo data was always flushed before UpdateCoins was called with new transactions, but could have been exposed in an otherwise safe refactor. Clarify in the comments the assumptions made in ModifyNewCoins. Add ability to undo transactions to UpdateCoins unit test. Thanks to Russ Yanofsky for suggestion on how to make logic clearer and fixing up the ccoins_modify_new test cases.
* / Make AcceptToMemoryPool take CTransactionRefPieter Wuille2016-12-211-7/+9
|/
* Merge #8589: Inline CTxInWitness inside CTxInWladimir J. van der Laan2016-12-211-12/+11
|\ | | | | | | f6fb7ac Move CTxInWitness inside CTxIn (Pieter Wuille)
| * Move CTxInWitness inside CTxInPieter Wuille2016-12-041-12/+11
| |
* | Merge #9236: Fix races for strMiscWarning and fLargeWork*Found, make QT ↵Wladimir J. van der Laan2016-12-191-56/+16
|\ \ | | | | | | | | | | | | | | | | | | | | | runawayException use GetWarnings 749be01 Move GetWarnings() into its own file. (Gregory Maxwell) e3ba0ef Eliminate data races for strMiscWarning and fLargeWork*Found. (Gregory Maxwell) c63198f Make QT runawayException call GetWarnings instead of directly access strMiscWarning. (Gregory Maxwell)
| * | Move GetWarnings() into its own file.Gregory Maxwell2016-12-031-0/+1
| | |
| * | Eliminate data races for strMiscWarning and fLargeWork*Found.Gregory Maxwell2016-12-031-11/+13
| | | | | | | | | | | | | | | This moves all access to these datastructures through accessor functions and protects them with a lock.
| * | Make QT runawayException call GetWarnings instead of directly access ↵Gregory Maxwell2016-12-031-45/+2
| | | | | | | | | | | | | | | | | | | | | | | | strMiscWarning. This is a first step in avoiding racy accesses to strMiscWarning. The change required moving GetWarnings and related globals to util.
* | | Merge #9273: Remove unused CDiskBlockPos* argument from ProcessNewBlockWladimir J. van der Laan2016-12-141-2/+2
|\ \ \ | | | | | | | | | | | | a13fa4c Remove unused CDiskBlockPos* argument from ProcessNewBlock (Matt Corallo)
| * | | Remove unused CDiskBlockPos* argument from ProcessNewBlockMatt Corallo2016-12-041-2/+2
| | | |
* | | | Do not run functions with necessary side-effects in assert()Gregory Maxwell2016-12-141-2/+4
| | | |
* | | | Merge #9240: Remove txConflictedPieter Wuille2016-12-091-9/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | a874ab5 remove internal tracking of mempool conflicts for reporting to wallet (Alex Morcos) bf663f8 remove external usage of mempool conflict tracking (Alex Morcos)
| * | | | remove external usage of mempool conflict trackingAlex Morcos2016-12-051-9/+3
| | |_|/ | |/| |
* / | | remove no longer needed check for premature v2 txsAlex Morcos2016-12-071-8/+0
|/ / /
* | | Merge #9014: Fix block-connection performance regressionWladimir J. van der Laan2016-12-051-23/+39
|\| | | | | | | | | | | | | | | | | | | | | | | | | | dd0df81 Document ConnectBlock connectTrace postconditions (Matt Corallo) 2d6e561 Switch pblock in ProcessNewBlock to a shared_ptr (Matt Corallo) 2736c44 Make the optional pblock in ActivateBestChain a shared_ptr (Matt Corallo) ae4db44 Create a shared_ptr for the block we're connecting in ActivateBCS (Matt Corallo) fd9d890 Keep blocks as shared_ptrs, instead of copying txn in ConnectTip (Matt Corallo) 6fdd43b Add struct to track block-connect-time-generated info for callbacks (Matt Corallo)
| * | Document ConnectBlock connectTrace postconditionsMatt Corallo2016-12-041-0/+4
| | |
| * | Switch pblock in ProcessNewBlock to a shared_ptrMatt Corallo2016-12-041-7/+2
| | | | | | | | | | | | | | | This (finally) fixes a performance regression in b3b3c2a5623d5c942d2b3565cc2d833c65105555
| * | Make the optional pblock in ActivateBestChain a shared_ptrMatt Corallo2016-12-041-6/+11
| | |
| * | Create a shared_ptr for the block we're connecting in ActivateBCSMatt Corallo2016-12-041-8/+8
| | |
| * | Keep blocks as shared_ptrs, instead of copying txn in ConnectTipMatt Corallo2016-12-041-9/+16
| | |
| * | Add struct to track block-connect-time-generated info for callbacksMatt Corallo2016-12-041-14/+19
| |/