Skip to content

Commit

Permalink
cleanup: removed RpcL2Block
Browse files Browse the repository at this point in the history
  • Loading branch information
purusang committed Dec 18, 2024
1 parent ee88e9b commit 14a9619
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
4 changes: 3 additions & 1 deletion bin/strata-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 8 additions & 6 deletions bin/strata-client/src/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -795,7 +797,7 @@ pub struct StrataDebugRpcImpl {

impl StrataDebugRpcImpl {
pub fn new(l2_block_manager: Arc<L2BlockManager>) -> Self {
Self {l2_block_manager}
Self { l2_block_manager }
}

Check warning on line 801 in bin/strata-client/src/rpc_server.rs

View check run for this annotation

Codecov / codecov/patch

bin/strata-client/src/rpc_server.rs#L799-L801

Added lines #L799 - L801 were not covered by tests
}

Expand Down
8 changes: 3 additions & 5 deletions crates/rpc/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<HexBytes32>>;
Expand Down Expand Up @@ -176,7 +175,6 @@ pub trait StrataSequencerApi {
async fn get_tx_status(&self, txid: HexBytes32) -> RpcResult<Option<L1TxStatus>>;
}


/// 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))]

Check warning on line 180 in crates/rpc/api/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

crates/rpc/api/src/lib.rs#L180

Added line #L180 was not covered by tests
Expand Down
11 changes: 0 additions & 11 deletions crates/rpc/types/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 14a9619

Please sign in to comment.