-
Notifications
You must be signed in to change notification settings - Fork 38.6k
rpc: Expose g_is_mempool_loaded via getmempoolinfo #15323
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
af9fced to
869e669
Compare
|
The test failure, for reference: |
src/rpc/blockchain.cpp
Outdated
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.
Should clarify that this means loaded from disk and if -persistmempool is on?
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 -persistmempool is off, g_is_mempool_loaded is set at the end of ThreadImport, after block import. Ideas on how to articulate that? Perhaps we could set it earlier in that case -persistmempool?
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.
How about this: ab48289
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.
nit, why /initialized?
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.
Because it will also be true in cases where it has not been loaded from disk, but only "initialized". Maybe not worth mentioning.
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.
Would prefer something like
True if the mempool has been loaded from disk (if persistent)
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.
I think True if the mempool has been loaded from disk (if persistent), or need not be is much less clear than the more simple True if the mempool is fully loaded. The first raises more questions than it answers ("What is persistent? When need it not be?")
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.
Maybe s/persist/-persistmempool/g?
|
Ref #12863 (comment) |
fce31d4 to
ab48289
Compare
promag
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. Could add a release note with the new key. This introduces a weird case, which is loaded can change from true to false. Maybe
Line 707 in b3a7153
| g_is_mempool_loaded = !ShutdownRequested(); |
should change to
g_is_mempool_loaded |= !ShutdownRequested(); 68396b6 to
b04c1f3
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
|
|
fe3b485 to
ae12a83
Compare
|
Revised and cleaned up:
|
ae12a83 to
cf5a189
Compare
|
Updated comments and documentation as per John and Marco's suggestions #15323 (comment) |
cf5a189 to
14642bc
Compare
14642bc to
32e2018
Compare
|
Rebase for #15473, and add another commit moving |
32e2018 to
d2870af
Compare
|
ACK the first and third commits (rpc: Expose g_is_mempool_loaded via getmempoolinfo and /rest/mempool/info.json and Move g_is_mempool_loaded into CTxMemPool::m_is_loaded). I like the tidy up in Move g_is_mempool_loaded into CTxMemPool::m_is_loaded to remove the I don't see the need for the second commit (rpc: Set g_is_mempool_loaded early if the mempool is not persisted). Having two places where |
d2870af to
1623a2a
Compare
Summary: And use it to fix a race condition in mempool_persist.py: https://travis-ci.org/Empact/bitcoin/jobs/487577243 Backport of Bitcoin Core PR15323 bitcoin/bitcoin#15323 Depends on D4234 and D4266. Test Plan: ``` ninja check-all ``` - Read the docs. Reviewers: Fabien, #bitcoin_abc, deadalnix Reviewed By: Fabien, #bitcoin_abc, deadalnix Differential Revision: https://reviews.bitcoinabc.org/D4243
2488ebc test: move sync_blocks and sync_mempool functions to test_framework.py (random-zebra) d076c81 [Test] Fix intermittent sync_blocks failures (random-zebra) f0de789 Move g_is_mempool_loaded into CTxMemPool::m_is_loaded (Ben Woosley) 0169a75 rpc: Expose g_is_mempool_loaded via getmempoolinfo and /rest/mempool/info.json (Ben Woosley) Pull request description: Backport the following PRs: - bitcoin#15323: rpc: Expose g_is_mempool_loaded via getmempoolinfo - bitcoin#18873: test: Fix intermittent sync_blocks failures - bitcoin#19208: test: move sync_blocks and sync_mempool functions to test_framework.py ACKs for top commit: furszy: nice finding!, code review ACK 2488ebc. Fuzzbawls: ACK 2488ebc Tree-SHA512: 4971a0076b4179b78c5338073a10fbf0649310c2cf3907cff1ab5c02f8dd67f5f7bb4bf524d69c554c8317bd98ce46411ff740aff676ed147525c75d83214976
And use it to fix a race condition in mempool_persist.py:
https://travis-ci.org/Empact/bitcoin/jobs/487577243
Since e.g. getrawmempool returns errors based on this status, this
enables users to test it for readiness.
Fixes #12863