Skip to content

Commit e76f50f

Browse files
mattssedebjit-bw
andauthored
chore: bump to reth 1.4.3 (#72)
* chore: bump to reth 1.4.3 * imports * gnosis evm changes to track u pstream changes * reduced diff --------- Co-authored-by: debjit <[email protected]>
1 parent 5d65422 commit e76f50f

File tree

13 files changed

+1727
-1510
lines changed

13 files changed

+1727
-1510
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,59 @@ name = "reth"
1212
path = "src/main.rs"
1313

1414
[dependencies]
15-
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
16-
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
17-
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
18-
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
19-
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
20-
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
21-
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
22-
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
23-
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
24-
reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
25-
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
26-
reth-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
27-
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
28-
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
29-
reth-prune-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
30-
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
31-
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
32-
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
33-
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
34-
reth-ethereum-engine-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
35-
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
36-
reth-fs-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
37-
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12", features = [
15+
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
16+
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
17+
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
18+
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
19+
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
20+
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
21+
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
22+
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
23+
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
24+
reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
25+
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
26+
reth-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
27+
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
28+
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
29+
reth-prune-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
30+
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
31+
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
32+
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
33+
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
34+
reth-ethereum-engine-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
35+
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
36+
reth-fs-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
37+
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3", features = [
3838
"test-utils",
3939
] }
40-
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
41-
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
42-
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
43-
reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
44-
reth-db-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
45-
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
46-
reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
47-
reth-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
48-
reth-stages = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
49-
reth-stages-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
50-
reth-stages-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
51-
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
52-
reth-tracing = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
53-
reth-trie = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
54-
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
55-
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
40+
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
41+
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
42+
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
43+
reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
44+
reth-db-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
45+
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
46+
reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
47+
reth-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
48+
reth-stages = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
49+
reth-stages-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
50+
reth-stages-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
51+
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
52+
reth-tracing = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
53+
reth-trie = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
54+
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
55+
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.4.3" }
5656
eyre = "0.6"
5757
clap = { version = "4.5.6", features = ["derive"] }
5858
derive_more = { version = "2", default-features = false, features = ["full"] }
5959

