Skip to content

state: Read the system contract code through the State - #1756

Merged
chfast merged 1 commit into
masterfrom
state/system-call-get-code
Oct 12, 2026
Merged

chfast merged 1 commit into
masterfrom
state/system-call-get-code

Conversation

@chfast

@chfast chfast commented Oct 12, 2026

Copy link
Copy Markdown
Member

The system calls read the contract code directly from the state view,
bypassing the State they execute on. Read it with State::get_code(), as
the code of any other called account.

The system calls read the contract code directly from the state view,
bypassing the State they execute on. Read it with State::get_code(), as
the code of any other called account.
@codspeed

codspeed Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 0.94%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 6 improved benchmarks
❌ 15 regressed benchmarks
✅ 878 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ test_push[fork_Osaka-blockchain_test-opcode_PUSH0-benchmark-gas-value_1M] 15.7 ms 16.2 ms -2.71%
❌ test_dup[fork_Osaka-blockchain_test-opcode_DUP12-benchmark-gas-value_1M] 12.3 ms 12.6 ms -2.5%
❌ test_dup[fork_Osaka-blockchain_test-opcode_DUP16-benchmark-gas-value_1M] 12.3 ms 12.6 ms -2.41%
❌ test_gas_op[fork_Osaka-blockchain_test-benchmark-gas-value_1M] 15 ms 15.4 ms -2.31%
❌ test_block_context_ops[fork_Osaka-blockchain_test-opcode_GASLIMIT-benchmark-gas-value_1M] 20.6 ms 21 ms -2.07%
❌ test_dup[fork_Osaka-blockchain_test-opcode_DUP15-benchmark-gas-value_1M] 12.3 ms 12.6 ms -2.06%
❌ test_dup[fork_Osaka-blockchain_test-opcode_DUP10-benchmark-gas-value_1M] 12.3 ms 12.6 ms -2.04%
❌ test_dup[fork_Osaka-blockchain_test-opcode_DUP1-benchmark-gas-value_1M] 12.2 ms 12.5 ms -1.98%
❌ test_dup[fork_Osaka-blockchain_test-opcode_DUP14-benchmark-gas-value_1M] 12.3 ms 12.5 ms -1.87%
❌ test_dup[fork_Osaka-blockchain_test-opcode_DUP7-benchmark-gas-value_1M] 12.4 ms 12.6 ms -1.84%
❌ test_block_context_ops[fork_Osaka-blockchain_test-opcode_NUMBER-benchmark-gas-value_1M] 20.7 ms 21 ms -1.46%
❌ test_dup[fork_Osaka-blockchain_test-opcode_DUP2-benchmark-gas-value_1M] 12.3 ms 12.5 ms -1.37%
❌ test_dup[fork_Osaka-blockchain_test-opcode_DUP13-benchmark-gas-value_1M] 12.3 ms 12.5 ms -1.31%
❌ test_block_context_ops[fork_Osaka-blockchain_test-opcode_CHAINID-benchmark-gas-value_1M] 21.4 ms 21.7 ms -1.21%
❌ test_msize[fork_Osaka-blockchain_test-mem_size_0-benchmark-gas-value_1M] 16.2 ms 16.4 ms -1.18%
⚡ test_calldatasize[fork_Osaka-blockchain_test-zero_data_False-calldata_size_1024-benchmark-gas-value_1M] 17.2 ms 16.9 ms +1.97%
⚡ test_calldatasize[fork_Osaka-blockchain_test-zero_data_False-calldata_size_32-benchmark-gas-value_1M] 17.3 ms 17 ms +1.91%
⚡ test_push[fork_Osaka-blockchain_test-opcode_PUSH1-benchmark-gas-value_1M] 12.8 ms 12.6 ms +1.5%
⚡ test_calldatasize[fork_Osaka-blockchain_test-zero_data_True-calldata_size_32-benchmark-gas-value_1M] 17.4 ms 17.2 ms +1.26%
⚡ test_calldatasize[fork_Osaka-blockchain_test-zero_data_False-calldata_size_256-benchmark-gas-value_1M] 17.1 ms 16.9 ms +1.18%
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing state/system-call-get-code (3f1b5d5) with master (fff0e98)

Open in CodSpeed

@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.06%. Comparing base (fff0e98) to head (3f1b5d5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1756      +/-   ##
==========================================
- Coverage   98.07%   98.06%   -0.02%     
==========================================
  Files         183      183              
  Lines       16944    16944              
  Branches     3876     3876              
==========================================
- Hits        16618    16616       -2     
- Misses        245      246       +1     
- Partials       81       82       +1     
Flag Coverage Δ
eest-develop-gmp 25.86% <0.00%> (ø)
eest-legacy 17.05% <100.00%> (ø)
eest-libsecp256k1 28.05% <0.00%> (ø)
eest-stable 83.86% <100.00%> (-0.04%) ⬇️
evmone-unittests 94.23% <100.00%> (-0.02%) ⬇️

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

Components Coverage Δ
core 96.27% <100.00%> (ø)
tooling 94.18% <ø> (-0.11%) ⬇️
tests 99.81% <ø> (ø)
Files with missing lines Coverage Δ
test/state/system_contracts.cpp 96.42% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

🟢 Approval recommended

The focused changes consistently use the active state without introducing correctness issues.

0 open findings

What changed in this PR

Routes system-contract code reads through the active State, ensuring calls use its account view.

Changes:

  • Uses State::get_code() for block-start and block-end system calls.
File Description
test/​state/​system_contracts.cpp Reads system-contract code through the execution state.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chfast
chfast merged commit 201a8f3 into master Oct 12, 2026
29 of 31 checks passed
@chfast
chfast deleted the state/system-call-get-code branch October 12, 2026 15:30
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.

2 participants