Skip to content

Commit

Permalink
chore: bump alloy and reth (#87)
Browse files Browse the repository at this point in the history
Bumps everything basically and essentially
  • Loading branch information
onbjerg authored Nov 18, 2024
1 parent 820c180 commit 9c06a05
Show file tree
Hide file tree
Showing 9 changed files with 1,203 additions and 820 deletions.
1,839 changes: 1,109 additions & 730 deletions Cargo.lock

Large diffs are not rendered by default.

62 changes: 33 additions & 29 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,57 +138,61 @@ odyssey-node = { path = "crates/node" }
odyssey-wallet = { path = "crates/wallet" }
odyssey-walltime = { path = "crates/walltime" }

alloy = { version = "0.5.3", features = [
alloy = { version = "0.6.4", features = [
"contract",
"providers",
"provider-http",
"signers",
] }
alloy-network = { version = "0.5.3" }
alloy-primitives = { version = "0.8.7" }
alloy-rpc-types = { version = "0.5.3" }
alloy-signer-local = { version = "0.5.3", features = ["mnemonic"] }
alloy-consensus = "0.6.4"
alloy-eips = "0.6.4"
alloy-network = "0.6.4"
alloy-primitives = "0.8.11"
alloy-rpc-types = "0.6.4"
alloy-signer-local = { version = "0.6.4", features = ["mnemonic"] }

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

# reth
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050", features = [
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf", features = [
"optimism",
] }
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050", features = [
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf", features = [
"optimism",
] }
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050", features = [
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf", features = [
"optimism",
] }
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050", features = [
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf", features = [
"optimism",
] }
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050", features = [
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf", features = [
"optimism",
] }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050", features = [
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf", features = [
"optimism",
] }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-network = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-network-types = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", rev = "e98a050" }
revm-precompile ={version= "14.0.0",features=["secp256r1"]}
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-network = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-network-types = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", rev = "4b4f9cf" }
revm-primitives = { version = "14.0.0" }
revm-precompile = { version = "15.0.0", features = ["secp256r1"] }

# metrics
metrics = "0.23.0"
Expand Down
4 changes: 2 additions & 2 deletions bin/odyssey/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use odyssey_wallet::{OdysseyWallet, OdysseyWalletApiServer};
use odyssey_walltime::{OdysseyWallTime, OdysseyWallTimeRpcApiServer};
use reth_node_builder::{engine_tree_config::TreeConfig, EngineNodeLauncher};
use reth_optimism_cli::Cli;
use reth_optimism_node::{args::RollupArgs, node::OptimismAddOns};
use reth_optimism_node::{args::RollupArgs, node::OpAddOns};
use reth_provider::{providers::BlockchainProvider2, CanonStateSubscriptions};
use tracing::{info, warn};

