Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,567 changes: 1,265 additions & 1,302 deletions Cargo.lock

Large diffs are not rendered by default.

76 changes: 63 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ members = [
"e2e-tests",
"xtask",
]
exclude = ["crates/op-reth"]

default-members = ["bin/world-chain"]

Expand Down Expand Up @@ -57,7 +58,11 @@ world-chain-pool = { path = "crates/pool", default-features = false }
world-chain-test-utils = { path = "crates/test-utils", default-features = false }

# reth crates.io
reth-codecs = { version = "0.1.0", default-features = false, features = [
"alloy",
] }
reth-primitives-traits = { version = "0.1.0", default-features = false }
reth-zstd-compressors = { version = "0.1.0", default-features = false }

# reth github
reth-trie-parallel = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0", default-features = false }
Expand Down Expand Up @@ -109,27 +114,59 @@ reth-tracing = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0", de
reth-rpc-layer = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0", default-features = false }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0", default-features = false }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0", default-features = false }
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-cli-runner = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-consensus-common = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0", default-features = false }
reth-db-common = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-downloaders = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0", default-features = false }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-execution-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0", default-features = false }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0", default-features = false }
reth-exex = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-exex-test-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-fs-util = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-metrics = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-node-events = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-node-metrics = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-prune = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-stages = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-static-file = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0" }
reth-static-file-types = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0", default-features = false }
reth-storage-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v2.0.0", default-features = false }

# reth-optimism
reth-optimism-evm = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
reth-optimism-node = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
reth-optimism-cli = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
reth-optimism-rpc = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
reth-optimism-consensus = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
reth-optimism-chainspec = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
reth-optimism-payload-builder = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
reth-optimism-forks = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
reth-optimism-primitives = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
reth-optimism-storage = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
reth-optimism-flashblocks = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
# Local op-reth surface.
reth-optimism-chainspec = { package = "world-chain-op-chainspec", path = "crates/op-reth/chainspec", default-features = false }
reth-optimism-cli = { package = "world-chain-op-cli", path = "crates/op-reth/cli", default-features = false }
reth-optimism-consensus = { package = "world-chain-op-consensus", path = "crates/op-reth/consensus", default-features = false }
reth-optimism-evm = { package = "world-chain-op-evm", path = "crates/op-reth/evm", default-features = false }
reth-optimism-exex = { package = "world-chain-op-exex", path = "crates/op-reth/exex", default-features = false }
reth-optimism-flashblocks = { package = "world-chain-op-flashblocks", path = "crates/op-reth/flashblocks", default-features = false }
reth-optimism-forks = { package = "world-chain-op-forks", path = "crates/op-reth/forks", default-features = false }
reth-optimism-node = { package = "world-chain-op-node", path = "crates/op-reth/node", default-features = false }
reth-optimism-payload-builder = { package = "world-chain-op-payload", path = "crates/op-reth/payload", default-features = false }
reth-optimism-primitives = { package = "world-chain-op-primitives", path = "crates/op-reth/primitives", default-features = false }
reth-optimism-rpc = { package = "world-chain-op-rpc", path = "crates/op-reth/rpc", default-features = false }
reth-optimism-storage = { package = "world-chain-op-storage", path = "crates/op-reth/storage", default-features = false }
reth-optimism-trie = { package = "world-chain-op-trie", path = "crates/op-reth/trie", default-features = false }
reth-optimism-txpool = { package = "world-chain-op-txpool", path = "crates/op-reth/txpool", default-features = false }
proptest-arbitrary-interop = "0.1"
rand_08 = { package = "rand", version = "0.8", default-features = false }
rstest = "0.23"
secp256k1 = { version = "0.30", default-features = false }

# alloy op
op-alloy-consensus = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
op-alloy-rpc-types = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
op-alloy-rpc-types-engine = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
op-alloy-rpc-jsonrpsee = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
op-alloy-network = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
alloy-op-hardforks = { version = "0.4.7", default-features = false }
alloy-op-hardforks = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
op-alloy-provider = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
op-alloy-flz = { version = "0.13.1", default-features = false }

# alloy
alloy = { version = "1.8.2" }
Expand Down Expand Up @@ -187,6 +224,7 @@ revm-interpreter = { version = "34.0.0", default-features = false }
revm-database-interface = { version = "10.0.0", default-features = false }
op-revm = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
revm-inspectors = "0.36.1"
c-kzg = { version = "2.1.5", default-features = false }

alloy-op-evm = { git = "https://github.com/ethereum-optimism/optimism", tag = "op-reth/v2.1.0", default-features = false }
alloy-evm = { version = "0.30.0", default-features = false }
Expand Down Expand Up @@ -217,6 +255,9 @@ semaphore-rs-proof = "0.5"
clap = { version = "4", features = ["derive", "env"] }
eyre = { version = "0.6", package = "color-eyre" }
serde = { version = "1", features = ["derive"] }
serde_with = { version = "3.16", default-features = false, features = [
"macros",
] }
tracing = "0.1"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
parking_lot = "0.12"
Expand All @@ -229,6 +270,7 @@ tempfile = "3"
criterion = { version = "0.8", features = ["async_tokio"] }
test-case = "3"
serde_json = "1"
bincode = { version = "2.0.1", features = ["serde"] }
rand = { version = "0.9", features = ["small_rng"] }
reqwest = { version = "0.12", default-features = false }
bon = "3.3.0"
Expand All @@ -250,6 +292,14 @@ once_cell = "1.19"
lru = "0.16"
either = { version = "1.15.0", default-features = false }
pin-project = "1.0.1"
humantime = "2.3"
miniz_oxide = "0.9.0"
mockall = "0.14.0"
modular-bitfield = "0.13.1"
paste = "1.0"
ringbuffer = "0.16.0"
serial_test = "3"
tar-no-std = { version = "0.4.2", default-features = false }

# Test
testcontainers = "0.27"
Expand Down
5 changes: 1 addition & 4 deletions bin/world-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@ workspace = true
# world-chain
world-chain-cli.workspace = true
world-chain-node.workspace = true
world-chain-primitives.workspace = true
world-chain-rpc.workspace = true

# reth
reth-cli-util.workspace = true
reth-node-builder.workspace = true
reth-tracing.workspace = true

# op-reth
reth-optimism-cli.workspace = true
reth-optimism-evm.workspace = true

reth-provider.workspace = true

# misc
Expand Down
4 changes: 2 additions & 2 deletions bin/world-chain/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use clap::Parser;
use eyre::config::HookBuilder;
use reth_node_builder::NodeHandle;
use reth_optimism_cli::{Cli, chainspec::OpChainSpecParser};
use reth_optimism_evm::{OpEvmConfig, OpRethReceiptBuilder};
use world_chain_primitives::{Cli, OpChainSpecParser};
use world_chain_primitives::{OpEvmConfig, OpRethReceiptBuilder};
use reth_provider::ChainSpecProvider;
use reth_tracing::tracing::info;
use world_chain_cli::{WorldChainArgs, WorldChainNodeConfig, WorldChainRpcModuleValidator};
Expand Down
8 changes: 1 addition & 7 deletions crates/builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ reth-revm.workspace = true
reth-primitives-traits.workspace = true

# op-reth
reth-optimism-forks.workspace = true
reth-optimism-node.workspace = true
reth-optimism-payload-builder.workspace = true
reth-optimism-primitives.workspace = true
reth-optimism-chainspec.workspace = true
reth-optimism-evm.workspace = true
alloy-op-hardforks.workspace = true

# alloy
alloy-consensus.workspace = true
Expand Down Expand Up @@ -77,7 +72,6 @@ world-chain-test-utils.workspace = true
world-chain-builder.workspace = true
world-chain-p2p = { workspace = true, features = ["test-utils"] }
world-chain-node.workspace = true
reth-optimism-node = { workspace = true, features = ["test-utils"] }
reth-tasks.workspace = true
serde.workspace = true
serde_json.workspace = true
Expand Down
25 changes: 12 additions & 13 deletions crates/builder/benches/flashblock_building_live_node.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
use std::sync::Arc;

use alloy_primitives::{Address, B256, Bytes};
use alloy_primitives::{Address, Bytes, B256};
use alloy_rpc_types_engine::PayloadAttributes as RpcPayloadAttributes;
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use reth_basic_payload_builder::{BuildArguments, BuildOutcome, PayloadConfig};
use reth_optimism_node::{
OpPayloadAttributes, payload::OpPayloadAttrs, utils::optimism_payload_attributes,
};
use reth_optimism_payload_builder::config::OpBuilderConfig;
use reth_payload_primitives::PayloadAttributes as _;
use reth_provider::{StateProvider, StateProviderFactory};
use world_chain_builder::{
WorldChainPayloadBuilderCtxBuilder, payload_builder::FlashblocksPayloadBuilder,
traits::payload_builder::FlashblockPayloadBuilder,
payload_builder::FlashblocksPayloadBuilder, traits::payload_builder::FlashblockPayloadBuilder,
WorldChainPayloadBuilderCtxBuilder,
};
use world_chain_node::context::WorldChainDefaultContext;
use world_chain_primitives::{
optimism_payload_attributes, OpBuilderConfig, OpPayloadAttributes, OpPayloadAttrs,
};
use world_chain_test_utils::{
PBH_DEV_ENTRYPOINT, PBH_DEV_SIGNATURE_AGGREGATOR,
builder::{
CHAIN_SPEC, build_flashblock_fixture_eth_transfers_with_provider,
build_flashblock_fixture_eth_transfers_with_provider,
build_flashblock_fixture_fib_with_provider,
build_flashblock_fixture_world_id_like_bn254_with_provider,
build_flashblock_fixture_world_id_like_bn254_with_provider, CHAIN_SPEC,
},
e2e_harness::setup::{
TX_SET_L1_BLOCK, encode_eip1559_params, setup_with_block_uncompressed_size_limit,
encode_eip1559_params, setup_with_block_uncompressed_size_limit, TX_SET_L1_BLOCK,
},
utils::signer,
PBH_DEV_ENTRYPOINT, PBH_DEV_SIGNATURE_AGGREGATOR,
};

