-
Notifications
You must be signed in to change notification settings - Fork 842
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
[#6301] Track bad block cause #6622
[#6301] Track bad block cause #6622
Conversation
Signed-off-by: mbaxter <mbaxter.dev@gmail.com>
Signed-off-by: mbaxter <mbaxter.dev@gmail.com>
Signed-off-by: mbaxter <mbaxter.dev@gmail.com>
Signed-off-by: mbaxter <mbaxter.dev@gmail.com>
Signed-off-by: mbaxter <mbaxter.dev@gmail.com>
@siladu - I have already pinged @garyschulte and @jflo for a review if you are busy |
Signed-off-by: mbaxter <mbaxter.dev@gmail.com>
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.
Overall big improvement in observability and readability! I think we need to think through the treatment of any RuntimeException as a bad block, that is a lot broader than known application exceptions like StorageException and MerkleTrieException. If that gets thrown unexpectedly and a protocol-compliant block is marked as bad, there will be a chain halt.
ethereum/core/src/test/java/org/hyperledger/besu/ethereum/chain/BadBlockManagerTest.java
Show resolved
Hide resolved
...h/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/DownloadHeaderSequenceTask.java
Show resolved
Hide resolved
See inline response here. |
Signed-off-by: mbaxter <mbaxter.dev@gmail.com> Signed-off-by: amsmota <antonio.mota@citi.com>
Signed-off-by: mbaxter <mbaxter.dev@gmail.com> Signed-off-by: amsmota <antonio.mota@citi.com>
Signed-off-by: mbaxter <mbaxter.dev@gmail.com>
PR description
Track bad block causes in
BadBlockManager
in preparation for exposing plugin events. This data is useful because a consumer may want to take a different action depending on the cause. For example, for #6301, we probably want to trace blocks with an actual validation error and ignore blocks that just descend from a bad block.Summary of changes:
BadBlockCause
when pushing blocks toBadBlockManager
BadBlockManager.isBadBlock
BadBlockManager
MergeCoordinator.onBadChain
, only push descendants of the bad block to theBadBlockManager
. The bad block itself will already have been pushed into theBadBlockManager
when processed inMainnetBlockValidator
and theMergeCoordinator
does not have the context on why the bad block was marked as bad.MergeMiningCoordinator.addBadBlock
MainnetBlockValidatorTest
fastBlockValidation()
InvalidBlockException
to handle cases where (previously required) block data is not availableDownloadHeaderSequenceTask
and add testsFixed Issue(s)
Part of #6301