Skip to content

Commit 8728b8d

Browse files
committed
Bump to reth 1.3.8
1 parent 60346d6 commit 8728b8d

File tree

8 files changed

+727
-511
lines changed

8 files changed

+727
-511
lines changed

Cargo.lock

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

Cargo.toml

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

5353
# eth
5454
alloy-chains = { version = "0.1.64", default-features = false }
55-
alloy-consensus = { version = "0.12.6", default-features = false }
56-
alloy-eips = { version = "0.12.6", default-features = false }
57-
alloy-evm = { version = "0.1.0-alpha.3", default-features = false }
58-
alloy-primitives = { version = "0.8.20", default-features = false, features = ["map-foldhash"] }
59-
alloy-rlp = { version = "0.3.10", default-features = false }
60-
alloy-rpc-types-debug = { version = "0.12.6", default-features = false }
61-
alloy-rpc-types-eth = { version = "0.12.5", default-features = false }
62-
alloy-rpc-types-engine = { version = "0.12.6", default-features = false }
55+
alloy-consensus = { version = "0.13.0", default-features = false }
56+
alloy-eips = { version = "0.13.0", default-features = false }
57+
alloy-evm = { version = "0.3.2", default-features = false }
58+
alloy-primitives = { version = "0.8.25", default-features = false, features = ["map-foldhash"] }
59+
alloy-rlp = { version = "0.3.10", default-features = false, features = ["core-net"] }
60+
alloy-rpc-types-debug = { version = "0.13.0", default-features = false }
61+
alloy-rpc-types-eth = { version = "0.13.0", default-features = false }
62+
alloy-rpc-types-engine = { version = "0.13.0", default-features = false }
6363

6464
# op
65-
alloy-op-evm = { version = "0.1.0-alpha.3", default-features = false }
66-
alloy-op-hardforks = "0.1"
67-
op-alloy-consensus = { version = "0.11.2", default-features = false }
68-
op-alloy-rpc-types = { version = "0.11.2", default-features = false }
69-
op-alloy-rpc-types-engine = { version = "0.11.2", default-features = false }
65+
alloy-op-evm = { version = "0.3.2", default-features = false }
66+
alloy-op-hardforks = "0.1.2"
67+
op-alloy-consensus = { version = "0.12.0", default-features = false }
68+
op-alloy-rpc-types = { version = "0.12.0", default-features = false }
69+
op-alloy-rpc-types-engine = { version = "0.12.0", default-features = false }
7070

7171
# revm
72-
revm = { version = "20.0.0-alpha.7", default-features = false }
73-
revm-primitives = { version = "16.0.0-alpha.5", default-features = false }
74-
op-revm = { version = "1.0.0-alpha.6", default-features = false }
72+
revm = { version = "21.0.0", default-features = false }
73+
revm-primitives = { version = "17.0.0", default-features = false }
74+
op-revm = { version = "2.0.0", default-features = false }
7575

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

crates/chainspec/src/lib.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ mod fraxtal_testnet;
1212
#[non_exhaustive]
1313
pub struct FraxtalChainSpecParser;
1414

15-
impl FraxtalChainSpecParser {
16-
pub fn mainnet() -> Arc<OpChainSpec> {
17-
FRAXTAL_MAINNET.clone()
18-
}
19-
20-
pub fn holesky() -> Arc<OpChainSpec> {
21-
FRAXTAL_TESTNET.clone()
22-
}
23-
}
24-
2515
impl ChainSpecParser for FraxtalChainSpecParser {
2616
type ChainSpec = OpChainSpec;
2717

@@ -55,3 +45,18 @@ mod tests {
5545
}
5646
}
5747
}
48+
49+
/// Optimism chain specification parser.
50+
#[derive(Debug, Clone, Default)]
51+
#[non_exhaustive]
52+
pub struct FraxtalChainSpec;
53+
54+
impl FraxtalChainSpec {
55+
pub fn mainnet() -> Arc<OpChainSpec> {
56+
FRAXTAL_MAINNET.clone()
57+
}
58+
59+
pub fn holesky() -> Arc<OpChainSpec> {
60+
FRAXTAL_TESTNET.clone()
61+
}
62+
}

