{
 "format": "zoobc-conformance-vectors/1",
 "edition": "0.6.1",
 "chapter": "24",
 "license": "CC BY 4.0, ZooBC Foundation",
 "cases": [
  {
   "id": "24-1-next",
   "chapter": "24",
   "section": "1",
   "title": "Compare(\"11811449964\", \"11810449964\")",
   "kind": "24-compare",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "fork_hash": "",
    "our_hash": "",
    "fork": "11811449964",
    "ours": "11810449964"
   },
   "expected": {
    "compare": "1"
   }
  },
  {
   "id": "24-1-shorter",
   "chapter": "24",
   "section": "1",
   "title": "Compare(\"99999999999\", \"100000000000\")",
   "kind": "24-compare",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "fork_hash": "",
    "our_hash": "",
    "fork": "99999999999",
    "ours": "100000000000"
   },
   "expected": {
    "compare": "-1"
   }
  },
  {
   "id": "24-1-empty",
   "chapter": "24",
   "section": "1",
   "title": "Compare(\"\", \"0\")",
   "kind": "24-compare",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "fork_hash": "",
    "our_hash": "",
    "fork": "",
    "ours": "0"
   },
   "expected": {
    "compare": "-1"
   }
  },
  {
   "id": "24-1-leading-zeros",
   "chapter": "24",
   "section": "1",
   "title": "Compare(\"007\", \"7\")",
   "kind": "24-compare",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "fork_hash": "",
    "our_hash": "",
    "fork": "007",
    "ours": "7"
   },
   "expected": {
    "compare": "0"
   }
  },
  {
   "id": "24-1-tie-fork-lower",
   "chapter": "24",
   "section": "1",
   "title": "Equal weights: the branch's tip hash is lower",
   "kind": "24-compare",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "fork": "11811449964",
    "ours": "11811449964",
    "fork_hash": "42cfa11fce0acdbebfcb649a2934dffcaecc032789259024db35146ce1881c52",
    "our_hash": "f8bde70949a02d92d9340816449928ee99b6ea53d5729735dd3f3951e15c0086"
   },
   "expected": {
    "compare": "0",
    "tie_broken": "1"
   }
  },
  {
   "id": "24-1-tie-ours-lower",
   "chapter": "24",
   "section": "1",
   "title": "Equal weights: our tip hash is lower",
   "kind": "24-compare",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "fork": "11811449964",
    "ours": "11811449964",
    "fork_hash": "f8bde70949a02d92d9340816449928ee99b6ea53d5729735dd3f3951e15c0086",
    "our_hash": "42cfa11fce0acdbebfcb649a2934dffcaecc032789259024db35146ce1881c52"
   },
   "expected": {
    "compare": "0",
    "tie_broken": "-1"
   }
  },
  {
   "id": "24-2-quorum",
   "chapter": "24",
   "section": "2",
   "title": "Stale tip, 7 answers: 5 report one tip",
   "kind": "24-sync-quorum",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "our_height": "12000",
    "reports": "k0 12471 11882449964\nk1 12471 11882449964\nk2 12471 11882449964\nk3 12471 11882449964\nk4 12471 11882449964\nk5 12300 11711449964\nk6 12300 11711449964"
   },
   "expected": {
    "answers": "7",
    "needed": "5",
    "source": "12471 11882449964"
   }
  },
  {
   "id": "24-2-no-quorum",
   "chapter": "24",
   "section": "2",
   "title": "Stale tip, 7 answers split 4 and 3",
   "kind": "24-sync-quorum",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "our_height": "12000",
    "reports": "k0 12471 11882449964\nk1 12471 11882449964\nk2 12471 11882449964\nk3 12471 11882449964\nk4 12300 11711449964\nk5 12300 11711449964\nk6 12300 11711449964"
   },
   "expected": {
    "answers": "7",
    "needed": "5",
    "source": "none"
   }
  },
  {
   "id": "24-2-too-few",
   "chapter": "24",
   "section": "2",
   "title": "Stale tip, 2 answers on the same tip",
   "kind": "24-sync-quorum",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "our_height": "12000",
    "reports": "k0 12471 11882449964\nk1 12471 11882449964"
   },
   "expected": {
    "answers": "2",
    "source": "none"
   }
  },
  {
   "id": "24-2-one-vote-per-key",
   "chapter": "24",
   "section": "2",
   "title": "A key answering twice counts once",
   "kind": "24-sync-quorum",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "our_height": "12000",
    "reports": "a 12471 11882449964\na 12471 11882449964\nb 12471 11882449964\nc 12300 11711449964"
   },
   "expected": {
    "answers": "3",
    "needed": "2",
    "source": "12471 11882449964"
   }
  },
  {
   "id": "24-2-cursor",
   "chapter": "24",
   "section": "2",
   "title": "A batch of 50 ids whose 20th block fails to apply",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "cursor": "the 19th block",
    "next pass": "asks again from our tip"
   }
  },
  {
   "id": "24-3-budget-720",
   "chapter": "24",
   "section": "3",
   "title": "Budget and fetch cap at max_rollback_height 720",
   "kind": "24-fork-budget",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "max_rollback_height": "720"
   },
   "expected": {
    "fetch_cap": "1540",
    "budget": "240"
   }
  },
  {
   "id": "24-3-budget-60",
   "chapter": "24",
   "section": "3",
   "title": "Budget and fetch cap at max_rollback_height 60",
   "kind": "24-fork-budget",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "max_rollback_height": "60"
   },
   "expected": {
    "fetch_cap": "220",
    "budget": "120"
   }
  },
  {
   "id": "24-3-within",
   "chapter": "24",
   "section": "3",
   "title": "Devnet, depth 60, not below the floor",
   "kind": "24-reach",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "max_rollback_height": "60",
    "common": "939",
    "finalized": "0",
    "side": "unknown",
    "heavier": "false",
    "depth": "60"
   },
   "expected": {
    "verdict": "within reach"
   }
  },
  {
   "id": "24-3-wedge-theirs",
   "chapter": "24",
   "section": "3",
   "title": "Devnet, depth 61, the spine block names a block we hold differently",
   "kind": "24-reach",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "max_rollback_height": "60",
    "common": "939",
    "finalized": "0",
    "side": "theirs",
    "heavier": "false",
    "depth": "61"
   },
   "expected": {
    "verdict": "wedge: Fork rejected: beyond the rollback bound on the branch the spine's checkpoint names (wedge)"
   }
  },
  {
   "id": "24-3-refused-ours",
   "chapter": "24",
   "section": "3",
   "title": "Devnet, depth 61, the spine block names our block, recomputed heavier",
   "kind": "24-reach",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "max_rollback_height": "60",
    "common": "939",
    "finalized": "0",
    "side": "ours",
    "heavier": "true",
    "depth": "61"
   },
   "expected": {
    "verdict": "Fork rejected: rollback depth exceeds max_rollback_height limit"
   }
  },
  {
   "id": "24-3-wedge-heavier",
   "chapter": "24",
   "section": "3",
   "title": "Devnet, depth 61, no spine block above the split, branch heavier",
   "kind": "24-reach",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "max_rollback_height": "60",
    "common": "939",
    "finalized": "0",
    "side": "unknown",
    "heavier": "true",
    "depth": "61"
   },
   "expected": {
    "verdict": "wedge: Fork rejected: beyond the rollback bound on a heavier valid branch (wedge)"
   }
  },
  {
   "id": "24-3-lighter",
   "chapter": "24",
   "section": "3",
   "title": "Devnet, depth 61, no spine block above the split, branch lighter",
   "kind": "24-reach",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "max_rollback_height": "60",
    "common": "939",
    "finalized": "0",
    "side": "unknown",
    "heavier": "false",
    "depth": "61"
   },
   "expected": {
    "verdict": "Fork rejected before rollback: the peer's branch is not heavier than ours"
   }
  },
  {
   "id": "24-3-floor",
   "chapter": "24",
   "section": "3",
   "title": "Depth 10, common block 900 below the finalized height 1,000",
   "kind": "24-reach",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "max_rollback_height": "60",
    "common": "900",
    "finalized": "1000",
    "side": "unknown",
    "heavier": "false",
    "depth": "10"
   },
   "expected": {
    "verdict": "Fork rejected: common block 900 is below the checkpoint floor 1000 (the last co-signed spine reference); the branch was not fetched"
   }
  },
  {
   "id": "24-3-floor-theirs",
   "chapter": "24",
   "section": "3",
   "title": "The same with the spine block on the peer's side",
   "kind": "24-reach",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "max_rollback_height": "60",
    "common": "900",
    "finalized": "1000",
    "side": "theirs",
    "heavier": "false",
    "depth": "10"
   },
   "expected": {
    "verdict": "wedge: Fork rejected: beyond the rollback bound on the branch the spine's checkpoint names (wedge)"
   }
  },
  {
   "id": "24-3-removal-v01",
   "chapter": "24",
   "section": "3",
   "title": "A branch block's RemoveNodeRegistration signed by its Ethereum-typed owner, ending in 01",
   "kind": "24-branch-removal",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "genesis": "e003e4e3557ef19f0519bd345009dea7fb43b3445eaa043920c5dc23b3302871",
    "unsigned": "020200000149c7e66a000000000400000036590dc6986e0755e42c7d4c8f385389403230fc02000000404b4c0000000000200000005e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f21520200000000000000",
    "owner": "0400000036590dc6986e0755e42c7d4c8f385389403230fc",
    "node_public_key": "5e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f2152",
    "height": "1000",
    "signature": "f942fb9437edf838805ee18e5bc6d876ab1d5a9fbd950067b857eba23f485bef69efb64c40f872de4a9d77e6792882236bd330b541077219ac6ef8a6749d5e9c01"
   },
   "expected": {
    "signed_by_owner": "false",
    "mirrored": "false",
    "leaving": "false"
   },
   "note": "The signature verifies (recovery id 1), but under rule eth_signature_canonical_v an Ethereum-typed owner signs in the 27/28 form: the node stays in the scratch registry."
  },
  {
   "id": "24-3-removal-v1c",
   "chapter": "24",
   "section": "3",
   "title": "The same removal with the signature ending in 1c (28)",
   "kind": "24-branch-removal",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "genesis": "e003e4e3557ef19f0519bd345009dea7fb43b3445eaa043920c5dc23b3302871",
    "unsigned": "020200000149c7e66a000000000400000036590dc6986e0755e42c7d4c8f385389403230fc02000000404b4c0000000000200000005e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f21520200000000000000",
    "owner": "0400000036590dc6986e0755e42c7d4c8f385389403230fc",
    "node_public_key": "5e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f2152",
    "height": "1000",
    "signature": "f942fb9437edf838805ee18e5bc6d876ab1d5a9fbd950067b857eba23f485bef69efb64c40f872de4a9d77e6792882236bd330b541077219ac6ef8a6749d5e9c1c"
   },
   "expected": {
    "signed_by_owner": "true",
    "mirrored": "true",
    "leaving": "true"
   },
   "note": "Mirrored: the node begins its exit at the branch block."
  },
  {
   "id": "24-3-removal-foreign",
   "chapter": "24",
   "section": "3",
   "title": "The same removal of a node the scratch holds under another owner",
   "kind": "24-branch-removal",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "genesis": "e003e4e3557ef19f0519bd345009dea7fb43b3445eaa043920c5dc23b3302871",
    "unsigned": "020200000149c7e66a000000000400000036590dc6986e0755e42c7d4c8f385389403230fc02000000404b4c0000000000200000005e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f21520200000000000000",
    "owner": "040000001111111111111111111111111111111111111111",
    "node_public_key": "5e8eb28dccaa94a992f7169fa67966207d96aa55df7d24d2d6ec1f538c9f2152",
    "height": "1000",
    "signature": "f942fb9437edf838805ee18e5bc6d876ab1d5a9fbd950067b857eba23f485bef69efb64c40f872de4a9d77e6792882236bd330b541077219ac6ef8a6749d5e9c1c"
   },
   "expected": {
    "signed_by_owner": "false",
    "mirrored": "false",
    "leaving": "false"
   }
  },
  {
   "id": "24-3-partial",
   "chapter": "24",
   "section": "3",
   "title": "A 30-block branch that applies 18 blocks",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "outcome": "kept, partial (18 of 30)",
    "feeder": "charged a bad block, skipped once as sync source"
   }
  },
  {
   "id": "24-4-ids",
   "chapter": "24",
   "section": "4",
   "title": "Block ids of the blocks at 12,399 to 12,402",
   "kind": "24-block-id",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "hashes": "f8bde70949a02d92d9340816449928ee99b6ea53d5729735dd3f3951e15c0086\n42cfa11fce0acdbebfcb649a2934dffcaecc032789259024db35146ce1881c52\nbef5277d8fa56e64fa435c29373f64312c3ccf2e2fab969110ba36dfd55ad4ae\n6dfc8283998a7fe02d09bf10856f32f65feb56c8cdc05ac9858e2eccdc38549e"
   },
   "expected": {
    "ids": "-7913492734660854280\n-4698086955867320510\n7236903686929642942\n-2269943295230411667"
   }
  },
  {
   "id": "24-4-next-ids",
   "chapter": "24",
   "section": "4",
   "title": "GetNextBlockIDs(id of 12,399, 3) on a chain holding the four blocks at 12,399 to 12,402",
   "kind": "24-next-ids",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "first_height": "12399",
    "hashes": "f8bde70949a02d92d9340816449928ee99b6ea53d5729735dd3f3951e15c0086\n42cfa11fce0acdbebfcb649a2934dffcaecc032789259024db35146ce1881c52\nbef5277d8fa56e64fa435c29373f64312c3ccf2e2fab969110ba36dfd55ad4ae\n6dfc8283998a7fe02d09bf10856f32f65feb56c8cdc05ac9858e2eccdc38549e",
    "block_id": "-7913492734660854280",
    "limit": "3"
   },
   "expected": {
    "ids": "-4698086955867320510\n7236903686929642942\n-2269943295230411667"
   }
  },
  {
   "id": "24-4-next-ids-unknown",
   "chapter": "24",
   "section": "4",
   "title": "GetNextBlockIDs for an id the server does not hold",
   "kind": "24-next-ids",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "first_height": "12399",
    "hashes": "f8bde70949a02d92d9340816449928ee99b6ea53d5729735dd3f3951e15c0086\n42cfa11fce0acdbebfcb649a2934dffcaecc032789259024db35146ce1881c52\nbef5277d8fa56e64fa435c29373f64312c3ccf2e2fab969110ba36dfd55ad4ae\n6dfc8283998a7fe02d09bf10856f32f65feb56c8cdc05ac9858e2eccdc38549e",
    "block_id": "1",
    "limit": "3"
   },
   "expected": {
    "error": "Block not found"
   },
   "note": "Answered NOT_FOUND."
  },
  {
   "id": "24-4-no-milestone",
   "chapter": "24",
   "section": "4",
   "title": "Server tip 12,471, our tip unknown to it, no milestone",
   "kind": "24-milestones",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "tip": "12471",
    "milestone_height": "",
    "both_zero": "false"
   },
   "expected": {
    "heights": "12471\n12461\n12451\n12441\n12431\n12421\n12411\n12401\n12391\n12381"
   }
  },
  {
   "id": "24-4-milestone",
   "chapter": "24",
   "section": "4",
   "title": "The same with the milestone at 12,381",
   "kind": "24-milestones",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "tip": "12471",
    "milestone_height": "12381",
    "both_zero": "false"
   },
   "expected": {
    "heights": "12381\n11661\n10941\n10221\n9501\n8781\n8061\n7341\n6621\n5901"
   }
  },
  {
   "id": "24-4-short-chain",
   "chapter": "24",
   "section": "4",
   "title": "Server tip 25, no milestone",
   "kind": "24-milestones",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "tip": "25",
    "milestone_height": "",
    "both_zero": "false"
   },
   "expected": {
    "heights": "25\n15\n5\n0"
   }
  },
  {
   "id": "24-4-both-zero",
   "chapter": "24",
   "section": "4",
   "title": "Both ids 0",
   "kind": "24-milestones",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "tip": "25",
    "milestone_height": "",
    "both_zero": "true"
   },
   "expected": {
    "error": "either LastBlockID or LastMilestoneBlockID has to be supplied"
   }
  },
  {
   "id": "24-4-walk",
   "chapter": "24",
   "section": "4",
   "title": "The walk from milestone 12,381 to the split",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "common": "12410",
    "first_fork_block": "the peer's next id"
   }
  },
  {
   "id": "24-5-fork-3-1-1",
   "chapter": "24",
   "section": "5",
   "title": "Fork poll: 3 for, 1 against, 1 abstaining",
   "kind": "24-fork-poll",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "voters": "5",
    "fork": "200",
    "ours": "100",
    "answers": "200\n300\n250\n150\n50"
   },
   "expected": {
    "verdict": "confirmed"
   }
  },
  {
   "id": "24-5-fork-2-1",
   "chapter": "24",
   "section": "5",
   "title": "Fork poll: 2 for, 1 against",
   "kind": "24-fork-poll",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "voters": "5",
    "fork": "200",
    "ours": "100",
    "answers": "200\n300\n150"
   },
   "expected": {
    "verdict": "confirmed"
   }
  },
  {
   "id": "24-5-fork-1-1",
   "chapter": "24",
   "section": "5",
   "title": "Fork poll: 1 for, 1 against",
   "kind": "24-fork-poll",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "voters": "5",
    "fork": "200",
    "ours": "100",
    "answers": "200\n150\n50"
   },
   "expected": {
    "verdict": "rejected"
   }
  },
  {
   "id": "24-5-fork-two-voters",
   "chapter": "24",
   "section": "5",
   "title": "Fork poll with 2 voters only",
   "kind": "24-fork-poll",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "voters": "2",
    "fork": "11811449964",
    "ours": "11810449964",
    "answers": "11811449964\n11811449964"
   },
   "expected": {
    "verdict": "confirmed (weight alone)"
   }
  },
  {
   "id": "24-5-milestone-pass",
   "chapter": "24",
   "section": "5",
   "title": "Milestone poll: 1 confirms, 3 disagree on 3 different heavy heads",
   "kind": "24-milestone-poll",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "voters": "4",
    "answers": "confirm\ndisagree h1 heavy\ndisagree h2 heavy\ndisagree h3 heavy"
   },
   "expected": {
    "verdict": "pass"
   }
  },
  {
   "id": "24-5-milestone-fail",
   "chapter": "24",
   "section": "5",
   "title": "Milestone poll: none confirms, 2 heavy on one head",
   "kind": "24-milestone-poll",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "voters": "4",
    "answers": "disagree h1 heavy\ndisagree h1 heavy\ndisagree h2 light\ndisagree h3 light"
   },
   "expected": {
    "verdict": "fail"
   }
  },
  {
   "id": "24-5-milestone-few",
   "chapter": "24",
   "section": "5",
   "title": "Milestone poll with fewer than 3 voters",
   "kind": "24-milestone-poll",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "voters": "2",
    "answers": "abstain\nabstain"
   },
   "expected": {
    "verdict": "pass"
   }
  },
  {
   "id": "24-5-hash-verify",
   "chapter": "24",
   "section": "5",
   "title": "Hash verification: peers report A, A, B; ours is B",
   "kind": "24-hash-verify",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "ours": "B",
    "reports": "A\nA\nB"
   },
   "expected": {
    "consensus": "A",
    "verified": "false"
   }
  },
  {
   "id": "24-6-balance",
   "chapter": "24",
   "section": "6",
   "title": "account_balance rows of A at 10, 15, 20; pop to 17",
   "kind": "24-rollback-versioned",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "account_balance",
    "rows": "A 10 100\nA 15 80 60\nA 20 50",
    "target": "17"
   },
   "expected": {
    "kept": "A 10 100\nA 15 80",
    "latest": "A 15 80",
    "spendable": "A 80"
   },
   "note": "The height-15 row carried a reservation (spendable 60); the pop sets every latest row's spendable_balance to its balance."
  },
  {
   "id": "24-6-token",
   "chapter": "24",
   "section": "6",
   "title": "A token whose only row is at 18; pop to 17",
   "kind": "24-rollback-versioned",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "token",
    "rows": "7 18 1000",
    "target": "17"
   },
   "expected": {
    "kept": "",
    "latest": ""
   },
   "note": "Token 7 does not exist after the pop."
  },
  {
   "id": "24-6-receipts",
   "chapter": "24",
   "section": "6",
   "title": "published_receipt rows at 16, 17, 18; pop to 17",
   "kind": "24-rollback-versioned",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "published_receipt",
    "rows": "r 16 a\nr 17 b\nr 18 c",
    "target": "17"
   },
   "expected": {
    "kept": "r 16 a\nr 17 b"
   }
  },
  {
   "id": "24-6-survival",
   "chapter": "24",
   "section": "6",
   "title": "survival_state rows (16, true), (17, true), (18, false); pop to 17",
   "kind": "24-rollback-versioned",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "survival_state",
    "rows": "16 16 true\n17 17 true\n18 18 false",
    "target": "17"
   },
   "expected": {
    "kept": "16 16 true\n17 17 true"
   }
  },
  {
   "id": "24-6-params",
   "chapter": "24",
   "section": "6",
   "title": "consensus_parameter_change rows 7 and 9 of min_fee above 17",
   "kind": "24-param-restore",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "current": "4000000",
    "changes": "7 1 2500000 18\n9 1 3000000 20",
    "target": "17"
   },
   "expected": {
    "value": "2500000",
    "change_rows": "0"
   },
   "note": "Row 9 is put back first, then row 7; both change rows are deleted."
  },
  {
   "id": "24-6-decision-kept",
   "chapter": "24",
   "section": "6",
   "title": "A readiness_bundle_decision row (602, effective 5,001, height 5,000); pop to 5,000",
   "kind": "24-readiness-pop",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "bundle": "602",
    "effective_height": "5001",
    "height": "5000",
    "target": "5000"
   },
   "expected": {
    "row": "kept",
    "gate": "5001"
   }
  },
  {
   "id": "24-6-decision-popped",
   "chapter": "24",
   "section": "6",
   "title": "The same row; pop to 4,999",
   "kind": "24-readiness-pop",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "bundle": "602",
    "effective_height": "5001",
    "height": "5000",
    "target": "4999"
   },
   "expected": {
    "row": "deleted",
    "gate": "held"
   },
   "note": "The gate holds bundle 602 until a block re-decides it on the way up."
  },
  {
   "id": "24-6-finalized",
   "chapter": "24",
   "section": "6",
   "title": "A pop to 995 below the finalized height 1,000",
   "kind": "24-pop-refusal",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "tip": "1010",
    "tip_id": "1",
    "target": "995",
    "target_id": "2",
    "finalized": "1000"
   },
   "expected": {
    "verdict": "PopOffToBlock: target 995 is below the finalized height 1000 (rule checkpoint_finality)"
   }
  },
  {
   "id": "24-6-above-tip",
   "chapter": "24",
   "section": "6",
   "title": "A target above the tip",
   "kind": "24-pop-refusal",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "tip": "100",
    "tip_id": "1",
    "target": "101",
    "target_id": "2",
    "finalized": "0"
   },
   "expected": {
    "verdict": "PopOffToBlock: Target block height exceeds current height"
   }
  },
  {
   "id": "24-6-same-height",
   "chapter": "24",
   "section": "6",
   "title": "A target at the tip's height with another id",
   "kind": "24-pop-refusal",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "tip": "100",
    "tip_id": "1",
    "target": "100",
    "target_id": "2",
    "finalized": "0"
   },
   "expected": {
    "verdict": "PopOffToBlock: Target and current at same height but different block IDs"
   }
  },
  {
   "id": "24-7-position-0",
   "chapter": "24",
   "section": "7",
   "title": "Two candidates, the clock in position 0's window",
   "kind": "19-candidate-select",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "previous_timestamp": "1000",
    "now": "1015",
    "candidates": "0 1015\n1 1030"
   },
   "expected": {
    "selected": "0"
   }
  },
  {
   "id": "24-7-between",
   "chapter": "24",
   "section": "7",
   "title": "Between the two windows nothing is selected",
   "kind": "19-candidate-select",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "previous_timestamp": "1000",
    "now": "1025",
    "candidates": "0 1015\n1 1030"
   },
   "expected": {
    "selected": "-1"
   }
  },
  {
   "id": "24-7-position-1",
   "chapter": "24",
   "section": "7",
   "title": "Position 0's window has closed",
   "kind": "19-candidate-select",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "previous_timestamp": "1000",
    "now": "1030",
    "candidates": "0 1015\n1 1030"
   },
   "expected": {
    "selected": "1"
   }
  },
  {
   "id": "24-7-fails-pass",
   "chapter": "24",
   "section": "7",
   "title": "After a failing position-0 candidate is removed at P + 15, the pass selects nothing more",
   "kind": "19-candidate-select",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "previous_timestamp": "1000",
    "now": "1015",
    "candidates": "1 1030"
   },
   "expected": {
    "selected": "-1"
   }
  },
  {
   "id": "24-7-fails-later",
   "chapter": "24",
   "section": "7",
   "title": "Position 1 is applied once its window opens",
   "kind": "19-candidate-select",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "previous_timestamp": "1000",
    "now": "1028",
    "candidates": "1 1030"
   },
   "expected": {
    "selected": "0"
   }
  },
  {
   "id": "24-8-resolve",
   "chapter": "24",
   "section": "8",
   "title": "5 answers: 3 heavier, 3 ahead",
   "kind": "24-health-check",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "answers": "5",
    "heavier": "3",
    "ahead": "3",
    "pending": "false"
   },
   "expected": {
    "resolve": "true"
   }
  },
  {
   "id": "24-8-no",
   "chapter": "24",
   "section": "8",
   "title": "5 answers: 3 heavier, 2 ahead, nothing pending",
   "kind": "24-health-check",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "answers": "5",
    "heavier": "3",
    "ahead": "2",
    "pending": "false"
   },
   "expected": {
    "resolve": "false"
   }
  },
  {
   "id": "24-8-pending",
   "chapter": "24",
   "section": "8",
   "title": "The same with an investigation pending",
   "kind": "24-health-check",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "answers": "5",
    "heavier": "3",
    "ahead": "2",
    "pending": "true"
   },
   "expected": {
    "resolve": "true"
   }
  },
  {
   "id": "24-8-one",
   "chapter": "24",
   "section": "8",
   "title": "1 answer",
   "kind": "24-health-check",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "answers": "1",
    "heavier": "1",
    "ahead": "1",
    "pending": "true"
   },
   "expected": {
    "resolve": "false"
   }
  },
  {
   "id": "24-9-queue",
   "chapter": "24",
   "section": "9",
   "title": "A block of 3 ids, one unknown",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "queued": "one missing id at position 2",
    "arrives after 40 s": "complete and validated",
    "not within 120 s": "dropped"
   }
  },
  {
   "id": "24-10-streak",
   "chapter": "24",
   "section": "10",
   "title": "10 failures at height 134,583 against two peers over 2,040 s, no wedge verdict",
   "kind": "24-streak",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "events": "failure 134583 p0 1793502060\nfailure 134583 p1 1793502286\nfailure 134583 p0 1793502513\nfailure 134583 p1 1793502740\nfailure 134583 p0 1793502966\nfailure 134583 p1 1793503193\nfailure 134583 p0 1793503420\nfailure 134583 p1 1793503646\nfailure 134583 p0 1793503873\nfailure 134583 p1 1793504100"
   },
   "expected": {
    "streak": "10",
    "report": "fork resolution failed 10 times in a row against 2 distinct peers over 2040s, with height frozen at 134583",
    "wedge": "false"
   },
   "note": "The streak is reported in the log only: no wedge reason, no resync marker."
  },
  {
   "id": "24-10-streak-verdict",
   "chapter": "24",
   "section": "10",
   "title": "The same streak after a wedge verdict on signed evidence",
   "kind": "24-streak",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "events": "failure 134583 p0 1793502060\nfailure 134583 p1 1793502286\nfailure 134583 p0 1793502513\nfailure 134583 p1 1793502740\nfailure 134583 p0 1793502966\nfailure 134583 p1 1793503193\nfailure 134583 p0 1793503420\nfailure 134583 p1 1793503646\nfailure 134583 p0 1793503873\nfailure 134583 p1 1793504100",
    "verdict": "true"
   },
   "expected": {
    "streak": "10",
    "wedge": "true"
   }
  },
  {
   "id": "24-10-short",
   "chapter": "24",
   "section": "10",
   "title": "10 failures within 20 minutes",
   "kind": "24-streak",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "events": "failure 134583 p0 1793502060\nfailure 134583 p1 1793502180\nfailure 134583 p0 1793502300\nfailure 134583 p1 1793502420\nfailure 134583 p0 1793502540\nfailure 134583 p1 1793502660\nfailure 134583 p0 1793502780\nfailure 134583 p1 1793502900\nfailure 134583 p0 1793503020\nfailure 134583 p1 1793503140"
   },
   "expected": {
    "streak": "10",
    "report": ""
   }
  },
  {
   "id": "24-10-cleared",
   "chapter": "24",
   "section": "10",
   "title": "9 failures, then a success",
   "kind": "24-streak",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "events": "failure 134583 p0 1793502060\nfailure 134583 p1 1793502360\nfailure 134583 p0 1793502660\nfailure 134583 p1 1793502960\nfailure 134583 p0 1793503260\nfailure 134583 p1 1793503560\nfailure 134583 p0 1793503860\nfailure 134583 p1 1793504160\nfailure 134583 p0 1793504460\nsuccess"
   },
   "expected": {
    "streak": "0",
    "report": ""
   }
  },
  {
   "id": "24-10-recovery",
   "chapter": "24",
   "section": "10",
   "title": "A wedge: recovered in place, or declared in backoff",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "recovery succeeds": "rebuilt in place",
    "recovery 60 s ago": "declared; with auto_resync a marker is written and the node exits"
   }
  }
 ]
}
