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

renamed OptimismPayloadBuilder to OpPayloadBuilder #12234

Merged
merged 1 commit into from
Oct 31, 2024
Merged
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 changes: 1 addition & 1 deletion crates/optimism/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub use node::OptimismNode;
pub mod txpool;

pub use reth_optimism_payload_builder::{
OpBuiltPayload, OpPayloadBuilderAttributes, OptimismPayloadBuilder,
OpBuiltPayload, OpPayloadBuilder, OpPayloadBuilderAttributes,
};

pub use reth_optimism_evm::*;
17 changes: 8 additions & 9 deletions crates/optimism/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl OptimismNode {
) -> ComponentsBuilder<
Node,
OptimismPoolBuilder,
OptimismPayloadBuilder,
OpPayloadBuilder,
OptimismNetworkBuilder,
OptimismExecutorBuilder,
OptimismConsensusBuilder,
Expand All @@ -81,7 +81,7 @@ impl OptimismNode {
ComponentsBuilder::default()
.node_types::<Node>()
.pool(OptimismPoolBuilder::default())
.payload(OptimismPayloadBuilder::new(compute_pending_block))
.payload(OpPayloadBuilder::new(compute_pending_block))
.network(OptimismNetworkBuilder {
disable_txpool_gossip,
disable_discovery_v4: !discovery_v4,
Expand All @@ -100,7 +100,7 @@ where
type ComponentsBuilder = ComponentsBuilder<
N,
OptimismPoolBuilder,
OptimismPayloadBuilder,
OpPayloadBuilder,
OptimismNetworkBuilder,
OptimismExecutorBuilder,
OptimismConsensusBuilder,
Expand Down Expand Up @@ -288,7 +288,7 @@ where

/// A basic optimism payload service builder
#[derive(Debug, Default, Clone)]
pub struct OptimismPayloadBuilder {
pub struct OpPayloadBuilder {
/// By default the pending block equals the latest block
/// to save resources and not leak txs from the tx-pool,
/// this flag enables computing of the pending block
Expand All @@ -300,7 +300,7 @@ pub struct OptimismPayloadBuilder {
pub compute_pending_block: bool,
}

impl OptimismPayloadBuilder {
impl OpPayloadBuilder {
/// Create a new instance with the given `compute_pending_block` flag.
pub const fn new(compute_pending_block: bool) -> Self {
Self { compute_pending_block }
Expand All @@ -320,9 +320,8 @@ impl OptimismPayloadBuilder {
Pool: TransactionPool + Unpin + 'static,
Evm: ConfigureEvm<Header = Header>,
{
let payload_builder =
reth_optimism_payload_builder::OptimismPayloadBuilder::new(evm_config)
.set_compute_pending_block(self.compute_pending_block);
let payload_builder = reth_optimism_payload_builder::OpPayloadBuilder::new(evm_config)
.set_compute_pending_block(self.compute_pending_block);
let conf = ctx.payload_builder_config();

let payload_job_config = BasicPayloadJobGeneratorConfig::default()
Expand All @@ -348,7 +347,7 @@ impl OptimismPayloadBuilder {
}
}

impl<Node, Pool> PayloadServiceBuilder<Node, Pool> for OptimismPayloadBuilder
impl<Node, Pool> PayloadServiceBuilder<Node, Pool> for OpPayloadBuilder
where
Node: FullNodeTypes<
Types: NodeTypesWithEngine<Engine = OptimismEngineTypes, ChainSpec = OpChainSpec>,
Expand Down
12 changes: 6 additions & 6 deletions crates/optimism/payload/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ use op_alloy_consensus::DepositTransaction;

/// Optimism's payload builder
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct OptimismPayloadBuilder<EvmConfig> {
pub struct OpPayloadBuilder<EvmConfig> {
/// The rollup's compute pending block configuration option.
// TODO(clabby): Implement this feature.
pub compute_pending_block: bool,
/// The type responsible for creating the evm.
pub evm_config: EvmConfig,
}

impl<EvmConfig> OptimismPayloadBuilder<EvmConfig> {
/// `OptimismPayloadBuilder` constructor.
impl<EvmConfig> OpPayloadBuilder<EvmConfig> {
/// `OpPayloadBuilder` constructor.
pub const fn new(evm_config: EvmConfig) -> Self {
Self { compute_pending_block: true, evm_config }
}
Expand All @@ -69,7 +69,7 @@ impl<EvmConfig> OptimismPayloadBuilder<EvmConfig> {
self.compute_pending_block
}
}
impl<EvmConfig> OptimismPayloadBuilder<EvmConfig>
impl<EvmConfig> OpPayloadBuilder<EvmConfig>
where
EvmConfig: ConfigureEvmEnv<Header = Header>,
{
Expand All @@ -89,8 +89,8 @@ where
}
}

/// Implementation of the [`PayloadBuilder`] trait for [`OptimismPayloadBuilder`].
impl<Pool, Client, EvmConfig> PayloadBuilder<Pool, Client> for OptimismPayloadBuilder<EvmConfig>
/// Implementation of the [`PayloadBuilder`] trait for [`OpPayloadBuilder`].
impl<Pool, Client, EvmConfig> PayloadBuilder<Pool, Client> for OpPayloadBuilder<EvmConfig>
where
Client: StateProviderFactory + ChainSpecProvider<ChainSpec = OpChainSpec>,
Pool: TransactionPool,
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/payload/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#![cfg(feature = "optimism")]

pub mod builder;
pub use builder::OptimismPayloadBuilder;
pub use builder::OpPayloadBuilder;
pub mod error;
pub mod payload;
pub use payload::{OpBuiltPayload, OpPayloadAttributes, OpPayloadBuilderAttributes};
Loading