Skip to content

Commit

Permalink
chore: bump reth to 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected committed Feb 27, 2025
1 parent 10bf02e commit 1a201a5
Show file tree
Hide file tree
Showing 15 changed files with 1,931 additions and 1,977 deletions.
3,088 changes: 1,713 additions & 1,375 deletions Cargo.lock

Large diffs are not rendered by default.

135 changes: 79 additions & 56 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,78 +141,80 @@ odyssey-node = { path = "crates/node" }
odyssey-wallet = { path = "crates/wallet" }
odyssey-walltime = { path = "crates/walltime" }

alloy = { version = "0.8", features = [
alloy = { version = "0.11.1", features = [
"contract",
"providers",
"provider-http",
"signers",
"reqwest-rustls-tls",
], default-features = false }
alloy-consensus = { version = "0.8", default-features = false }
alloy-eips = { version = "0.8", default-features = false }
alloy-network = { version = "0.8", default-features = false }
alloy-primitives = { version = "0.8", default-features = false }
alloy-provider = { version = "0.8", default-features = false }
alloy-rpc-client = { version = "0.8", default-features = false }
alloy-rpc-types = { version = "0.8", default-features = false }
alloy-rpc-types-eth = { version = "0.8", default-features = false }
alloy-signer-local = { version = "0.8", features = ["mnemonic"] }
alloy-transport = { version = "0.8", default-features = false }
alloy-transport-http = { version = "0.8", default-features = false, features = [
alloy-consensus = { version = "0.11.1", default-features = false }
alloy-eips = { version = "0.11.1", default-features = false }
alloy-network = { version = "0.11.1", default-features = false }
alloy-provider = { version = "0.11.1", default-features = false }
alloy-rpc-client = { version = "0.11.1", default-features = false }
alloy-rpc-types = { version = "0.11.1", default-features = false }
alloy-json-rpc = { version = "0.11.1", default-features = false }
alloy-rpc-types-eth = { version = "0.11.1", default-features = false }
alloy-signer-local = { version = "0.11.1", features = ["mnemonic"] }
alloy-transport = { version = "0.11.1", default-features = false }
alloy-transport-http = { version = "0.11.1", default-features = false, features = [
"reqwest",
"reqwest-rustls-tls",
] }

# alloy-core
alloy-primitives = { version = "0.8", default-features = false }

reqwest = { version = "0.12.9", default-features = false, features = [
"rustls-tls",
] }

op-alloy-consensus = { version = "0.8", default-features = false }

# tokio
tokio = { version = "1.21", default-features = false }

reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-errors = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9", features = [
"optimism",
] }
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9", features = [
"optimism",
] }
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9", features = [
"optimism",
] }
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9", features = [
"optimism",
] }
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9", features = [
"optimism",
] }
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9", features = [
"optimism",
] }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-rpc-types-compat = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-network = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-network-types = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", rev = "320a0b9" }
reth = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-errors = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-network = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-network-types = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", version = "1.2.0" }

# alloy-evm
alloy-evm = { version = "0.1", default-features = false }
alloy-op-evm = { version = "0.1", default-features = false }

# revm-optimism
revm-optimism = { version = "1.0.0-alpha.1", default-features = false }

# op-alloy-consensus
op-alloy-consensus = { version = "0.10.5", default-features = false }

revm-primitives = { version = "14.0.0" }
revm-precompile = { version = "15.0.0", features = ["secp256r1"] }

Expand All @@ -239,3 +241,24 @@ parking_lot = "0.12"

# misc-testing
rstest = "0.18.2"

# TODO(dan): remove this when reth removes
[patch.crates-io]
alloy-evm = { git = "https://github.com/alloy-rs/evm", rev = "beb6832" }
alloy-op-evm = { git = "https://github.com/alloy-rs/evm", rev = "beb6832" }

revm = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-bytecode = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-database = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-state = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-precompile = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-primitives = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-interpreter = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-inspector = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-context = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-context-interface = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-database-interface = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-specification = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }
revm-optimism = { git = "https://github.com/bluealloy/revm", rev = "a8a9893b" }

revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors", rev = "8900c2b" }
20 changes: 5 additions & 15 deletions bin/odyssey/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ use odyssey_node::{
};
use odyssey_wallet::{OdysseyWallet, OdysseyWalletApiServer, RethUpstream};
use odyssey_walltime::{OdysseyWallTime, OdysseyWallTimeRpcApiServer};
use reth_node_builder::{engine_tree_config::TreeConfig, EngineNodeLauncher, NodeComponents};
use reth_node_builder::NodeComponents;
use reth_optimism_cli::Cli;
use reth_optimism_node::{args::RollupArgs, node::OpAddOnsBuilder};
use reth_provider::{providers::BlockchainProvider2, CanonStateSubscriptions};
use reth_provider::{providers::BlockchainProvider, CanonStateSubscriptions};
use std::time::Duration;
use tracing::{info, warn};

