Pectra devnet 5: 7702 changes#8118
Conversation
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
…tx processing Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
… not exist Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
siladu
left a comment
There was a problem hiding this comment.
Approved with some minor comments which can be picked up in the next PR.
General point: throughout the code and specs we appear to use "delegated" vs "authorized" interchangeable (and "delegation" vs "authorization").
One point where this is obvious is in EVMWorldUpdater:
public DelegatedCodeService authorizedCodeService() { return delegatedCodeService; }
Think we should pick one or is there a semantic difference depending on usage?
Related, could there be confusion with the existing "DELEGATECALL"?
| } | ||
|
|
||
| return getDelegatedAccount().map(Account::getUnprocessedCode).orElse(Bytes.EMPTY); | ||
| return Optional.of(maybeDelegatedAccount.get().getCode()); |
There was a problem hiding this comment.
| return Optional.of(maybeDelegatedAccount.get().getCode()); | |
| return maybeDelegatedAccount.map(AccountState::getCode); |
| public static boolean hasDelegatedCode(final Bytes code) { | ||
| return code != null | ||
| && code.size() == DELEGATED_CODE_SIZE | ||
| && code.slice(0, DELEGATED_CODE_PREFIX.size()).equals(DELEGATED_CODE_PREFIX); |
There was a problem hiding this comment.
Might be good to have a unit test for this.
| } | ||
| } | ||
|
|
||
| private static Bytes getCode(final Account account) { |
There was a problem hiding this comment.
| private static Bytes getCode(final Account account) { | |
| private Bytes getCode(final Account account) { |
| } | ||
| } | ||
|
|
||
| private static Bytes getCode(final Account account) { |
There was a problem hiding this comment.
| private static Bytes getCode(final Account account) { | |
| private Bytes getCode(final Account account) { |
| return new OperationResult(cost, null); | ||
| } | ||
|
|
||
| private static Bytes getCode(final Account account) { |
There was a problem hiding this comment.
| private static Bytes getCode(final Account account) { | |
| private Bytes getCode(final Account account) { |
| * @param account the account which needs to be retrieved | ||
| * @return the code | ||
| */ | ||
| protected static Code getCode(final EVM evm, final Account account) { |
There was a problem hiding this comment.
| protected static Code getCode(final EVM evm, final Account account) { | |
| protected Code getCode(final EVM evm, final Account account) { |
There was a problem hiding this comment.
I'm surprised to see ExtCall in here since the EIP doesn't mention it is impacted?
There was a problem hiding this comment.
Looks like it's a future EIP https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7069.md
Has there been any discussion about how this EIP should interact with 7702?
* first draft for 7702 changes for pectra-devnet5 Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net> * spotless, javadoc Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net> * fixed get code in call operations Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net> * allow code delegation chain id to be up to 2^256-1 Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net> * set code for delegated accounts correctly in the initialFrame of the tx processing Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net> * delegated accounts return empty bytes for the code if the target does not exist Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net> --------- Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net> Co-authored-by: Simon Dudley <simon.dudley@consensys.net> Signed-off-by: Bhanu Pulluri <bhanu.pulluri@kaleido.io>
PR description
EIP-7702 changes required for Pectra devnet-5
Fixed Issue(s)
fixes #7948
Thanks for sending a pull request! Have you done the following?
doc-change-requiredlabel to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build./gradlew acceptanceTest./gradlew integrationTest./gradlew ethereum:referenceTests:referenceTests