6060
# revm
61-
revm = { version = "22.0.1", features = ["std"], default-features = false }
62-
revm-database = { version = "3.0.0", default-features = false }
63-
revm-state = { version = "3.0.0", default-features = false }
64-
revm-primitives = { version = "18.0.0", features = [
61+
revm = { version = "23.0.0", features = ["std"], default-features = false }
62+
revm-database = { version = "4.0.0", default-features = false }
63+
revm-state = { version = "4.0.0", default-features = false }
64+
revm-primitives = { version = "19.0.0", features = [
6565
"std",
6666
], default-features = false }
67-
revm-inspectors = "0.19"
67+
revm-inspectors = "0.22"
6868

6969
serde = { version = "1.0", features = ["derive"], default-features = false }
7070
serde_json = "1.0.94"
@@ -76,18 +76,18 @@ thiserror-no-std = { version = "2.0.2", default-features = false }
7676

7777
# eth
7878
alloy-chains = { version = "0.2.0", default-features = false }
79-
alloy-dyn-abi = "0.8.20"
80-
alloy-evm = { version = "0.5.0", default-features = false }
79+
alloy-evm = { version = "0.8.0", default-features = false }
80+
alloy-dyn-abi = "1.0"
8181
alloy-primitives = { version = "1.1.0", default-features = false }
8282
alloy-rlp = { version = "0.3.10", default-features = false }
8383
alloy-sol-types = "1.1.0"
8484
alloy-trie = { version = "0.7.9", default-features = false }
8585

86-
alloy-consensus = { version = "0.14.0", default-features = false }
87-
alloy-eips = { version = "0.14.0", default-features = false }
88-
alloy-genesis = { version = "0.14.0", default-features = false }
86+
alloy-consensus = { version = "1.0", default-features = false }
87+
alloy-eips = { version = "1.0", default-features = false }
88+
alloy-genesis = { version = "1.0", default-features = false }
8989
alloy-sol-macro = "1.1.0"
90-
alloy-serde = { version = "0.14.0", default-features = false }
90+
alloy-serde = { version = "1.0", default-features = false }
9191
rayon = "1.7"
9292

9393
tracing = "0.1.0"

src/blobs.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use alloy_eips::eip7840::BlobParams;
2-
use reth_chainspec::HardforkBlobParams;
2+
use alloy_eips::BlobScheduleBlobParams;
33
use revm::context_interface::block::BlobExcessGasAndPrice;
44
use revm_primitives::hardfork::SpecId;
55

@@ -17,10 +17,14 @@ pub static PRAGUE_BLOB_PARAMS: BlobParams = BlobParams {
1717
min_blob_fee: 1000000000,
1818
};
1919

20-
pub const GNOSIS_BLOB_SCHEDULE: HardforkBlobParams = HardforkBlobParams {
21-
cancun: CANCUN_BLOB_PARAMS,
22-
prague: PRAGUE_BLOB_PARAMS,
23-
};
20+
pub fn gnosis_blob_schedule() -> BlobScheduleBlobParams {
21+
BlobScheduleBlobParams {
22+
cancun: CANCUN_BLOB_PARAMS,
23+
prague: PRAGUE_BLOB_PARAMS,
24+
osaka: PRAGUE_BLOB_PARAMS,
25+
scheduled: vec![],
26+
}
27+
}
2428

2529
// helper function to create the evm's CfgEnv in get_cfg_env
2630
pub fn evm_env_blob_schedule() -> Vec<(SpecId, u64, u64)> {

src/cli.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use reth_ethereum_consensus::EthBeaconConsensus;
1717
use reth_tracing::FileWorkerGuard;
1818
use tracing::info;
1919

20+
use crate::evm_config::GnosisEvmConfig;
2021
use crate::{
21-
execute::GnosisExecutorProvider,
2222
spec::gnosis_spec::{GnosisChainSpec, GnosisChainSpecParser},
2323
GnosisNode,
2424
};
@@ -120,7 +120,7 @@ where
120120

121121
let components = |spec: Arc<C::ChainSpec>| {
122122
(
123-
GnosisExecutorProvider::new(spec.clone()),
123+
GnosisEvmConfig::new(spec.clone()),
124124
EthBeaconConsensus::new(spec),
125125
)
126126
};
@@ -154,6 +154,8 @@ where
154154
runner.run_blocking_until_ctrl_c(command.execute::<GnosisNode, _, _>(components))
155155
}
156156
Commands::Debug(_command) => todo!(),
157+
Commands::ImportEra(_) => unimplemented!(),
158+
Commands::Download(_) => unimplemented!(),
157159
}
158160
}
159161

src/evm/factory.rs

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
use alloy_evm::precompiles::PrecompilesMap;
12
use alloy_evm::{Database, Evm};
23
use core::ops::{Deref, DerefMut};
4+
use reth::revm::precompile::{PrecompileSpecId, Precompiles};
35
use reth_evm::{eth::EthEvmContext, EvmEnv, EvmFactory};
46
use revm::{
57
context::{
68
result::{EVMError, HaltReason, ResultAndState},
79
BlockEnv, TxEnv,
810
},
9-
handler::{instructions::EthInstructions, EthPrecompiles, PrecompileProvider},
11+
handler::{instructions::EthInstructions, PrecompileProvider},
1012
inspector::NoOpInspector,
1113
interpreter::{interpreter::EthInterpreter, InterpreterResult},
1214
Context, ExecuteEvm, InspectEvm, Inspector, MainBuilder, MainContext,
@@ -15,7 +17,7 @@ use revm_primitives::{hardfork::SpecId, Address, Bytes, TxKind, U256};
1517
use revm_state::{Account, AccountInfo, AccountStatus};
1618

1719
#[allow(missing_debug_implementations)] // missing revm::Context Debug impl
18-
pub struct GnosisEvm<DB: Database, I, PRECOMPILE = EthPrecompiles> {
20+
pub struct GnosisEvm<DB: Database, I, PRECOMPILE = PrecompilesMap> {
1921
inner: crate::evm::gnosis_evm::GnosisEvm<
2022
EthEvmContext<DB>,
2123
I,
@@ -59,17 +61,17 @@ impl<DB: Database, I, PRECOMPILE> GnosisEvm<DB, I, PRECOMPILE> {
5961

6062
/// Provides a reference to the EVM context.
6163
pub const fn ctx(&self) -> &EthEvmContext<DB> {
62-
&self.inner.0.data.ctx
64+
&self.inner.0.ctx
6365
}
6466

6567
/// Provides a mutable reference to the EVM context.
6668
pub fn ctx_mut(&mut self) -> &mut EthEvmContext<DB> {
67-
&mut self.inner.0.data.ctx
69+
&mut self.inner.0.ctx
6870
}
6971

7072
/// Provides a mutable reference to the EVM inspector.
7173
pub fn inspector_mut(&mut self) -> &mut I {
72-
&mut self.inner.0.data.inspector
74+
&mut self.inner.0.inspector
7375
}
7476
}
7577

@@ -100,6 +102,8 @@ where
100102
type Error = EVMError<DB::Error>;
101103
type HaltReason = HaltReason;
102104
type Spec = SpecId;
105+
type Precompiles = PRECOMPILE;
106+
type Inspector = I;
103107

104108
fn block(&self) -> &BlockEnv {
105109
&self.block
@@ -223,14 +227,22 @@ where
223227
cfg: cfg_env,
224228
journaled_state,
225229
..
226-
} = self.inner.0.data.ctx;
230+
} = self.inner.0.ctx;
227231

228232
(journaled_state.database, EvmEnv { block_env, cfg_env })
229233
}
230234

231235
fn set_inspector_enabled(&mut self, enabled: bool) {
232236
self.inspect = enabled;
233237
}
238+
239+
fn precompiles_mut(&mut self) -> &mut Self::Precompiles {
240+
&mut self.inner.0.precompiles
241+
}
242+
243+
fn inspector_mut(&mut self) -> &mut Self::Inspector {
244+
&mut self.inner.0.inspector
245+
}
234246
}
235247

236248
/// Custom EVM configuration.
@@ -242,20 +254,25 @@ pub struct GnosisEvmFactory {
242254

243255
impl EvmFactory for GnosisEvmFactory {
244256
type Evm<DB: Database, I: Inspector<EthEvmContext<DB>>> = GnosisEvm<DB, I>;
257+
type Context<DB: Database> = EthEvmContext<DB>;
245258
type Tx = TxEnv;
246259
type Error<DBError: core::error::Error + Send + Sync + 'static> = EVMError<DBError>;
247260
type HaltReason = HaltReason;
248-
type Context<DB: Database> = EthEvmContext<DB>;
249261
type Spec = SpecId;
262+
type Precompiles = PrecompilesMap;
250263

251264
fn create_evm<DB: Database>(&self, db: DB, input: EvmEnv) -> Self::Evm<DB, NoOpInspector> {
265+
let spec_id = input.cfg_env.spec;
252266
GnosisEvm {
253267
inner: super::gnosis_evm::GnosisEvm(
254268
Context::mainnet()
255269
.with_db(db)
256270
.with_cfg(input.cfg_env)
257271
.with_block(input.block_env)
258-
.build_mainnet_with_inspector(NoOpInspector {}),
272+
.build_mainnet_with_inspector(NoOpInspector {})
273+
.with_precompiles(PrecompilesMap::from_static(Precompiles::new(
274+
PrecompileSpecId::from_spec_id(spec_id),
275+
))),
259276
self.fee_collector_address,
260277
),
261278
inspect: false,
@@ -268,13 +285,17 @@ impl EvmFactory for GnosisEvmFactory {
268285
input: EvmEnv,
269286
inspector: I,
270287
) -> Self::Evm<DB, I> {
288+
let spec_id = input.cfg_env.spec;
271289
GnosisEvm {
272290
inner: super::gnosis_evm::GnosisEvm(
273291
Context::mainnet()
274292
.with_db(db)
275293
.with_cfg(input.cfg_env)
276294
.with_block(input.block_env)
277-
.build_mainnet_with_inspector(inspector),
295+
.build_mainnet_with_inspector(inspector)
296+
.with_precompiles(PrecompilesMap::from_static(Precompiles::new(
297+
PrecompileSpecId::from_spec_id(spec_id),
298+
))),
278299
self.fee_collector_address,
279300
),
280301
inspect: true,

0 commit comments

Comments
 (0)