Expand All @@ -54,7 +54,7 @@ fn main() {
let node = builder
.with_types_and_provider::<OdysseyNode, BlockchainProvider2<_>>()
.with_components(OdysseyNode::components(&rollup_args))
.with_add_ons(OptimismAddOns::new(rollup_args.sequencer_http.clone()))
.with_add_ons(OpAddOns::new(rollup_args.sequencer_http.clone()))
.extend_rpc_modules(move |ctx| {
// register odyssey wallet namespace
if let Ok(sk) = std::env::var("EXP1_SK") {
Expand Down
5 changes: 5 additions & 0 deletions crates/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ categories.workspace = true

[dependencies]
revm-precompile.workspace = true
revm-primitives.workspace = true

reth-cli.workspace = true
reth-node-api.workspace = true
reth-node-builder.workspace = true
Expand All @@ -23,9 +25,12 @@ reth-primitives.workspace = true
reth-evm.workspace = true
reth-revm.workspace = true
reth-transaction-pool.workspace = true
reth-trie-db.workspace = true
reth-network.workspace = true
reth-network-types.workspace = true

alloy-consensus.workspace = true
alloy-eips.workspace = true
alloy-primitives.workspace = true

serde_json.workspace = true
Expand Down
16 changes: 8 additions & 8 deletions crates/node/src/chainspec.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//! Odyssey chainspec parsing logic.
use std::sync::LazyLock;

use alloy_eips::eip1559::ETHEREUM_BLOCK_GAS_LIMIT;
use alloy_primitives::{b256, U256};
use reth_chainspec::{
once_cell_set, BaseFeeParams, BaseFeeParamsKind, Chain, ChainHardforks, ChainSpec,
EthereumHardfork, ForkCondition, NamedChain,
};
use reth_cli::chainspec::{parse_genesis, ChainSpecParser};
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_forks::OptimismHardfork;
use reth_primitives::constants::ETHEREUM_BLOCK_GAS_LIMIT;
use reth_optimism_forks::OpHardfork;
use std::sync::Arc;

/// Odyssey forks.
Expand All @@ -32,10 +32,10 @@ pub static ODYSSEY_FORKS: LazyLock<ChainHardforks> = LazyLock::new(|| {
),
(EthereumHardfork::Shanghai.boxed(), ForkCondition::Timestamp(0)),
(EthereumHardfork::Cancun.boxed(), ForkCondition::Timestamp(0)),
(OptimismHardfork::Regolith.boxed(), ForkCondition::Timestamp(0)),
(OptimismHardfork::Bedrock.boxed(), ForkCondition::Block(0)),
(OptimismHardfork::Ecotone.boxed(), ForkCondition::Timestamp(0)),
(OptimismHardfork::Canyon.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)),
(EthereumHardfork::Prague.boxed(), ForkCondition::Timestamp(0)),
])
});
Expand Down Expand Up @@ -71,7 +71,7 @@ pub static ODYSSEY_MAINNET: LazyLock<Arc<OpChainSpec>> = LazyLock::new(|| {
base_fee_params: BaseFeeParamsKind::Variable(
vec![
(EthereumHardfork::London.boxed(), BaseFeeParams::optimism()),
(OptimismHardfork::Canyon.boxed(), BaseFeeParams::optimism_canyon()),
(OpHardfork::Canyon.boxed(), BaseFeeParams::optimism_canyon()),
]
.into(),
),
Expand Down Expand Up @@ -128,7 +128,7 @@ mod tests {
use super::OdysseyChainSpecParser;
use reth_chainspec::EthereumHardforks;
use reth_cli::chainspec::ChainSpecParser;
use reth_optimism_forks::OptimismHardforks;
use reth_optimism_forks::OpHardforks;

#[test]
fn chainspec_parser_adds_prague() {
Expand Down
37 changes: 17 additions & 20 deletions crates/node/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@
//! This currently configures the instructions defined in [EIP3074-instructions](https://github.com/paradigmxyz/eip3074-instructions), and the
//! precompiles defined by [`revm_precompile`].

use alloy_consensus::Header;
use alloy_primitives::{Address, Bytes, TxKind, U256};
use reth_chainspec::{ChainSpec, EthereumHardfork, Head};
use reth_node_api::{ConfigureEvm, ConfigureEvmEnv, NextBlockEnvAttributes};
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_forks::OptimismHardfork;
use reth_primitives::{
revm_primitives::{CfgEnvWithHandlerCfg, TxEnv},
transaction::FillTxEnv,
Header, TransactionSigned,
};
use reth_optimism_chainspec::{DecodeError, OpChainSpec};
use reth_optimism_forks::OpHardfork;
use reth_primitives::{transaction::FillTxEnv, TransactionSigned};
use reth_revm::{
handler::register::EvmHandler,
inspector_handle_register,
Expand All @@ -31,6 +28,7 @@ use reth_revm::{
ContextPrecompiles, Database, Evm, EvmBuilder, GetInspector,
};
use revm_precompile::secp256r1;
use revm_primitives::{CfgEnvWithHandlerCfg, TxEnv};
use std::sync::Arc;

/// Custom EVM configuration
Expand Down Expand Up @@ -72,6 +70,7 @@ impl OdysseyEvmConfig {

impl ConfigureEvmEnv for OdysseyEvmConfig {
type Header = Header;
type Error = DecodeError;

fn fill_tx_env(&self, tx_env: &mut TxEnv, transaction: &TransactionSigned, sender: Address) {
transaction.fill_tx_env(tx_env, sender);
Expand Down Expand Up @@ -170,7 +169,7 @@ impl ConfigureEvmEnv for OdysseyEvmConfig {
&self,
parent: &Self::Header,
attributes: NextBlockEnvAttributes,
) -> (CfgEnvWithHandlerCfg, BlockEnv) {
) -> Result<(CfgEnvWithHandlerCfg, BlockEnv), Self::Error> {
// configure evm env based on parent block
let cfg_env = CfgEnv::default().with_chain_id(self.chain_spec.chain().id());

Expand Down Expand Up @@ -210,13 +209,13 @@ impl ConfigureEvmEnv for OdysseyEvmConfig {
blob_excess_gas_and_price,
};

(
Ok((
CfgEnvWithHandlerCfg {
cfg_env,
handler_cfg: HandlerCfg { spec_id, is_optimism: true },
},
block_env,
)
))
}
}

Expand Down Expand Up @@ -254,17 +253,17 @@ impl ConfigureEvm for OdysseyEvmConfig {
fn revm_spec(chain_spec: &ChainSpec, block: &Head) -> reth_revm::primitives::SpecId {
if chain_spec.fork(EthereumHardfork::Prague).active_at_head(block) {
reth_revm::primitives::OSAKA
} else if chain_spec.fork(OptimismHardfork::Granite).active_at_head(block) {
} else if chain_spec.fork(OpHardfork::Granite).active_at_head(block) {
reth_revm::primitives::GRANITE
} else if chain_spec.fork(OptimismHardfork::Fjord).active_at_head(block) {
} else if chain_spec.fork(OpHardfork::Fjord).active_at_head(block) {
reth_revm::primitives::FJORD
} else if chain_spec.fork(OptimismHardfork::Ecotone).active_at_head(block) {
} else if chain_spec.fork(OpHardfork::Ecotone).active_at_head(block) {
reth_revm::primitives::ECOTONE
} else if chain_spec.fork(OptimismHardfork::Canyon).active_at_head(block) {
} else if chain_spec.fork(OpHardfork::Canyon).active_at_head(block) {
reth_revm::primitives::CANYON
} else if chain_spec.fork(OptimismHardfork::Regolith).active_at_head(block) {
} else if chain_spec.fork(OpHardfork::Regolith).active_at_head(block) {
reth_revm::primitives::REGOLITH
} else if chain_spec.fork(OptimismHardfork::Bedrock).active_at_head(block) {
} else if chain_spec.fork(OpHardfork::Bedrock).active_at_head(block) {
reth_revm::primitives::BEDROCK
} else if chain_spec.fork(EthereumHardfork::Prague).active_at_head(block) {
reth_revm::primitives::PRAGUE
Expand Down Expand Up @@ -304,10 +303,8 @@ fn revm_spec(chain_spec: &ChainSpec, block: &Head) -> reth_revm::primitives::Spe
mod tests {
use super::*;
use reth_chainspec::{Chain, ChainSpecBuilder, EthereumHardfork};
use reth_primitives::{
revm_primitives::{BlockEnv, CfgEnv, SpecId},
ForkCondition,
};
use reth_primitives::ForkCondition;
use revm_primitives::{BlockEnv, CfgEnv, SpecId};

#[test]
fn test_fill_cfg_and_block_env() {
Expand Down
Loading

0 comments on commit 9c06a05

Please sign in to comment.