-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin/bitcoin#28251: validation: fix coins disappearing mid-p…
…ackage evaluation 32c1dd1 [test] mempool coins disappearing mid-package evaluation (glozow) a67f460 [refactor] split setup in mempool_limit test (glozow) d086961 [test framework] add ability to spend only confirmed utxos (glozow) 3ea71fe [validation] don't LimitMempoolSize in any subpackage submissions (glozow) d227b72 [validation] return correct result when already-in-mempool tx gets evicted (glozow) 9698b81 [refactor] back-fill results in AcceptPackage (glozow) 8ad7ad3 [validation] make PackageMempoolAcceptResult members mutable (glozow) 03b87c1 [validation] add AcceptSubPackage to delegate Accept* calls and clean up m_view (glozow) 3f01a3d [CCoinsViewMemPool] track non-base coins and allow Reset (glozow) 7d7f7a1 [policy] check for duplicate txids in package (glozow) Pull request description: While we are evaluating a package, we split it into "subpackages" for evaluation (currently subpackages all have size 1 except the last one). If a subpackage has size 1, we may add a tx to mempool and call `LimitMempoolSize()`, which evicts transactions if the mempool gets full. We handle the case where the just-submitted transaction is evicted immediately, but we don't handle the case in which a transaction from a previous subpackage (either just submitted or already in mempool) is evicted. Mainly, since the coins created by the evicted transaction are cached in `m_view`, we don't realize the UTXO has disappeared until `CheckInputsFromMempoolAndCache` asserts that they exist. Also, the returned `PackageMempoolAcceptResult` reports that the transaction is in mempool even though it isn't anymore. Fix this by not calling `LimitMempoolSize()` until the very end, and editing the results map with "mempool full" if things fall out. Pointed out by instagibbs in bitcoin/bitcoin@faeed68 on top of the v3 PR. ACKs for top commit: instagibbs: reACK bitcoin/bitcoin@32c1dd1 Tree-SHA512: 61e7f69db4712e5e5bfa27d037ab66bdd97f1bf60a8d9ffb96adb1f0609af012c810d681102ee5c7baec7b5fe8cb7c304a60c63ccc445d00d86a2b7f0e7ddb90
- Loading branch information
Showing
9 changed files
with
392 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.