Skip to content
Open
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
10 changes: 0 additions & 10 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ threads-required = 8
filter = "package(tempo-node) & binary(it)"
threads-required = 4

[[profile.ci.overrides]]
filter = "test(sync::can_restart_after_joining_from_snapshot)"
slow-timeout = { period = "60s", terminate-after = 4, on-timeout = "pass" }
success-output = "final"

# Local development defaults (same constraints apply)
[[profile.default.overrides]]
filter = "package(tempo-e2e)"
Expand All @@ -32,8 +27,3 @@ threads-required = 8
[[profile.default.overrides]]
filter = "package(tempo-node) & binary(it)"
threads-required = 4

[[profile.default.overrides]]
filter = "test(sync::can_restart_after_joining_from_snapshot)"
slow-timeout = { period = "60s", terminate-after = 4, on-timeout = "pass" }
success-output = "final"
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/commonware-node/src/dkg/manager/actor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1755,8 +1755,8 @@ fn determine_next_players(
fields(
%digest,
),
err,
ret(level = Level::WARN)
err(level = Level::WARN)
ret,
)]
pub(crate) fn read_re_dkg_epoch(
node: &TempoFullNode,
Expand Down
30 changes: 27 additions & 3 deletions crates/commonware-node/src/dkg/manager/actor/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,14 +766,13 @@ impl Read for State {
buf: &mut impl bytes::Buf,
cfg: &Self::Cfg,
) -> Result<Self, commonware_codec::Error> {
let range_cfg = RangeCfg::from(1..=(u16::MAX as usize));
Ok(Self {
epoch: ReadExt::read(buf)?,
seed: ReadExt::read(buf)?,
output: Read::read_cfg(buf, cfg)?,
share: ReadExt::read(buf)?,
players: Read::read_cfg(buf, &(range_cfg, ()))?,
syncers: Read::read_cfg(buf, &(range_cfg, ()))?,
Copy link
Contributor Author

@SuperFluffy SuperFluffy Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once transitioned to V2, syncers can be 0.

This is not a format breaking change! The RangeCfg acts as a check for the encoded length.

Of course once a node has transitioned to V2 it can no longer run in V1. But that's ok.

players: Read::read_cfg(buf, &(RangeCfg::from(1..=(u16::MAX as usize)), ()))?,
syncers: Read::read_cfg(buf, &(RangeCfg::from(0..=(u16::MAX as usize)), ()))?,
is_full_dkg: ReadExt::read(buf)?,
})
}
Expand Down Expand Up @@ -1338,6 +1337,7 @@ impl ReducedBlock {
#[cfg(test)]
mod tests {
use super::*;
use commonware_codec::Encode as _;
use commonware_cryptography::{
bls12381::{dkg, primitives::sharing::Mode},
ed25519::PrivateKey,
Expand Down Expand Up @@ -1394,6 +1394,30 @@ mod tests {
}
}

#[test]
fn state_round_trip_with() {
let executor = deterministic::Runner::default();
executor.start(|mut context| async move {
let state = make_test_state(&mut context, 0);
let mut bytes = state.encode();
assert_eq!(
state,
State::read_cfg(&mut bytes, &NZU32!(u32::MAX)).unwrap(),
);

let state_without_syncers = {
let mut s = make_test_state(&mut context, 0);
s.syncers = Default::default();
s
};
let mut bytes = state_without_syncers.encode();
assert_eq!(
state_without_syncers,
State::read_cfg(&mut bytes, &NZU32!(u32::MAX)).unwrap(),
);
});
}

#[test]
fn states_migration_migrates_last_two() {
let executor = deterministic::Runner::default();
Expand Down
1 change: 1 addition & 0 deletions crates/e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ commonware-utils.workspace = true
itertools.workspace = true

eyre.workspace = true
reth-chainspec.workspace = true
reth-db.workspace = true
reth-ethereum = { workspace = true, features = [
"node",
Expand Down
Loading
Loading