Skip to content

Commit bba6804

Browse files
committed
Bump to reth 1.5.0
1 parent 3897648 commit bba6804

File tree

8 files changed

+602
-487
lines changed

8 files changed

+602
-487
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,59 +19,59 @@ 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.4.8" }
23-
reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
24-
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
25-
reth-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
26-
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
27-
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
28-
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
29-
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
30-
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
31-
reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
32-
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
33-
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
34-
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
35-
reth-optimism-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
36-
reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
37-
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
38-
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
39-
reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
40-
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
41-
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
42-
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
43-
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
44-
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
45-
reth-payload-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
46-
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
47-
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
48-
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
49-
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
50-
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
51-
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.8" }
22+
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
23+
reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
24+
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
25+
reth-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
26+
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
27+
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
28+
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
29+
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
30+
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
31+
reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
32+
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
33+
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
34+
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
35+
reth-optimism-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
36+
reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
37+
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
38+
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
39+
reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
40+
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
41+
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
42+
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
43+
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
44+
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
45+
reth-payload-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
46+
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
47+
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
48+
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
49+
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
50+
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
51+
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.5.0" }
5252

5353
# eth
5454
alloy-chains = { version = "0.2.0", default-features = false }
55-
alloy-consensus = { version = "1.0.12", default-features = false }
56-
alloy-eips = { version = "1.0.12", default-features = false }
57-
alloy-evm = { version = "0.10", default-features = false }
55+
alloy-consensus = { version = "1.0.13", default-features = false }
56+
alloy-eips = { version = "1.0.13", default-features = false }
57+
alloy-evm = { version = "0.12", default-features = false }
5858
alloy-primitives = { version = "1.2.0", default-features = false, features = ["map-foldhash"] }
5959
alloy-rlp = { version = "0.3.10", default-features = false, features = ["core-net"] }
60-
alloy-rpc-types-debug = { version = "1.0.12", default-features = false }
61-
alloy-rpc-types-eth = { version = "1.0.12", default-features = false }
62-
alloy-rpc-types-engine = { version = "1.0.12", default-features = false }
60+
alloy-rpc-types-debug = { version = "1.0.13", default-features = false }
61+
alloy-rpc-types-eth = { version = "1.0.13", default-features = false }
62+
alloy-rpc-types-engine = { version = "1.0.13", default-features = false }
6363

6464
# op
65-
alloy-op-evm = { version = "0.10.0", default-features = false }
65+
alloy-op-evm = { version = "0.12", default-features = false }
6666
alloy-op-hardforks = "0.2.2"
67-
op-alloy-consensus = { version = "0.17.2", default-features = false }
68-
op-alloy-rpc-types = { version = "0.18.6", default-features = false }
69-
op-alloy-rpc-types-engine = { version = "0.18.6", default-features = false }
67+
op-alloy-consensus = { version = "0.18.7", default-features = false }
68+
op-alloy-rpc-types = { version = "0.18.7", default-features = false }
69+
op-alloy-rpc-types-engine = { version = "0.18.7", default-features = false }
7070

7171
# revm
72-
revm = { version = "24.0.1", default-features = false }
72+
revm = { version = "26.0.1", default-features = false }
7373
revm-primitives = { version = "20.0.0", default-features = false }
74-
op-revm = { version = "5.0.0", default-features = false }
74+
op-revm = { version = "7.0.1", default-features = false }
7575

