-
Notifications
You must be signed in to change notification settings - Fork 978
Stop adding bad proposed block to bad block manager #5082
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
Stop adding bad proposed block to bad block manager #5082
Conversation
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
…he bad block manager Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
… manager Signed-off-by: Gabriel Fukushima <[email protected]>
…e bad block manager Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
… into dont-report-proposed-bad-blocks
Signed-off-by: Gabriel Fukushima <[email protected]>
siladu
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.
LGTM but I'm too close to this, would like someone else to approve
...src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeMiningCoordinator.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| @Test | ||
| public void shouldNotRecordProposedBadBlockToBadBlockManager() |
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 test already to ensure that an invalid block we received does get added to the bad blocks?
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/MainnetBlockValidator.java
Outdated
Show resolved
Hide resolved
macfarla
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.
LGTM. some suggestions on test names
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/MainnetBlockValidator.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/test/java/org/hyperledger/besu/ethereum/MainnetBlockValidatorTest.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/test/java/org/hyperledger/besu/ethereum/MainnetBlockValidatorTest.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/test/java/org/hyperledger/besu/ethereum/MainnetBlockValidatorTest.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeMiningCoordinator.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/hyperledger/besu/consensus/merge/blockcreation/MergeMiningCoordinator.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/MainnetBlockValidator.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/test/java/org/hyperledger/besu/ethereum/MainnetBlockValidatorTest.java
Outdated
Show resolved
Hide resolved
|
pining @jflo since he worked on this before |
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
* Add flag to distinguish when bad block is a proposed block Signed-off-by: Gabriel Fukushima <[email protected]> * Add flag to distinguish when bad block is a proposed block Signed-off-by: Gabriel Fukushima <[email protected]> * javadoc Signed-off-by: Gabriel Fukushima <[email protected]> * Add shouldRecordBadBlock flag to stop adding proposed bad blocks to the bad block manager Signed-off-by: Gabriel Fukushima <[email protected]> * Add overload to validateAndProcessBlock with shouldRecordBadBlock flag Signed-off-by: Gabriel Fukushima <[email protected]> * Add unit test to ensure flag is being used to add blocks to bad block manager Signed-off-by: Gabriel Fukushima <[email protected]> * Add unit test to ensure we don't add our own proposed bad block to the bad block manager Signed-off-by: Gabriel Fukushima <[email protected]> * Add debug log when badBlock is not added Signed-off-by: Gabriel Fukushima <[email protected]> * Undo change done in the first approach Signed-off-by: Gabriel Fukushima <[email protected]> * Improve log Signed-off-by: Gabriel Fukushima <[email protected]> * Improve test names Signed-off-by: Gabriel Fukushima <[email protected]> * Improve javadoc of validateProposedBlock method Signed-off-by: Gabriel Fukushima <[email protected]> * Remove method from interface Signed-off-by: Gabriel Fukushima <[email protected]> * Change validateProposedBlock access modifier to private Signed-off-by: Gabriel Fukushima <[email protected]> --------- Signed-off-by: Gabriel Fukushima <[email protected]>
* Add flag to distinguish when bad block is a proposed block Signed-off-by: Gabriel Fukushima <[email protected]> * Add flag to distinguish when bad block is a proposed block Signed-off-by: Gabriel Fukushima <[email protected]> * javadoc Signed-off-by: Gabriel Fukushima <[email protected]> * Add shouldRecordBadBlock flag to stop adding proposed bad blocks to the bad block manager Signed-off-by: Gabriel Fukushima <[email protected]> * Add overload to validateAndProcessBlock with shouldRecordBadBlock flag Signed-off-by: Gabriel Fukushima <[email protected]> * Add unit test to ensure flag is being used to add blocks to bad block manager Signed-off-by: Gabriel Fukushima <[email protected]> * Add unit test to ensure we don't add our own proposed bad block to the bad block manager Signed-off-by: Gabriel Fukushima <[email protected]> * Add debug log when badBlock is not added Signed-off-by: Gabriel Fukushima <[email protected]> * Undo change done in the first approach Signed-off-by: Gabriel Fukushima <[email protected]> * Improve log Signed-off-by: Gabriel Fukushima <[email protected]> * Improve test names Signed-off-by: Gabriel Fukushima <[email protected]> * Improve javadoc of validateProposedBlock method Signed-off-by: Gabriel Fukushima <[email protected]> * Remove method from interface Signed-off-by: Gabriel Fukushima <[email protected]> * Change validateProposedBlock access modifier to private Signed-off-by: Gabriel Fukushima <[email protected]> --------- Signed-off-by: Gabriel Fukushima <[email protected]>
* Add flag to distinguish when bad block is a proposed block Signed-off-by: Gabriel Fukushima <[email protected]> * Add flag to distinguish when bad block is a proposed block Signed-off-by: Gabriel Fukushima <[email protected]> * javadoc Signed-off-by: Gabriel Fukushima <[email protected]> * Add shouldRecordBadBlock flag to stop adding proposed bad blocks to the bad block manager Signed-off-by: Gabriel Fukushima <[email protected]> * Add overload to validateAndProcessBlock with shouldRecordBadBlock flag Signed-off-by: Gabriel Fukushima <[email protected]> * Add unit test to ensure flag is being used to add blocks to bad block manager Signed-off-by: Gabriel Fukushima <[email protected]> * Add unit test to ensure we don't add our own proposed bad block to the bad block manager Signed-off-by: Gabriel Fukushima <[email protected]> * Add debug log when badBlock is not added Signed-off-by: Gabriel Fukushima <[email protected]> * Undo change done in the first approach Signed-off-by: Gabriel Fukushima <[email protected]> * Improve log Signed-off-by: Gabriel Fukushima <[email protected]> * Improve test names Signed-off-by: Gabriel Fukushima <[email protected]> * Improve javadoc of validateProposedBlock method Signed-off-by: Gabriel Fukushima <[email protected]> * Remove method from interface Signed-off-by: Gabriel Fukushima <[email protected]> * Change validateProposedBlock access modifier to private Signed-off-by: Gabriel Fukushima <[email protected]> --------- Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima [email protected]
PR description
This PR uses a new parameter to distinguish between bad imported blocks vs bad proposed blocks.
Main objective is stop adding proposed bad blocks to the badBlockManager.
Tested on local devnet beku + txfuzzer
Tested on sepolia + teku w/ validators proposing blocks (20/02)
Fixed Issue(s)
Fixes #5058
Documentation
doc-change-requiredlabel to this PR ifupdates are required.
Acceptance Tests (Non Mainnet)
./gradlew acceptanceTestNonMainnetlocally if my PR affects non-mainnet modules.Changelog