From cc7372ae52e63a72aebf746d79bbf7c45738debf Mon Sep 17 00:00:00 2001 From: panos Date: Wed, 29 Apr 2026 10:02:12 +0800 Subject: [PATCH 1/2] refactor(engine-api): remove engine_appendBatchSignature and BatchSignature The consensus layer (tendermint/morphnode) no longer calls engine_appendBatchSignature after the batch generation is moved out of the consensus path to the tx-submitter. Remove the no-op stub and its associated BatchSignature type. Corresponds to morph-l2/go-ethereum#319, morph-l2/tendermint#35, and morph-l2/morph#939. --- README.md | 1 - crates/engine-api/src/api.rs | 14 +---------- crates/engine-api/src/rpc.rs | 37 +----------------------------- crates/payload/types/src/lib.rs | 2 +- crates/payload/types/src/params.rs | 18 +-------------- 5 files changed, 4 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 911aaef..b0a216f 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,6 @@ Morph provides a custom L2 Engine API (different from the standard Ethereum Engi | `engine_newL2Block` | Import a new L2 block via `newPayload` + `forkchoiceUpdated` and advance the canonical head | | `engine_newSafeL2Block` | Rebuild and import a safe L2 block from derivation inputs | | `engine_setBlockTags` | Update safe/finalized block tags without importing a block | -| `engine_appendBatchSignature` | Accept a BLS batch signature from the consensus layer (no-op for sync nodes) | ## Contributing diff --git a/crates/engine-api/src/api.rs b/crates/engine-api/src/api.rs index fbcfc3d..e86788d 100644 --- a/crates/engine-api/src/api.rs +++ b/crates/engine-api/src/api.rs @@ -7,7 +7,7 @@ use crate::EngineApiResult; use alloy_primitives::B256; use morph_payload_types::{ - AssembleL2BlockParams, BatchSignature, ExecutableL2Data, GenericResponse, SafeL2Data, + AssembleL2BlockParams, ExecutableL2Data, GenericResponse, SafeL2Data, }; use morph_primitives::MorphHeader; @@ -109,16 +109,4 @@ pub trait MorphL2EngineApi: Send + Sync { safe_block_hash: B256, finalized_block_hash: B256, ) -> EngineApiResult<()>; - - /// Append a BLS batch signature for a given batch hash. - /// - /// Called by the consensus layer when collecting validator signatures for - /// L1 batch submission. For non-sequencer sync nodes, this is a no-op. - async fn append_batch_signature( - &self, - _batch_hash: B256, - _signature: BatchSignature, - ) -> EngineApiResult<()> { - Ok(()) - } } diff --git a/crates/engine-api/src/rpc.rs b/crates/engine-api/src/rpc.rs index 90b6ed5..adbf927 100644 --- a/crates/engine-api/src/rpc.rs +++ b/crates/engine-api/src/rpc.rs @@ -7,7 +7,7 @@ use crate::{EngineApiResult, api::MorphL2EngineApi}; use alloy_primitives::B256; use jsonrpsee::{RpcModule, core::RpcResult, proc_macros::rpc}; use morph_payload_types::{ - AssembleL2BlockParams, BatchSignature, ExecutableL2Data, GenericResponse, SafeL2Data, + AssembleL2BlockParams, ExecutableL2Data, GenericResponse, SafeL2Data, }; use morph_primitives::MorphHeader; use reth_rpc_api::IntoEngineApiRpcModule; @@ -63,22 +63,6 @@ pub trait MorphL2EngineRpc { safe_block_hash: B256, finalized_block_hash: B256, ) -> RpcResult<()>; - - /// Append a BLS batch signature for a given batch hash. - /// - /// Called by the consensus layer when collecting validator signatures for - /// L1 batch submission. Non-sequencer sync nodes accept this call but do - /// not persist the signature. - /// - /// # JSON-RPC Method - /// - /// `engine_appendBatchSignature` - #[method(name = "appendBatchSignature")] - async fn append_batch_signature( - &self, - batch_hash: B256, - signature: BatchSignature, - ) -> RpcResult<()>; } /// Implementation of the L2 Engine RPC API. @@ -182,25 +166,6 @@ where e.into() }) } - - async fn append_batch_signature( - &self, - batch_hash: B256, - _signature: BatchSignature, - ) -> RpcResult<()> { - tracing::debug!( - target: "morph::engine", - %batch_hash, - "RPC appendBatchSignature called (no-op for sync node)" - ); - self.inner - .append_batch_signature(batch_hash, _signature) - .await - .map_err(|e| { - tracing::error!(target: "morph::engine", error = %e, "failed to append batch signature"); - e.into() - }) - } } /// Converts an `EngineApiResult` into a `RpcResult`. diff --git a/crates/payload/types/src/lib.rs b/crates/payload/types/src/lib.rs index 3b51724..a6159f8 100644 --- a/crates/payload/types/src/lib.rs +++ b/crates/payload/types/src/lib.rs @@ -35,7 +35,7 @@ use reth_ethereum_primitives as _; pub use attributes::{MorphPayloadAttributes, MorphPayloadBuilderAttributes}; pub use built::MorphBuiltPayload; pub use executable_l2_data::ExecutableL2Data; -pub use params::{AssembleL2BlockParams, BatchSignature, GenericResponse}; +pub use params::{AssembleL2BlockParams, GenericResponse}; pub use safe_l2_data::SafeL2Data; // ============================================================================= diff --git a/crates/payload/types/src/params.rs b/crates/payload/types/src/params.rs index 4aa66a8..77343b4 100644 --- a/crates/payload/types/src/params.rs +++ b/crates/payload/types/src/params.rs @@ -1,6 +1,6 @@ //! Request/response types for L2 Engine API methods. -use alloy_primitives::{Address, Bytes}; +use alloy_primitives::Bytes; /// Parameters for engine_assembleL2Block. /// @@ -70,22 +70,6 @@ impl GenericResponse { } } -/// BLS batch signature from a sequencer validator. -/// -/// This is sent by the consensus layer via `engine_appendBatchSignature` -/// when collecting validator signatures for L1 batch submission. -/// For non-sequencer nodes this is accepted but not persisted. -#[derive(Debug, Clone, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct BatchSignature { - /// Validator address that produced the signature. - pub signer: Address, - /// BLS public key of the signer. - pub signer_pub_key: Bytes, - /// BLS signature over the batch hash. - pub signature: Bytes, -} - impl From for GenericResponse { fn from(success: bool) -> Self { Self { success } From ec7c735970668918897a21749783e4f97ac582b9 Mon Sep 17 00:00:00 2001 From: panos Date: Wed, 29 Apr 2026 10:05:56 +0800 Subject: [PATCH 2/2] style: apply rustfmt --- crates/engine-api/src/api.rs | 4 +--- crates/engine-api/src/rpc.rs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/engine-api/src/api.rs b/crates/engine-api/src/api.rs index e86788d..f5c9082 100644 --- a/crates/engine-api/src/api.rs +++ b/crates/engine-api/src/api.rs @@ -6,9 +6,7 @@ use crate::EngineApiResult; use alloy_primitives::B256; -use morph_payload_types::{ - AssembleL2BlockParams, ExecutableL2Data, GenericResponse, SafeL2Data, -}; +use morph_payload_types::{AssembleL2BlockParams, ExecutableL2Data, GenericResponse, SafeL2Data}; use morph_primitives::MorphHeader; /// Morph L2 Engine API trait. diff --git a/crates/engine-api/src/rpc.rs b/crates/engine-api/src/rpc.rs index adbf927..3282e17 100644 --- a/crates/engine-api/src/rpc.rs +++ b/crates/engine-api/src/rpc.rs @@ -6,9 +6,7 @@ use crate::{EngineApiResult, api::MorphL2EngineApi}; use alloy_primitives::B256; use jsonrpsee::{RpcModule, core::RpcResult, proc_macros::rpc}; -use morph_payload_types::{ - AssembleL2BlockParams, ExecutableL2Data, GenericResponse, SafeL2Data, -}; +use morph_payload_types::{AssembleL2BlockParams, ExecutableL2Data, GenericResponse, SafeL2Data}; use morph_primitives::MorphHeader; use reth_rpc_api::IntoEngineApiRpcModule; use std::sync::Arc;