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 OptimismEngineTypes to OpEngineTypes #12285

Merged
merged 1 commit into from
Nov 3, 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
18 changes: 9 additions & 9 deletions crates/optimism/node/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ use reth_optimism_payload_builder::{
/// The types used in the optimism beacon consensus engine.
#[derive(Debug, Default, Clone, serde::Deserialize, serde::Serialize)]
#[non_exhaustive]
pub struct OptimismEngineTypes<T: PayloadTypes = OpPayloadTypes> {
pub struct OpEngineTypes<T: PayloadTypes = OpPayloadTypes> {
_marker: std::marker::PhantomData<T>,
}

impl<T: PayloadTypes> PayloadTypes for OptimismEngineTypes<T> {
impl<T: PayloadTypes> PayloadTypes for OpEngineTypes<T> {
type BuiltPayload = T::BuiltPayload;
type PayloadAttributes = T::PayloadAttributes;
type PayloadBuilderAttributes = T::PayloadBuilderAttributes;
}

impl<T: PayloadTypes> EngineTypes for OptimismEngineTypes<T>
impl<T: PayloadTypes> EngineTypes for OpEngineTypes<T>
where
T::BuiltPayload: TryInto<ExecutionPayloadV1>
+ TryInto<ExecutionPayloadEnvelopeV2>
Expand All @@ -45,7 +45,7 @@ where
type ExecutionPayloadEnvelopeV4 = OpExecutionPayloadEnvelopeV4;
}

/// A default payload type for [`OptimismEngineTypes`]
/// A default payload type for [`OpEngineTypes`]
#[derive(Debug, Default, Clone, serde::Deserialize, serde::Serialize)]
#[non_exhaustive]
pub struct OpPayloadTypes;
Expand Down Expand Up @@ -224,7 +224,7 @@ mod test {
let attributes = get_attributes(None, 1799999999);

let result = <engine::OptimismEngineValidator as reth_node_builder::EngineValidator<
OptimismEngineTypes,
OpEngineTypes,
>>::ensure_well_formed_attributes(
&validator, EngineApiMessageVersion::V3, &attributes
);
Expand All @@ -237,7 +237,7 @@ mod test {
let attributes = get_attributes(None, 1800000000);

let result = <engine::OptimismEngineValidator as reth_node_builder::EngineValidator<
OptimismEngineTypes,
OpEngineTypes,
>>::ensure_well_formed_attributes(
&validator, EngineApiMessageVersion::V3, &attributes
);
Expand All @@ -250,7 +250,7 @@ mod test {
let attributes = get_attributes(Some(b64!("0000000000000008")), 1800000000);

let result = <engine::OptimismEngineValidator as reth_node_builder::EngineValidator<
OptimismEngineTypes,
OpEngineTypes,
>>::ensure_well_formed_attributes(
&validator, EngineApiMessageVersion::V3, &attributes
);
Expand All @@ -263,7 +263,7 @@ mod test {
let attributes = get_attributes(Some(b64!("0000000800000008")), 1800000000);

let result = <engine::OptimismEngineValidator as reth_node_builder::EngineValidator<
OptimismEngineTypes,
OpEngineTypes,
>>::ensure_well_formed_attributes(
&validator, EngineApiMessageVersion::V3, &attributes
);
Expand All @@ -276,7 +276,7 @@ mod test {
let attributes = get_attributes(Some(b64!("0000000000000000")), 1800000000);

let result = <engine::OptimismEngineValidator as reth_node_builder::EngineValidator<
OptimismEngineTypes,
OpEngineTypes,
>>::ensure_well_formed_attributes(
&validator, EngineApiMessageVersion::V3, &attributes
);
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub mod args;
/// Exports optimism-specific implementations of the [`EngineTypes`](reth_node_api::EngineTypes)
/// trait.
pub mod engine;
pub use engine::OptimismEngineTypes;
pub use engine::OpEngineTypes;

pub mod node;
pub use node::OptimismNode;
Expand Down
21 changes: 9 additions & 12 deletions crates/optimism/node/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use crate::{
args::RollupArgs,
engine::OptimismEngineValidator,
txpool::{OpTransactionPool, OpTransactionValidator},
OptimismEngineTypes,
OpEngineTypes,
};

/// Optimism primitive types.
Expand Down Expand Up @@ -74,7 +74,7 @@ impl OptimismNode {
>
where
Node: FullNodeTypes<
Types: NodeTypesWithEngine<Engine = OptimismEngineTypes, ChainSpec = OpChainSpec>,
Types: NodeTypesWithEngine<Engine = OpEngineTypes, ChainSpec = OpChainSpec>,
>,
{
let RollupArgs { disable_txpool_gossip, compute_pending_block, discovery_v4, .. } = args;
Expand All @@ -93,9 +93,7 @@ impl OptimismNode {

impl<N> Node<N> for OptimismNode
where
N: FullNodeTypes<
Types: NodeTypesWithEngine<Engine = OptimismEngineTypes, ChainSpec = OpChainSpec>,
>,
N: FullNodeTypes<Types: NodeTypesWithEngine<Engine = OpEngineTypes, ChainSpec = OpChainSpec>>,
{
type ComponentsBuilder = ComponentsBuilder<
N,
Expand Down Expand Up @@ -127,7 +125,7 @@ impl NodeTypes for OptimismNode {
}

impl NodeTypesWithEngine for OptimismNode {
type Engine = OptimismEngineTypes;
type Engine = OpEngineTypes;
}

/// Add-ons w.r.t. optimism.
Expand Down Expand Up @@ -312,10 +310,10 @@ impl OpPayloadBuilder {
evm_config: Evm,
ctx: &BuilderContext<Node>,
pool: Pool,
) -> eyre::Result<PayloadBuilderHandle<OptimismEngineTypes>>
) -> eyre::Result<PayloadBuilderHandle<OpEngineTypes>>
where
Node: FullNodeTypes<
Types: NodeTypesWithEngine<Engine = OptimismEngineTypes, ChainSpec = OpChainSpec>,
Types: NodeTypesWithEngine<Engine = OpEngineTypes, ChainSpec = OpChainSpec>,
>,
Pool: TransactionPool + Unpin + 'static,
Evm: ConfigureEvm<Header = Header>,
Expand Down Expand Up @@ -349,16 +347,15 @@ impl OpPayloadBuilder {

impl<Node, Pool> PayloadServiceBuilder<Node, Pool> for OpPayloadBuilder
where
Node: FullNodeTypes<
Types: NodeTypesWithEngine<Engine = OptimismEngineTypes, ChainSpec = OpChainSpec>,
>,
Node:
FullNodeTypes<Types: NodeTypesWithEngine<Engine = OpEngineTypes, ChainSpec = OpChainSpec>>,
Pool: TransactionPool + Unpin + 'static,
{
async fn spawn_payload_service(
self,
ctx: &BuilderContext<Node>,
pool: Pool,
) -> eyre::Result<PayloadBuilderHandle<OptimismEngineTypes>> {
) -> eyre::Result<PayloadBuilderHandle<OpEngineTypes>> {
self.spawn(OpEvmConfig::new(ctx.chain_spec()), ctx, pool)
}
}
Expand Down
Loading