Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Reth to 1.1.2 #288

Merged
merged 13 commits into from
Dec 18, 2024
845 changes: 449 additions & 396 deletions Cargo.lock

Large diffs are not rendered by default.

152 changes: 75 additions & 77 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = [
"crates/rbuilder/src/telemetry/metrics_macros",
"crates/transaction-pool-bundle-ext",
"crates/transaction-pool-bundle-ext/bundle_pool_ops/rbuilder",
"crates/eth-sparse-mpt"
"crates/eth-sparse-mpt",
]
default-members = ["crates/rbuilder", "crates/reth-rbuilder"]
resolver = "2"
Expand All @@ -30,97 +30,95 @@ version = "0.1.0"
edition = "2021"

[workspace.dependencies]
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-beacon-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-db-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-libmdbx = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-trie = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-trie-parallel = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1", features = ["test-utils"] }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-execution-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-optimism-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-auto-seal-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-rpc-types-compat = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-rpc-api-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-discv4 = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-discv5 = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-network = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.1" }
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-beacon-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-db-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-libmdbx = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-trie = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-trie-parallel = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2", features = [
"test-utils",
] }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-execution-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-optimism-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-auto-seal-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-rpc-types-compat = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-rpc-api-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-discv4 = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-discv5 = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-network = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.1.2" }

