Skip to content

Fix <codeAddr> tracking for delegated calls#2846

Draft
tothtamas28 wants to merge 2 commits into
masterfrom
fix-delegated-codeaddr
Draft

Fix <codeAddr> tracking for delegated calls#2846
tothtamas28 wants to merge 2 commits into
masterfrom
fix-delegated-codeaddr

Conversation

@tothtamas28
Copy link
Copy Markdown
Contributor

No description provided.

@tothtamas28 tothtamas28 self-assigned this May 14, 2026
@tothtamas28
Copy link
Copy Markdown
Contributor Author

@anvacaru, @RaoulSchaffranek, this PR fixes <codeAddr> tracking for delegated calls, but breaks EIP-7702 delegation in the context of precompiles (see newly added failing tests: 0b91714). Let's discuss how to properly decouple these two concerns.

@anvacaru
Copy link
Copy Markdown
Contributor

@tothtamas28 One possible solution could be to add an additional argument in #mkCall, named ACCTEXEC below. ACCTCODE would be the one used in the #precompiled? rule, whereas ACCTEXEC is set in the <codeAddr>.

rule <k> #mkCall ACCTFROM ACCTTO ACCTCODE ACCTEXEC BYTES APPVALUE ARGS STATIC
     => … ~> #precompiled?(ACCTCODE, SCHED) ~> #execute
    …
    </k>
    …
    <codeAddr> _ => ACCTEXEC </codeAddr> 

Then, for the call.delegatedAuthority rule, you would pass both ACCTCODE and DELEGATED_ACCOUNT.

#callWithCode ACCTFROM ACCTTO ACCTCODE #getAccountCode(DELEGATED_ACCOUNT) VALUE APPVALUE ARGS STATIC

But, this means that for the remaining call.* rules, we have to duplicate the ACCTCODE argument when calling #callWithCode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants