-
Notifications
You must be signed in to change notification settings - Fork 38.8k
assumeutxo state and locking cleanup #28608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/28608. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
|
Concept ACK, aside from the linked discussions, this would also resolve a few more review comments in #27596. |
|
Drop from 26.0 milestone? |
Why? |
nm. I missed the context. |
|
Sorry about the noise. |
Sjors
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
| get_inflight_budget(), | ||
| vToDownload, m_chainman.GetBackgroundSyncTip(), | ||
| Assert(m_chainman.GetSnapshotBaseBlock())); | ||
| vToDownload, historical_blocks->first, historical_blocks->second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If practical, it would be nice to have this change in a seperate commit from the (simpler) changes above.
f870170 to
c6122e4
Compare
4ee775e to
decf338
Compare
|
|
🐙 This pull request conflicts with the target branch and needs rebase. |
|
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
4 similar comments
|
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
|
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
|
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
|
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
Hey hi, I can work on this given that you have been stuck with other commitments. Should I work on this or open a separate pr, either way works for me? |
|
re: #28608 (comment)
Hi, feel free to work on anything here and open a separate PR. Note that this PR is trying to do two things:
I'm not sure which of these you may be more interested in but progress has been very slow on the first and nonexistent on the second. I think different approaches are possible and the two things above are not tied together so a lot could be done here depending on your goals. |
|
I will look into this and get back here soon! |
|
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
82be652 doc: Improve ChainstateManager documentation, use consistent terms (Ryan Ofsky) af455dc refactor: Simplify pruning functions (TheCharlatan) ae85c49 refactor: Delete ChainstateManager::GetAll() method (Ryan Ofsky) 6a572db refactor: Add ChainstateManager::ActivateBestChains() method (Ryan Ofsky) 491d827 refactor: Add ChainstateManager::m_chainstates member (Ryan Ofsky) e514fe6 refactor: Delete ChainstateManager::SnapshotBlockhash() method (Ryan Ofsky) ee35250 refactor: Delete ChainstateManager::IsSnapshotValidated() method (Ryan Ofsky) d9e8229 refactor: Delete ChainstateManager::IsSnapshotActive() method (Ryan Ofsky) 4dfe383 refactor: Convert ChainstateRole enum to struct (Ryan Ofsky) 352ad27 refactor: Add ChainstateManager::ValidatedChainstate() method (Ryan Ofsky) a229cb9 refactor: Add ChainstateManager::CurrentChainstate() method (Ryan Ofsky) a9b7f56 refactor: Add Chainstate::StoragePath() method (Ryan Ofsky) 840bd2e refactor: Pass chainstate parameters to MaybeCompleteSnapshotValidation (Ryan Ofsky) 1598a15 refactor: Deduplicate Chainstate activation code (Ryan Ofsky) 9fe927b refactor: Add Chainstate m_assumeutxo and m_target_utxohash members (Ryan Ofsky) 6082c84 refactor: Add Chainstate::m_target_blockhash member (Ryan Ofsky) de00e87 test: Fix broken chainstatemanager_snapshot_init check (Ryan Ofsky) Pull request description: This PR contains the first part of #28608, which tries to make assumeutxo code more maintainable, and improve it by not locking `cs_main` for a long time when the snapshot block is connected, and by deleting the snapshot validation chainstate when it is no longer used, instead of waiting until the next restart. The changes in this PR are just refactoring. They make `Chainstate` objects self-contained, so for example, it is possible to determine what blocks to connect to a chainstate without querying `ChainstateManager`, and to determine whether a Chainstate is validated without basing it on inferences like `&cs != &ActiveChainstate()` or `GetAll().size() == 1`. The PR also tries to make assumeutxo terminology less confusing, using "current chainstate" to refer to the chainstate targeting the current network tip, and "historical chainstate" to refer to the chainstate downloading old blocks and validating the assumeutxo snapshot. It removes uses of the terms "active chainstate," "usable chainstate," "disabled chainstate," "ibd chainstate," and "snapshot chainstate" which are confusing for various reasons. ACKs for top commit: maflcko: re-review ACK 82be652 🕍 fjahr: re-ACK 82be652 sedited: Re-ACK 82be652 Tree-SHA512: 81c67abba9fc5bb170e32b7bf8a1e4f7b5592315b4ef720be916d5f1f5a7088c0c59cfb697744dd385552f58aa31ee36176bae6a6e465723e65861089a1252e5
This is based on #29370. The non-base commits are:
35d0519c4728refactor: Replace ChainstateManager IBD and snapshot chainstates with flat list of chainstates0bb0db780ff6brokenThis is a draft PR to follow up on comments about simplifying assumetxo state representation #28562 (comment), #27746 (comment), #24232 (comment) so validation code is less complicated, and each chainstate is handled independently without references to other assumeutxo chainstates everywhere.
Implementation is not done, but the plan is also for this PR to make two functional improvements: