You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consumer context: gas-killer/roadmap#18. These tests are the acceptance gates for the concurrency work, and two of them fail against today's code — which is the point.
Why this is its own issue
The deterministic runtime (commonware_runtime::deterministic) is already used in node/src/task_book.rs, node/src/reporter.rs, and router/src/reporter.rs tests, so reproducible interleavings are available. But router/src/sequencer.rs has no tests that exercise run/drive_height at all — it only tests stamp_dispatch_time and the assignment map. That gap is what let the non-contiguous-tip defect (#188) sit unnoticed, because the defect is invisible unless you can drive the loop with a mock CertIndex and a mock network.
So the first deliverable is the harness, not a test.
Harness
A recording mock NetworkSender / NetworkReceiver for the directive channel, with per-peer drop and reorder controls. commonware_p2p::simulated may be sufficient; if not, a minimal in-crate mock is fine. It needs to support:
capturing every encoded send with its recipient set, for golden-bytes assertions
dropping sends to peer k with probability p, or dropping the first n sends per height
delivering a batch of sends in an arbitrary permutation
Plus a mock CertIndex whose get_tip() and contiguous_tip() can be driven independently — that separation is exactly what the tip tests need.
out_of_order_window_does_not_skip_live_heights — park waiters at 1..8, deliver Announce{5} then Announce{1}; waiter 1 must resolve to Announce, not Skip. Fails today.
Consumer context: gas-killer/roadmap#18. These tests are the acceptance gates for the concurrency work, and two of them fail against today's code — which is the point.
Why this is its own issue
The deterministic runtime (
commonware_runtime::deterministic) is already used innode/src/task_book.rs,node/src/reporter.rs, androuter/src/reporter.rstests, so reproducible interleavings are available. Butrouter/src/sequencer.rshas no tests that exerciserun/drive_heightat all — it only testsstamp_dispatch_timeand the assignment map. That gap is what let the non-contiguous-tip defect (#188) sit unnoticed, because the defect is invisible unless you can drive the loop with a mockCertIndexand a mock network.So the first deliverable is the harness, not a test.
Harness
A recording mock
NetworkSender/NetworkReceiverfor the directive channel, with per-peer drop and reorder controls.commonware_p2p::simulatedmay be sufficient; if not, a minimal in-crate mock is fine. It needs to support:Plus a mock
CertIndexwhoseget_tip()andcontiguous_tip()can be driven independently — that separation is exactly what the tip tests need.Tests
node/src/task_book.rs(gates #192):out_of_order_window_does_not_skip_live_heights— park waiters at 1..8, deliverAnnounce{5}thenAnnounce{1}; waiter 1 must resolve toAnnounce, notSkip. Fails today.window_snapshot_skips_only_omitted_heights—{base:1, entries:[T1, _, T3]}→ 1 Announce, 2 Skip, 3 Announce, 4 parkedolder_window_seq_does_not_regress— apply seq 2 then seq 1; seq 1 ignoredexplicit_skip_still_overrides_announce— regression for the existing latchdirective_below_window_base_resolves_skipnode/src/reporter.rs(gates #189):tip_mirror_tracks_contiguous_tip_not_max_certified— reportCertified(5)with no lower certificates →tip_handle == 0; thenActivity::Tip(1)→ 1. Fails today.router/src/reporter.rs(gates #188):contiguous_tip_stops_at_first_gap— certify 0, 1, 3 →contiguous_tip() == 2whileget_tip() == 4router/src/sequencer.rs(new coverage, gates #193):never_assigns_beyond_contiguous_tip_plus_window— mock reporting contiguous tip 10, certified 17 → does not assign 18. Fails today.window_stays_contiguous_and_bounded— no gaps,len <= Wsuperseded_requires_f_plus_one_reports— at n=4, one node's inflated tip must not abandon a live heightdispatch_time_retains_all_in_flight_heights— replaces the existing test, which asserts the opposite invariant (sequencer: stamp_dispatch_time evicts the timestamps of live lower heights #190)w_equals_one_emits_legacy_directive_bytes— golden bytesshutdown_drains_inflight_before_returning—next_task() == Nonemust not abandon W heightsAcceptance