Skip to content

state: Move Authorization into its own header - #1613

Merged
chfast merged 1 commit into
masterfrom
state/authorization-move
Jul 26, 2026
Merged

state: Move Authorization into its own header#1613
chfast merged 1 commit into
masterfrom
state/authorization-move

Conversation

@chfast

@chfast chfast commented Jul 26, 2026

Copy link
Copy Markdown
Member

The EIP-7702 authorization tuple has its own signing hash and signature recovery, which do not belong in transaction.hpp. Give it a home first.

Order the fields as the tuple is specified: chain_id, address, nonce, y_parity, r, s. Put signer, which is not part of it, at the end.

y_parity becomes uint8_t: EIP-7702 bounds it to one byte, and a value above 1 invalidates the tuple, not the transaction, so the field must still be able to hold it. The state test loader now rejects a wider one.

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 refactors the EIP-7702 set-code transaction authorization tuple into a dedicated authorization.hpp header, updates field ordering to match the EIP tuple definition, and tightens y_parity handling to reflect its 1-byte wire-format constraint.

Changes:

  • Moved state::Authorization / AuthorizationList out of transaction.hpp into a new test/state/authorization.hpp.
  • Reordered authorization fields to chain_id, address, nonce, y_parity, r, s (with signer last) and updated serialization/encoding code accordingly.
  • Changed y_parity storage to uint8_t and updated the state-test loader to reject values that don’t fit in a byte.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/utils/statetest_loader.cpp Parses v into y_parity with explicit 1-byte bounds checking for malformed tests.
test/utils/statetest_export.cpp Updates structured binding order and ensures y_parity is exported numerically (avoids uint8_t formatting pitfalls).
test/utils/rlp_encode.cpp Encodes y_parity as an integer for RLP tuple encoding.
test/unittests/state_transition_eip7702_test.cpp Updates unit test to use .y_parity instead of .v.
test/state/transaction.hpp Includes new authorization.hpp and removes the embedded Authorization definition.
test/state/state.cpp Switches validation logic from auth.v to auth.y_parity.
test/state/CMakeLists.txt Adds authorization.hpp to the evmone-state target sources.
test/state/authorization.hpp New header introducing the extracted Authorization tuple with reordered fields and uint8_t y_parity.

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

Comment thread test/state/authorization.hpp
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.38%. Comparing base (bcefc4f) to head (a623423).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1613   +/-   ##
=======================================
  Coverage   97.38%   97.38%           
=======================================
  Files         164      164           
  Lines       14789    14789           
  Branches     3411     3411           
=======================================
  Hits        14403    14403           
  Misses        281      281           
  Partials      105      105           
Flag Coverage Δ
eest-develop 89.37% <100.00%> (ø)
eest-develop-gmp 25.97% <40.00%> (+0.01%) ⬆️
eest-legacy 17.42% <0.00%> (ø)
eest-libsecp256k1 27.59% <40.00%> (+0.01%) ⬆️
eest-stable 89.33% <100.00%> (ø)
evmone-unittests 92.68% <60.00%> (ø)

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

Components Coverage Δ
core 95.89% <100.00%> (ø)
tooling 90.32% <100.00%> (ø)
tests 99.80% <100.00%> (ø)
Files with missing lines Coverage Δ
test/state/state.cpp 99.69% <100.00%> (ø)
test/state/transaction.hpp 100.00% <ø> (ø)
test/unittests/state_transition_eip7702_test.cpp 100.00% <100.00%> (ø)
test/utils/rlp_encode.cpp 100.00% <100.00%> (ø)
test/utils/statetest_export.cpp 72.44% <100.00%> (ø)
test/utils/statetest_loader.cpp 92.92% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The EIP-7702 authorization tuple has its own signing hash and signature
recovery, which do not belong in transaction.hpp. Give it a home first.

Order the fields as the tuple is specified: chain_id, address, nonce,
y_parity, r, s; and put signer, which is not part of it, at the end.

y_parity becomes uint8_t: EIP-7702 bounds it to one byte, and a value
above 1 invalidates the tuple, not the transaction, so the field must
still be able to hold it. The state test loader now rejects a wider one.
@chfast
chfast force-pushed the state/authorization-move branch from 35a11e8 to a623423 Compare July 26, 2026 13:23
@chfast
chfast requested a review from Copilot July 26, 2026 13:24

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread test/state/authorization.hpp
@chfast
chfast merged commit 3368397 into master Jul 26, 2026
24 checks passed
@chfast
chfast deleted the state/authorization-move branch July 26, 2026 13:48
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