7676
# misc
7777
serde_json = { version = "1.0", default-features = false, features = [

crates/evm/src/lib.rs

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<ChainSpec: OpHardforks> FraxtalEvmConfig<ChainSpec> {
6060
}
6161

6262
impl<ChainSpec: OpHardforks, N: NodePrimitives, R> FraxtalEvmConfig<ChainSpec, N, R> {
63-
/// Creates a new [`OpEvmConfig`] with the given chain spec.
63+
/// Creates a new [`FraxtalEvmConfig`] with the given chain spec.
6464
pub fn new(chain_spec: Arc<ChainSpec>, receipt_builder: R) -> Self {
6565
Self {
6666
block_assembler: OpBlockAssembler::new(chain_spec.clone()),
@@ -114,10 +114,18 @@ where
114114
.with_chain_id(self.chain_spec().chain().id())
115115
.with_spec(spec);
116116

117+
let blob_excess_gas_and_price = spec
118+
.into_eth_spec()
119+
.is_enabled_in(SpecId::CANCUN)
120+
.then_some(BlobExcessGasAndPrice {
121+
excess_blob_gas: 0,
122+
blob_gasprice: 0,
123+
});
124+
117125
let block_env = BlockEnv {
118-
number: header.number(),
126+
number: U256::from(header.number()),
119127
beneficiary: header.beneficiary(),
120-
timestamp: header.timestamp(),
128+
timestamp: U256::from(header.timestamp()),
121129
difficulty: if spec.into_eth_spec() >= SpecId::MERGE {
122130
U256::ZERO
123131
} else {
@@ -131,9 +139,7 @@ where
131139
gas_limit: header.gas_limit(),
132140
basefee: header.base_fee_per_gas().unwrap_or_default(),
133141
// EIP-4844 excess blob gas of this block, introduced in Cancun
134-
blob_excess_gas_and_price: header.excess_blob_gas().map(|excess_blob_gas| {
135-
BlobExcessGasAndPrice::new(excess_blob_gas, spec.into_eth_spec() >= SpecId::PRAGUE)
136-
}),
142+
blob_excess_gas_and_price,
137143
};
138144

139145
EvmEnv { cfg_env, block_env }
@@ -154,18 +160,18 @@ where
154160

155161
// if the parent block did not have excess blob gas (i.e. it was pre-cancun), but it is
156162
// cancun now, we need to set the excess blob gas to the default value(0)
157-
let blob_excess_gas_and_price = parent
158-
.maybe_next_block_excess_blob_gas(
159-
self.chain_spec()
160-
.blob_params_at_timestamp(attributes.timestamp),
161-
)
162-
.or_else(|| (spec_id.into_eth_spec().is_enabled_in(SpecId::CANCUN)).then_some(0))
163-
.map(|gas| BlobExcessGasAndPrice::new(gas, false));
163+
let blob_excess_gas_and_price = spec_id
164+
.into_eth_spec()
165+
.is_enabled_in(SpecId::CANCUN)
166+
.then_some(BlobExcessGasAndPrice {
167+
excess_blob_gas: 0,
168+
blob_gasprice: 0,
169+
});
164170

165171
let block_env = BlockEnv {
166-
number: parent.number() + 1,
172+
number: U256::from(parent.number() + 1),
167173
beneficiary: attributes.suggested_fee_recipient,
168-
timestamp: attributes.timestamp,
174+
timestamp: U256::from(attributes.timestamp),
169175
difficulty: U256::ZERO,
170176
prevrandao: Some(attributes.prev_randao),
171177
gas_limit: attributes.gas_limit,

crates/node/src/node.rs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use fraxtal_evm::FraxtalEvmConfig;
2-
use reth_chainspec::{ChainSpecProvider, Hardforks};
2+
use reth_chainspec::ChainSpecProvider;
33
use reth_evm::ConfigureEvm;
44
use reth_node_api::{FullNodeComponents, PayloadTypes, PrimitivesTy, TxTy};
55
use reth_node_builder::{
@@ -19,22 +19,19 @@ use reth_optimism_node::{
1919
OpPoolBuilder,
2020
},
2121
txpool::OpPooledTx,
22-
OpEngineApiBuilder, OpEngineTypes, OpPayloadAttributes,
22+
OpEngineApiBuilder, OpEngineTypes, OpFullNodeTypes, OpPayloadAttributes, OpStorage,
2323
};
2424
use reth_optimism_payload_builder::{
2525
builder::OpPayloadTransactions,
2626
config::{OpBuilderConfig, OpDAConfig},
2727
OpBuiltPayload, OpPayloadBuilderAttributes, OpPayloadPrimitives,
2828
};
29-
use reth_optimism_primitives::{OpPrimitives, OpTransactionSigned};
29+
use reth_optimism_primitives::OpPrimitives;
3030
use reth_optimism_rpc::eth::OpEthApiBuilder;
31-
use reth_provider::{providers::ProviderFactoryBuilder, EthStorage};
31+
use reth_provider::providers::ProviderFactoryBuilder;
3232
use reth_transaction_pool::TransactionPool;
3333
use reth_trie_db::MerklePatriciaTrie;
3434

35-
/// Storage implementation for Optimism.
36-
pub type OpStorage = EthStorage<OpTransactionSigned>;
37-
3835
/// Type configuration for a regular Optimism node.
3936
#[derive(Debug, Default, Clone)]
4037
#[non_exhaustive]
@@ -142,14 +139,7 @@ impl FraxtalNode {
142139

143140
impl<N> Node<N> for FraxtalNode
144141
where
145-
N: FullNodeTypes<
146-
Types: NodeTypes<
147-
Payload = OpEngineTypes,
148-
ChainSpec: OpHardforks + Hardforks,
149-
Primitives = OpPrimitives,
150-
Storage = OpStorage,
151-
>,
152-
>,
142+
N: FullNodeTypes<Types: OpFullNodeTypes + OpNodeTypes>,
153143
{
154144
type ComponentsBuilder = ComponentsBuilder<
155145
N,
@@ -178,6 +168,7 @@ where
178168
.with_da_config(self.da_config.clone())
179169
.with_enable_tx_conditional(self.args.enable_tx_conditional)
180170
.with_min_suggested_priority_fee(self.args.min_suggested_priority_fee)
171+
.with_historical_rpc(self.args.historical_rpc.clone())
181172
.build()
182173
}
183174
}

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ where
191191
EvmStorageSlot::new_changed(
192192
U256::default(),
193193
U256::from_be_bytes(B256::left_padding_from(owner.as_slice()).into()),
194+
0,
194195
),
195196
);
196197
info!(target: "evm", "Setting proxy {} implementation to {}", proxy_source_addr, implementation_addr);
@@ -199,17 +200,22 @@ where
199200
EvmStorageSlot::new_changed(
200201
U256::default(),
201202
U256::from_be_bytes(B256::left_padding_from(implementation_addr.as_slice()).into()),
203+
0,
202204
),
203205
);
204206

205207
info!(target: "evm", "Setting proxy {} name and symbol", proxy_source_addr);
206208
current_contract_revm_account.storage.insert(
207209
U256::from(3),
208-
EvmStorageSlot::new_changed(U256::default(), U256::from_be_bytes(name_storage.into())),
210+
EvmStorageSlot::new_changed(U256::default(), U256::from_be_bytes(name_storage.into()), 0),
209211
);
210212
current_contract_revm_account.storage.insert(
211213
U256::from(4),
212-
EvmStorageSlot::new_changed(U256::default(), U256::from_be_bytes(symbol_storage.into())),
214+
EvmStorageSlot::new_changed(
215+
U256::default(),
216+
U256::from_be_bytes(symbol_storage.into()),
217+
0,
218+
),
213219
);
214220

215221
db.commit(HashMap::from_iter([

crates/op-evm/src/block/holocene/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ where
7575
U256::from_be_bytes(
7676
B256::left_padding_from(constants::PROXY_ADMIN_ADDR.as_slice()).into(),
7777
),
78+
0,
7879
),
7980
);
8081
info!(target: "evm", "Setting proxy {} implementation to {}", constants::PROXY_ADDR, implementation_addr);
@@ -85,6 +86,7 @@ where
8586
U256::from_be_bytes(
8687
B256::left_padding_from(implementation_addr.as_slice()).into(),
8788
),
89+
0,
8890
),
8991
);
9092

@@ -122,7 +124,7 @@ where
122124

123125
acc.storage.insert(
124126
change.storage_slot.into(),
125-
EvmStorageSlot::new_changed(U256::default(), change.value.into()),
127+
EvmStorageSlot::new_changed(U256::default(), change.value.into(), 0),
126128
);
127129

128130
acc.mark_touch();

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

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ where
6464
/// Creates a new [`OpBlockExecutor`].
6565
pub fn new(evm: E, ctx: OpBlockExecutionCtx, spec: Spec, receipt_builder: R) -> Self {
6666
Self {
67-
is_regolith: spec.is_regolith_active_at_timestamp(evm.block().timestamp),
67+
is_regolith: spec
68+
.is_regolith_active_at_timestamp(evm.block().timestamp.saturating_to()),
6869
evm,
6970
system_caller: SystemCaller::new(spec.clone()),
7071
spec,
@@ -94,7 +95,7 @@ where
9495
// Set state clear flag if the block is after the Spurious Dragon hardfork.
9596
let state_clear_flag = self
9697
.spec
97-
.is_spurious_dragon_active_at_block(self.evm.block().number);
98+
.is_spurious_dragon_active_at_block(self.evm.block().number.saturating_to());
9899
self.evm.db_mut().set_state_clear_flag(state_clear_flag);
99100

100101
self.system_caller
@@ -106,16 +107,28 @@ where
106107
// blocks will always have at least a single transaction in them (the L1 info transaction),
107108
// so we can safely assume that this will always be triggered upon the transition and that
108109
// the above check for empty blocks will never be hit on OP chains.
109-
ensure_create2_deployer(&self.spec, self.evm.block().timestamp, self.evm.db_mut())
110-
.map_err(BlockExecutionError::other)?;
110+
ensure_create2_deployer(
111+
&self.spec,
112+
self.evm.block().timestamp.saturating_to(),
113+
self.evm.db_mut(),
114+
)
115+
.map_err(BlockExecutionError::other)?;
111116

112117
// Ensure that during the granite hard fork we migrate frax to frxUSD and sfrax to sfrxUSD
113-
granite::migrate_frxusd(&self.spec, self.evm.block().timestamp, self.evm.db_mut())
114-
.map_err(BlockExecutionError::other)?;
118+
granite::migrate_frxusd(
119+
&self.spec,
120+
self.evm.block().timestamp.saturating_to(),
121+
self.evm.db_mut(),
122+
)
123+
.map_err(BlockExecutionError::other)?;
115124

116125
// Ensure that during the holocene hard fork we run the frax holocene migration
117-
holocene::migrate_frax_holocene(&self.spec, self.evm.block().timestamp, self.evm.db_mut())
118-
.map_err(BlockExecutionError::other)?;
126+
holocene::migrate_frax_holocene(
127+
&self.spec,
128+
self.evm.block().timestamp.saturating_to(),
129+
self.evm.db_mut(),
130+
)
131+
.map_err(BlockExecutionError::other)?;
119132

120133
Ok(())
121134
}
@@ -203,9 +216,9 @@ where
203216
// this is only set for post-Canyon deposit
204217
// transactions.
205218
deposit_receipt_version: (is_deposit
206-
&& self
207-
.spec
208-
.is_canyon_active_at_timestamp(self.evm.block().timestamp))
219+
&& self.spec.is_canyon_active_at_timestamp(
220+
self.evm.block().timestamp.saturating_to(),
221+
))
209222
.then_some(1),
210223
})
211224
}

crates/op-evm/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ where
106106
tx: Self::Tx,
107107
) -> Result<ResultAndState<Self::HaltReason>, Self::Error> {
108108
if self.inspect {
109-
self.inner.set_tx(tx);
110-
self.inner.inspect_replay()
109+
self.inner.inspect_tx(tx)
111110
} else {
112111
self.inner.transact(tx)
113112
}

0 commit comments

Comments
 (0)