Fix empty body concept after shanghai#5174
Merged
gfukushima merged 7 commits intohyperledger:mainfrom Mar 7, 2023
Merged
Conversation
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
jframe
reviewed
Mar 6, 2023
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/CompleteBlocksTask.java
Show resolved
Hide resolved
jframe
reviewed
Mar 7, 2023
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>
jframe
reviewed
Mar 7, 2023
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/tasks/CompleteBlocksTask.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| @Test | ||
| public void shouldCompleteWhenBlocksAreEmptyExceptForWithdrawals() { |
Contributor
There was a problem hiding this comment.
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
Contributor
There was a problem hiding this comment.
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>
macfarla
approved these changes
Mar 7, 2023
...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>
jframe
approved these changes
Mar 7, 2023
garyschulte
added a commit
to garyschulte/besu
that referenced
this pull request
Apr 10, 2023
* 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>
elenduuche
pushed a commit
to elenduuche/besu
that referenced
this pull request
Aug 16, 2023
* 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>
eum602
pushed a commit
to lacchain/besu
that referenced
this pull request
Nov 3, 2023
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-requiredlabel to this PR ifupdates are required.
Acceptance Tests (Non Mainnet)
./gradlew acceptanceTestNonMainnetlocally if my PR affects non-mainnet modules.Changelog