Skip to content

Commit 3105526

Browse files
committed
Bump to reth 1.11.2
1 parent f977617 commit 3105526

File tree

9 files changed

+1716
-1359
lines changed

9 files changed

+1716
-1359
lines changed

Cargo.lock

Lines changed: 1495 additions & 1136 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 64 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ default-members = ["bin/fraxtal-op-reth"]
99
resolver = "2"
1010

1111
[workspace.package]
12-
version = "1.9.3-frax-1.3.0"
12+
version = "1.11.2-frax-1.3.0"
1313
edition = "2024"
1414
rust-version = "1.88"
1515

@@ -19,63 +19,65 @@ fraxtal-node = { path = "crates/node" }
1919
fraxtal-evm = { path = "crates/evm" }
2020
fraxtal-op-evm = { path = "crates/op-evm" }
2121

22-
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
23-
reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
24-
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
25-
reth-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
26-
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
27-
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
28-
reth-engine-local = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
29-
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
30-
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
31-
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
32-
reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
33-
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
34-
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
35-
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
36-
reth-optimism-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
37-
reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
38-
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
39-
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
40-
reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
41-
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
42-
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
43-
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
44-
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
45-
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
46-
reth-payload-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
47-
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
48-
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
49-
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
50-
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
51-
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
52-
reth-storage-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
53-
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
54-
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
22+
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
23+
reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
24+
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
25+
reth-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
26+
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
27+
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
28+
reth-engine-local = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
29+
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
30+
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
31+
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
32+
reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
33+
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
34+
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
35+
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
36+
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
37+
reth-payload-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
38+
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
39+
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
40+
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
41+
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
42+
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
43+
reth-storage-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
44+
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
45+
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.2" }
46+
47+
# reth-optimism crates — from ethereum-optimism/optimism monorepo
48+
reth-optimism-chainspec = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
49+
reth-optimism-cli = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
50+
reth-optimism-consensus = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
51+
reth-optimism-evm = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
52+
reth-optimism-forks = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
53+
reth-optimism-node = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
54+
reth-optimism-payload-builder = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
55+
reth-optimism-primitives = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
56+
reth-optimism-rpc = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
5557

5658
# eth
57-
alloy-chains = { version = "0.2.5", default-features = false }
58-
alloy-consensus = { version = "1.0.41", default-features = false }
59-
alloy-eips = { version = "1.0.41", default-features = false }
60-
alloy-evm = { version = "0.23.0", default-features = false }
61-
alloy-genesis = { version = "1.0.41", default-features = false }
62-
alloy-primitives = { version = "1.4.1", default-features = false, features = ["map-foldhash"] }
63-
alloy-rlp = { version = "0.3.10", default-features = false, features = ["core-net"] }
64-
alloy-rpc-types-debug = { version = "1.0.41", default-features = false }
65-
alloy-rpc-types-eth = { version = "1.0.41", default-features = false }
66-
alloy-rpc-types-engine = { version = "1.0.41", default-features = false }
67-
68-
# op
69-
alloy-op-evm = { version = "0.23.0", default-features = false }
70-
alloy-op-hardforks = "0.4.4"
71-
op-alloy-consensus = { version = "0.22.0", default-features = false }
72-
op-alloy-rpc-types = { version = "0.22.0", default-features = false }
73-
op-alloy-rpc-types-engine = { version = "0.22.0", default-features = false }
59+
alloy-chains = { version = "0.2.30", default-features = false }
60+
alloy-consensus = { version = "1.6.3", default-features = false }
61+
alloy-eips = { version = "1.6.3", default-features = false }
62+
alloy-evm = { version = "0.27.2", default-features = false }
63+
alloy-genesis = { version = "1.6.3", default-features = false }
64+
alloy-primitives = { version = "1.5.6", default-features = false, features = ["map-foldhash"] }
65+
alloy-rlp = { version = "0.3.13", default-features = false, features = ["core-net"] }
66+
alloy-rpc-types-debug = { version = "1.6.3", default-features = false }
67+
alloy-rpc-types-eth = { version = "1.6.3", default-features = false }
68+
alloy-rpc-types-engine = { version = "1.6.3", default-features = false }
69+
70+
# op — from ethereum-optimism/optimism monorepo (path deps bundled there)
71+
alloy-op-evm = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f", default-features = false }
72+
alloy-op-hardforks = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
73+
op-alloy-consensus = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f", default-features = false }
74+
op-alloy-rpc-types = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f", default-features = false }
75+
op-alloy-rpc-types-engine = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f", default-features = false }
7476

7577
# revm
76-
revm = { version = "31.0.2", default-features = false }
77-
revm-primitives = { version = "21.0.2", default-features = false }
78-
op-revm = { version = "12.0.2", default-features = false }
78+
revm = { version = "34.0.0", default-features = false }
79+
revm-primitives = { version = "22.0.0", default-features = false }
80+
op-revm = { version = "15.0.0", default-features = false }
7981

