-
Notifications
You must be signed in to change notification settings - Fork 38.7k
rpc: Avoid getchaintxstats invalid results #29720
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 CoverageFor detailed information about the code coverage, see the test coverage report. 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. |
2ece999 to
fa032a5
Compare
fa032a5 to
faeb205
Compare
|
Concept ACK, could we add a test for this? |
|
A test is already present in |
fa146d9 to
fa28613
Compare
fjahr
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.
tACK fa28613
I have written some additional coverage to test the behavior and build my understanding, it could be added here or I can make a follow-up: fjahr@03a0f31
I think |
fa28613 to
fa73710
Compare
|
re-ACK fa737100af538f7257e55d88fe1f24246bcce7fc
Here is a version with |
fa73710 to
ef692e5
Compare
|
@fjahr Thanks! I've pushed your test commit with small fixups. |
|
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
|
re-ACK ef692e52b4121ba3d8de91e45b2d33aff946e8d2 Also reviewed #30144 to confirm the failure is ok. |
…task fa73431 ci: Add mising -Wno-error=maybe-uninitialized to armhf task (MarcoFalke) Pull request description: This happens after bd597c3 in many pull requests as a silent merge conflict. For example: * #29720 (comment) * #29521 (comment) * (Probably many undetected, because the CI task was not yet re-run) * ... ACKs for top commit: fjahr: utACK fa73431 fanquake: ACK fa73431 - many fixed with 13.x Tree-SHA512: 6e6ff8dc6f3c6a2abcd04c4203d3468f6e98c1ad3a4da4ad0037a9ee2cbec6bec079a5f778aba0273e38e173849927abcdfcfba7643d08ed66c1168cb89fab08
ef692e5 to
fac11c5
Compare
fac11c5 to
2342b46
Compare
|
re-ACK 2342b46 Confirmed only changes were rebase and typo-fix, per |
mzumsande
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.
ACK 2342b46
I reviewed the code and tested the getchaintxstats output with a snapshot.
|
ACK 2342b46 |
|
This PR introduced a new
|
|
See #29359 |
Add `-Wno-error=maybe-uninitialized` for GCC 11.4. See: bitcoin#29720 (comment)
Add `-Wno-error=maybe-uninitialized` for GCC 11.4. See: bitcoin#29720 (comment)
d8c2692 fixup! ci: Test CMake edge cases (Hennadii Stepanov) Pull request description: This PR adds `-Wno-error=maybe-uninitialized` for GCC 11.4. See: bitcoin#29720 (comment). ACKs for top commit: m3dwards: ACK d8c2692 Tree-SHA512: 9c5b5ebf67a0fcc29288943b8f089f4e93bd6cd18e87f0d887cc3f7bc39a59a675ee526158f5c55a6788c9aaddeafa8f3365e436cdee245b8c71fb9f7805f6e0
Summary: The getchaintxstats RPC reply during AU background download may return non-zero, but invalid, values for window_tx_count and txrate. For example, txcount may be zero for a to-be-downloaded block, but may be non-zero for an ancestor block which is already downloaded. Thus, the values returned may be negative (and cause intermediate integer sanitizer violations). Also, txcount may be accurate for the snapshot base block, or a descendant of it. However it may be zero for an ancestor block that still needs to be downloaded. Thus, the values returned may be positive, but wrong. Fix all issues by skipping the returned value if either txcount is unset (equal to zero). Also, skip txcount in the returned value, if it is unset (equal to zero). This is a backport of [[bitcoin/bitcoin#29720 | core#29720]] Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D18053
The
getchaintxstatsRPC reply during AU background download may return non-zero, but invalid, values forwindow_tx_countandtxrate.For example,
txcountmay be zero for a to-be-downloaded block, but may be non-zero for an ancestor block which is already downloaded. Thus, the values returned may be negative (and cause intermediate integer sanitizer violations).Also,
txcountmay be accurate for the snapshot base block, or a descendant of it. However it may be zero for an ancestor block that still needs to be downloaded. Thus, the values returned may be positive, but wrong.Fix all issues by skipping the returned value if either
txcountis unset (equal to zero).Also, skip
txcountin the returned value, if it is unset (equal to zero).Fixes #29328