fin-proof: the inclusive two-thirds test over a divisible window; the switch in the fast-time file
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
de5ff2357f
commit
d3fc1ba159
2 changed files with 10 additions and 2 deletions
|
|
@ -58,6 +58,7 @@
|
|||
"program_class_v4_activation_daa": 18446744073709551615,
|
||||
"program_class_v4_signal_window_daa": 120,
|
||||
"proving_v1_fresh_rule_daa": 18446744073709551615,
|
||||
"finality_in_proof_activation_daa": 18446744073709551615,
|
||||
"exec_restart_number": 18446744073709551615,
|
||||
"exec_restart_hash": "",
|
||||
"exec_restart_trust_daa": 18446744073709551615,
|
||||
|
|
|
|||
|
|
@ -292,8 +292,13 @@ fn known_failed_first_todays_light_client_takes_the_voter_list_from_a_node_and_t
|
|||
|
||||
#[test]
|
||||
fn two_thirds_is_inclusive_and_under_it_is_refused() {
|
||||
// six equal keys: 4 of 6 locks, 3 of 6 does not (spec 3.10 Q3's unit test, here inside the proof)
|
||||
let mut sim = Sim::new(params(), &["a", "b", "c", "d", "e", "f"]);
|
||||
// six equal keys over a 240-block window (40 blocks each): 4 of 6 is exactly two thirds and locks, 3 of 6 does
|
||||
// not (spec 3.10 Q3's unit test, here inside the proof)
|
||||
let mut p = params();
|
||||
p.weight_window = 240;
|
||||
p.min_daa = 240;
|
||||
p.equivocation_ban = 240;
|
||||
let mut sim = Sim::new(p, &["a", "b", "c", "d", "e", "f"]);
|
||||
let mut w = FoldWitness::default();
|
||||
w.reveals = (0..6).map(|i| reveal(&sim.keys[i])).collect();
|
||||
sim.mine(0, &[], w).unwrap();
|
||||
|
|
@ -301,6 +306,8 @@ fn two_thirds_is_inclusive_and_under_it_is_refused() {
|
|||
sim.mine((n % 6) as usize, &[], FoldWitness::default()).unwrap();
|
||||
}
|
||||
let cp = 240u64;
|
||||
let (_, total) = voters_at(&sim.tables[&cp], cp, sim.params.dust);
|
||||
assert_eq!(total, 240);
|
||||
let three = sim.certificate(8, cp, &[0, 1, 2]);
|
||||
let mut w = FoldWitness::default();
|
||||
w.certificates.push(three);
|
||||
|
|
|
|||
Loading…
Reference in a new issue