8082
# misc
8183
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
@@ -86,6 +88,14 @@ eyre = "0.6"
8688
thiserror = { version = "2.0.0", default-features = false }
8789
derive_more = { version = "2", default-features = false, features = ["full"] }
8890

91+
# Patch crates-io for deps that the optimism repo bundles locally
92+
[patch.crates-io]
93+
op-alloy-consensus = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
94+
op-alloy-rpc-types = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
95+
op-alloy-rpc-types-engine = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
96+
alloy-op-evm = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
97+
alloy-op-hardforks = { git = "https://github.com/ethereum-optimism/optimism", rev = "f67fd6c6930180012e33878c6054f008ed7b548f" }
98+
8999
[profile.dev]
90100
# https://davidlattimore.github.io/posts/2024/02/04/speeding-up-the-rust-edit-build-run-cycle.html
91101
debug = "line-tables-only"

crates/evm/src/lib.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use alloy_op_evm::{
88
OpBlockExecutionCtx,
99
block::{OpTxEnv, receipt_builder::OpReceiptBuilder},
1010
};
11-
use alloy_primitives::U256;
11+
use alloy_primitives::{Bytes, U256};
1212
use core::fmt::Debug;
1313
use fraxtal_op_evm::{FraxtalBlockExecutorFactory, FraxtalEvmFactory};
1414
use op_alloy_consensus::EIP1559ParamError;
@@ -214,7 +214,7 @@ where
214214

215215
let cfg_env = CfgEnv::new()
216216
.with_chain_id(self.chain_spec().chain().id())
217-
.with_spec(spec);
217+
.with_spec_and_mainnet_gas_params(spec);
218218

219219
let blob_excess_gas_and_price = spec
220220
.into_eth_spec()
@@ -259,16 +259,14 @@ where
259259
&self,
260260
payload: &OpExecutionData,
261261
) -> Result<impl ExecutableTxIterator<Self>, Self::Error> {
262-
Ok(payload
263-
.payload
264-
.transactions()
265-
.clone()
266-
.into_iter()
267-
.map(|encoded| {
268-
let tx = TxTy::<Self::Primitives>::decode_2718_exact(encoded.as_ref())
269-
.map_err(AnyError::new)?;
270-
let signer = tx.try_recover().map_err(AnyError::new)?;
271-
Ok::<_, AnyError>(WithEncoded::new(encoded, tx.with_signer(signer)))
272-
}))
262+
let transactions = payload.payload.transactions().clone();
263+
let convert = |encoded: Bytes| {
264+
let tx = TxTy::<Self::Primitives>::decode_2718_exact(encoded.as_ref())
265+
.map_err(AnyError::new)?;
266+
let signer = tx.try_recover().map_err(AnyError::new)?;
267+
Ok::<_, AnyError>(WithEncoded::new(encoded, tx.with_signer(signer)))
268+
};
269+
270+
Ok((transactions, convert))
273271
}
274272
}

crates/op-evm/src/block/canyon.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use alloy_evm::Database;
22
use alloy_op_hardforks::OpHardforks;
33
use alloy_primitives::{address, b256, hex, Address, Bytes, B256};
4-
use revm::{database::State, primitives::HashMap, state::Bytecode, DatabaseCommit};
4+
use revm::{DatabaseCommit, primitives::HashMap, state::Bytecode};
55