Expand All @@ -64,8 +64,8 @@ fn main() {
.map(<EthereumWallet as NetworkWallet<Ethereum>>::default_signer_address);

let handle = builder
.with_types_and_provider::<OdysseyNode, BlockchainProvider2<_>>()
.with_components(OdysseyNode::components(&rollup_args))
.with_types_and_provider::<OdysseyNode, BlockchainProvider<_>>()
.with_components(OdysseyNode::new(rollup_args.clone()).components())
.with_add_ons(
OpAddOnsBuilder::default().with_sequencer(rollup_args.sequencer_http).build(),
)
Expand Down Expand Up @@ -126,17 +126,7 @@ fn main() {

Ok(())
})
.launch_with_fn(|builder| {
let engine_tree_config = TreeConfig::default()
.with_persistence_threshold(rollup_args.persistence_threshold)
.with_memory_block_buffer_target(rollup_args.memory_block_buffer_target);
let launcher = EngineNodeLauncher::new(
builder.task_executor().clone(),
builder.config().datadir(),
engine_tree_config,
);
builder.launch_with(launcher)
})
.launch()
.await?;

// spawn raw transaction forwarding
Expand Down
1 change: 1 addition & 0 deletions bin/relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ workspace = true
alloy-primitives.workspace = true
alloy-provider.workspace = true
alloy-rpc-client.workspace = true
alloy-rpc-types.workspace = true
alloy-signer-local.workspace = true
clap = { workspace = true, features = ["derive", "env"] }
eyre.workspace = true
Expand Down
5 changes: 2 additions & 3 deletions bin/relay/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ impl Args {
// construct provider
let signer: PrivateKeySigner = self.secret_key.parse().wrap_err("Invalid signing key")?;
let wallet = EthereumWallet::from(signer);
let rpc_client = RpcClient::new_http(self.upstream).boxed();
let provider =
ProviderBuilder::new().with_recommended_fillers().wallet(wallet).on_client(rpc_client);
let rpc_client = RpcClient::new_http(self.upstream);
let provider = ProviderBuilder::new().wallet(wallet).on_client(rpc_client);

// get chain id
let chain_id = provider.get_chain_id().await?;
Expand Down
9 changes: 1 addition & 8 deletions crates/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ reth-optimism-node.workspace = true
reth-optimism-forks.workspace = true
reth-optimism-chainspec.workspace = true
reth-optimism-primitives.workspace = true
reth-optimism-payload-builder.workspace = true
reth-chainspec.workspace = true
reth-payload-builder.workspace = true
reth-primitives.workspace = true
reth-evm.workspace = true
reth-revm.workspace = true
reth-rpc-eth-api.workspace = true
reth-rpc-eth-types.workspace = true
reth-transaction-pool.workspace = true
Expand All @@ -35,17 +32,13 @@ reth-network.workspace = true
reth-network-types.workspace = true
reth-chain-state.workspace = true

alloy-consensus.workspace = true
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types.workspace = true
alloy-rpc-types-eth.workspace = true

op-alloy-consensus.workspace = true

revm-precompile.workspace = true
revm-primitives.workspace = true

serde_json.workspace = true
tokio.workspace = true
tracing.workspace = true
Expand Down
33 changes: 22 additions & 11 deletions crates/node/src/chainspec.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
//! Odyssey chainspec parsing logic.
use alloy_primitives::{b256, U256};
use alloy_primitives::U256;
use reth_chainspec::{
once_cell_set, BaseFeeParams, BaseFeeParamsKind, Chain, ChainHardforks, ChainSpec,
EthereumHardfork, ForkCondition, NamedChain,
BaseFeeParams, BaseFeeParamsKind, Chain, ChainHardforks, ChainSpec, EthereumHardfork,
ForkCondition, Hardfork, NamedChain,
};
use reth_cli::chainspec::{parse_genesis, ChainSpecParser};
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_chainspec::{make_op_genesis_header, OpChainSpec};
use reth_optimism_forks::OpHardfork;
use reth_primitives_traits::SealedHeader;
use std::sync::{Arc, LazyLock};

/// Odyssey forks.
Expand All @@ -25,14 +26,20 @@ pub static ODYSSEY_FORKS: LazyLock<ChainHardforks> = LazyLock::new(|| {
(EthereumHardfork::London.boxed(), ForkCondition::Block(0)),
(
EthereumHardfork::Paris.boxed(),
ForkCondition::TTD { fork_block: None, total_difficulty: U256::ZERO },
ForkCondition::TTD {
fork_block: None,
total_difficulty: U256::ZERO,
activation_block_number: 0,
},
),
(EthereumHardfork::Shanghai.boxed(), ForkCondition::Timestamp(0)),
(EthereumHardfork::Cancun.boxed(), ForkCondition::Timestamp(0)),
(OpHardfork::Regolith.boxed(), ForkCondition::Timestamp(0)),
(OpHardfork::Bedrock.boxed(), ForkCondition::Block(0)),
(OpHardfork::Ecotone.boxed(), ForkCondition::Timestamp(0)),
(OpHardfork::Canyon.boxed(), ForkCondition::Timestamp(0)),
(OpHardfork::Holocene.boxed(), ForkCondition::Timestamp(0)),
(OpHardfork::Isthmus.boxed(), ForkCondition::Timestamp(0)),
(EthereumHardfork::Prague.boxed(), ForkCondition::Timestamp(0)),
])
});
Expand All @@ -54,15 +61,15 @@ pub static ODYSSEY_DEV: LazyLock<Arc<OpChainSpec>> = LazyLock::new(|| {

/// Odyssey main chain specification.
pub static ODYSSEY_MAINNET: LazyLock<Arc<OpChainSpec>> = LazyLock::new(|| {
let genesis = serde_json::from_str(include_str!("../../../etc/odyssey-genesis.json"))
.expect("Can't deserialize odyssey genesis json");
let genesis_header = make_op_genesis_header(&genesis, &ODYSSEY_FORKS.clone());
OpChainSpec::new(ChainSpec {
chain: Chain::from_named(NamedChain::Odyssey),
// genesis contains empty alloc field because state at first bedrock block is imported
// manually from trusted source
genesis: serde_json::from_str(include_str!("../../../etc/odyssey-genesis.json"))
.expect("Can't deserialize odyssey genesis json"),
genesis_hash: once_cell_set(b256!(
"2f980576711e3617a5e4d83dd539548ec0f7792007d505a3d2e9674833af2d7c"
)),
genesis,
genesis_header: SealedHeader::seal_slow(genesis_header),
paris_block_and_final_difficulty: Some((0, U256::ZERO)),
hardforks: ODYSSEY_FORKS.clone(),
base_fee_params: BaseFeeParamsKind::Variable(
Expand Down Expand Up @@ -102,14 +109,18 @@ impl ChainSpecParser for OdysseyChainSpecParser {
.hardforks
.insert(EthereumHardfork::Prague, ForkCondition::Timestamp(0));

// NOTE: This enables isthmus, which is required to have OP features and prague
// features at the same time
chainspec.inner.hardforks.insert(OpHardfork::Isthmus, ForkCondition::Timestamp(0));

// NOTE(onbjerg): op-node will fetch the genesis block and check that the hash
// matches whatever is in the L2 rollup config, which it will not when we activate
// Prague, since the autogenerated genesis header will include a requests hash of
// `EMPTY_HASH`. To circumvent this without modifying the OP stack genesis
// generator, we simply remove the requests root manually here.
let mut header = chainspec.genesis_header().clone();
header.requests_hash = None;
chainspec.inner.genesis_header = once_cell_set(header);
chainspec.inner.genesis_header = SealedHeader::seal_slow(header);

Arc::new(chainspec)
}
Expand Down
3 changes: 2 additions & 1 deletion crates/node/src/delayed_resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use jsonrpsee::{
};
use parking_lot::Mutex;
use reth_chain_state::CanonStateNotification;
use reth_optimism_primitives::OpPrimitives;
use serde::de::Error;
use serde_json::value::RawValue;
use std::{
Expand Down Expand Up @@ -43,7 +44,7 @@ impl DelayedResolver {
/// Listen for new blocks and track the local timestamp.
pub fn spawn<St>(self, mut st: St)
where
St: Stream<Item = CanonStateNotification> + Send + Unpin + 'static,
St: Stream<Item = CanonStateNotification<OpPrimitives>> + Send + Unpin + 'static,
{
tokio::task::spawn(async move {
while st.next().await.is_some() {
Expand Down
Loading

0 comments on commit 1a201a5

Please sign in to comment.