Skip to content

state: Check deploy prefix 0xEF before gas cost#1552

Merged
chfast merged 1 commit into
masterfrom
state/create_EF_before_gas
May 28, 2026
Merged

state: Check deploy prefix 0xEF before gas cost#1552
chfast merged 1 commit into
masterfrom
state/create_EF_before_gas

Conversation

@chfast
Copy link
Copy Markdown
Member

@chfast chfast commented May 28, 2026

When checking new code deployment requirements, check the forbidden 0xEF prefix before checking the by-byte deployment cost. This help with future EIP-8037 implementation.

When checking new code deployment requirements, check the forbidden 0xEF
prefix before checking the by-byte deployment cost.
This help with future EIP-8037 implementation.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Reorders contract-creation validation in the state test host so the EIP-3541 “0xEF prefix” rejection happens before charging the per-byte code deployment gas cost, aligning behavior with upcoming work (e.g., EIP-8037-related handling).

Changes:

  • Move the EIP-3541 0xEF-prefix rejection check to occur before computing/charging deployment gas.
  • Use bytes_view::starts_with() instead of manual code[0] indexing for the prefix check.

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

Comment thread test/state/host.cpp
Comment on lines +305 to +307
// Reject new contract code starting with the 0xEF byte (EIP-3541).
if (m_rev >= EVMC_LONDON && code.starts_with(0xEF))
return evmc::Result{EVMC_CONTRACT_VALIDATION_FAILURE};
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.97%. Comparing base (55a3ec8) to head (3143fb1).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1552   +/-   ##
=======================================
  Coverage   96.97%   96.97%           
=======================================
  Files         163      163           
  Lines       14449    14449           
  Branches     3383     3383           
=======================================
  Hits        14012    14012           
  Misses        307      307           
  Partials      130      130           
Flag Coverage Δ
eest-develop 91.93% <100.00%> (ø)
eest-develop-gmp 26.50% <100.00%> (ø)
eest-legacy 17.56% <0.00%> (ø)
eest-libsecp256k1 28.14% <100.00%> (ø)
eest-stable 91.86% <100.00%> (ø)
evmone-unittests 92.64% <0.00%> (ø)

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

Components Coverage Δ
core 96.01% <100.00%> (ø)
tooling 86.71% <ø> (ø)
tests 99.79% <ø> (ø)
Files with missing lines Coverage Δ
test/state/host.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 merged commit bbfadd3 into master May 28, 2026
24 checks passed
@chfast chfast deleted the state/create_EF_before_gas branch May 28, 2026 10:53
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