Skip to content

Commit

Permalink
chore: bump reth
Browse files Browse the repository at this point in the history
  • Loading branch information
onbjerg committed Sep 10, 2024
1 parent 5045bf9 commit 2d25a8b
Show file tree
Hide file tree
Showing 8 changed files with 469 additions and 426 deletions.
795 changes: 421 additions & 374 deletions Cargo.lock

Large diffs are not rendered by default.

23 changes: 11 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,17 @@ alloy-signer-local = { version = "0.3", features = ["mnemonic"] }
tokio = { version = "1.21", default-features = false }

# reth
reth = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.6", features = [
"optimism",
] }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.6" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.6" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.6" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.6" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.6" }
reth-node-optimism = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.6" }
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.6" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.6" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.0.6" }
reth = { git = "https://github.com/paradigmxyz/reth.git", rev = "e4b5325" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "e4b5325" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", rev = "e4b5325" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "e4b5325" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "e4b5325" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", rev = "e4b5325" }
reth-node-optimism = { git = "https://github.com/paradigmxyz/reth.git", rev = "e4b5325" }
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth.git", rev = "e4b5325" }
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth.git", rev = "e4b5325" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "e4b5325" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", rev = "e4b5325" }

# misc
clap = "4"
Expand Down
7 changes: 4 additions & 3 deletions bin/alphanet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@ workspace = true
[dependencies]
alphanet-node.workspace = true
tracing.workspace = true
reth.workspace = true
reth.workspace = true # not needed
reth-cli-util.workspace = true
reth-node-optimism.workspace = true
reth-optimism-cli = { workspace = true, features = ["optimism"] }
reth-optimism-rpc.workspace = true
clap = { workspace = true, features = ["derive"] }

[target.'cfg(not(windows))'.dependencies]
tikv-jemallocator = { version = "0.5", optional = true }

[features]
default = ["jemalloc", "reth/optimism", "reth-node-optimism/optimism"]
default = ["jemalloc", "reth-node-optimism/optimism"]

asm-keccak = ["reth/asm-keccak"]
asm-keccak = ["reth/asm-keccak"] # how do we enable this now

jemalloc = ["dep:tikv-jemallocator"]
jemalloc-prof = ["jemalloc", "tikv-jemallocator?/profiling"]
Expand Down
36 changes: 19 additions & 17 deletions bin/alphanet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

use alphanet_node::node::AlphaNetNode;
use clap::Parser;
use reth::cli::Cli;
use reth_node_optimism::args::RollupArgs;
use reth_optimism_cli::{chainspec::OpChainSpecParser, Cli};
use reth_optimism_rpc::eth::rpc::SequencerClient;

// We use jemalloc for performance reasons.
Expand All @@ -44,24 +44,26 @@ fn main() {
std::env::set_var("RUST_BACKTRACE", "1");
}

if let Err(err) = Cli::<RollupArgs>::parse().run(|builder, rollup_args| async move {
let node = builder
.node(AlphaNetNode::new(rollup_args.clone()))
.extend_rpc_modules(move |ctx| {
// register sequencer tx forwarder
if let Some(sequencer_http) = rollup_args.sequencer_http.clone() {
ctx.registry
.eth_api()
.set_sequencer_client(SequencerClient::new(sequencer_http));
}
if let Err(err) =
Cli::<OpChainSpecParser, RollupArgs>::parse().run(|builder, rollup_args| async move {
let node = builder
.node(AlphaNetNode::new(rollup_args.clone()))
.extend_rpc_modules(move |ctx| {
// register sequencer tx forwarder
if let Some(sequencer_http) = rollup_args.sequencer_http.clone() {
ctx.registry
.eth_api()
.set_sequencer_client(SequencerClient::new(sequencer_http));
}

Ok(())
})
.launch()
.await?;
Ok(())
})
.launch()
.await?;

node.wait_for_node_exit().await
}) {
node.wait_for_node_exit().await
})
{
eprintln!("Error: {err:?}");
std::process::exit(1);
}
Expand Down
6 changes: 1 addition & 5 deletions crates/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ reth-chainspec.workspace = true
eyre.workspace = true

[features]
default = [
"alphanet-precompile/optimism",
"reth/optimism",
"reth-node-optimism/optimism",
]
default = ["reth-node-optimism/optimism"]

[lints]
workspace = true
17 changes: 12 additions & 5 deletions crates/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use reth::builder::{
BuilderContext, Node, NodeTypes,
};
use reth_chainspec::ChainSpec;
use reth_node_api::FullNodeTypes;
use reth_node_api::{FullNodeTypes, NodeTypesWithEngine};
use reth_node_optimism::{
args::RollupArgs,
node::{
Expand Down Expand Up @@ -44,7 +44,9 @@ impl AlphaNetNode {
OptimismConsensusBuilder,
>
where
Node: FullNodeTypes<Engine = OptimismEngineTypes>,
Node: FullNodeTypes<
Types: NodeTypesWithEngine<Engine = OptimismEngineTypes, ChainSpec = ChainSpec>,
>,
{
let RollupArgs { disable_txpool_gossip, compute_pending_block, discovery_v4, .. } = args;
ComponentsBuilder::default()
Expand All @@ -66,13 +68,18 @@ impl AlphaNetNode {
/// Configure the node types
impl NodeTypes for AlphaNetNode {
type Primitives = ();
type Engine = OptimismEngineTypes;
type ChainSpec = ChainSpec;
}

impl NodeTypesWithEngine for AlphaNetNode {
type Engine = OptimismEngineTypes;
}

impl<N> Node<N> for AlphaNetNode
where
N: FullNodeTypes<Engine = OptimismEngineTypes>,
N: FullNodeTypes<
Types: NodeTypesWithEngine<Engine = OptimismEngineTypes, ChainSpec = ChainSpec>,
>,
{
type ComponentsBuilder = ComponentsBuilder<
N,
Expand All @@ -98,7 +105,7 @@ pub struct AlphaNetExecutorBuilder;

impl<Node> ExecutorBuilder<Node> for AlphaNetExecutorBuilder
where
Node: FullNodeTypes,
Node: FullNodeTypes<Types: NodeTypes<ChainSpec = ChainSpec>>,
{
type EVM = AlphaNetEvmConfig;
type Executor = OpExecutorProvider<Self::EVM>;
Expand Down
5 changes: 0 additions & 5 deletions crates/precompile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,5 @@ reth-chainspec.workspace = true
eyre.workspace = true
rstest.workspace = true

[features]
optimism = [
"reth/optimism",
]

[lints]
workspace = true
6 changes: 1 addition & 5 deletions crates/testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ tokio.workspace = true
url = "2.5.0"

[features]
default = [
"reth/optimism",
"reth-node-core/optimism",
"reth-primitives/optimism",
]
default = ["reth-node-core/optimism", "reth-primitives/optimism"]

[lints]
workspace = true

0 comments on commit 2d25a8b

Please sign in to comment.