Skip to content
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

Add an acceptance test to ensure eth_getBlockByNumber and eth_getBlockByHash return withdrawals correctly for shanghai #5146

Merged
merged 4 commits into from
Mar 3, 2023

Conversation

siladu
Copy link
Contributor

@siladu siladu commented Mar 2, 2023

Fixes #4808

I spent a good amount of time trying to add a test similar to https://github.com/hyperledger/besu/blob/main/ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/fork/frontier/EthGetBlockByNumberIntegrationTest.java

...but was ultimately thwarted by some post-merge genesis protocol schedule issues.

I think this AT-style is actually easier to understand and work with, and also tests the JSON serialization as a bonus.

…kByHash return withdrawals correctly for shanghai

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@siladu siladu added TeamGroot GH issues worked on by Groot Team mainnet EIP Ethereum Improvement Proposal labels Mar 2, 2023
@@ -0,0 +1,35 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the first test start from 02?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, I knew you'd pick up on that ;)

I copied the test cases over from replayBlock ATs and I was too lazy to rename all the files after deleting the unnecessary first 01_prepare_payload.
I will rename :p

"uncles" : [ ],
"transactions" : [ ],
"withdrawalsRoot" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"withdrawals": [ ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also test this block with the empty withdrawals case using eth_getBlockByHash

Copy link
Contributor Author

@siladu siladu Mar 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeh sure. I know it's using the same code underneath so took a short cut to minimise the test execution cost, but maybe I should go whole hog and test last paris block too?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we need to test the last Paris block, just testing the shanghai block would be enough

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Copy link
Contributor

@jframe jframe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@siladu siladu enabled auto-merge (squash) March 3, 2023 07:38
@siladu siladu merged commit d04d35b into hyperledger:main Mar 3, 2023
@siladu siladu deleted the eth_getBlockBy-acceptanceTest branch March 3, 2023 08:21
elenduuche pushed a commit to elenduuche/besu that referenced this pull request Aug 16, 2023
…yperledger#5146)

Add an acceptance test to ensure eth_getBlockByNumber and eth_getBlockByHash return withdrawals correctly for shanghai

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
…yperledger#5146)

Add an acceptance test to ensure eth_getBlockByNumber and eth_getBlockByHash return withdrawals correctly for shanghai

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EIP Ethereum Improvement Proposal mainnet TeamGroot GH issues worked on by Groot Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add withdrawals details to eth_getBlock methods
2 participants