Fence Windows sync until the helper confirms the signed decision
Rust development slice / linux (push) Failing after 7s

This commit is contained in:
2026-11-15 22:28:49 +01:00
parent 17c53c1602
commit 148969f0c6
5 changed files with 155 additions and 11 deletions
+66
View File
@@ -1026,6 +1026,72 @@ fn helper_gate_requires_exact_signed_instruction_and_applied_checkpoint() {
assert!(!c.can_start(&f.channel, true, &f.clock));
}
#[test]
fn windows_unconfirmed_helper_head_cannot_replace_a_committed_decision() {
let mut f = Fixture::new();
f.helper_identity = HelperIdentity::System;
let mut client = f.client();
let mut helper = HelperSnapshot {
journal_id: Uuid::new_v4(),
checkpoint: 1,
previous_decision_id: None,
attempts: vec![],
};
let first = client
.prepare(
&mut f.db,
&f.ledger,
f.channel.clone(),
Some(&helper),
&f.clock,
)
.unwrap();
let decision = f.decision(&first, true);
f.apply(&mut client, &decision).unwrap();
client.apply_consumption(&mut f.ledger, &f.clock).unwrap();
for previous in [None, Some(Uuid::new_v4())] {
let mut reopened = f.client();
helper.previous_decision_id = previous;
assert_eq!(
reopened
.prepare(
&mut f.db,
&f.ledger,
f.channel.clone(),
Some(&helper),
&f.clock
)
.err()
.unwrap()
.to_string(),
"SYSTEM_HELPER_APPLY_UNCONFIRMED"
);
assert!(!reopened.can_start(&f.channel, false, &f.clock));
let count: u64 =
f.db.query_row("SELECT count(*) FROM reconcile_requests", [], |r| r.get(0))
.unwrap();
assert_eq!(count, 1);
}
helper.previous_decision_id = Some(decision.decision_id);
helper.checkpoint += 1;
f.channel.connection_generation += 1;
let mut reopened = f.client();
let next = reopened
.prepare(
&mut f.db,
&f.ledger,
f.channel.clone(),
Some(&helper),
&f.clock,
)
.unwrap();
assert_eq!(
next.request.helper_previous_decision_id,
decision.decision_id.to_string()
);
assert!(!reopened.can_start(&f.channel, false, &f.clock));
}
#[test]
fn independent_helper_checkpoint_regression_is_sticky() {
let mut f = Fixture::new();
let mut c = f.client();