# version is copied from reth "v1.1.1" dependencies
revm = { version = "17.0.0", features = [
# version is copied from reth "v1.1.2" dependencies
revm = { version = "18.0.0", features = [
"std",
"secp256k1",
"optional_balance_check",
], default-features = false }
revm-inspectors = "0.10.0"
revm-primitives = { version = "13.0.0", features = [
revm-inspectors = "0.11.0"
revm-primitives = { version = "14.0.0", features = [
"std",
], default-features = false }

ethereum_ssz_derive = "0.8"
ethereum_ssz = "0.8"

alloy-primitives = { version = "0.8.9", default-features = false }
alloy-primitives = { version = "0.8.11", default-features = false }
alloy-rlp = "0.3.4"
alloy-chains = "0.1.33"
alloy-provider = { version = "0.5.4", features = ["ipc", "pubsub"] }
alloy-pubsub = { version = "0.5.4" }
alloy-eips = { version = "0.5.4" }
alloy-rpc-types = { version = "0.5.4" }
alloy-json-rpc = { version = "0.5.4" }
alloy-transport-http = { version = "0.5.4" }
alloy-network = { version = "0.5.4" }
alloy-transport = { version = "0.5.4" }
alloy-node-bindings = { version = "0.5.4" }
alloy-consensus = { version = "0.5.4", features = ["kzg"] }
op-alloy-consensus = { version = "0.5.2", features = ["kzg"] }
alloy-serde = { version = "0.5.4" }
alloy-rpc-types-beacon = { version = "0.5.4", features = [
"ssz",
] }
alloy-rpc-types-engine = { version = "0.5.4", features = [
"ssz",
] }
alloy-rpc-types-eth = { version = "0.5.4" }
alloy-signer-local = { version = "0.5.4" }
alloy-genesis = { version = "0.5.4" }
alloy-provider = { version = "0.6.4", features = ["ipc", "pubsub"] }
alloy-pubsub = { version = "0.6.4" }
alloy-eips = { version = "0.6.4" }
alloy-rpc-types = { version = "0.6.4" }
alloy-json-rpc = { version = "0.6.4" }
alloy-transport-http = { version = "0.6.4" }
alloy-network = { version = "0.6.4" }
alloy-network-primitives = { version = "0.6.4" }
alloy-transport = { version = "0.6.4" }
alloy-node-bindings = { version = "0.6.4" }
alloy-consensus = { version = "0.6.4", features = ["kzg"] }
op-alloy-consensus = { version = "0.6.8", features = ["kzg"] }
alloy-serde = { version = "0.6.4" }
alloy-rpc-types-beacon = { version = "0.6.4", features = ["ssz"] }
alloy-rpc-types-engine = { version = "0.6.4", features = ["ssz"] }
alloy-rpc-types-eth = { version = "0.6.4" }
alloy-signer-local = { version = "0.6.4" }
alloy-genesis = { version = "0.6.4" }
alloy-trie = { version = "0.7" }


async-trait = { version = "0.1.83" }
clap = { version = "4.4.3" }
thiserror = { version = "1.0.64" }
Expand Down
5 changes: 4 additions & 1 deletion crates/op-rbuilder/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ op-rbuilder-payload-builder = { path = "../payload_builder" }
transaction-pool-bundle-ext = { path = "../../transaction-pool-bundle-ext" }
rbuilder-bundle-pool-operations = { path = "../../transaction-pool-bundle-ext/bundle_pool_ops/rbuilder" }

# alloy
alloy-consensus.workspace = true

# reth
reth-payload-builder.workspace = true
reth-primitives.workspace = true
Expand Down Expand Up @@ -37,5 +40,5 @@ optimism = [
"reth-optimism-node/optimism",
"reth-primitives/optimism",
"reth-provider/optimism",
"op-rbuilder-payload-builder/optimism"
"op-rbuilder-payload-builder/optimism",
]
17 changes: 10 additions & 7 deletions crates/op-rbuilder/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//! Inherits Network, Executor, and Consensus Builders from the optimism node,
//! and overrides the Pool and Payload Builders.

use alloy_consensus::Header;
use rbuilder_bundle_pool_operations::BundlePoolOps;
use reth_basic_payload_builder::{BasicPayloadJobGenerator, BasicPayloadJobGeneratorConfig};
use reth_evm::ConfigureEvm;
Expand All @@ -16,12 +17,12 @@ use reth_node_builder::{
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_evm::OpEvmConfig;
use reth_optimism_node::{
node::{OpConsensusBuilder, OpExecutorBuilder, OpNetworkBuilder, OpPrimitives, OptimismAddOns},
node::{OpAddOns, OpConsensusBuilder, OpExecutorBuilder, OpNetworkBuilder, OpPrimitives},
txpool::OpTransactionValidator,
OpEngineTypes,
};
use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService};
use reth_primitives::{Header, TransactionSigned};
use reth_primitives::TransactionSigned;
use reth_provider::{BlockReader, CanonStateSubscriptions, DatabaseProviderFactory};
use reth_tracing::tracing::{debug, info};
use reth_transaction_pool::{
Expand All @@ -37,11 +38,14 @@ use transaction_pool_bundle_ext::{
use crate::args::OpRbuilderArgs;

/// Optimism primitive types.
#[derive(Debug)]
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct OpRbuilderPrimitives;

impl NodePrimitives for OpRbuilderPrimitives {
type Block = reth_primitives::Block;
type SignedTx = reth_primitives::TransactionSigned;
type TxType = reth_primitives::TxType;
type Receipt = reth_primitives::Receipt;
}

/// Type configuration for an Optimism rbuilder.
Expand Down Expand Up @@ -109,17 +113,16 @@ where
OpConsensusBuilder,
>;

type AddOns = OptimismAddOns<
NodeAdapter<N, <Self::ComponentsBuilder as NodeComponentsBuilder<N>>::Components>,
>;
type AddOns =
OpAddOns<NodeAdapter<N, <Self::ComponentsBuilder as NodeComponentsBuilder<N>>::Components>>;

fn components_builder(&self) -> Self::ComponentsBuilder {
let Self { args } = self;
Self::components(args.clone())
}

fn add_ons(&self) -> Self::AddOns {
OptimismAddOns::new(self.args.sequencer_http.clone())
OpAddOns::new(self.args.sequencer_http.clone())
}
}

Expand Down
3 changes: 1 addition & 2 deletions crates/op-rbuilder/payload_builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ optimism = [
"reth-execution-types/optimism",
"reth-optimism-evm/optimism",
"reth-optimism-node/optimism",
"reth-optimism-payload-builder/optimism",
"reth-primitives/optimism",
"reth-provider/optimism",
"revm/optimism",
"reth-optimism-consensus/optimism"
"reth-optimism-consensus/optimism",
]
20 changes: 10 additions & 10 deletions crates/op-rbuilder/payload_builder/src/builder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Optimism payload builder implementation with Flashbots bundle support.

use alloy_consensus::{BlockHeader, Transaction, EMPTY_OMMER_ROOT_HASH};
use alloy_consensus::{BlockHeader, Header, Transaction, EMPTY_OMMER_ROOT_HASH};
use alloy_eips::merge::BEACON_NONCE;
use alloy_rpc_types_beacon::events::{PayloadAttributesData, PayloadAttributesEvent};
use alloy_rpc_types_engine::payload::PayloadAttributes;
Expand All @@ -12,12 +12,12 @@ use reth_evm::{system_calls::SystemCaller, ConfigureEvm, ConfigureEvmEnv, NextBl
use reth_execution_types::ExecutionOutcome;
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_consensus::calculate_receipt_root_no_memo_optimism;
use reth_optimism_forks::OptimismHardforks;
use reth_optimism_forks::OpHardforks;
use reth_optimism_node::{OpBuiltPayload, OpPayloadBuilderAttributes};
use reth_optimism_payload_builder::error::OptimismPayloadBuilderError;
use reth_optimism_payload_builder::error::OpPayloadBuilderError;
use reth_payload_builder::PayloadBuilderError;
use reth_payload_primitives::PayloadBuilderAttributes;
use reth_primitives::{proofs, Block, BlockBody, Header, Receipt, TransactionSigned, TxType};
use reth_primitives::{proofs, Block, BlockBody, Receipt, TransactionSigned, TxType};
use reth_provider::StateProviderFactory;
use reth_revm::database::StateProviderDatabase;
use reth_trie::HashedPostState;
Expand Down Expand Up @@ -257,7 +257,7 @@ where
)
.map_err(|err| {
warn!(target: "payload_builder", %err, "missing create2 deployer, skipping block.");
PayloadBuilderError::other(OptimismPayloadBuilderError::ForceCreate2DeployerFail)
PayloadBuilderError::other(OpPayloadBuilderError::ForceCreate2DeployerFail)
})?;

let mut receipts = Vec::with_capacity(attributes.transactions.len());
Expand All @@ -270,7 +270,7 @@ where
// A sequencer's block should never contain blob transactions.
if sequencer_tx.value().is_eip4844() {
return Err(PayloadBuilderError::other(
OptimismPayloadBuilderError::BlobTransactionRejected,
OpPayloadBuilderError::BlobTransactionRejected,
));
}

Expand All @@ -283,7 +283,7 @@ where
.clone()
.try_into_ecrecovered()
.map_err(|_| {
PayloadBuilderError::other(OptimismPayloadBuilderError::TransactionEcRecoverFailed)
PayloadBuilderError::other(OpPayloadBuilderError::TransactionEcRecoverFailed)
})?;

// Cache the depositor account prior to the state transition for the deposit nonce.
Expand All @@ -298,7 +298,7 @@ where
})
.transpose()
.map_err(|_| {
PayloadBuilderError::other(OptimismPayloadBuilderError::AccountLoadFailed(
PayloadBuilderError::other(OpPayloadBuilderError::AccountLoadFailed(
sequencer_tx.signer(),
))
})?;
Expand Down Expand Up @@ -386,7 +386,7 @@ where

// convert tx to a signed transaction
let tx = pool_tx.try_into_ecrecovered().map_err(|_| {
PayloadBuilderError::other(OptimismPayloadBuilderError::TransactionEcRecoverFailed)
PayloadBuilderError::other(OpPayloadBuilderError::TransactionEcRecoverFailed)
})?;

let env = EnvWithHandlerCfg::new_with_cfg_env(
Expand Down Expand Up @@ -583,7 +583,7 @@ where

let payload = OpBuiltPayload::new(
attributes.payload_attributes.id,
sealed_block,
Arc::new(sealed_block),
total_fees,
chain_spec,
attributes,
Expand Down
4 changes: 2 additions & 2 deletions crates/op-rbuilder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use reth::{
providers::providers::BlockchainProvider2,
};
use reth_optimism_cli::{chainspec::OpChainSpecParser, Cli};
use reth_optimism_node::node::OptimismAddOns;
use reth_optimism_node::node::OpAddOns;
use tracing as _;

// jemalloc provides better performance
Expand Down Expand Up @@ -71,7 +71,7 @@ fn main() {
let handle = builder
.with_types_and_provider::<OpRbuilderNode, BlockchainProvider2<_>>()
.with_components(OpRbuilderNode::components(op_rbuilder_args))
.with_add_ons(OptimismAddOns::new(sequencer_http_arg))
.with_add_ons(OpAddOns::new(sequencer_http_arg))
.extend_rpc_modules(move |ctx| {
// register eth bundle api
let ext = EthBundleMinimalApi::new(ctx.registry.pool().clone());
Expand Down
14 changes: 7 additions & 7 deletions crates/rbuilder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ alloy-rpc-types.workspace = true
alloy-json-rpc.workspace = true
alloy-transport-http.workspace = true
alloy-network.workspace = true
alloy-network-primitives.workspace = true
alloy-transport.workspace = true
alloy-rpc-types-beacon.workspace = true
alloy-rpc-types-engine.workspace = true
Expand Down Expand Up @@ -139,16 +140,15 @@ criterion = { version = "0.5.1", features = ["html_reports", "async_tokio"] }

[features]
optimism = [
"reth-db/optimism",
"reth-node-core/optimism",
"reth-primitives/optimism",
"reth-provider/optimism",
"revm-primitives/optimism",
"revm/optimism"
"reth-db/optimism",
"reth-node-core/optimism",
"reth-primitives/optimism",
"reth-provider/optimism",
"revm-primitives/optimism",
"revm/optimism",
]
redact-sensitive = []

[[bench]]
name = "bench_main"
harness = false

Loading
Loading