Skip to content

Commit f8fcf76

Browse files
shekhirinmattsse
andauthored
deps: bump reth (#34)
* deps: bump reth * bump rusqlite * fix codec * migrate * migrate * cargo update --------- Co-authored-by: Matthias Seitz <[email protected]>
1 parent 5af288e commit f8fcf76

File tree

20 files changed

+1533
-1461
lines changed

20 files changed

+1533
-1461
lines changed

Cargo.lock

+1,363-1,329
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+34-27
Original file line numberDiff line numberDiff line change
@@ -20,45 +20,52 @@ publish = false
2020

2121
[workspace.dependencies]
2222
# reth
23-
reth = { git = "https://github.com/paradigmxyz/reth" }
24-
reth-chainspec = { git = "https://github.com/paradigmxyz/reth" }
25-
reth-discv5 = { git = "https://github.com/paradigmxyz/reth" }
26-
reth-execution-errors = { git = "https://github.com/paradigmxyz/reth" }
27-
reth-execution-types = { git = "https://github.com/paradigmxyz/reth" }
28-
reth-exex = { git = "https://github.com/paradigmxyz/reth", features = ["serde"] }
29-
reth-eth-wire = { git = "https://github.com/paradigmxyz/reth" }
30-
reth-evm = { git = "https://github.com/paradigmxyz/reth" }
31-
reth-network = { git = "https://github.com/paradigmxyz/reth", features = ["test-utils"] }
32-
reth-network-api = { git = "https://github.com/paradigmxyz/reth" }
33-
reth-network-peers = { git = "https://github.com/paradigmxyz/reth" }
34-
reth-node-api = { git = "https://github.com/paradigmxyz/reth" }
35-
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth" }
36-
reth-primitives = { git = "https://github.com/paradigmxyz/reth" }
37-
reth-provider = { git = "https://github.com/paradigmxyz/reth" }
38-
reth-revm = { git = "https://github.com/paradigmxyz/reth" }
39-
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth" }
40-
reth-tracing = { git = "https://github.com/paradigmxyz/reth" }
23+
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
24+
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
25+
reth-discv5 = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
26+
reth-execution-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
27+
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
28+
reth-exex = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3", features = ["serde"] }
29+
reth-eth-wire = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
30+
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
31+
reth-network = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3", features = ["test-utils"] }
32+
reth-network-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
33+
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
34+
reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
35+
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
36+
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
37+
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
38+
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
39+
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
40+
reth-tracing = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
4141

4242
# alloy
43-
alloy-eips = { version = "0.5.4", default-features = false }
44-
alloy-consensus = { version = "0.5.4", default-features = false }
45-
alloy-primitives = { version = "0.8.9", default-features = false }
43+
alloy-eips = { version = "0.7", default-features = false }
44+
alloy-genesis = { version = "0.7", default-features = false }
45+
alloy-consensus = { version = "0.7", default-features = false }
4646
alloy-rlp = "0.3.4"
47-
alloy-rpc-types = { version = "0.5.4", features = [
47+
alloy-rpc-types = { version = "0.7", features = [
4848
"eth",
4949
], default-features = false }
50-
alloy-signer = { version = "0.5.4", default-features = false }
51-
alloy-signer-local = { version = "0.5.4", default-features = false }
50+
alloy-signer = { version = "0.7", default-features = false }
51+
alloy-signer-local = { version = "0.7", default-features = false }
52+
53+
alloy-primitives = { version = "0.8", default-features = false }
5254
alloy-sol-types = { version = "0.8", features = ["json"] }
5355

5456
discv5 = "0.8"
57+
enr = "0.12.1"
58+
secp256k1 = { version = "0.29", default-features = false, features = [
59+
"global-context",
60+
"recovery",
61+
] }
5562

5663
# async
5764
futures = "0.3"
5865
futures-util = "0.3"
5966
tokio = { version = "1.0", features = ["full"] }
6067
tokio-stream = "0.1"
61-
tokio-tungstenite = { version = "0.23", features = ["native-tls"] }
68+
tokio-tungstenite = { version = "0.24", features = ["native-tls"] }
6269

6370
# serde
6471
serde = "1"
@@ -68,5 +75,5 @@ serde_json = "1"
6875
eyre = "0.6"
6976

7077
# testing
71-
reth-exex-test-utils = { git = "https://github.com/paradigmxyz/reth" }
72-
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth" }
78+
reth-exex-test-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }
79+
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.3" }

backfill/src/main.rs

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
mod rpc;
22

3-
use std::{collections::HashMap, ops::RangeInclusive, sync::Arc};
4-
3+
use crate::rpc::{BackfillRpcExt, BackfillRpcExtApiServer};
54
use alloy_primitives::BlockNumber;
65
use clap::{Args, Parser};
76
use eyre::OptionExt;
8-
use futures::{FutureExt, StreamExt, TryStreamExt};
7+
use futures::{FutureExt, Stream, StreamExt, TryStreamExt};
98
use jsonrpsee::tracing::instrument;
109
use reth::{
10+
api::NodeTypes,
1111
chainspec::EthereumChainSpecParser,
12-
primitives::{BlockId, BlockNumberOrTag},
13-
providers::{BlockIdReader, BlockReader, HeaderProvider, StateProviderFactory},
12+
primitives::EthPrimitives,
13+
providers::BlockIdReader,
14+
rpc::types::{BlockId, BlockNumberOrTag},
1415
};
15-
use reth_evm::execute::BlockExecutorProvider;
1616
use reth_execution_types::Chain;
1717
use reth_exex::{BackfillJob, BackfillJobFactory, ExExContext, ExExEvent, ExExNotification};
1818
use reth_node_api::FullNodeComponents;
1919
use reth_node_ethereum::EthereumNode;
2020
use reth_tracing::tracing::{error, info};
21+
use std::{collections::HashMap, ops::RangeInclusive, sync::Arc};
2122
use tokio::sync::{mpsc, oneshot, OwnedSemaphorePermit, Semaphore};
2223

23-
use crate::rpc::{BackfillRpcExt, BackfillRpcExtApiServer};
24-
2524
/// The message type used to communicate with the ExEx.
2625
enum BackfillMessage {
2726
/// Start a backfill job for the given range.
@@ -55,7 +54,10 @@ struct BackfillExEx<Node: FullNodeComponents> {
5554
backfill_jobs: HashMap<u64, oneshot::Sender<oneshot::Sender<()>>>,
5655
}
5756

58-
impl<Node: FullNodeComponents> BackfillExEx<Node> {
57+
impl<Node> BackfillExEx<Node>
58+
where
59+
Node: FullNodeComponents<Types: NodeTypes<Primitives = EthPrimitives>>,
60+
{
5961
/// Creates a new instance of the ExEx.
6062
fn new(
6163
ctx: ExExContext<Node>,
@@ -191,7 +193,7 @@ impl<Node: FullNodeComponents> BackfillExEx<Node> {
191193
backfill_tx: mpsc::UnboundedSender<BackfillMessage>,
192194
cancel_rx: oneshot::Receiver<oneshot::Sender<()>>,
193195
) {
194-
let backfill = backfill_with_job(job);
196+
let backfill = backfill_with_job(job.into_stream());
195197

196198
tokio::select! {
197199
result = backfill => {
@@ -214,15 +216,12 @@ impl<Node: FullNodeComponents> BackfillExEx<Node> {
214216

215217
/// Backfills the given range of blocks in parallel, calling the
216218
/// [`process_committed_chain`] method for each block.
217-
async fn backfill_with_job<
218-
E: BlockExecutorProvider + Send,
219-
P: BlockReader + HeaderProvider + StateProviderFactory + Clone + Send + Unpin + 'static,
220-
>(
221-
job: BackfillJob<E, P>,
222-
) -> eyre::Result<()> {
223-
job
224-
// Convert the backfill job into a parallel stream
225-
.into_stream()
219+
async fn backfill_with_job<S, E>(st: S) -> eyre::Result<()>
220+
where
221+
S: Stream<Item = Result<Chain, E>>,
222+
E: Into<eyre::Error>,
223+
{
224+
st
226225
// Covert the block execution error into `eyre`
227226
.map_err(Into::into)
228227
// Process each block, returning early if an error occurs
@@ -304,7 +303,7 @@ fn main() -> eyre::Result<()> {
304303
.backfill_job_factory
305304
.backfill(args.from_block.unwrap_or(1)..=to_block);
306305

307-
backfill_with_job(job).await.map_err(|err| {
306+
backfill_with_job(job.into_stream()).await.map_err(|err| {
308307
eyre::eyre!("failed to backfill for the provided args: {err:?}")
309308
})?;
310309
}

discv5/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ reth.workspace = true
1919

2020
# networking
2121
discv5.workspace = true
22-
enr = "0.12"
22+
enr.workspace = true
2323

2424
# async
2525
futures-util.workspace = true

in-memory-state/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ reth-node-ethereum.workspace = true
1313
reth-tracing.workspace = true
1414
reth-execution-types.workspace = true
1515

16+
alloy-consensus.workspace = true
1617
eyre.workspace = true
1718
futures-util.workspace = true
1819

in-memory-state/src/main.rs

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#![warn(unused_crate_dependencies)]
22

3+
use alloy_consensus::BlockHeader;
34
use futures_util::{FutureExt, TryStreamExt};
5+
use reth::{api::NodeTypes, primitives::EthPrimitives};
46
use reth_execution_types::ExecutionOutcome;
57
use reth_exex::{ExExContext, ExExEvent, ExExNotification};
68
use reth_node_api::FullNodeComponents;
@@ -27,7 +29,10 @@ impl<Node: FullNodeComponents> InMemoryStateExEx<Node> {
2729
}
2830
}
2931

30-
impl<Node: FullNodeComponents + Unpin> Future for InMemoryStateExEx<Node> {
32+
impl<Node> Future for InMemoryStateExEx<Node>
33+
where
34+
Node: FullNodeComponents<Types: NodeTypes<Primitives = EthPrimitives>> + Unpin,
35+
{
3136
type Output = eyre::Result<()>;
3237

3338
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
@@ -40,11 +45,11 @@ impl<Node: FullNodeComponents + Unpin> Future for InMemoryStateExEx<Node> {
4045
}
4146
ExExNotification::ChainReorged { old, new } => {
4247
// revert to block before the reorg
43-
this.execution_outcome.revert_to(new.first().number - 1);
48+
this.execution_outcome.revert_to(new.first().number() - 1);
4449
info!(from_chain = ?old.range(), to_chain = ?new.range(), "Received reorg");
4550
}
4651
ExExNotification::ChainReverted { old } => {
47-
this.execution_outcome.revert_to(old.first().number - 1);
52+
this.execution_outcome.revert_to(old.first().number() - 1);
4853
info!(reverted_chain = ?old.range(), "Received revert");
4954
}
5055
};
@@ -76,7 +81,8 @@ fn main() -> eyre::Result<()> {
7681

7782
#[cfg(test)]
7883
mod tests {
79-
use reth::revm::db::BundleState;
84+
use super::*;
85+
use reth::{primitives::SealedBlockWithSenders, revm::db::BundleState};
8086
use reth_execution_types::{Chain, ExecutionOutcome};
8187
use reth_exex_test_utils::{test_exex_context, PollOnce};
8288
use reth_testing_utils::generators::{self, random_block, random_receipt, BlockParams};
@@ -87,20 +93,20 @@ mod tests {
8793
let mut rng = &mut generators::rng();
8894

8995
let (ctx, handle) = test_exex_context().await?;
90-
let mut exex = pin!(super::InMemoryStateExEx::new(ctx));
96+
let mut exex = pin!(InMemoryStateExEx::new(ctx));
9197

9298
let mut expected_state = ExecutionOutcome::default();
9399

94100
// Generate first block and its state
95-
let block_1 =
101+
let block_1: SealedBlockWithSenders =
96102
random_block(&mut rng, 0, BlockParams { tx_count: Some(1), ..Default::default() })
97103
.seal_with_senders()
98104
.ok_or(eyre::eyre!("failed to recover senders"))?;
99-
let block_number_1 = block_1.number;
105+
let block_number_1 = block_1.header().number();
100106
let execution_outcome1 = ExecutionOutcome::new(
101107
BundleState::default(),
102108
vec![random_receipt(&mut rng, &block_1.body.transactions[0], None)].into(),
103-
block_1.number,
109+
block_1.header().number(),
104110
vec![],
105111
);
106112
// Extend the expected state with the first block
@@ -117,14 +123,14 @@ mod tests {
117123
assert_eq!(exex.as_mut().execution_outcome, expected_state);
118124

119125
// Generate second block and its state
120-
let block_2 =
126+
let block_2: SealedBlockWithSenders =
121127
random_block(&mut rng, 1, BlockParams { tx_count: Some(2), ..Default::default() })
122128
.seal_with_senders()
123129
.ok_or(eyre::eyre!("failed to recover senders"))?;
124130
let execution_outcome2 = ExecutionOutcome::new(
125131
BundleState::default(),
126132
vec![random_receipt(&mut rng, &block_2.body.transactions[0], None)].into(),
127-
block_2.number,
133+
block_2.header().number(),
128134
vec![],
129135
);
130136
// Extend the expected execution outcome with the second block

op-bridge/Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ reth-node-ethereum.workspace = true
1414
reth-primitives.workspace = true
1515
reth-tracing.workspace = true
1616
reth.workspace = true
17+
reth-evm.workspace = true
1718

1819
# alloy
1920
alloy-primitives.workspace = true
@@ -23,13 +24,14 @@ alloy-eips.workspace = true
2324
# misc
2425
eyre.workspace = true
2526
futures.workspace = true
26-
rusqlite = { version = "0.31.0", features = ["bundled"] }
27+
rusqlite = { version = "0.32", features = ["bundled"] }
2728
tokio.workspace = true
2829

2930
[dev-dependencies]
3031
# reth
3132
reth-exex-test-utils.workspace = true
3233
reth-testing-utils.workspace = true
34+
alloy-primitives = { workspace = true, features = ["rand"]}
3335

3436
# alloy
3537
alloy-consensus.workspace = true

op-bridge/src/main.rs

+18-12
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
use alloy_primitives::{address, Address};
22
use alloy_sol_types::{sol, SolEventInterface};
33
use futures::{Future, FutureExt, TryStreamExt};
4+
use reth::api::NodeTypes;
45
use reth_execution_types::Chain;
56
use reth_exex::{ExExContext, ExExEvent};
67
use reth_node_api::FullNodeComponents;
78
use reth_node_ethereum::EthereumNode;
8-
use reth_primitives::{Log, SealedBlockWithSenders, TransactionSigned};
9+
use reth_primitives::{EthPrimitives, Log, SealedBlockWithSenders, TransactionSigned};
910
use reth_tracing::tracing::info;
1011
use rusqlite::Connection;
1112

@@ -24,10 +25,13 @@ const OP_BRIDGES: [Address; 6] = [
2425
/// Initializes the ExEx.
2526
///
2627
/// Opens up a SQLite database and creates the tables (if they don't exist).
27-
async fn init<Node: FullNodeComponents>(
28+
async fn init<Node>(
2829
ctx: ExExContext<Node>,
2930
mut connection: Connection,
30-
) -> eyre::Result<impl Future<Output = eyre::Result<()>>> {
31+
) -> eyre::Result<impl Future<Output = eyre::Result<()>>>
32+
where
33+
Node: FullNodeComponents<Types: NodeTypes<Primitives = EthPrimitives>>,
34+
{
3135
create_tables(&mut connection)?;
3236

3337
Ok(op_bridge_exex(ctx, connection))
@@ -98,10 +102,13 @@ fn create_tables(connection: &mut Connection) -> rusqlite::Result<()> {
98102

99103
/// An example of ExEx that listens to ETH bridging events from OP Stack chains
100104
/// and stores deposits and withdrawals in a SQLite database.
101-
async fn op_bridge_exex<Node: FullNodeComponents>(
105+
async fn op_bridge_exex<Node>(
102106
mut ctx: ExExContext<Node>,
103107
connection: Connection,
104-
) -> eyre::Result<()> {
108+
) -> eyre::Result<()>
109+
where
110+
Node: FullNodeComponents<Types: NodeTypes<Primitives = EthPrimitives>>,
111+
{
105112
// Process all new chain state notifications
106113
while let Some(notification) = ctx.notifications.try_next().await? {
107114
// Revert all deposits and withdrawals
@@ -219,7 +226,8 @@ fn decode_chain_into_events(
219226
.flat_map(|(block, receipts)| {
220227
block
221228
.body
222-
.transactions()
229+
.transactions
230+
.iter()
223231
.zip(receipts.iter().flatten())
224232
.map(move |(tx, receipt)| (block, tx, receipt))
225233
})
@@ -270,8 +278,7 @@ fn main() -> eyre::Result<()> {
270278

271279
#[cfg(test)]
272280
mod tests {
273-
use std::pin::pin;
274-
281+
use super::*;
275282
use alloy_consensus::TxLegacy;
276283
use alloy_eips::eip7685::Requests;
277284
use alloy_primitives::{Address, TxKind, U256};
@@ -280,12 +287,11 @@ mod tests {
280287
use reth_execution_types::{Chain, ExecutionOutcome};
281288
use reth_exex_test_utils::{test_exex_context, PollOnce};
282289
use reth_primitives::{
283-
Block, BlockBody, Header, Log, Receipt, Transaction, TransactionSigned, TxType,
290+
Block, BlockBody, BlockExt, Header, Log, Receipt, Transaction, TransactionSigned, TxType,
284291
};
285292
use reth_testing_utils::generators::sign_tx_with_random_key_pair;
286293
use rusqlite::Connection;
287-
288-
use crate::{L1StandardBridge, OP_BRIDGES};
294+
use std::pin::pin;
289295

290296
/// Given the address of a bridge contract and an event, construct a transaction signed with a
291297
/// random private key and a receipt for that transaction.
@@ -351,7 +357,7 @@ mod tests {
351357
body: BlockBody { transactions: vec![deposit_tx, withdrawal_tx], ..Default::default() },
352358
}
353359
.seal_slow()
354-
.seal_with_senders()
360+
.seal_with_senders::<Block>()
355361
.ok_or_else(|| eyre::eyre!("failed to recover senders"))?;
356362

357363
// Construct a chain

0 commit comments

Comments
 (0)