Skip to content
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

Pectra EIP 7702: set eoa account code for one transaction #2489

Merged

Conversation

bzawisto
Copy link
Contributor

@bzawisto bzawisto commented Nov 6, 2024

Last EIP from Pectra. It's not fully implemented and, depending on the outcome of evm v2 API, the remaining bit is either integrating with new API or, more complicated, implementing required logic directly in silkworm.

…ansaction' of github.com:erigontech/silkworm into 2120-implement-eip-7702-set-eoa-account-code-for-one-transaction
…ansaction' of github.com:erigontech/silkworm into 2120-implement-eip-7702-set-eoa-account-code-for-one-transaction
…ansaction' of github.com:erigontech/silkworm into 2120-implement-eip-7702-set-eoa-account-code-for-one-transaction
@bzawisto bzawisto added the pectra The Prague/Electra protocol upgrade label Nov 6, 2024
@bzawisto bzawisto linked an issue Nov 6, 2024 that may be closed by this pull request
@bzawisto bzawisto marked this pull request as draft November 6, 2024 09:40
@bzawisto bzawisto changed the title [WIP] implement eip 7702 set eoa account code for one transaction Pectra EIP 7702: set eoa account code for one transaction Nov 20, 2024
@bzawisto bzawisto marked this pull request as ready for review November 20, 2024 08:49
@@ -187,6 +199,12 @@ ValidationResult validate_call_precheck(const Transaction& txn, const EVM& evm)
}
}

if (evm.revision() >= EVMC_PRAGUE) {
if (txn.type == TransactionType::kSetCode && !txn.to) {
Copy link
Member

Choose a reason for hiding this comment

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

Hmm. I'm not sure what's the difference between validate_call_precheck & pre_validate_transaction is (looks like we should eliminate code duplication between the two methods), but it looks suspicious to me that EIP-7702 transactions are validated differently between the two.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The former seems to be more relaxed, and that's an issue with EIP-7702 txns - they should be validated the same way in both places.

Copy link
Member

Choose a reason for hiding this comment

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

pre_validate_transaction and validate_call_precheck are slightly different because the checks done also by Erigon before call simulations (e.g. eth_call) are somewhat more relaxed.
Anyway, validation of EIP-7702 transactions seems to be equivalent except for the missing check on Prague revision in pre_validate_transaction, which should be added.

I agree we should eliminate duplication between the two methods (see #2522), doing it in separate PR is fine or even better.

@canepat canepat merged commit e885b96 into master Nov 21, 2024
5 checks passed
@canepat canepat deleted the 2120-implement-eip-7702-set-eoa-account-code-for-one-transaction branch November 21, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pectra The Prague/Electra protocol upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement EIP-7702: Set EOA account code for one transaction
3 participants