From 14a96193fedb4776bf10122e7a42d6667eb71c9d Mon Sep 17 00:00:00 2001 From: Purushotam Date: Wed, 18 Dec 2024 15:03:47 +0545 Subject: [PATCH] cleanup: removed RpcL2Block --- bin/strata-client/src/main.rs | 4 +++- bin/strata-client/src/rpc_server.rs | 14 ++++++++------ crates/rpc/api/src/lib.rs | 8 +++----- crates/rpc/types/src/types.rs | 11 ----------- 4 files changed, 14 insertions(+), 23 deletions(-) diff --git a/bin/strata-client/src/main.rs b/bin/strata-client/src/main.rs index 800c5cc6f..3815f0349 100644 --- a/bin/strata-client/src/main.rs +++ b/bin/strata-client/src/main.rs @@ -27,7 +27,9 @@ use strata_primitives::params::{Params, SyncParams}; use strata_rocksdb::{ broadcaster::db::BroadcastDb, sequencer::db::SequencerDB, DbOpsConfig, RBSeqBlobDb, }; -use strata_rpc_api::{StrataAdminApiServer, StrataApiServer, StrataSequencerApiServer, StrataDebugApiServer}; +use strata_rpc_api::{ + StrataAdminApiServer, StrataApiServer, StrataDebugApiServer, StrataSequencerApiServer, +}; use strata_status::StatusChannel; use strata_storage::{ managers::checkpoint::CheckpointDbManager, ops::bridge_relay::BridgeMsgOps, L2BlockManager, diff --git a/bin/strata-client/src/rpc_server.rs b/bin/strata-client/src/rpc_server.rs index 0beadc268..f537b10d3 100644 --- a/bin/strata-client/src/rpc_server.rs +++ b/bin/strata-client/src/rpc_server.rs @@ -25,16 +25,18 @@ use strata_primitives::{ hash, params::Params, }; -use strata_rpc_api::{StrataAdminApiServer, StrataApiServer, StrataSequencerApiServer, StrataDebugApiServer}; +use strata_rpc_api::{ + StrataAdminApiServer, StrataApiServer, StrataDebugApiServer, StrataSequencerApiServer, +}; use strata_rpc_types::{ - errors::RpcServerError as Error, DaBlob, HexBytes, HexBytes32, L2BlockStatus, RpcBlockBody, - RpcBlockHeader, RpcBridgeDuties, RpcChainState, RpcCheckpointInfo, RpcClientStatus, - RpcDepositEntry, RpcExecUpdate, RpcL1Status, RpcL2Block, RpcSyncStatus, + errors::RpcServerError as Error, DaBlob, HexBytes, HexBytes32, L2BlockStatus, RpcBlockHeader, + RpcBridgeDuties, RpcChainState, RpcCheckpointInfo, RpcClientStatus, RpcDepositEntry, + RpcExecUpdate, RpcL1Status, RpcSyncStatus, }; use strata_rpc_utils::to_jsonrpsee_error; use strata_state::{ batch::BatchCheckpoint, - block::{L2BlockBundle, L2Block}, + block::{L2Block, L2BlockBundle}, bridge_duties::BridgeDuty, bridge_ops::WithdrawalIntent, client_state::ClientState, @@ -795,7 +797,7 @@ pub struct StrataDebugRpcImpl { impl StrataDebugRpcImpl { pub fn new(l2_block_manager: Arc) -> Self { - Self {l2_block_manager} + Self { l2_block_manager } } } diff --git a/crates/rpc/api/src/lib.rs b/crates/rpc/api/src/lib.rs index 2c6b5309e..174e13d85 100644 --- a/crates/rpc/api/src/lib.rs +++ b/crates/rpc/api/src/lib.rs @@ -6,16 +6,15 @@ use strata_primitives::bridge::{OperatorIdx, PublickeyTable}; use strata_rpc_types::{ types::{RpcBlockHeader, RpcClientStatus, RpcL1Status}, HexBytes, HexBytes32, L2BlockStatus, RpcBridgeDuties, RpcChainState, RpcCheckpointInfo, - RpcDepositEntry, RpcExecUpdate, RpcL2Block, RpcSyncStatus, + RpcDepositEntry, RpcExecUpdate, RpcSyncStatus, }; use strata_state::{ - client_state::ClientState, id::L2BlockId, operation::ClientUpdateOutput, sync_event::SyncEvent, - block::L2Block, + block::L2Block, client_state::ClientState, id::L2BlockId, operation::ClientUpdateOutput, + sync_event::SyncEvent, }; #[cfg_attr(not(feature = "client"), rpc(server, namespace = "strata"))] #[cfg_attr(feature = "client", rpc(server, client, namespace = "strata"))] pub trait StrataApi { - /// Get blocks at a certain height #[method(name = "getBlocksAtIdx")] async fn get_blocks_at_idx(&self, idx: u64) -> RpcResult>; @@ -176,7 +175,6 @@ pub trait StrataSequencerApi { async fn get_tx_status(&self, txid: HexBytes32) -> RpcResult>; } - /// rpc endpoints that are only available for debugging purpose and subject to change. #[cfg_attr(not(feature = "client"), rpc(server))] #[cfg_attr(feature = "client", rpc(server, client))] diff --git a/crates/rpc/types/src/types.rs b/crates/rpc/types/src/types.rs index 13ebefd05..197fc4e11 100644 --- a/crates/rpc/types/src/types.rs +++ b/crates/rpc/types/src/types.rs @@ -163,17 +163,6 @@ pub struct RpcBlockHeader { pub state_root: [u8; 32], } -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RpcBlockBody { - /// The fields of block body is to be decided. - pub todo: u64, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct RpcL2Block { - pub header: RpcBlockHeader, - pub body: RpcBlockBody, -} #[derive(Clone, Debug, Deserialize, Serialize)] pub struct DaBlob { /// The destination or identifier for the blob.