mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 10:47:36 +00:00
validation: don't accept txs to the mempool while loading a snapshot #36346
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36346
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-loadtxoutset-mempool-recheck"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ActivateSnapshotchecks that the mempool is empty before it starts, butPopulateAndValidateSnapshotthen runs withoutcs_main, which takes minutes on mainnet. A transaction entering the mempool in that window (e.g. throughsendrawtransaction) hits the assert inAddChainstate:By then the base blockhash file has been written, so the node needs
-reindexto start again.This sets a flag on
ChainstateManagerwhileActivateSnapshotruns, andAcceptToMemoryPoolandProcessNewPackagereject withsnapshot-loadingwhile it's set.testmempoolacceptstill works. A secondloadtxoutsetstarted while one is running is also rejected.test_mempool_blocked_during_loadinfeature_assumeutxo.pypauses the load through a FIFO, checks thatsendrawtransactionandsubmitpackageare rejected and the mempool stays empty, then lets the load finish. On master the transaction is accepted and the node aborts. The test is skipped whereos.mkfifoisn't available.The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
loadtxoutsetRPC with a startup arg by l0rinc)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
I haven't looked at the code or verified the issue but it seems to me the correct fix would be to prevent the user from putting a tx into the mempool when we don't want one to get there instead of letting them do it and then fail, even if it's a graceful failure with this change.
Makes sense, changed it to that. While a snapshot is loading, AcceptToMemoryPool and ProcessNewPackage now reject with "snapshot-loading" (test_accept still works), so the load no longer fails because of the mempool. Updated the description and the test.
🔵 Suggestion · Concurrent-load rejection lacks a paused-window test
The paused-load test never exercises the new concurrent-activation guard or verifies that a rejected second request leaves mempool admission blocked.
Location:
test/functional/feature_assumeutxo.py:246(head).🔵 Suggestion ·
snapshot-loadingrejections skip the documented rejection tracepointDuring snapshot loading, transactions rejected with
snapshot-loadingbypassmempool:rejected, leaving attached USDT mempool monitors unaware of those rejections.Location:
src/validation.cpp:1778(head).🔵 Suggestion · Package test acceptance lacks snapshot-loading coverage
The loading-window test checks only singleton
testmempoolaccept, leaving the separate package test-accept exemption untested.Location:
test/functional/feature_assumeutxo.py:247(head).Review coverage was incomplete.
Reviewed:
ca21d8f5fbc9· Full review report · Previous reportspermalink
I think this one more issue that is so fringe that we may not really want to address it. But if we would I prefer #36778 for a more structural solution. And there are further changes to this code upcoming with #36603 so I would rather close this or maybe it could be turned into an issue to make sure this doesn't get lost but even that is probably not worth it.