state: Recover the EIP-7702 authorization authority from the signature - #1611
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1611 +/- ##
==========================================
+ Coverage 97.38% 97.40% +0.01%
==========================================
Files 164 166 +2
Lines 14789 14810 +21
Branches 3411 3412 +1
==========================================
+ Hits 14403 14425 +22
Misses 281 281
+ Partials 105 104 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
chfast
force-pushed
the
state/authority-recovery
branch
2 times, most recently
from
July 26, 2026 14:24
0316b22 to
a64ed66
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the state-test harness’ EIP-7702 set-code authorization handling to recover the authority address from the secp256k1 signature (strict / non-malleable mode), removing reliance on the artificial JSON "signer" field and tightening edge-case validation to match consensus rules.
Changes:
- Remove JSON
"signer"import/export for authorization tuples and stop storingAuthorization::signer. - Add
state::recover_authority()with EIP-7702 signing-hash computation and strict secp256k1 recovery; wire it into authorization list processing. - Expand unit/state-transition coverage for invalid y_parity, unrecoverable signatures, and additional secp256k1 recovery edge cases.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/utils/statetest_loader.cpp | Stops reading the optional JSON "signer" field when loading authorization tuples. |
| test/utils/statetest_export.cpp | Stops emitting "signer" and serializes authorization tuples directly from struct fields. |
| test/unittests/state_transition.hpp | Adds a second fixture signing identity (Authority) for EIP-7702-related tests. |
| test/unittests/state_transition_eip7702_test.cpp | Reworks tests to use literal signed authorizations (no "signer"), adds invalid/unrecoverable signature coverage. |
| test/unittests/state_authorization_test.cpp | Adds direct unit tests for state::recover_authority() and y_parity rejection. |
| test/unittests/evmmax_secp256k1_test.cpp | Adds a recovery test case where r is in-range but not a valid curve x-coordinate. |
| test/unittests/CMakeLists.txt | Registers the new state_authorization_test.cpp unit test. |
| test/state/state.cpp | Replaces prior partial validation + "signer" usage with strict signature recovery via recover_authority(). |
| test/state/CMakeLists.txt | Adds the new authorization.cpp implementation file to the test-state target. |
| test/state/authorization.hpp | Removes signer field, documents strict recovery semantics, declares recover_authority(). |
| test/state/authorization.cpp | Implements EIP-7702 signing-hash + strict secp256k1 authority recovery. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
chfast
force-pushed
the
state/authority-recovery
branch
2 times, most recently
from
July 26, 2026 15:25
26049ef to
eacee86
Compare
process_authorization_list took the authority from the non-standard
"signer" JSON field and only checked the signature's shape: y_parity in
{0, 1} and s <= secp256k1n/2. The signature itself was never verified, so
a t8n input could name any address as the signer of a garbage signature
and get a delegation designator installed on it, diverging from geth's
state root.
Recover the authority with strict (non-malleable) ecrecover instead. This
folds the three shape checks into one call and lets the signer field go;
every fixture already carries r, s and v.
The unit tests can no longer name an authority, so they carry signed
tuples as literals.
Closes #1483.
chfast
force-pushed
the
state/authority-recovery
branch
from
July 26, 2026 15:47
eacee86 to
6cee007
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
process_authorization_list took the authority from the non-standard
"signer" JSON field and only checked the signature's shape: y_parity in
{0, 1} and s <= secp256k1n/2. The signature itself was never verified, so
a t8n input could name any address as the signer of a garbage signature
and get a delegation designator installed on it, diverging from geth's
state root.
Recover the authority with strict (non-malleable) ecrecover instead. This
folds the three shape checks into one call and lets the signer field go;
every fixture already carries r, s and v.
The unit tests can no longer name an authority, so they carry signed
tuples as literals.
Closes #1483.