-
Notifications
You must be signed in to change notification settings - Fork 185
feat: Handle EIP-7702 code delegation #21964
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: feature/hedera-evm-pectra-support
Are you sure you want to change the base?
feat: Handle EIP-7702 code delegation #21964
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
2f09564 to
4447a3f
Compare
7e6445e to
4b98cae
Compare
e07274e to
efde495
Compare
efde495 to
d037997
Compare
Signed-off-by: Lukasz Gasior <[email protected]>
Signed-off-by: Lukasz Gasior <[email protected]>
6578b57 to
42bfaa5
Compare
hedera-node/hedera-smart-contract-service-impl/build.gradle.kts
Outdated
Show resolved
Hide resolved
...va/com/hedera/node/app/service/contract/impl/exec/processors/CustomMessageCallProcessor.java
Show resolved
Hide resolved
| doExecuteSystemContract(context, systemContracts.get(context.executableCodeAddress)); | ||
| } | ||
| } else { | ||
| // For any other accounts: code delegation to System Contracts is a no-op - so just succeed. |
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.
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)) { |
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.
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( |
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.
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.
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.
Yeah, I couldn't find the right place for it. Any suggestions?
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.
Maybe HasCallAttempt - not a strong preference as it is not used there really but logically it might fit there.
...va/com/hedera/node/app/service/contract/impl/exec/processors/CustomMessageCallProcessor.java
Show resolved
Hide resolved
.../java/com/hedera/node/app/service/contract/impl/exec/systemcontracts/has/HasCallFactory.java
Outdated
Show resolved
Hide resolved
...e-impl/src/main/java/com/hedera/node/app/service/contract/impl/state/ScheduleEvmAccount.java
Outdated
Show resolved
Hide resolved
...e-impl/src/main/java/com/hedera/node/app/service/contract/impl/state/hooks/ProxyEvmHook.java
Show resolved
Hide resolved
...ervice-impl/src/main/java/com/hedera/node/app/service/contract/impl/state/EvmFrameState.java
Show resolved
Hide resolved
.../src/main/java/com/hedera/node/app/service/contract/impl/state/DispatchingEvmFrameState.java
Outdated
Show resolved
Hide resolved
lukelee-sl
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.
Generally looks really good. Up to you if you want to address any of my comments.
Signed-off-by: Lukasz Gasior <[email protected]>
stoyanov-st
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.
Adding to most of Luke's comments
LG so far, really nice cleanup, thanks @lukasz-hashgraph 🙌
...e-impl/src/main/java/com/hedera/node/app/service/contract/impl/state/ScheduleEvmAccount.java
Show resolved
Hide resolved
Signed-off-by: Lukasz Gasior <[email protected]>
Added EIP-7702 code delegation handling when processing calls.
Includes the proxy/facade refactoring described in HIP-1340.
Related issue: #21198