-
Notifications
You must be signed in to change notification settings - Fork 1.1k
EIP-7702 Implementation for pallet-revive #10851
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
base: master
Are you sure you want to change the base?
Conversation
…k into david/eip-7702
a747040 to
bb69263
Compare
|
/bot fmt |
pgherveou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove the pure fmt diff, it will make it easier to review
f4eb19a to
bbc05c1
Compare
Done |
pgherveou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, thanks for putting this together.
I think the implementation still has a few gaps; I’ve added some initial remarks.
|
@pgherveou I've attended to the comments, please check it out when you can. |
it requires some bin like solc & resolc I believe, the build error should tell you why it fails I presume |
It doesn't fail, it just gets stuck on building and never progresses. I'll try again, maybe I wasn't patient enough |

Description
This PR implements EIP-7702: Set EOA Account Code for pallet-revive. This implementation allows Externally Owned Accounts (EOAs) to temporarily delegate their execution to smart contract code via signed authorizations.
Key Components Implemented
1. Core Authorization Processing (
src/evm/eip7702.rs)New Module: Complete implementation of authorization tuple processing
process_authorizations(): Main function to process authorization listsprocess_single_authorization(): Validates individual authorization tuplesrecover_authority(): Recovers signer address using ECDSA signature recoveryauthorization_intrinsic_gas(): Calculates gas costs for authorizationsKey Features:
keccak256(MAGIC || rlp([chain_id, address, nonce]))2. Delegation Indicator Storage (
src/storage.rs)Extended
AccountInfowith EIP-7702-specific methods:Storage Strategy:
PristineCodewithoutCodeInfo0xef0100 || <20-byte address>(23 bytes total)3. Code Execution Resolution (
src/exec.rs)New Function:
resolve_delegation(code_hash: H256) -> H256EMPTY_CODE_HASHif target is not a contractnew_frame()for contract callsBehavior:
CALL,CALLCODE,DELEGATECALL,STATICCALLfollow delegationEXTCODEHASH,EXTCODESIZE,EXTCODECOPYoperate on delegation indicator itselfCODESIZE≠EXTCODESIZE(per spec)4. Transaction Integration (
src/lib.rs,src/evm/call.rs)Modified Dispatchables:
Note:
authorization_listis only added toeth_call, not toeth_instantiate_with_code. EIP-7702 is for setting code on existing EOAs, not for contract creation.Processing Flow:
New Helper Function:
6. EIP-3607 Modification (
src/lib.rs)Updated
ensure_non_contract_if_signed():Per EIP-7702: EOAs with valid delegation indicators can originate transactions.