Skip to content
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
1 change: 1 addition & 0 deletions crates/rpc-jsonrpsee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ workspace = true
[dependencies]
# Alloy
op-alloy-rpc-types.workspace = true
op-alloy-rpc-types-engine = { workspace = true, features = ["serde"] }
alloy-eips.workspace = true
alloy-primitives.workspace = true

Expand Down
19 changes: 19 additions & 0 deletions crates/rpc-jsonrpsee/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use op_alloy_rpc_types::{
safe_head::SafeHeadResponse,
sync::SyncStatus,
};
use op_alloy_rpc_types_engine::{ProtocolVersion, SuperchainSignal};
use std::net::IpAddr;

/// Optimism specified rpc interface.
Expand Down Expand Up @@ -120,3 +121,21 @@ pub trait OpAdminApi {
#[method(name = "sequencerActive")]
async fn admin_sequencer_active(&self) -> RpcResult<bool>;
}

/// Engine API extension for Optimism superchain signaling
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "engine"))]
#[cfg_attr(feature = "client", rpc(server, client, namespace = "engine"))]
pub trait EngineApiExt {
/// Signal superchain v1 message
///
/// The execution engine SHOULD warn when the recommended version is newer than the current
/// version. The execution engine SHOULD take safety precautions if it does not meet
/// the required version.
///
/// # Returns
/// The latest supported OP-Stack protocol version of the execution engine.
///
/// See: <https://specs.optimism.io/protocol/exec-engine.html#engine_signalsuperchainv1>
#[method(name = "signalSuperchainV1")]
async fn signal_superchain_v1(&self, signal: SuperchainSignal) -> RpcResult<ProtocolVersion>;
}