crates/evm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ op-revm.workspace = true
3131
# alloy
3232
alloy-consensus.workspace = true
3333
alloy-eips.workspace = true
34+
alloy-primitives.workspace = true
3435

3536
# Optimism
3637
op-alloy-consensus.workspace = true

crates/evm/src/lib.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ extern crate alloc;
22

33
use alloc::sync::Arc;
44
use alloy_consensus::{BlockHeader, Header};
5-
use alloy_evm::FromRecoveredTx;
5+
use alloy_evm::{FromRecoveredTx, FromTxWithEncoded};
66
use alloy_op_evm::{block::receipt_builder::OpReceiptBuilder, OpBlockExecutionCtx};
7+
use alloy_primitives::U256;
78
use core::fmt::Debug;
89
use fraxtal_op_evm::{block::FraxtalBlockExecutorFactory, FraxtalEvmFactory};
910
use op_alloy_consensus::EIP1559ParamError;
@@ -24,7 +25,6 @@ use revm::{
2425
context_interface::block::BlobExcessGasAndPrice,
2526
primitives::hardfork::SpecId,
2627
};
27-
use revm_primitives::alloy_primitives::U256;
2828

2929
/// Optimism-related EVM configuration.
3030
#[derive(Debug)]
@@ -33,8 +33,10 @@ pub struct FraxtalEvmConfig<
3333
N: NodePrimitives = OpPrimitives,
3434
R = OpRethReceiptBuilder,
3535
> {
36-
executor_factory: FraxtalBlockExecutorFactory<R, Arc<ChainSpec>>,
37-
block_assembler: OpBlockAssembler<ChainSpec>,
36+
/// Inner [`FraxtalBlockExecutorFactory`].
37+
pub executor_factory: FraxtalBlockExecutorFactory<R, Arc<ChainSpec>>,
38+
/// Optimism block assembler.
39+
pub block_assembler: OpBlockAssembler<ChainSpec>,
3840
_pd: core::marker::PhantomData<N>,
3941
}
4042

