Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
9a9c15e
feat: :sparkles: add support for EIP-7702
manuelmauro Jun 16, 2025
0442de2
chore: :arrow_up: use temporary fork of ethereum crate
manuelmauro Jun 16, 2025
d80ad5a
feat: :sparkles: update to ethereum crate v3 structs
manuelmauro Jun 16, 2025
26cdab5
feat: :arrow_up: upgrade evm crate
manuelmauro Jun 16, 2025
1ad8f0d
feat: :sparkles: add EIP-7702 support to RPC
manuelmauro Jun 17, 2025
45aabc6
fix: :arrow_up: upgrade evm crate
manuelmauro Jun 17, 2025
c63ef24
feat: :sparkles: upgrade evm crate
manuelmauro Jun 18, 2025
b2b7c6d
feat: :sparkles: add EIP-7702 support to EthDevSigner
manuelmauro Jun 20, 2025
e7671b1
test: :fire: temporarily remove EIP-7702 tests
manuelmauro Jun 20, 2025
a1a929e
feat: :arrow_up: upgrade ethereum and evm crates
manuelmauro Jun 20, 2025
c509516
fix: :bug: properly convert authorization list to evm's data type
manuelmauro Jun 20, 2025
464cad8
fix: :fire: fix logic
manuelmauro Jun 20, 2025
02fff86
fix: :bug: fix usage of authorization list throughout the codebase
manuelmauro Jun 20, 2025
fc1c136
style: :art: fmt
manuelmauro Jun 20, 2025
fffc7d1
fix: :arrow_up: upgrade evm
manuelmauro Jun 23, 2025
ceb6bf2
refactor: :rotating_light: silence lint error
manuelmauro Jun 23, 2025
3d11e21
style: :art: fmt
manuelmauro Jun 23, 2025
b4a3c46
refactor: :fire: remove unused imports
manuelmauro Jun 23, 2025
9b022f3
fix: :arrow_up: upgrade config to pectra
manuelmauro Jun 23, 2025
a7381c3
fix: :bug: manage API v6 case in Eth::call
manuelmauro Jun 23, 2025
f0a03de
fix: :bug: manage API v6 case in Eth::estimate_gas
manuelmauro Jun 23, 2025
72717e2
chore: :fire: remove unused dependencies
manuelmauro Jun 23, 2025
a62f9a7
test: :white_check_mark: add unit tests for EIP-7702
manuelmauro Jun 25, 2025
2939872
test: :white_check_mark: add integration tests for EIP-7702
manuelmauro Jun 25, 2025
8822105
style: :art: fmt
manuelmauro Jun 26, 2025
3a10ef0
refactor: :arrow_up: upgrade evm crate
manuelmauro Jun 26, 2025
975e1a4
fix: :bug: propagate std feature to ethereum-ext
manuelmauro Jun 26, 2025
e3b9ea0
refactor: :recycle: use upstream evm crate
manuelmauro Jun 26, 2025
3536ed5
refactor: :fire: remove ethereum-ext temporary dependency
manuelmauro Jul 4, 2025
f12b253
style: :art: format TS code
manuelmauro Jul 4, 2025
3ed445c
refactor: :recycle: ignore lint warning
manuelmauro Jul 4, 2025
20876f0
feat: :arrow_up: upgrade evm/ethereum dependencies
manuelmauro Jul 4, 2025
bb06a92
feat: :sparkles: add validation error for EIP-7702 empty authorizatio…
manuelmauro Jul 4, 2025
3e29636
style: :art: format code
manuelmauro Jul 4, 2025
1aecfa6
refactor: :fire: remove unused const
manuelmauro Jul 4, 2025
04d7437
test: :test_tube: add failing test for EIP-7702 authoriations
manuelmauro Jul 4, 2025
66dbc16
fix: :bug: fix authorization creation in tests
manuelmauro Jul 4, 2025
643ee7d
refactor: :arrow_up: use evm release on crates.io
manuelmauro Jul 4, 2025
75d51c1
style: :art: format code
manuelmauro Jul 4, 2025
22cb7df
feat: :sparkles: record delegation resolution external operation
manuelmauro Jul 7, 2025
58223d4
revert: :fire: remove old TODOs
manuelmauro Jul 7, 2025
f4d888d
fix: :bug: add missing semicolon
manuelmauro Jul 7, 2025
bfdc177
feat: add comprehensive EIP-7702 validation at Substrate level
manuelmauro Jul 7, 2025
2781f6b
feat: add documentation for EIP-7702 gas costs and improve error hand…
manuelmauro Jul 7, 2025
d9055a8
fix: :bug: add missing case in error conversion
manuelmauro Jul 7, 2025
4df857e
fix: correct authorization signature format in TypeScript tests
manuelmauro Jul 7, 2025
b6b1c52
test: add comprehensive EIP-7702 validation tests
manuelmauro Jul 7, 2025
4d50d38
docs: add comprehensive documentation for EIP-7702 validation functions
manuelmauro Jul 7, 2025
832cacc
revert: :fire: remove InvalidAuthorizationChainId validation error
manuelmauro Jul 7, 2025
a5f42ae
docs: :memo: digest docs
manuelmauro Jul 7, 2025
8d35598
style: :art: format
manuelmauro Jul 7, 2025
ae28ea8
fix: :bug: account for authentication list items in the proof size ba…
manuelmauro Jul 7, 2025
1dd766e
refactor: :recycle: return error for unsupported API version
manuelmauro Jul 8, 2025
65b4904
refactor: :recycle: refactor TransactionRequest to TransactionMessage…
manuelmauro Jul 8, 2025
ec8b368
style: :art: format
manuelmauro Jul 8, 2025
ee91909
refactor: :recycle: reduce code duplication
manuelmauro Jul 8, 2025
80d15cf
fix: :bug: fix delegation code length in test
manuelmauro Jul 8, 2025
e525090
test: :white_check_mark: actually check gas consumption in EIP-7702
manuelmauro Jul 8, 2025
8f9b606
fix: :bug: treat DelegationResolution just as a second AddressCodeRead
manuelmauro Jul 8, 2025
1a74e05
refactor: :art: use serde rename_all directive
manuelmauro Jul 8, 2025
17d4065
docs: :memo: improve AuthorizationListTooLarge docs
manuelmauro Jul 8, 2025
7f041a5
fix: :bug: add EIP7702 variant to TxType
manuelmauro Jul 8, 2025
590ed11
feat: :arrow_up: upgrade ethers.js
manuelmauro Jul 8, 2025
fe98a33
test: :bug: first revision of the integration tests for EIP-7702
manuelmauro Jul 8, 2025
2e089f2
fix: :bug: second revision of the integration tests for EIP-7702
manuelmauro Jul 8, 2025
27e5ece
fix: :bug: upgrade evm
manuelmauro Jul 9, 2025
3a9c595
fix: :bug: fix authorization nonce in test
manuelmauro Jul 9, 2025
88b8fbc
feat: :sparkles: add EthereumBlockWrapper
manuelmauro Jul 9, 2025
273f031
refactor: :fire: remove CurrentBlock v0 to v2 migrations
manuelmauro Jul 9, 2025
6521a03
refactor: :recycle: clippy
manuelmauro Jul 10, 2025
c0923c7
refactor: :recycle: refactor EthereumBlockWrapper decoding
manuelmauro Jul 10, 2025
02c4a29
revert: :rewind: restore block migration functions
manuelmauro Jul 11, 2025
50f0565
Revert "refactor: :recycle: refactor EthereumBlockWrapper decoding"
manuelmauro Jul 14, 2025
ad7ff9d
Revert "refactor: :recycle: clippy"
manuelmauro Jul 14, 2025
d0d1375
Revert "feat: :sparkles: add EthereumBlockWrapper"
manuelmauro Jul 14, 2025
5330e77
feat: :sparkles: add block v2 to v3 migration methods
manuelmauro Jul 14, 2025
6cf7f34
fix: :bug: fix typo in post_migrate_block_v3
manuelmauro Jul 15, 2025
4100b04
refactor: :recycle: rename size_limit to create_contract_limit
manuelmauro Jul 16, 2025
53fdd34
fix: :bug: account for empty authorization list cost in template
manuelmauro Jul 16, 2025
a4fec3c
fix: :bug: the base cost for the authorization list is already accoun…
manuelmauro Jul 16, 2025
6f7541d
revert: :rewind: block v2 is still a valid block v3
manuelmauro Jul 16, 2025
aa6b207
fix: :lock: validate authorizations signatures on extrinsic call
manuelmauro Jul 16, 2025
d13400a
fix: :bug: add ethereum/std to std feature
manuelmauro Jul 16, 2025
fe647c2
fix: :lock: properly validate authorization list
manuelmauro Jul 16, 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
32 changes: 20 additions & 12 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ clap = { version = "4.5", features = ["derive", "deprecated"] }
const-hex = { version = "1.14", default-features = false, features = ["alloc"] }
derive_more = "1.0"
environmental = { version = "1.1.4", default-features = false }
ethereum = { git = "https://github.com/rust-ethereum/ethereum", rev = "bbb544622208ef6e9890a2dbc224248f6dd13318", default-features = false }
ethereum = { version = "0.18.2", default-features = false }
ethereum-types = { version = "0.15", default-features = false }
evm = { git = "https://github.com/rust-ethereum/evm", branch = "v0.x", default-features = false }
evm = { version = "0.43.2", 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
7 changes: 4 additions & 3 deletions client/db/src/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,10 @@ where
transaction_count += receipts.len();
for (transaction_index, receipt) in receipts.iter().enumerate() {
let receipt_logs = match receipt {
ethereum::ReceiptV3::Legacy(d)
| ethereum::ReceiptV3::EIP2930(d)
| ethereum::ReceiptV3::EIP1559(d) => &d.logs,
ethereum::ReceiptV4::Legacy(d)
| ethereum::ReceiptV4::EIP2930(d)
| ethereum::ReceiptV4::EIP1559(d)
| ethereum::ReceiptV4::EIP7702(d) => &d.logs,
};
let transaction_index = transaction_index as i32;
log_count += receipt_logs.len();
Expand Down
10 changes: 5 additions & 5 deletions client/mapping-sync/src/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ mod test {
mix_hash: H256::default(),
nonce: ethereum_types::H64::default(),
};
let ethereum_transactions: Vec<ethereum::TransactionV2> = vec![];
let ethereum_transactions: Vec<ethereum::TransactionV3> = vec![];
let ethereum_block = ethereum::Block::new(partial_header, ethereum_transactions, vec![]);
DigestItem::Consensus(
fp_consensus::FRONTIER_ENGINE_ID,
Expand Down Expand Up @@ -596,7 +596,7 @@ mod test {
let topics_2_4 = H256::repeat_byte(0x06);

let receipts = Encode::encode(&vec![
ethereum::ReceiptV3::EIP1559(ethereum::EIP1559ReceiptData {
ethereum::ReceiptV4::EIP1559(ethereum::EIP1559ReceiptData {
status_code: 0u8,
used_gas: U256::zero(),
logs_bloom: ethereum_types::Bloom::zero(),
Expand All @@ -606,7 +606,7 @@ mod test {
data: vec![],
}],
}),
ethereum::ReceiptV3::EIP1559(ethereum::EIP1559ReceiptData {
ethereum::ReceiptV4::EIP1559(ethereum::EIP1559ReceiptData {
status_code: 0u8,
used_gas: U256::zero(),
logs_bloom: ethereum_types::Bloom::zero(),
Expand Down Expand Up @@ -829,7 +829,7 @@ mod test {
let topics_2_4 = H256::random();

let receipts = Encode::encode(&vec![
ethereum::ReceiptV3::EIP1559(ethereum::EIP1559ReceiptData {
ethereum::ReceiptV4::EIP1559(ethereum::EIP1559ReceiptData {
status_code: 0u8,
used_gas: U256::zero(),
logs_bloom: ethereum_types::Bloom::zero(),
Expand All @@ -839,7 +839,7 @@ mod test {
data: vec![],
}],
}),
ethereum::ReceiptV3::EIP1559(ethereum::EIP1559ReceiptData {
ethereum::ReceiptV4::EIP1559(ethereum::EIP1559ReceiptData {
status_code: 0u8,
used_gas: U256::zero(),
logs_bloom: ethereum_types::Bloom::zero(),
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-core/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mod work;

pub mod pubsub;

use ethereum::TransactionV2 as EthereumTransaction;
use ethereum::TransactionV3 as EthereumTransaction;
use ethereum_types::H160;

#[cfg(feature = "txpool")]
Expand Down
5 changes: 3 additions & 2 deletions client/rpc-core/src/types/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use std::collections::BTreeMap;

use ethereum::{
BlockV2 as EthereumBlock, ReceiptV3 as EthereumReceipt, TransactionV2 as EthereumTransaction,
BlockV3 as EthereumBlock, ReceiptV4 as EthereumReceipt, TransactionV3 as EthereumTransaction,
};
use ethereum_types::{H256, U256};
use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer};
Expand Down Expand Up @@ -126,7 +126,8 @@ impl PubSubResult {
let receipt_logs = match receipt {
EthereumReceipt::Legacy(d)
| EthereumReceipt::EIP2930(d)
| EthereumReceipt::EIP1559(d) => d.logs,
| EthereumReceipt::EIP1559(d)
| EthereumReceipt::EIP7702(d) => d.logs,
};

let transaction_hash: Option<H256> = if !receipt_logs.is_empty() {
Expand Down
53 changes: 44 additions & 9 deletions client/rpc-core/src/types/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use ethereum::{AccessListItem, TransactionAction, TransactionV2 as EthereumTransaction};
use ethereum::{
AccessListItem, AuthorizationListItem, TransactionAction, TransactionV3 as EthereumTransaction,
};
use ethereum_types::{H160, H256, U256, U64};
use serde::{ser::SerializeStruct, Serialize, Serializer};

Expand Down Expand Up @@ -66,6 +68,9 @@ pub struct Transaction {
/// Pre-pay to warm storage access.
#[serde(skip_serializing_if = "Option::is_none")]
pub access_list: Option<Vec<AccessListItem>>,
/// EIP-7702 authorization list.
#[serde(skip_serializing_if = "Option::is_none")]
pub authorization_list: Option<Vec<AuthorizationListItem>>,
/// The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.
#[serde(skip_serializing_if = "Option::is_none")]
pub y_parity: Option<U256>,
Expand Down Expand Up @@ -106,6 +111,7 @@ impl BuildFrom for Transaction {
creates: None,
chain_id: t.signature.chain_id().map(U64::from),
access_list: None,
authorization_list: None,
y_parity: None,
v: Some(U256::from(t.signature.v())),
r: U256::from_big_endian(t.signature.r().as_bytes()),
Expand All @@ -132,10 +138,11 @@ impl BuildFrom for Transaction {
creates: None,
chain_id: Some(U64::from(t.chain_id)),
access_list: Some(t.access_list.clone()),
y_parity: Some(U256::from(t.odd_y_parity as u8)),
v: Some(U256::from(t.odd_y_parity as u8)),
r: U256::from_big_endian(t.r.as_bytes()),
s: U256::from_big_endian(t.s.as_bytes()),
authorization_list: None,
y_parity: Some(U256::from(t.signature.odd_y_parity() as u8)),
v: Some(U256::from(t.signature.odd_y_parity() as u8)),
r: U256::from_big_endian(t.signature.r().as_bytes()),
s: U256::from_big_endian(t.signature.s().as_bytes()),
},
EthereumTransaction::EIP1559(t) => Self {
transaction_type: U256::from(2),
Expand All @@ -159,10 +166,38 @@ impl BuildFrom for Transaction {
creates: None,
chain_id: Some(U64::from(t.chain_id)),
access_list: Some(t.access_list.clone()),
y_parity: Some(U256::from(t.odd_y_parity as u8)),
v: Some(U256::from(t.odd_y_parity as u8)),
r: U256::from_big_endian(t.r.as_bytes()),
s: U256::from_big_endian(t.s.as_bytes()),
authorization_list: None,
y_parity: Some(U256::from(t.signature.odd_y_parity() as u8)),
v: Some(U256::from(t.signature.odd_y_parity() as u8)),
r: U256::from_big_endian(t.signature.r().as_bytes()),
s: U256::from_big_endian(t.signature.s().as_bytes()),
},
EthereumTransaction::EIP7702(t) => Self {
transaction_type: U256::from(4),
hash,
nonce: t.nonce,
block_hash: None,
block_number: None,
transaction_index: None,
from,
to: match t.destination {
TransactionAction::Call(to) => Some(to),
TransactionAction::Create => None,
},
value: t.value,
gas: t.gas_limit,
gas_price: Some(t.max_fee_per_gas),
max_fee_per_gas: Some(t.max_fee_per_gas),
max_priority_fee_per_gas: Some(t.max_priority_fee_per_gas),
input: Bytes(t.data.clone()),
creates: None,
chain_id: Some(U64::from(t.chain_id)),
access_list: Some(t.access_list.clone()),
authorization_list: Some(t.authorization_list.clone()),
y_parity: Some(U256::from(t.signature.odd_y_parity() as u8)),
v: Some(U256::from(t.signature.odd_y_parity() as u8)),
r: U256::from_big_endian(t.signature.r().as_bytes()),
s: U256::from_big_endian(t.signature.s().as_bytes()),
},
}
}
Expand Down
Loading
Loading