const TOTAL_TX_COUNTS: [usize; 3] = [50, 500, 1000];
Expand Down Expand Up @@ -81,7 +80,7 @@ where
fn build_live_payload_builder<Pool, Client>(
pool: Pool,
client: Client,
evm_config: reth_optimism_node::OpEvmConfig,
evm_config: world_chain_primitives::OpEvmConfig,
bal_enabled: bool,
) -> FlashblocksPayloadBuilder<Pool, Client, WorldChainPayloadBuilderCtxBuilder, ()>
where
Expand Down
4 changes: 2 additions & 2 deletions crates/builder/benches/flashblock_validation_live_node.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
use futures::StreamExt;
use reth_chain_state::ExecutedBlock;
use reth_optimism_node::utils::optimism_payload_attributes;
use reth_optimism_primitives::OpPrimitives;
use world_chain_primitives::optimism_payload_attributes;
use world_chain_primitives::OpPrimitives;
use reth_provider::{StateProvider, StateProviderFactory};
use std::sync::Arc;
use world_chain_node::context::WorldChainDefaultContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::sync::Arc;
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
use futures::StreamExt;
use reth_chain_state::ExecutedBlock;
use reth_optimism_primitives::OpPrimitives;
use world_chain_primitives::OpPrimitives;
use world_chain_test_utils::builder::{
BenchProvider, CHAIN_SPEC, EVM_CONFIG, build_flashblock_fixture_eth_transfers,
build_flashblock_fixture_fib, build_flashblock_fixture_world_id_like_bn254,
Expand Down
8 changes: 4 additions & 4 deletions crates/builder/src/bal_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ use reth_evm::{
block::{BlockExecutionError, BlockExecutor, InternalBlockExecutionError},
};
use reth_node_api::NodePrimitives;
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_evm::OpRethReceiptBuilder;
use reth_optimism_primitives::OpTransactionSigned;
use world_chain_primitives::OpChainSpec;
use world_chain_primitives::OpRethReceiptBuilder;
use world_chain_primitives::OpTransactionSigned;
use reth_payload_primitives::BuiltPayload;
use reth_primitives_traits::{Recovered, RecoveredBlock, SealedHeader};
use reth_trie_common::updates::TrieUpdates;
Expand All @@ -33,7 +33,7 @@ use reth_evm::{
block::CommitChanges,
execute::{BlockAssemblerInput, BlockBuilder, BlockBuilderOutcome, ExecutorTx},
};
use reth_optimism_node::{OpBlockAssembler, OpBuiltPayload};
use world_chain_primitives::{OpBlockAssembler, OpBuiltPayload};
use reth_provider::StateProvider;
use revm::{context::result::ExecutionResult, database::states::bundle_state::BundleRetention};
use std::{sync::Arc, time::Instant};
Expand Down
8 changes: 4 additions & 4 deletions crates/builder/src/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use reth_chain_state::ExecutedBlock;
use reth_evm::ConfigureEvm;
use reth_node_api::{BuiltPayload as _, Events, FullNodeTypes, NodePrimitives, NodeTypes};
use reth_node_builder::BuilderContext;
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_evm::OpNextBlockEnvAttributes;
use reth_optimism_node::{OpBuiltPayload, OpEngineTypes, OpEvmConfig};
use reth_optimism_primitives::OpPrimitives;
use world_chain_primitives::OpChainSpec;
use world_chain_primitives::OpNextBlockEnvAttributes;
use world_chain_primitives::{OpBuiltPayload, OpEngineTypes, OpEvmConfig};
use world_chain_primitives::OpPrimitives;
use world_chain_p2p::protocol::{
event::{ChainEvent, WorldChainEvent, WorldChainEventsStream},
handler::FlashblocksHandle,
Expand Down
40 changes: 16 additions & 24 deletions crates/builder/src/execution_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
state_db::StateDB,
traits::{context::PayloadBuilderCtx, context_builder::PayloadBuilderCtxBuilder},
};
use alloy_consensus::{Block, SignableTransaction, Transaction, transaction::SignerRecoverable};
use alloy_consensus::{transaction::SignerRecoverable, Block, SignableTransaction, Transaction};
use alloy_eips::{Encodable2718, Typed2718};
use alloy_network::{TransactionBuilder, TxSignerSync};
use alloy_primitives::{Address, U256};
Expand All @@ -12,33 +12,23 @@ use eyre::eyre::eyre;
use op_alloy_consensus::EIP1559ParamError;
use op_alloy_rpc_types::OpTransactionRequest;

use alloy_op_hardforks::OpHardforks;
use alloy_rpc_types_engine::PayloadId;
use op_revm::OpSpecId;
use reth_basic_payload_builder::PayloadConfig;
use reth_evm::{
ConfigureEvm, Database, Evm, EvmEnv,
block::{BlockExecutionError, BlockValidationError},
execute::{BlockBuilder, BlockExecutor},
ConfigureEvm, Database, Evm, EvmEnv,
};
use reth_node_api::{NodePrimitives, PayloadBuilderError};
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_forks::OpHardforks;
use reth_optimism_node::{
OpBuiltPayload, OpEvmConfig, OpNextBlockEnvAttributes, OpPayloadBuilderAttributes,
txpool::estimated_da_size::DataAvailabilitySized,
};
use reth_optimism_payload_builder::{
builder::{ExecutionInfo, OpPayloadBuilderCtx},
config::OpBuilderConfig,
};
use reth_optimism_primitives::OpTransactionSigned;
use reth_payload_primitives::BuildNextEnv;
use reth_payload_util::PayloadTransactions;
use reth_primitives_traits::{Recovered, SealedHeader, TxTy};
use reth_provider::{BlockReaderIdExt, ChainSpecProvider, StateProviderFactory};
use reth_revm::cancelled::CancelOnDrop;
use reth_transaction_pool::{BestTransactionsAttributes, PoolTransaction, TransactionPool};
use revm::{DatabaseCommit, context::BlockEnv};
use revm::{context::BlockEnv, DatabaseCommit};
use revm_database::State;
use semaphore_rs::Field;
use std::{collections::HashSet, fmt::Debug, sync::Arc, time::Instant};
Expand All @@ -47,6 +37,11 @@ use world_chain_pool::{
bindings::IPBHEntryPoint::spendNullifierHashesCall,
tx::{WorldChainPoolTransaction, WorldChainPooledTransaction},
};
use world_chain_primitives::{
DataAvailabilitySized, ExecutionInfo, OpBuilderConfig, OpBuiltPayload, OpChainSpec,
OpEvmConfig, OpNextBlockEnvAttributes, OpPayloadBuilderAttributes, OpPayloadBuilderCtx,
OpTransactionSigned,
};

/// Container type that holds all necessities to build a new payload.
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -156,9 +151,9 @@ where
db: &'a mut State<DB>,
) -> Result<
impl BlockBuilder<
Executor: BlockExecutor<Evm: Evm<DB = &'a mut State<DB>, BlockEnv = BlockEnv>>,
Primitives = <Self::Evm as ConfigureEvm>::Primitives,
> + 'a,
Executor: BlockExecutor<Evm: Evm<DB = &'a mut State<DB>, BlockEnv = BlockEnv>>,
Primitives = <Self::Evm as ConfigureEvm>::Primitives,
> + 'a,
PayloadBuilderError,
>
where
Expand Down Expand Up @@ -221,14 +216,11 @@ where
where
Pool: TransactionPool,
Builder: BlockBuilder<
Primitives = <Self::Evm as ConfigureEvm>::Primitives,
Executor: BlockExecutor<
Evm: Evm<
DB: StateDB + DatabaseCommit + reth_evm::Database,
BlockEnv = BlockEnv,
>,
>,
Primitives = <Self::Evm as ConfigureEvm>::Primitives,
Executor: BlockExecutor<
Evm: Evm<DB: StateDB + DatabaseCommit + reth_evm::Database, BlockEnv = BlockEnv>,
>,
>,
Txs: PayloadTransactions<
Transaction: WorldChainPoolTransaction<Consensus = OpTransactionSigned>,
>,
Expand Down
Loading
Loading