@@ -85,7 +87,7 @@ where
8587
BlockBody = alloy_consensus::BlockBody<R::Transaction>,
8688
Block = alloy_consensus::Block<R::Transaction>,
8789
>,
88-
OpTransaction<TxEnv>: FromRecoveredTx<N::SignedTx>,
90+
OpTransaction<TxEnv>: FromRecoveredTx<N::SignedTx> + FromTxWithEncoded<N::SignedTx>,
8991
R: OpReceiptBuilder<Receipt: DepositReceipt, Transaction: SignedTransaction>,
9092
Self: Send + Sync + Unpin + Clone + 'static,
9193
{

crates/node/src/node.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
//! Optimism Node types config.
2-
31
use fraxtal_evm::FraxtalEvmConfig;
42
use reth_evm::{execute::BasicBlockExecutorProvider, ConfigureEvm};
53
use reth_node_api::{FullNodeComponents, PrimitivesTy, TxTy};
64
use reth_node_builder::{
75
components::{
86
BasicPayloadServiceBuilder, ComponentsBuilder, ExecutorBuilder, PayloadBuilderBuilder,
97
},
10-
node::{FullNodeTypes, NodeTypes, NodeTypesWithEngine},
8+
node::{FullNodeTypes, NodeTypes},
119
BuilderContext, DebugNode, Node, NodeAdapter, NodeComponentsBuilder,
1210
};
1311
use reth_optimism_chainspec::OpChainSpec;
@@ -72,8 +70,8 @@ impl FraxtalNode {
7270
>
7371
where
7472
Node: FullNodeTypes<
75-
Types: NodeTypesWithEngine<
76-
Engine = OpEngineTypes,
73+
Types: NodeTypes<
74+
Payload = OpEngineTypes,
7775
ChainSpec = OpChainSpec,
7876
Primitives = OpPrimitives,
7977
>,
@@ -141,8 +139,8 @@ impl FraxtalNode {
141139
impl<N> Node<N> for FraxtalNode
142140
where
143141
N: FullNodeTypes<
144-
Types: NodeTypesWithEngine<
145-
Engine = OpEngineTypes,
142+
Types: NodeTypes<
143+
Payload = OpEngineTypes,
146144
ChainSpec = OpChainSpec,
147145
Primitives = OpPrimitives,
148146
Storage = OpStorage,
@@ -201,10 +199,7 @@ impl NodeTypes for FraxtalNode {
201199
type ChainSpec = OpChainSpec;
202200
type StateCommitment = MerklePatriciaTrie;
203201
type Storage = OpStorage;
204-
}
205-
206-
impl NodeTypesWithEngine for FraxtalNode {
207-
type Engine = OpEngineTypes;
202+
type Payload = OpEngineTypes;
208203
}
209204

210205
/// A regular optimism evm and executor builder.
@@ -294,8 +289,8 @@ impl<Txs> FraxtalPayloadBuilder<Txs> {
294289
) -> eyre::Result<reth_optimism_payload_builder::OpPayloadBuilder<Pool, Node::Provider, Evm, Txs>>
295290
where
296291
Node: FullNodeTypes<
297-
Types: NodeTypesWithEngine<
298-
Engine = OpEngineTypes,
292+
Types: NodeTypes<
293+
Payload = OpEngineTypes,
299294
ChainSpec = OpChainSpec,
300295
Primitives = OpPrimitives,
301296
>,
@@ -323,8 +318,8 @@ impl<Txs> FraxtalPayloadBuilder<Txs> {
323318
impl<Node, Pool, Txs> PayloadBuilderBuilder<Node, Pool> for FraxtalPayloadBuilder<Txs>
324319
where
325320
Node: FullNodeTypes<
326-
Types: NodeTypesWithEngine<
327-
Engine = OpEngineTypes,
321+
Types: NodeTypes<
322+
Payload = OpEngineTypes,
328323
ChainSpec = OpChainSpec,
329324
Primitives = OpPrimitives,
330325
>,

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
//! Block executor for Optimism.
22
33
use alloc::{borrow::Cow, boxed::Box, vec::Vec};
4-
use alloy_consensus::{transaction::Recovered, Eip658Value, Header, Transaction, TxReceipt};
4+
use alloy_consensus::{Eip658Value, Header, Transaction, TxReceipt};
55
use alloy_eips::{Encodable2718, Typed2718};
66
use alloy_evm::{
77
block::{
88
state_changes::{balance_increment_state, post_block_balance_increments},
99
BlockExecutionError, BlockExecutionResult, BlockExecutor, BlockExecutorFactory,
10-
BlockExecutorFor, BlockValidationError, OnStateHook, StateChangePostBlockSource,
11-
StateChangeSource, SystemCaller,
10+
BlockExecutorFor, BlockValidationError, ExecutableTx, OnStateHook,
11+
StateChangePostBlockSource, StateChangeSource, SystemCaller,
1212
},
1313
eth::receipt_builder::ReceiptBuilderCtx,
14-
Database, Evm, EvmFactory, FromRecoveredTx,
14+
Database, Evm, EvmFactory, FromRecoveredTx, FromTxWithEncoded,
1515
};
1616
use alloy_op_evm::{
1717
block::{receipt_builder::OpReceiptBuilder, OpAlloyReceiptBuilder},
1818
OpBlockExecutionCtx,
1919
};
2020
use alloy_op_hardforks::{OpChainHardforks, OpHardforks};
2121
use canyon::ensure_create2_deployer;
22-
use granite::migrate_frxusd;
23-
use holocene::migrate_frax_holocene;
2422
use op_alloy_consensus::OpDepositReceipt;
2523
use op_revm::transaction::deposit::DEPOSIT_TRANSACTION_TYPE;
2624
use reth_chainspec::EthChainSpec;
@@ -78,7 +76,10 @@ where
7876
impl<'db, DB, E, R, Spec> BlockExecutor for FraxtalBlockExecutor<E, R, Spec>
7977
where
8078
DB: Database + 'db,
81-
E: Evm<DB = &'db mut State<DB>, Tx: FromRecoveredTx<R::Transaction>>,
79+
E: Evm<
80+
DB = &'db mut State<DB>,
81+
Tx: FromRecoveredTx<R::Transaction> + FromTxWithEncoded<R::Transaction>,
82+
>,
8283
R: OpReceiptBuilder<Transaction: Transaction + Encodable2718, Receipt: TxReceipt>,
8384
Spec: OpHardforks + EthChainSpec,
8485
{
@@ -106,30 +107,30 @@ where
106107
.map_err(BlockExecutionError::other)?;
107108

108109
// Ensure that during the granite hard fork we migrate frax to frxUSD and sfrax to sfrxUSD
109-
migrate_frxusd(&self.spec, self.evm.block().timestamp, self.evm.db_mut())
110+
granite::migrate_frxusd(&self.spec, self.evm.block().timestamp, self.evm.db_mut())
110111
.map_err(BlockExecutionError::other)?;
111112

112113
// Ensure that during the holocene hard fork we run the frax holocene migration
113-
migrate_frax_holocene(&self.spec, self.evm.block().timestamp, self.evm.db_mut())
114+
holocene::migrate_frax_holocene(&self.spec, self.evm.block().timestamp, self.evm.db_mut())
114115
.map_err(BlockExecutionError::other)?;
115116

116117
Ok(())
117118
}
118119

119120
fn execute_transaction_with_result_closure(
120121
&mut self,
121-
tx: Recovered<&Self::Transaction>,
122+
tx: impl ExecutableTx<Self>,
122123
f: impl FnOnce(&revm::context::result::ExecutionResult<<Self::Evm as Evm>::HaltReason>),
123124
) -> Result<u64, BlockExecutionError> {
124-
let is_deposit = tx.ty() == DEPOSIT_TRANSACTION_TYPE;
125+
let is_deposit = tx.tx().ty() == DEPOSIT_TRANSACTION_TYPE;
125126

126127
// The sum of the transaction’s gas limit, Tg, and the gas utilized in this block prior,
127128
// must be no greater than the block’s gasLimit.
128129
let block_available_gas = self.evm.block().gas_limit - self.gas_used;
129-
if tx.gas_limit() > block_available_gas && (self.is_regolith || !is_deposit) {
130+
if tx.tx().gas_limit() > block_available_gas && (self.is_regolith || !is_deposit) {
130131
return Err(
131132
BlockValidationError::TransactionGasLimitMoreThanAvailableBlockGas {
132-
transaction_gas_limit: tx.gas_limit(),
133+
transaction_gas_limit: tx.tx().gas_limit(),
133134
block_available_gas,
134135
}
135136
.into(),
@@ -145,13 +146,13 @@ where
145146
.then(|| {
146147
self.evm
147148
.db_mut()
148-
.load_cache_account(tx.signer())
149+
.load_cache_account(*tx.signer())
149150
.map(|acc| acc.account_info().unwrap_or_default())
150151
})
151152
.transpose()
152153
.map_err(BlockExecutionError::other)?;
153154

154-
let hash = tx.trie_hash();
155+
let hash = tx.tx().trie_hash();
155156

156157
// Execute transaction.
157158
let result_and_state = self
@@ -174,7 +175,7 @@ where
174175

175176
self.receipts.push(
176177
match self.receipt_builder.build_receipt(ReceiptBuilderCtx {
177-
tx: tx.inner(),
178+
tx: tx.tx(),
178179
result,
179180
cumulative_gas_used: self.gas_used,
180181
evm: &self.evm,
@@ -256,6 +257,10 @@ where
256257
fn evm_mut(&mut self) -> &mut Self::Evm {
257258
&mut self.evm
258259
}
260+
261+
fn evm(&self) -> &Self::Evm {
262+
&self.evm
263+
}
259264
}
260265

261266
/// Ethereum block executor factory.
@@ -304,7 +309,7 @@ impl<R, Spec, EvmF> BlockExecutorFactory for FraxtalBlockExecutorFactory<R, Spec
304309
where
305310
R: OpReceiptBuilder<Transaction: Transaction + Encodable2718, Receipt: TxReceipt>,
306311
Spec: OpHardforks + EthChainSpec,
307-
EvmF: EvmFactory<Tx: FromRecoveredTx<R::Transaction>>,
312+
EvmF: EvmFactory<Tx: FromRecoveredTx<R::Transaction> + FromTxWithEncoded<R::Transaction>>,
308313
Self: 'static,
309314
{
310315
type EvmFactory = EvmF;

0 commit comments

Comments
 (0)