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

EIP-2935: Serve historical block hashes from state #953

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

chfast
Copy link
Member

@chfast chfast commented Jul 22, 2024

Implement EIP-2935 "Serve historical block hashes from state" required for the Prague revision.
This mostly adds new system contract.

Copy link

codecov bot commented Jul 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.84%. Comparing base (a79218c) to head (645756f).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #953   +/-   ##
=======================================
  Coverage   93.84%   93.84%           
=======================================
  Files         146      146           
  Lines       15439    15456   +17     
=======================================
+ Hits        14488    14505   +17     
  Misses        951      951           
Flag Coverage Δ
eof_execution_spec_tests 17.42% <5.88%> (-0.01%) ⬇️
ethereum_tests 27.81% <5.88%> (-0.03%) ⬇️
ethereum_tests_silkpre 19.48% <0.00%> (-0.03%) ⬇️
execution_spec_tests 18.92% <23.52%> (+0.10%) ⬆️
unittests 89.01% <94.11%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
test/state/system_contracts.cpp 100.00% <100.00%> (ø)
test/unittests/state_system_call_test.cpp 100.00% <100.00%> (ø)
test/utils/utils.cpp 92.30% <100.00%> (+0.41%) ⬆️

@chfast chfast self-assigned this Aug 5, 2024
chfast added a commit that referenced this pull request Aug 19, 2024
This is blockchain tests execution optimization: only check state root
hash of first 5 blocks (to detect early problems) and last 5 blocks
(to do the final check of the chain of blocks).

The current implementation of the MPT hash of the state builds
the trie from scratch (no updates to the trie of the previous block).
For the tests will a long chain of blocks the performance degrades
significantly with 99% time spent in the keccak hash function.

This improves testing of EIP-2935
implemented in #953.
@chfast chfast requested review from gumb0 and pdobacz August 19, 2024 21:15
@chfast chfast marked this pull request as ready for review August 19, 2024 21:15
Copy link
Collaborator

@pdobacz pdobacz left a comment

Choose a reason for hiding this comment

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

LGTM, just one call for comment and one question

@chfast chfast added the Prague Changes for Prague upgrade label Sep 10, 2024
chfast added a commit that referenced this pull request Sep 10, 2024
This is blockchain tests execution optimization: for listed test names
only check state root hash of first 5 blocks (to detect early problems)
and last 5 blocks (to do the final check of the chain of blocks).

The current implementation of the MPT hash of the state builds
the trie from scratch (no updates to the trie of the previous block).
For the tests will a long chain of blocks the performance degrades
significantly with 99% time spent in the keccak hash function.

This improves testing of EIP-2935
implemented in #953.
chfast added a commit that referenced this pull request Sep 10, 2024
This is blockchain tests execution optimization: for listed test names
only check state root hash of first 5 blocks (to detect early problems)
and last 5 blocks (to do the final check of the chain of blocks).

The current implementation of the MPT hash of the state builds
the trie from scratch (no updates to the trie of the previous block).
For the tests will a long chain of blocks the performance degrades
significantly with 99% time spent in the keccak hash function.

This improves testing of EIP-2935
implemented in #953.
@chfast chfast force-pushed the eip2935_blockhash_history branch 2 times, most recently from c3ad014 to b5f9990 Compare September 10, 2024 13:49
@chfast chfast merged commit 652b4b1 into master Sep 10, 2024
25 checks passed
@chfast chfast deleted the eip2935_blockhash_history branch September 10, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prague Changes for Prague upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants