feat(evm): EIP-7851 code-controlled EOA delegation (SETSELFDELEGATE) - #12239
Draft
MarekM25 wants to merge 1 commit into
Draft
feat(evm): EIP-7851 code-controlled EOA delegation (SETSELFDELEGATE)#12239MarekM25 wants to merge 1 commit into
MarekM25 wants to merge 1 commit into
Conversation
Adds the SETSELFDELEGATE opcode (0xf6 placeholder, 9500 gas): delegated wallet code can rewrite its EOA's designator to the ECDSA-disabled form 0xef0101 || delegate, permanently disabling the ECDSA key. Delegation following (calls) accepts both 0xef0100 and 0xef0101 designators, while sender validation (EIP-3607 path) and EIP-7702 authorization processing keep rejecting ECDSA-disabled accounts — authorizations from them are now explicitly invalid. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 tasks
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.
Changes
SETSELFDELEGATEopcode (0xf6placeholder — value is TBD in the spec; 9500 gas), gated byIsEip7851Enabled: pops a delegate address, rewrites the executing account's designator to0xef0101 || delegateand pushes 1; pushes 0 without state change for a zero delegate or when the executing account's state code is not a 23-byte designator; exceptional halt in static contextEip7851Constantswith the0xef0101ECDSA-disabled designator helpersICodeInfoRepository.TryGetDelegatedAddress) now accepts both0xef0100and0xef0101, so calls to an ECDSA-disabled EOA still execute its delegate0xef0100check, so ECDSA-authenticated transactions from0xef0101accounts are rejected as contract senders — covered by regression testsIsEip7851Enabledflag +eip7851TransitionTimestampchainspec plumbingSpec: https://eips.ethereum.org/EIPS/eip-7851 (Hegotá / EIP-8081 candidate). Not yet activated in any fork file — activation lands with the Hegotá fork wiring (#12226).
Part of the Hegotá (EIP-8081) PR series.
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Eip7851Tests(7): success from 0xef0100 and 0xef0101 contexts, zero-delegate failure, non-delegated-context failure, static-context halt, ECDSA-disabled sender rejection, ECDSA-disabled authorization skip. Existing 7702/delegation/transaction-processor suites pass unchanged (119 tests).Documentation
Requires documentation update
Requires explanation in Release Notes
Remarks
The opcode value is marked TBD in the EIP;
0xf6is a placeholder to revisit when the spec assigns one.🤖 Generated with Claude Code