66
/// The address of the create2 deployer
77
const CREATE_2_DEPLOYER_ADDR: Address = address!("0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2");
@@ -19,10 +19,10 @@ const CREATE_2_DEPLOYER_BYTECODE: [u8; 1584] = hex!("608060405260043610610043576
1919
pub(crate) fn ensure_create2_deployer<DB>(
2020
chain_spec: impl OpHardforks,
2121
timestamp: u64,
22-
db: &mut State<DB>,
22+
db: &mut DB,
2323
) -> Result<(), DB::Error>
2424
where
25-
DB: Database,
25+
DB: Database + DatabaseCommit,
2626
{
2727
// If the canyon hardfork is active at the current timestamp, and it was not active at the
2828
// previous block timestamp (heuristically, block time is not perfectly constant at 2s), and the
@@ -31,10 +31,9 @@ where
3131
&& !chain_spec.is_canyon_active_at_timestamp(timestamp.saturating_sub(2))
3232
{
3333
// Load the create2 deployer account from the cache.
34-
let acc = db.load_cache_account(CREATE_2_DEPLOYER_ADDR)?;
34+
let mut acc_info = db.basic(CREATE_2_DEPLOYER_ADDR)?.unwrap_or_default();
3535

3636
// Update the account info with the create2 deployer codehash and bytecode.
37-
let mut acc_info = acc.account_info().unwrap_or_default();
3837
acc_info.code_hash = CREATE_2_DEPLOYER_CODEHASH;
3938
acc_info.code = Some(Bytecode::new_raw(Bytes::from_static(
4039
&CREATE_2_DEPLOYER_BYTECODE,

crates/op-evm/src/block/granite.rs

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::collections::HashMap;
22

3+
use alloy_evm::Database;
34
use alloy_op_hardforks::OpHardforks;
45
use alloy_primitives::{address, b256, Address, B256, U256};
56
use reth_chainspec::EthChainSpec;
67
use revm::{
7-
database::State,
8+
DatabaseCommit,
89
state::{Account, Bytecode, EvmStorageSlot},
9-
Database, DatabaseCommit,
1010
};
1111
use tracing::info;
1212

@@ -40,19 +40,16 @@ const TESTNET_FRAX_L1_REPLACEMENTS_INDEXES: &[usize] = &[2137, 6962, 7330];
4040
const DEVNET_FRAX_L1_REPLACEMENTS_INDEXES: &[usize] = &[693, 1303];
4141
const DEVNET_SFRAX_L1_REPLACEMENTS_INDEXES: &[usize] = &[693, 1303];
4242

43-
/// The Graanite hardfork issues an irregular state transition that upgrades the frax/sfrax
44-
/// contracts code to be upgreadable proxies.
43+
/// The Granite hardfork issues an irregular state transition that upgrades the frax/sfrax
44+
/// contracts code to be upgradable proxies.
4545
pub(super) fn migrate_frxusd<DB>(
4646
chain_spec: impl OpHardforks + EthChainSpec,
4747
timestamp: u64,
48-
db: &mut State<DB>,
48+
db: &mut DB,
4949
) -> Result<(), DB::Error>
5050
where
51-
DB: revm::Database,
51+
DB: Database + DatabaseCommit,
5252
{
53-
// If the granite hardfork is active at the current timestamp, and it was not active at the
54-
// previous block timestamp (heuristically, block time is not perfectly constant at 2s), and the
55-
// chain is an optimism chain, then we need to upgrade the frax/sfrax contracts.
5653
if chain_spec.is_granite_active_at_timestamp(timestamp)
5754
&& !chain_spec.is_granite_active_at_timestamp(timestamp.saturating_sub(2))
5855
{
@@ -137,20 +134,18 @@ fn migrate<DB>(
137134
owner: Address,
138135
name_storage: B256,
139136
symbol_storage: B256,
140-
db: &mut State<DB>,
137+
db: &mut DB,
141138
) -> Result<(), DB::Error>
142139
where
143-
DB: revm::Database,
140+
DB: Database + DatabaseCommit,
144141
{
145142
info!(target: "evm", "Setting implementation from {} to {}", contract_addr, implementation_addr);
146143
let l1_token_bytes = l1_token.as_slice();
147-
let mut current_contract_acc = db
148-
.load_cache_account(contract_addr)?
149-
.account_info()
150-
.unwrap_or_default();
144+
let mut current_contract_acc = db.basic(contract_addr)?.unwrap_or_default();
151145

152146
let mut new_implementation_code = current_contract_acc
153147
.code
148+
.clone()
154149
.unwrap_or_else(|| {
155150
db.code_by_hash(current_contract_acc.code_hash)
156151
.unwrap_or_default()
@@ -162,10 +157,7 @@ where
162157
new_implementation_code[*i..*i + l1_token_bytes.len()].copy_from_slice(l1_token_bytes);
163158
}
164159

165-
let mut implementation_acc = db
166-
.load_cache_account(implementation_addr)?
167-
.account_info()
168-
.unwrap_or_default();
160+
let mut implementation_acc = db.basic(implementation_addr)?.unwrap_or_default();
169161
implementation_acc.code = Some(Bytecode::new_raw(new_implementation_code.into()));
170162
implementation_acc.code_hash = implementation_acc
171163
.code
@@ -176,12 +168,9 @@ where
176168
implementation_revm_account.mark_touch();
177169

178170
info!(target: "evm", "Setting proxy from {} to {}", proxy_source_addr, contract_addr);
179-
let proxy_acc = db
180-
.load_cache_account(proxy_source_addr)?
181-
.account_info()
182-
.unwrap_or_default();
171+
let proxy_acc = db.basic(proxy_source_addr)?.unwrap_or_default();
183172
current_contract_acc.code = proxy_acc.code.clone();
184-
current_contract_acc.code_hash = proxy_acc.code_hash.clone();
173+
current_contract_acc.code_hash = proxy_acc.code_hash;
185174

186175
let mut current_contract_revm_account: Account = current_contract_acc.into();
187176
current_contract_revm_account.mark_touch();

0 commit comments

Comments
 (0)