Skip to content

Commit 4f83dbc

Browse files
committed
refactor: move CSM state/status types to a new crate
1 parent 05d5cbd commit 4f83dbc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+347
-77
lines changed

Cargo.lock

Lines changed: 31 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ members = [
2828
"crates/config",
2929
"crates/consensus-logic",
3030
"crates/crypto",
31+
"crates/csm-types",
3132
"crates/da-framework",
3233
"crates/db",
3334
"crates/db-store-sled",
@@ -154,6 +155,7 @@ strata-common = { path = "crates/common" }
154155
strata-config = { path = "crates/config" }
155156
strata-consensus-logic = { path = "crates/consensus-logic" }
156157
strata-crypto = { path = "crates/crypto", default-features = false }
158+
strata-csm-types = { path = "crates/csm-types" }
157159
strata-da-framework = { path = "crates/da-framework" }
158160
strata-db = { path = "crates/db" }
159161
strata-db-store-rocksdb = { path = "crates/db-store-rocksdb" }

bin/strata-client/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ strata-checkpoint-types.workspace = true
1818
strata-common = { workspace = true, default-features = true }
1919
strata-config.workspace = true
2020
strata-consensus-logic = { workspace = true, default-features = true }
21+
strata-csm-types.workspace = true
2122
strata-db.workspace = true
2223
strata-db-store-rocksdb = { workspace = true, optional = true }
2324
strata-db-store-sled = { workspace = true, optional = true }

bin/strata-client/src/helpers.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ use bitcoin::{Address, Network};
55
use bitcoind_async_client::{traits::Wallet, Client};
66
use format_serde_error::SerdeError;
77
use strata_config::{BitcoindConfig, Config};
8+
use strata_csm_types::L1Status;
89
use strata_evmexec::{engine::RpcExecEngineCtl, fetch_init_fork_choice_state, EngineRpcClient};
9-
use strata_primitives::{
10-
l1::L1Status,
11-
params::{Params, RollupParams, SyncParams},
12-
};
10+
use strata_primitives::params::{Params, RollupParams, SyncParams};
1311
use strata_status::StatusChannel;
1412
use strata_storage::NodeStorage;
1513
use tokio::runtime::Handle;

bin/strata-client/src/rpc_server.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use strata_checkpoint_types::{Checkpoint, EpochSummary, SignedCheckpoint};
1818
use strata_common::BAIL_SENDER;
1919
use strata_common::{send_action_to_worker, Action, WorkerType};
2020
use strata_consensus_logic::{checkpoint_verification::verify_proof, sync_manager::SyncManager};
21+
use strata_csm_types::{ClientState, ClientUpdateOutput, L1Payload, PayloadDest, PayloadIntent};
2122
use strata_db::types::{CheckpointConfStatus, CheckpointProvingStatus, L1TxEntry, L1TxStatus};
2223
use strata_l1_txfmt::TagData;
2324
use strata_ol_chain_types::{L2Block, L2BlockBundle, L2BlockId, L2Header};
@@ -26,10 +27,7 @@ use strata_primitives::{
2627
buf::Buf32,
2728
epoch::EpochCommitment,
2829
hash,
29-
l1::{
30-
payload::{L1Payload, PayloadDest, PayloadIntent},
31-
L1BlockCommitment, L1BlockId,
32-
},
30+
l1::{L1BlockCommitment, L1BlockId},
3331
operator::OperatorIdx,
3432
params::Params,
3533
};
@@ -49,7 +47,6 @@ use strata_sequencer::{
4947
checkpoint::{verify_checkpoint_sig, CheckpointHandle},
5048
duty::{extractor::extract_duties, types::Duty},
5149
};
52-
use strata_state::{client_state::ClientState, operation::ClientUpdateOutput};
5350
use strata_status::StatusChannel;
5451
use strata_storage::NodeStorage;
5552
use tokio::sync::{oneshot, Mutex};

bin/strata-dbtool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ strata-asm-types.workspace = true
2121
strata-checkpoint-types.workspace = true
2222
strata-cli-common.workspace = true
2323
strata-consensus-logic.workspace = true
24+
strata-csm-types.workspace = true
2425
strata-db.workspace = true
2526
strata-db-store-rocksdb = { workspace = true, optional = true }
2627
strata-db-store-sled = { workspace = true, optional = true }
2728
strata-ol-chain-types.workspace = true
2829
strata-ol-chainstate-types.workspace = true
2930
strata-primitives.workspace = true
30-
strata-state.workspace = true
3131

3232
[features]
3333
default = ["sled"]

bin/strata-dbtool/src/cmd/client_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use argh::FromArgs;
22
use strata_cli_common::errors::{DisplayableError, DisplayedError};
3+
use strata_csm_types::ClientUpdateOutput;
34
use strata_db::traits::{ClientStateDatabase, DatabaseBackend};
45
use strata_primitives::l1::L1BlockCommitment;
5-
use strata_state::operation::ClientUpdateOutput;
66

77
use crate::{
88
cli::OutputFormat,

bin/strata-dbtool/src/output/checkpoint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
use strata_checkpoint_types::{
44
BatchInfo, BatchTransition, Checkpoint, EpochSummary, SignedCheckpoint,
55
};
6+
use strata_csm_types::CheckpointL1Ref;
67
use strata_db::types::{CheckpointConfStatus, CheckpointProvingStatus};
7-
use strata_state::client_state::CheckpointL1Ref;
88

99
use super::{helpers::porcelain_field, traits::Formattable};
1010

bin/strata-dbtool/src/output/client_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Client state formatting implementations
22
3+
use strata_csm_types::{ClientState, SyncAction};
34
use strata_primitives::prelude::L1BlockCommitment;
4-
use strata_state::{client_state::ClientState, operation::SyncAction};
55

66
use super::{helpers::porcelain_field, traits::Formattable};
77
use crate::output::helpers::porcelain_optional;

bin/strata-dbtool/src/output/writer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use serde::Serialize;
2+
use strata_csm_types::L1Payload;
23
use strata_db::types::L1BundleStatus;
3-
use strata_primitives::{buf::Buf32, hash, l1::payload::L1Payload};
4+
use strata_primitives::{buf::Buf32, hash};
45

56
use super::{helpers::porcelain_field, traits::Formattable};
67

0 commit comments

Comments
 (0)