-
Notifications
You must be signed in to change notification settings - Fork 1.1k
pallet-revive: EIP-7702 Set EOA Account Code (continued) #10936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pgherveou
wants to merge
67
commits into
master
Choose a base branch
from
pg/eip-7702
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…rinsic - Add EIP-7702 authorization list processing to dry_run_eth_transact - Split eth_call into eth_call (9 args) and eth_call_with_authorization_list (10 args) - Update call.rs to dispatch to correct extrinsic based on authorization list - Add eth_call_with_authorization_list to SetWeightLimit implementation - Add builder function for eth_call_with_authorization_list in tests - Refactor eip7702.rs to use WeightMeter for progressive weight charging
b1522d8 to
21967d3
Compare
Contributor
Author
|
/cmd bench --runtime dev --pallet pallet_revive |
- Move TransactionMeter creation inside with_ethereum_context closure - Handle meter creation errors by returning EthereumCallResult with error - Process authorizations inside closure with proper error handling - Fixes OutOfGas errors in test_runtime_set_authorization and related tests Note: Tests now fail at delegation assertion instead of OutOfGas, indicating authorization processing may need to happen outside transaction scope.
- Change Call variant to eth_call_with_authorization_list with named field - Move authorization processing outside with_ethereum_context closure - Use TransactionMeter with WeightAndDeposit limits for auth processing - Subtract consumed gas from eth_gas_limit for main call - Fixes delegation not being applied in runtime tests All three runtime tests now pass: - test_runtime_set_authorization - test_runtime_clear_authorization - test_runtime_delegation_resolution
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.
Summary
This PR implements EIP-7702 for
pallet-revive, enabling Externally Owned Accounts (EOAs) to temporarily delegate their code execution to contract addresses via authorization tuples in transactions.Key Structural Changes
New
AccountType::DelegatedVariantThis allows EOAs to:
New
code_addressField in Execution Frame (exec.rs)Added
code_address: H160to theFramestruct to track where code/immutable data originates from:This unifies immutable data resolution across all execution modes.
EIP-7702 Authorization Processing Module (
evm/eip7702.rs)New module implementing the core EIP-7702 logic:
process_authorizations(): Processes authorization list with weight meteringvalidate_authorization(): Validates chain_id, recovers signer, checks nonce, verifies non-contract statusapply_delegation(): Sets/clears delegation indicator and increments nonceAuthorization List Support in
eth_callExtrinsic (lib.rs)Extended
eth_callwith anauthorization_listparameter:Delegation-Aware Code Resolution (
lib.rs)Updated
Pallet::code()to return the EIP-7702 delegation indicator (0xef0100 || target) for delegated accounts, enabling external tools to detect delegated EOAs.