-
Notifications
You must be signed in to change notification settings - Fork 839
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
Fix empty body concept after shanghai #5174
Fix empty body concept after shanghai #5174
Conversation
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/CompleteBlocksTask.java
Show resolved
Hide resolved
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/CompleteBlocksTask.java
Show resolved
Hide resolved
…mpty block check Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/CompleteBlocksTask.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Test | ||
public void shouldCompleteWhenBlocksAreEmptyExceptForWithdrawals() { |
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 this testing that when blocks are empty but have withdrawals they are still downloaded? i.e. that they are considered empty blocks. Was a bit confused from the test name
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 this testing that when blocks are empty but have withdrawals they are still downloaded?
yes, i.e. that they are not considered empty blocks like they were being before.
Any name suggestion? This was an modification of the existing test's name: shouldCompleteWithoutPeersWhenAllBlocksAreEmpty
. Agree the new one could be better
...m/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/tasks/CompleteBlocksTaskTest.java
Show resolved
Hide resolved
...m/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/tasks/CompleteBlocksTaskTest.java
Outdated
Show resolved
Hide resolved
...m/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/tasks/CompleteBlocksTaskTest.java
Show resolved
Hide resolved
...m/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/tasks/CompleteBlocksTaskTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@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.
LGTM
...m/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/tasks/CompleteBlocksTaskTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Fix empty body concept after shanghai Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Check protocolSchedule to create empty block and add withdrawals to empty block check Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Add unit tests Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Extract block creation into a private method Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Nit changes Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Refactor test names Signed-off-by: Simon Dudley <simon.dudley@consensys.net> --------- Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> Co-authored-by: garyschulte <garyschulte@gmail.com> Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
* Fix empty body concept after shanghai Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Check protocolSchedule to create empty block and add withdrawals to empty block check Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Add unit tests Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Extract block creation into a private method Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Nit changes Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Refactor test names Signed-off-by: Simon Dudley <simon.dudley@consensys.net> --------- Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> Co-authored-by: garyschulte <garyschulte@gmail.com> Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
* Fix empty body concept after shanghai Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Check protocolSchedule to create empty block and add withdrawals to empty block check Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Add unit tests Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Extract block creation into a private method Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Nit changes Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> * Refactor test names Signed-off-by: Simon Dudley <simon.dudley@consensys.net> --------- Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com> Co-authored-by: garyschulte <garyschulte@gmail.com> Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
PR description
This PR adds withdrawals to the method that checks for empty block bodies in CompleteBlocksTask.java
Adding withdrawals allows Besu to be able to distinguish empty blocks after shanghai skiping the block body download when body is empty.
Prior to this PR Besu would understand blocks like (0txs, 0 ommers, x ws) as an empty block, during the sync process. (x > 0)
Fixed Issue(s)
Fixes #4976
This PR has performed the following tests:
Documentation
doc-change-required
label to this PR ifupdates are required.
Acceptance Tests (Non Mainnet)
./gradlew acceptanceTestNonMainnet
locally if my PR affects non-mainnet modules.Changelog