fin-proof: fin-synth takes a DAA base when the fixture carries none
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
53e0927801
commit
d845af5d1d
1 changed files with 5 additions and 2 deletions
|
|
@ -172,7 +172,10 @@ fn synth_hash(tag: &str, n: u64) -> H {
|
|||
/// certificate verification touched (for the report).
|
||||
pub fn synth(fixtures: &[Fixture], keys: usize, voters: usize, window_blocks: u64, cert_back: usize) -> Result<FinWitnessFile> {
|
||||
let first = fixtures.first().ok_or_else(|| anyhow!("no fixtures"))?;
|
||||
let first_daa = first.block.env.daa_score.max(1);
|
||||
// a fixture written before the DAA field existed carries 0; the guest never checks the DAA against the shard
|
||||
// statement, so the synthetic run takes a base of its own then (the real chain's DAA is what the node feeds)
|
||||
let daa_base = if first.block.env.daa_score == 0 { 100_000 } else { first.block.env.daa_score };
|
||||
let first_daa = daa_base;
|
||||
// the window of the root state: W spans the synthetic history; min_daa under the first DAA so certificates pass C5
|
||||
let params = FinParams { chain_id: "igneum-fin-synth".into(), weight_window: window_blocks.max(16) * 2, dust: 1, min_daa: 1, leave_delay: 3_600, equivocation_ban: window_blocks.max(16) * 2 };
|
||||
let synth_keys: Vec<SynthKey> = (0..keys.max(1)).map(synth_key).collect();
|
||||
|
|
@ -204,7 +207,7 @@ pub fn synth(fixtures: &[Fixture], keys: usize, voters: usize, window_blocks: u6
|
|||
let mut blocks = Vec::new();
|
||||
for (i, f) in fixtures.iter().enumerate() {
|
||||
let n = f.block.env.number;
|
||||
let daa = f.block.env.daa_score.max(state.end_daa);
|
||||
let daa = (daa_base + i as u64).max(state.end_daa);
|
||||
let k = &synth_keys[i % synth_keys.len()];
|
||||
let k2 = &synth_keys[(i * 5 + 1) % synth_keys.len()];
|
||||
let block = ChainBlockWitness { number: n, block_hash: f.block.env.hash.0, daa, blues: vec![BlueBlock { block_hash: f.block.env.hash.0, key_hash: k.hash, daa }, BlueBlock { block_hash: synth_hash("side", n), key_hash: k2.hash, daa }] };
|
||||
|
|
|
|||
Loading…
Reference in a new issue