-
Notifications
You must be signed in to change notification settings - Fork 37.7k
validation: Run CheckBlockIndex only on success for now #16453
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
validation: Run CheckBlockIndex only on success for now #16453
Conversation
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.
Is there a stack trace, or any clue why CheckBlockIndex is failing?
utACK fa21995. It does make sense to restore the previous behavior and remove the extra CheckBlockIndex call as a workaround.
Yes, I don't really like my change. Ideally |
Closing for now. Hoping someone else comes up with a better fix. |
A lot of the test runs are failing due to this and we are blindly resetting each failing test run, thus missing actual test failures. We need to either fix the underlying bug or restore the previous behavior. |
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. |
fa21995
to
fa5ad3e
Compare
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.
utACK fa5ad3e. Control flow simplified a little since last review, just moving CheckBlockIndex calls after returns.
|
||
if (!accepted) { | ||
if (first_invalid) *first_invalid = header; | ||
return false; | ||
} | ||
::ChainstateActive().CheckBlockIndex(chainparams.GetConsensus()); |
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 comment that check can fail if header is not accepted. Could quote or link to #16444 (comment)
ACK fa5ad3e |
I'd really prefer we at least attempt to fix InvalidateBlock to fix the issue in #16444 (comment) before we jump to removing CheckBlockIndex. Ideally we'd capture this case in CheckBlockIndex directly. |
…c_invalidateblock fae961d test: Establish only one connection between nodes in rpc_invalidateblock (MarcoFalke) Pull request description: Headers and block sync should eventually converge to the same result, regardless of whether the peers treat each other as "inbound" or "outbound". `connect_nodes_bi` has been introduced as a (temporary?) workaround for bug #5113 and #5138, which has long been fixed in #5157 and #5662. Thus remove the `connect_nodes_bi` workaround from the rpc_invalidateblock test. Conveniently, this also closes #16453. See #16444 (comment) for rationale ACKs for top commit: laanwj: ACK fae961d Tree-SHA512: b3614c66a205823df73f64d19cacfbec269beb5db52ff79004d746e17d7c0dfb43ab9785fdddc97e2a76fe76286c8c605b34df3dda4a2bf5be035f01169ae89a
…s in rpc_invalidateblock fae961d test: Establish only one connection between nodes in rpc_invalidateblock (MarcoFalke) Pull request description: Headers and block sync should eventually converge to the same result, regardless of whether the peers treat each other as "inbound" or "outbound". `connect_nodes_bi` has been introduced as a (temporary?) workaround for bug bitcoin#5113 and bitcoin#5138, which has long been fixed in bitcoin#5157 and bitcoin#5662. Thus remove the `connect_nodes_bi` workaround from the rpc_invalidateblock test. Conveniently, this also closes bitcoin#16453. See bitcoin#16444 (comment) for rationale ACKs for top commit: laanwj: ACK fae961d Tree-SHA512: b3614c66a205823df73f64d19cacfbec269beb5db52ff79004d746e17d7c0dfb43ab9785fdddc97e2a76fe76286c8c605b34df3dda4a2bf5be035f01169ae89a
…s in rpc_invalidateblock fae961d test: Establish only one connection between nodes in rpc_invalidateblock (MarcoFalke) Pull request description: Headers and block sync should eventually converge to the same result, regardless of whether the peers treat each other as "inbound" or "outbound". `connect_nodes_bi` has been introduced as a (temporary?) workaround for bug dashpay#5113 and dashpay#5138, which has long been fixed in dashpay#5157 and dashpay#5662. Thus remove the `connect_nodes_bi` workaround from the rpc_invalidateblock test. Conveniently, this also closes bitcoin#16453. See bitcoin#16444 (comment) for rationale ACKs for top commit: laanwj: ACK fae961d Tree-SHA512: b3614c66a205823df73f64d19cacfbec269beb5db52ff79004d746e17d7c0dfb43ab9785fdddc97e2a76fe76286c8c605b34df3dda4a2bf5be035f01169ae89a
…s in rpc_invalidateblock fae961d test: Establish only one connection between nodes in rpc_invalidateblock (MarcoFalke) Pull request description: Headers and block sync should eventually converge to the same result, regardless of whether the peers treat each other as "inbound" or "outbound". `connect_nodes_bi` has been introduced as a (temporary?) workaround for bug dashpay#5113 and dashpay#5138, which has long been fixed in dashpay#5157 and dashpay#5662. Thus remove the `connect_nodes_bi` workaround from the rpc_invalidateblock test. Conveniently, this also closes bitcoin#16453. See bitcoin#16444 (comment) for rationale ACKs for top commit: laanwj: ACK fae961d Tree-SHA512: b3614c66a205823df73f64d19cacfbec269beb5db52ff79004d746e17d7c0dfb43ab9785fdddc97e2a76fe76286c8c605b34df3dda4a2bf5be035f01169ae89a
…s in rpc_invalidateblock fae961d test: Establish only one connection between nodes in rpc_invalidateblock (MarcoFalke) Pull request description: Headers and block sync should eventually converge to the same result, regardless of whether the peers treat each other as "inbound" or "outbound". `connect_nodes_bi` has been introduced as a (temporary?) workaround for bug dashpay#5113 and dashpay#5138, which has long been fixed in dashpay#5157 and dashpay#5662. Thus remove the `connect_nodes_bi` workaround from the rpc_invalidateblock test. Conveniently, this also closes bitcoin#16453. See bitcoin#16444 (comment) for rationale ACKs for top commit: laanwj: ACK fae961d Tree-SHA512: b3614c66a205823df73f64d19cacfbec269beb5db52ff79004d746e17d7c0dfb43ab9785fdddc97e2a76fe76286c8c605b34df3dda4a2bf5be035f01169ae89a
…s in rpc_invalidateblock fae961d test: Establish only one connection between nodes in rpc_invalidateblock (MarcoFalke) Pull request description: Headers and block sync should eventually converge to the same result, regardless of whether the peers treat each other as "inbound" or "outbound". `connect_nodes_bi` has been introduced as a (temporary?) workaround for bug dashpay#5113 and dashpay#5138, which has long been fixed in dashpay#5157 and dashpay#5662. Thus remove the `connect_nodes_bi` workaround from the rpc_invalidateblock test. Conveniently, this also closes bitcoin#16453. See bitcoin#16444 (comment) for rationale ACKs for top commit: laanwj: ACK fae961d Tree-SHA512: b3614c66a205823df73f64d19cacfbec269beb5db52ff79004d746e17d7c0dfb43ab9785fdddc97e2a76fe76286c8c605b34df3dda4a2bf5be035f01169ae89a
…s in rpc_invalidateblock fae961d test: Establish only one connection between nodes in rpc_invalidateblock (MarcoFalke) Pull request description: Headers and block sync should eventually converge to the same result, regardless of whether the peers treat each other as "inbound" or "outbound". `connect_nodes_bi` has been introduced as a (temporary?) workaround for bug dashpay#5113 and dashpay#5138, which has long been fixed in dashpay#5157 and dashpay#5662. Thus remove the `connect_nodes_bi` workaround from the rpc_invalidateblock test. Conveniently, this also closes bitcoin#16453. See bitcoin#16444 (comment) for rationale ACKs for top commit: laanwj: ACK fae961d Tree-SHA512: b3614c66a205823df73f64d19cacfbec269beb5db52ff79004d746e17d7c0dfb43ab9785fdddc97e2a76fe76286c8c605b34df3dda4a2bf5be035f01169ae89a
To run CheckBlockIndex also on failure was changed in 613c46f and uncovered the bug #16444.
This pull restores the previous behavior, where
CheckBlockIndex
was only called on success (return true
inbitcoin/src/validation.cpp
Line 3440 in a6cba19