Skip to content

state: Don't create state entries for precompiles in access_account#1606

Merged
chfast merged 1 commit into
masterfrom
state/access-precompile-warm
Jul 23, 2026
Merged

state: Don't create state entries for precompiles in access_account#1606
chfast merged 1 commit into
masterfrom
state/access-precompile-warm

Conversation

@chfast

@chfast chfast commented Jul 20, 2026

Copy link
Copy Markdown
Member

Don't insert new nodes to State just to mark a precompile as warm
(they are warm by default).

We also split access_account() into find-precompile-insert.
This is double lookup in the worst case but overall performs better
on Mainnet.

We also ignore storage entries in access list targeting precompiles.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.41%. Comparing base (bef66c9) to head (3a750c7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1606   +/-   ##
=======================================
  Coverage   97.41%   97.41%           
=======================================
  Files         164      164           
  Lines       14720    14730   +10     
  Branches     3391     3394    +3     
=======================================
+ Hits        14339    14349   +10     
  Misses        280      280           
  Partials      101      101           
Flag Coverage Δ
eest-develop 89.49% <100.00%> (+0.01%) ⬆️
eest-develop-gmp 26.03% <71.42%> (+0.02%) ⬆️
eest-legacy 17.47% <57.14%> (+0.01%) ⬆️
eest-libsecp256k1 27.65% <71.42%> (+0.02%) ⬆️
eest-stable 89.46% <100.00%> (+0.01%) ⬆️
evmone-unittests 92.69% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
core 95.95% <100.00%> (+<0.01%) ⬆️
tooling 90.35% <ø> (ø)
tests 99.80% <100.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
test/state/host.cpp 99.54% <100.00%> (+<0.01%) ⬆️
test/state/state.cpp 99.69% <100.00%> (+<0.01%) ⬆️
test/unittests/state_transition_tx_test.cpp 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chfast
chfast force-pushed the state/access-precompile-warm branch 4 times, most recently from d7b86d4 to e611d99 Compare July 22, 2026 16:32
@chfast
chfast requested a review from Copilot July 22, 2026 16:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes access-list warming behavior around precompiles by avoiding state mutations for precompile addresses (which are warm by definition) and by skipping access-list storage-key warming for precompiles.

Changes:

  • Update Host::access_account() to avoid inserting state entries for precompiles and to split the logic into find/precompile/insert paths.
  • Skip applying access-list storage-key warming for precompile addresses during state transition.
  • Add a unit test covering an access list that targets a precompile with storage keys (ensuring intrinsic gas accounting remains correct).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
test/unittests/state_transition_tx_test.cpp Adds a regression test for access lists that include a precompile plus storage keys.
test/state/state.cpp Skips access-list storage warming for precompile addresses during transition.
test/state/host.cpp Avoids creating state entries for precompiles in access_account() (precompiles treated as warm by default).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/unittests/state_transition_tx_test.cpp Outdated
Comment thread test/state/state.cpp Outdated
@chfast
chfast force-pushed the state/access-precompile-warm branch 2 times, most recently from 35954b6 to 61dc0f0 Compare July 22, 2026 19:11
Don't insert new nodes to State just to mark a precompile as warm
(they are warm by default).

We also split access_account() into find-precompile-insert.
This is double lookup in the worst case but overall performs better
on Mainnet.

We also ignore storage entries in access list targeting precompiles.
@chfast
chfast force-pushed the state/access-precompile-warm branch from 61dc0f0 to 3a750c7 Compare July 22, 2026 20:05
@chfast
chfast merged commit 26ddc83 into master Jul 23, 2026
23 checks passed
@chfast
chfast deleted the state/access-precompile-warm branch July 23, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants