Skip to content

Commit 28a825d

Browse files
authored
update to reth 1.9.1 (#70)
* update to reth 1.9.1 * update to reth 1.9.2 * update to alloy-evm with new api * fix clippy * fix tests
1 parent d2f9e64 commit 28a825d

File tree

11 files changed

+985
-788
lines changed

11 files changed

+985
-788
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 78 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -21,102 +21,103 @@ authors = ["Evolve Stack Contributors"]
2121

2222
[workspace.dependencies]
2323
# Reth dependencies - Using the latest stable versions
24-
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
25-
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
26-
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
27-
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
28-
reth-tracing-otlp = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
29-
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
30-
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
31-
reth-errors = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
32-
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
33-
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
34-
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
35-
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
36-
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
37-
reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
38-
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
39-
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
40-
reth-trie-common = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
41-
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
42-
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
43-
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
44-
reth-storage-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
45-
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
46-
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
47-
reth-network = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
48-
reth-network-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
49-
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
50-
reth-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
51-
reth-ethereum-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
52-
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
53-
reth-engine-local = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
54-
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
55-
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
56-
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
57-
reth-e2e-test-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
58-
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
59-
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
60-
reth-execution-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
61-
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
62-
reth-node-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
63-
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
64-
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
65-
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
66-
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
67-
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
68-
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
69-
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
70-
reth-rpc-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
71-
reth-rpc-engine-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0" }
24+
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
25+
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
26+
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
27+
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
28+
reth-tracing-otlp = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
29+
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
30+
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
31+
reth-errors = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
32+
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
33+
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
34+
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
35+
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
36+
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
37+
reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
38+
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
39+
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
40+
reth-trie-common = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
41+
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
42+
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
43+
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
44+
reth-storage-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
45+
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
46+
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
47+
reth-network = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
48+
reth-network-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
49+
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
50+
reth-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
51+
reth-ethereum-cli = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
52+
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
53+
reth-engine-local = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
54+
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
55+
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
56+
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
57+
reth-e2e-test-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
58+
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
59+
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
60+
reth-execution-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
61+
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
62+
reth-node-types = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
63+
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
64+
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
65+
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
66+
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
67+
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
68+
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
69+
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
70+
reth-rpc-builder = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
71+
reth-rpc-engine-api = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2" }
7272

7373
ev-revm = { path = "crates/ev-revm" }
7474

7575

7676
# Consensus dependencies
77-
reth-consensus = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0", default-features = false }
78-
reth-consensus-common = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0", default-features = false }
79-
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0", default-features = false }
77+
reth-consensus = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
78+
reth-consensus-common = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
79+
reth-ethereum-consensus = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
8080

8181
# Test dependencies
82-
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0", default-features = false }
83-
reth-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0", default-features = false }
84-
reth-tasks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.7.0", default-features = false }
82+
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
83+
reth-db = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
84+
reth-tasks = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.9.2", default-features = false }
8585

86-
revm = { version = "29.0.0", default-features = false }
86+
revm = { version = "31.0.1", default-features = false }
87+
revm-context-interface = { version = "=12.0.1", default-features = false }
8788

8889
# Alloy dependencies
89-
alloy = { version = "1.0.30", features = [
90+
alloy = { version = "1.0.41", features = [
9091
"contract",
9192
"providers",
9293
"provider-http",
9394
"signers",
9495
"reqwest-rustls-tls",
9596
], default-features = false }
96-
# Alloy family versions aligned to 1.0.30 compatibility
97-
alloy-evm = { version = "0.20.1", default-features = false }
98-
alloy-eips = { version = "1.0.30", default-features = false }
99-
alloy-network = { version = "1.0.30", default-features = false }
100-
alloy-provider = { version = "1.0.30", default-features = false }
101-
alloy-rpc-client = { version = "1.0.30", default-features = false }
102-
alloy-rpc-types = { version = "1.0.30", default-features = false }
103-
alloy-json-rpc = { version = "1.0.30", default-features = false }
104-
alloy-rpc-types-eth = { version = "1.0.30", default-features = false }
105-
alloy-rpc-types-engine = { version = "1.0.30", default-features = false }
106-
alloy-signer = { version = "1.0.30", default-features = false }
107-
alloy-signer-local = { version = "1.0.30", features = ["mnemonic"] }
108-
alloy-primitives = { version = "1.3.1", default-features = false }
109-
alloy-consensus = { version = "1.0.30", default-features = false }
110-
alloy-genesis = { version = "1.0.30", default-features = false }
111-
alloy-rpc-types-txpool = { version = "1.0.30", default-features = false }
112-
alloy-sol-types = { version = "1.3.1", default-features = false }
113-
114-
revm-inspector = { version = "10.0.0" }
97+
# Alloy family versions aligned to 1.0.41 compatibility
98+
alloy-evm = { version = "0.23.3", default-features = false }
99+
alloy-eips = { version = "1.0.41", default-features = false }
100+
alloy-network = { version = "1.0.41", default-features = false }
101+
alloy-provider = { version = "1.0.41", default-features = false }
102+
alloy-rpc-client = { version = "1.0.41", default-features = false }
103+
alloy-rpc-types = { version = "1.0.41", default-features = false }
104+
alloy-json-rpc = { version = "1.0.41", default-features = false }
105+
alloy-rpc-types-eth = { version = "1.0.41", default-features = false }
106+
alloy-rpc-types-engine = { version = "1.0.41", default-features = false }
107+
alloy-signer = { version = "1.0.41", default-features = false }
108+
alloy-signer-local = { version = "1.0.41", features = ["mnemonic"] }
109+
alloy-primitives = { version = "1.4.1", default-features = false }
110+
alloy-consensus = { version = "1.0.41", default-features = false }
111+
alloy-genesis = { version = "1.0.41", default-features = false }
112+
alloy-rpc-types-txpool = { version = "1.0.41", default-features = false }
113+
alloy-sol-types = { version = "1.4.1", default-features = false }
114+
115+
revm-inspector = { version = "12.0.1" }
115116
# Core dependencies
116117
eyre = "0.6"
117118
tracing = "0.1"
118119
tokio = { version = "1.38", features = ["full"] }
119-
serde = { version = "=1.0.217", default-features = false, features = ["derive"] }
120+
serde = { version = "=1.0.228", default-features = false, features = ["derive"] }
120121
serde_json = "1.0"
121122
thiserror = "2.0"
122123
async-trait = "0.1"
@@ -136,6 +137,7 @@ chrono = { version = "0.4", features = ["serde"] }
136137
rand = "0.8"
137138
tempfile = "3.10"
138139
hex = "0.4"
140+
url = "2.5"
139141

140142
[workspace.lints]
141143
rust.missing_debug_implementations = "warn"

bin/ev-reth/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ tokio = { workspace = true, features = ["full"] }
5656
clap = { workspace = true, features = ["derive", "env"] }
5757
serde = { workspace = true, features = ["derive"] }
5858
thiserror.workspace = true
59+
url.workspace = true
5960

6061
# Reth OTLP tracing
6162
reth-tracing-otlp.workspace = true
62-
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
63+
tracing-subscriber = { version = "0.3.20", features = ["env-filter", "fmt"] }
6364

6465
[lints]
6566
workspace = true

bin/ev-reth/src/main.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ use evolve_ev_reth::{
1111
rpc::txpool::{EvolveTxpoolApiImpl, EvolveTxpoolApiServer},
1212
};
1313
use reth_ethereum_cli::{chainspec::EthereumChainSpecParser, Cli};
14+
use reth_tracing_otlp::{span_layer, OtlpProtocol};
1415
use tracing::info;
1516
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
17+
use url::Url;
1618

1719
use ev_node::{log_startup, EvolveArgs, EvolveNode};
1820

@@ -21,11 +23,29 @@ static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::ne
2123

2224
/// Initialize reth OTLP tracing
2325
fn init_otlp_tracing() -> eyre::Result<()> {
26+
const DEFAULT_ENDPOINT: &str = "http://127.0.0.1:4318/v1/traces";
27+
28+
let endpoint = std::env::var("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT")
29+
.or_else(|_| std::env::var("OTEL_EXPORTER_OTLP_ENDPOINT"))
30+
.unwrap_or_else(|_| DEFAULT_ENDPOINT.to_owned());
31+
let mut endpoint = Url::parse(&endpoint).or_else(|_| Url::parse(DEFAULT_ENDPOINT))?;
32+
33+
let protocol = std::env::var("OTEL_EXPORTER_OTLP_TRACES_PROTOCOL")
34+
.or_else(|_| std::env::var("OTEL_EXPORTER_OTLP_PROTOCOL"))
35+
.unwrap_or_else(|_| "http".to_string());
36+
let protocol = match protocol.to_lowercase().as_str() {
37+
"grpc" => OtlpProtocol::Grpc,
38+
_ => OtlpProtocol::Http,
39+
};
40+
41+
protocol.validate_endpoint(&mut endpoint)?;
42+
43+
let span_layer = span_layer("ev-reth", &endpoint, protocol)?;
2444
// Set up tracing subscriber with reth OTLP layer
2545
tracing_subscriber::registry()
2646
.with(EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into()))
2747
.with(tracing_subscriber::fmt::layer().with_target(false))
28-
.with(reth_tracing_otlp::layer("ev-reth"))
48+
.with(span_layer)
2949
.init();
3050

3151
info!("Reth OTLP tracing initialized for service: ev-reth");

crates/ev-precompiles/src/mint.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,17 @@ impl MintPrecompile {
5555
internals: &mut EvmInternals<'_>,
5656
addr: Address,
5757
) -> Result<(), PrecompileError> {
58-
let mut account = internals
58+
let account = internals
5959
.load_account(addr)
6060
.map_err(Self::map_internals_error)?;
6161

6262
if account.is_loaded_as_not_existing() {
6363
if addr == MINT_PRECOMPILE_ADDR {
6464
// Ensure the mint precompile account is treated as non-empty so state pruning
6565
// does not wipe out its storage between blocks.
66-
account.info.set_code(Self::bytecode().clone());
67-
account.info.set_nonce(1);
66+
internals.set_code(addr, Self::bytecode().clone());
67+
internals.nonce_bump_journal_entry(addr);
6868
}
69-
account.mark_created();
7069
internals.touch_account(addr);
7170
}
7271

@@ -78,15 +77,17 @@ impl MintPrecompile {
7877
addr: Address,
7978
amount: U256,
8079
) -> Result<(), PrecompileError> {
81-
let mut account = internals
80+
let account = internals
8281
.load_account(addr)
8382
.map_err(Self::map_internals_error)?;
84-
let new_balance = account
83+
account
8584
.info
8685
.balance
8786
.checked_add(amount)
8887
.ok_or_else(|| PrecompileError::Other("balance overflow".to_string()))?;
89-
account.info.set_balance(new_balance);
88+
internals
89+
.balance_incr(addr, amount)
90+
.map_err(Self::map_internals_error)?;
9091
Ok(())
9192
}
9293

@@ -95,15 +96,17 @@ impl MintPrecompile {
9596
addr: Address,
9697
amount: U256,
9798
) -> Result<(), PrecompileError> {
98-
let mut account = internals
99+
let account = internals
99100
.load_account(addr)
100101
.map_err(Self::map_internals_error)?;
101102
let new_balance = account
102103
.info
103104
.balance
104105
.checked_sub(amount)
105106
.ok_or_else(|| PrecompileError::Other("insufficient balance".to_string()))?;
106-
account.info.set_balance(new_balance);
107+
internals
108+
.set_balance(addr, new_balance)
109+
.map_err(Self::map_internals_error)?;
107110
Ok(())
108111
}
109112

@@ -330,10 +333,6 @@ mod tests {
330333
account.is_touched(),
331334
"recipient account should be marked touched"
332335
);
333-
assert!(
334-
account.is_created(),
335-
"recipient account should be marked created"
336-
);
337336
}
338337

339338
#[test]

crates/ev-revm/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ reth-evm.workspace = true
1616
reth-primitives.workspace = true
1717
reth-evm-ethereum.workspace = true
1818
revm-inspector.workspace = true
19+
revm-context-interface.workspace = true
1920
thiserror.workspace = true
2021
ev-precompiles = { path = "../ev-precompiles" }
2122

0 commit comments

Comments
 (0)