Skip to content

Conversation

@lukasz-hashgraph
Copy link
Contributor

@lukasz-hashgraph lukasz-hashgraph commented Nov 3, 2025

Added EIP-7702 code delegation handling when processing calls.
Includes the proxy/facade refactoring described in HIP-1340.

Related issue: #21198

@lukasz-hashgraph lukasz-hashgraph self-assigned this Nov 3, 2025
@lukasz-hashgraph lukasz-hashgraph changed the title WIP (not for review): Handle EIP-7702 code delegation feat: WIP (not for review): Handle EIP-7702 code delegation Nov 3, 2025
@lfdt-bot
Copy link

lfdt-bot commented Nov 3, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@lukasz-hashgraph lukasz-hashgraph marked this pull request as draft November 3, 2025 13:36
@lukasz-hashgraph lukasz-hashgraph marked this pull request as ready for review November 3, 2025 14:26
@lukasz-hashgraph lukasz-hashgraph force-pushed the feature/pectra-execution branch from 2f09564 to 4447a3f Compare November 3, 2025 14:43
@lukasz-hashgraph lukasz-hashgraph requested a review from a team as a code owner November 3, 2025 14:43
@lukasz-hashgraph lukasz-hashgraph changed the title feat: WIP (not for review): Handle EIP-7702 code delegation feat: Handle EIP-7702 code delegation Nov 18, 2025
@lukasz-hashgraph lukasz-hashgraph force-pushed the feature/pectra-execution branch 3 times, most recently from e07274e to efde495 Compare November 19, 2025 14:30
@lukasz-hashgraph lukasz-hashgraph force-pushed the feature/pectra-execution branch from efde495 to d037997 Compare December 5, 2025 15:16
@lukasz-hashgraph lukasz-hashgraph force-pushed the feature/pectra-execution branch from 6578b57 to 42bfaa5 Compare December 8, 2025 15:52
doExecuteSystemContract(context, systemContracts.get(context.executableCodeAddress));
}
} else {
// For any other accounts: code delegation to System Contracts is a no-op - so just succeed.
Copy link
Contributor

@lukelee-sl lukelee-sl Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to specify in the comment that this condition is only for Hedera accounts? To me this implies that if we have another entity type that can have a facade contract (like HCS), we will fall into this else clause but it seems likely that the new entity will be treated like token/schedule entities

private boolean isTokenCreation(MessageFrame frame) {
if (frame.getInputData().isEmpty()) {
return false;
if (isSystemContractCall(context)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I really like this refactor. It makes things much cleaner.

* A set of call data prefixes (i.e. function selectors in the realm of Solidity)
* that are eligible for proxy redirection to the Hedera Account Service system contract.
*/
private static final Set<Integer> ACCOUNT_PROXY_ELIGIBLE_CALL_DATA_PREFIXES = Set.of(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a little out of place to me to be here. If we ever add a new function to HAS, I guess we will have to remember to maintain this list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I couldn't find the right place for it. Any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe HasCallAttempt - not a strong preference as it is not used there really but logically it might fit there.

Copy link
Contributor

@lukelee-sl lukelee-sl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks really good. Up to you if you want to address any of my comments.

Signed-off-by: Lukasz Gasior <[email protected]>
Copy link
Contributor

@stoyanov-st stoyanov-st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding to most of Luke's comments
LG so far, really nice cleanup, thanks @lukasz-hashgraph 🙌

Signed-off-by: Lukasz Gasior <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants