Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f8a091c
test: :white_check_mark: add happy path test
manuelmauro Jul 31, 2025
84e110d
test: :recycle: minimize happy path
manuelmauro Jul 31, 2025
2c7bc8d
feat: :arrow_up: upgrade evm crate
manuelmauro Jul 31, 2025
24d10b6
test: :white_check_mark: remove silly condition in test
manuelmauro Jul 31, 2025
dc55a6b
fix: :bug: modify the restriction put in place by EIP-3607
manuelmauro Jul 31, 2025
4327a16
refactor: :recycle: nit delegation indicator check
manuelmauro Aug 1, 2025
a5cd886
test: :white_check_mark: add EIP-7702 happy path unit test
manuelmauro Aug 1, 2025
480b9da
test: :white_check_mark: split delegation and call to delegated code
manuelmauro Aug 1, 2025
530019f
test: :white_check_mark: fix smart contract creation in test
manuelmauro Aug 1, 2025
0d9c9fb
fix: :white_check_mark: use simpler smart contract on delegation
manuelmauro Aug 1, 2025
c40e6e2
docs: :memo: document EIP-7702 behavior
manuelmauro Aug 1, 2025
39bc7ed
test: :white_check_mark: cleanup new unit test
manuelmauro Aug 1, 2025
7003602
style: :art: define constant EIP7702_DELEGATION_INDICATOR
manuelmauro Aug 1, 2025
a11d805
refactor: :rotating_light: clippy
manuelmauro Aug 4, 2025
f2f8857
refactor: :recycle: use ethers TS authorization utils
manuelmauro Aug 4, 2025
cfd2af0
test: :white_check_mark: fix failing test
manuelmauro Aug 4, 2025
26f8e7d
refactor: :art: use EIP7702_DELEGATION_INDICATOR constant
manuelmauro Aug 4, 2025
3b213e9
style: :art: fmt
manuelmauro Aug 4, 2025
5e9c66b
Merge branch 'master' into manuel/add-eip7702-testing
manuelmauro Aug 4, 2025
e749d09
test: :white_check_mark: properly test zero-address delegation
manuelmauro Aug 4, 2025
1a546c1
test: :white_check_mark: fix test expectations
manuelmauro Aug 4, 2025
eee1cd1
refactor: :recycle: use ethers.ZeroAddress constant
manuelmauro Aug 4, 2025
664fe9f
fix: :bug: fix bug preventing a delegation to the zero address to cle…
manuelmauro Aug 5, 2025
fc7adaf
refactor: :recycle: use EVM constants for EIP-7702
manuelmauro Aug 5, 2025
580c22f
revert: :fire: remove AI slop
manuelmauro Aug 5, 2025
4c890e7
test: :white_check_mark: add rust test for zero-address delegations
manuelmauro Aug 5, 2025
23da4aa
refactor: :recycle: use evm constants for EIP-7702 delegations
manuelmauro Aug 5, 2025
2108960
refactor: :recycle: add a dedicated function for code cleanup
manuelmauro Aug 6, 2025
084e5a1
chore: :see_no_evil: ignore .zed folder
manuelmauro Aug 6, 2025
5ff810a
perf: :zap: avoid code read by checking code metadata first
manuelmauro Aug 7, 2025
38d6e68
fix: :bug: fix delegation checks
manuelmauro Aug 7, 2025
ce3075a
feat: :arrow_up: upgrade evm crate
manuelmauro Aug 12, 2025
77a5d44
fix: :bug: implement set/reset_delegation methods
manuelmauro Aug 12, 2025
e1fd429
fix: :bug: fix import path for constant
manuelmauro Aug 12, 2025
532a550
refactor: :bug: do not rely on create_account when setting a delegation
manuelmauro Aug 12, 2025
5f9e289
fix: :bug: fully remove account creation on set_delegation
manuelmauro Aug 12, 2025
c1dcd9f
Merge branch 'master' into manuel/add-eip7702-testing
manuelmauro Aug 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ pwasm-libc/Cargo.lock
node/runtime/wasm/target/
**/._*
**/.criterion/
.vscode
polkadot.*
.DS_Store
.idea/
.cargo-remote.toml

# Editors
.vscode
.idea/
.zed

# Added by cargo
/target

Expand Down
12 changes: 4 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ derive_more = "1.0"
environmental = { version = "1.1.4", default-features = false }
ethereum = { version = "0.18.2", default-features = false }
ethereum-types = { version = "0.15", default-features = false }
evm = { version = "0.43.2", default-features = false }
evm = { git = "https://github.com/rust-ethereum/evm.git", branch = "v0.x", default-features = false }
futures = "0.3.31"
hash-db = { version = "0.16.0", default-features = false }
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
Expand Down
15 changes: 13 additions & 2 deletions frame/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,23 @@ impl<T: Config> Pallet<T> {

// EIP-3607: https://eips.ethereum.org/EIPS/eip-3607
// Do not allow transactions for which `tx.sender` has any code deployed.
// Exception: Allow transactions from EOAs whose code is a valid delegation indicator (0xef0100 || address).
//
// This check should be done on the transaction validation (here) **and**
// on transaction execution, otherwise a contract tx will be included in
// the mempool and pollute the mempool forever.
if !pallet_evm::AccountCodes::<T>::get(origin).is_empty() {
return Err(InvalidTransaction::BadSigner.into());
if let Some(metadata) = pallet_evm::AccountCodesMetadata::<T>::get(origin) {
if metadata.size > 0 {
// Account has code, check if it's a valid delegation
let is_delegation = metadata.size
== evm::delegation::EIP_7702_DELEGATION_SIZE as u64
&& pallet_evm::AccountCodes::<T>::get(origin)
.starts_with(evm::delegation::EIP_7702_DELEGATION_PREFIX);

if !is_delegation {
return Err(InvalidTransaction::BadSigner.into());
}
}
}

let priority = match (
Expand Down
Loading
Loading