Skip to content

Commit 2f27bd6

Browse files
committed
cleanups
1 parent e379591 commit 2f27bd6

20 files changed

Lines changed: 1999 additions & 1651 deletions

File tree

Cargo.lock

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

glue/Cargo.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ repository = "https://github.com/commonwarexyz/monorepo/tree/main/glue"
1313
workspace = true
1414

1515
[dependencies]
16+
arbitrary = { workspace = true, optional = true, features = ["derive"] }
1617
bytes.workspace = true
1718
commonware-codec.workspace = true
1819
commonware-consensus.workspace = true
@@ -26,18 +27,32 @@ commonware-utils.workspace = true
2627
futures.workspace = true
2728
rand.workspace = true
2829
rand_core.workspace = true
30+
thiserror.workspace = true
2931
tracing.workspace = true
3032

3133
[dev-dependencies]
3234
commonware-broadcast.workspace = true
3335
commonware-codec.workspace = true
36+
commonware-conformance.workspace = true
3437
commonware-consensus = { workspace = true, features = ["mocks"] }
3538
commonware-cryptography = { workspace = true, features = ["mocks"] }
3639
commonware-p2p.workspace = true
3740
commonware-parallel.workspace = true
3841
commonware-resolver.workspace = true
3942
commonware-storage.workspace = true
43+
prometheus-client.workspace = true
4044
tracing-subscriber.workspace = true
4145

4246
[features]
4347
test-utils = []
48+
arbitrary = [
49+
"commonware-codec/arbitrary",
50+
"commonware-consensus/arbitrary",
51+
"commonware-cryptography/arbitrary",
52+
"commonware-p2p/arbitrary",
53+
"commonware-resolver/arbitrary",
54+
"commonware-runtime/arbitrary",
55+
"commonware-storage/arbitrary",
56+
"commonware-utils/arbitrary",
57+
"dep:arbitrary",
58+
]

glue/conformance.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
["commonware_glue::stateful::db::qmdb::resolver::handler::tests::conformance::CodecConformance<Request>"]
2+
n_cases = 65536
3+
hash = "44c363dc52376203a66269a71e13f7271c1a9beb1f8ee9dd9864a3ce7ae2c281"
4+
5+
["commonware_glue::stateful::db::qmdb::resolver::handler::tests::conformance::CodecConformance<Response<u64,sha256::Digest>>"]
6+
n_cases = 65536
7+
hash = "84f9f3cad168682d218cc7e44e2ba71a54308833f6e7040ccd1b58a298c6b42a"

glue/src/stateful/actor/bootstrap.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub async fn bootstrap<E, A, S, V, R>(
152152
{
153153
let marshal_for_sync = marshal.clone();
154154
let mailbox_for_sync = mailbox.clone();
155-
let (databases, sync_height, finalized_digest, floor_height) = {
155+
let (databases, sync_height, last_processed_digest, floor_height) = {
156156
let mut metadata = Metadata::<E, U64, bool>::init(
157157
config.context.clone().with_label("state_sync_metadata"),
158158
MetadataConfig {
@@ -241,11 +241,21 @@ pub async fn bootstrap<E, A, S, V, R>(
241241
"sync complete, setting marshal floor and transitioning to running"
242242
);
243243
marshal.set_floor(floor_height).await;
244+
let processed_height = marshal
245+
.get_processed_height()
246+
.await
247+
.expect("marshal must respond with processed height after set_floor");
248+
assert!(
249+
processed_height >= floor_height,
250+
"marshal floor must be applied before sync_complete"
251+
);
244252
} else {
245253
info!(
246254
sync_height = sync_height.get(),
247255
"sync complete, transitioning to running"
248256
);
249257
}
250-
mailbox.sync_complete(databases, finalized_digest).await;
258+
mailbox
259+
.sync_complete(databases, last_processed_digest)
260+
.await;
251261
}

0 commit comments

Comments
 (0)