Skip to content

Commit

Permalink
Move OpPayloadBuilderCtx to dedicated crate
Browse files Browse the repository at this point in the history
  • Loading branch information
SozinM committed Feb 24, 2025
1 parent 6ea15da commit fa331cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 31 deletions.
40 changes: 13 additions & 27 deletions crates/op-rbuilder/src/payload_builder_vanilla.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,25 @@ use crate::{
generator::{BlockCell, PayloadBuilder},
metrics::OpRBuilderMetrics,
primitives::{
estimate_gas_for_builder_tx, signed_builder_tx, ExecutedPayload, ExecutionInfo,
estimate_gas_for_builder_tx, ExecutedPayload,
OpPayloadBuilderCtx, PayloadBuilderService,
},
tx_signer::Signer,
};
use alloy_consensus::constants::EMPTY_WITHDRAWALS;
use alloy_consensus::{Eip658Value, Header, Transaction, Typed2718, EMPTY_OMMER_ROOT_HASH};
use alloy_consensus::{Header, EMPTY_OMMER_ROOT_HASH};
use alloy_eips::merge::BEACON_NONCE;
use alloy_primitives::private::alloy_rlp::Encodable;
use alloy_primitives::{Bytes, U256};
use alloy_rpc_types_engine::PayloadId;
use alloy_rpc_types_eth::Withdrawals;
use op_alloy_consensus::OpDepositReceipt;
use alloy_primitives::U256;
use reth::builder::{components::PayloadServiceBuilder, node::FullNodeTypes, BuilderContext};
use reth::core::primitives::InMemorySize;
use reth::payload::PayloadBuilderHandle;
use reth_basic_payload_builder::{
BasicPayloadJobGeneratorConfig, BuildOutcome, BuildOutcomeKind, PayloadConfig,
BasicPayloadJobGeneratorConfig, BuildOutcome, BuildOutcomeKind,
};
use reth_chain_state::{ExecutedBlock, ExecutedBlockWithTrieUpdates};
use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardforks};
use reth_chainspec::{ChainSpecProvider, EthChainSpec};
use reth_evm::{
env::EvmEnv, system_calls::SystemCaller, ConfigureEvmEnv, ConfigureEvmFor, Database, Evm,
EvmError, InvalidTxError, NextBlockEnvAttributes,
env::EvmEnv, ConfigureEvmFor, Database, NextBlockEnvAttributes,
};
use reth_execution_types::ExecutionOutcome;
use reth_node_api::NodePrimitives;
Expand All @@ -37,23 +32,20 @@ use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_consensus::calculate_receipt_root_no_memo_optimism;
use reth_optimism_evm::BasicOpReceiptBuilder;
use reth_optimism_evm::OpEvmConfig;
use reth_optimism_evm::{OpReceiptBuilder, ReceiptBuilderCtx};
use reth_optimism_evm::OpReceiptBuilder;
use reth_optimism_forks::OpHardforks;
use reth_optimism_node::OpEngineTypes;
use reth_optimism_payload_builder::config::{OpBuilderConfig, OpDAConfig};
use reth_optimism_payload_builder::config::OpBuilderConfig;
use reth_optimism_payload_builder::OpPayloadPrimitives;
use reth_optimism_payload_builder::{
error::OpPayloadBuilderError,
payload::{OpBuiltPayload, OpPayloadBuilderAttributes},
};
use reth_optimism_payload_builder::payload::{OpBuiltPayload, OpPayloadBuilderAttributes};
use reth_optimism_primitives::{
OpPrimitives, OpTransactionSigned, ADDRESS_L2_TO_L1_MESSAGE_PASSER,
};
use reth_payload_builder_primitives::PayloadBuilderError;
use reth_payload_primitives::PayloadBuilderAttributes;
use reth_payload_util::BestPayloadTransactions;
use reth_payload_util::PayloadTransactions;
use reth_primitives::{transaction::SignedTransactionIntoRecoveredExt, BlockBody, SealedHeader};
use reth_primitives::BlockBody;
use reth_primitives_traits::proofs;
use reth_primitives_traits::Block;
use reth_primitives_traits::RecoveredBlock;
Expand All @@ -66,15 +58,9 @@ use reth_revm::database::StateProviderDatabase;
use reth_transaction_pool::BestTransactionsAttributes;
use reth_transaction_pool::PoolTransaction;
use reth_transaction_pool::TransactionPool;
use revm::{
db::{states::bundle_state::BundleRetention, State},
primitives::{ExecutionResult, ResultAndState},
DatabaseCommit,
};
use std::error::Error as StdError;
use std::{fmt::Display, sync::Arc, time::Instant};
use tokio_util::sync::CancellationToken;
use tracing::{info, trace, warn};
use revm::db::{states::bundle_state::BundleRetention, State};
use std::{sync::Arc, time::Instant};
use tracing::{info, warn};

#[derive(Debug, Clone, Copy, Default)]
#[non_exhaustive]
Expand Down
7 changes: 3 additions & 4 deletions crates/op-rbuilder/src/primitives/payload_builder_ctx.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use super::super::{metrics::OpRBuilderMetrics, tx_signer::Signer};
use super::{signed_builder_tx, ExecutionInfo};
use alloy_consensus::{Eip658Value, Transaction, TxEip1559, Typed2718};
use alloy_consensus::{Eip658Value, Transaction, Typed2718};
use alloy_primitives::private::alloy_rlp::Encodable;
use alloy_primitives::{Address, Bytes, TxKind, U256};
use alloy_primitives::{Bytes, U256};
use alloy_rpc_types_engine::PayloadId;
use alloy_rpc_types_eth::Withdrawals;
use op_alloy_consensus::{OpDepositReceipt, OpTypedTransaction};
use op_alloy_consensus::OpDepositReceipt;
use reth::core::primitives::InMemorySize;
use reth_basic_payload_builder::PayloadConfig;
use reth_chainspec::{EthChainSpec, EthereumHardforks};
Expand All @@ -26,7 +26,6 @@ use reth_payload_builder_primitives::PayloadBuilderError;
use reth_payload_primitives::PayloadBuilderAttributes;
use reth_payload_util::PayloadTransactions;
use reth_primitives::{transaction::SignedTransactionIntoRecoveredExt, SealedHeader};
use reth_primitives_traits::Block;
use reth_provider::ProviderError;
use reth_transaction_pool::BestTransactionsAttributes;
use reth_transaction_pool::PoolTransaction;
Expand Down

0 comments on commit fa331cb

Please sign in to comment.