{
 "format": "zoobc-conformance-vectors/1",
 "edition": "0.6.1",
 "chapter": "26",
 "license": "CC BY 4.0, ZooBC Foundation",
 "cases": [
  {
   "id": "26-0-intervals",
   "chapter": "26",
   "section": "0",
   "title": "The snapshot interval and depth on each chain",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "testnet_interval": "172800",
    "testnet_depth": "760",
    "devnet_interval": "240",
    "devnet_depth": "80",
    "depth_when_zero": "1440",
    "chunk_size": "102400",
    "state_tables": "65",
    "block_reach": "1440",
    "locally_kept": "3",
    "archive_holders": "5"
   }
  },
  {
   "id": "26-1-testnet-first",
   "chapter": "26",
   "section": "1",
   "title": "The first TestNet snapshot: tip 172,800, height 172,040, a 90-day manifest",
   "kind": "26-schedule",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "interval": "172800",
    "min_height": "760",
    "height": "172800",
    "timestamp": "0",
    "block_time": "15",
    "expiration_override": "0",
    "node_key": ""
   },
   "expected": {
    "trigger": "true",
    "snapshot_height": "172040",
    "lifetime": "7776000",
    "stagger_window": "60"
   }
  },
  {
   "id": "26-1-devnet-480",
   "chapter": "26",
   "section": "1",
   "title": "DevNet: tip 480 gives S = 400 and a 30-day manifest",
   "kind": "26-schedule",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "interval": "240",
    "min_height": "80",
    "height": "480",
    "timestamp": "0",
    "block_time": "15",
    "expiration_override": "0",
    "node_key": ""
   },
   "expected": {
    "trigger": "true",
    "snapshot_height": "400",
    "lifetime": "2592000",
    "stagger_window": "24"
   }
  },
  {
   "id": "26-1-no-trigger",
   "chapter": "26",
   "section": "1",
   "title": "A tip that is not a multiple of the interval takes no snapshot",
   "kind": "26-schedule",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "interval": "240",
    "min_height": "80",
    "height": "500",
    "timestamp": "0",
    "block_time": "15",
    "expiration_override": "0",
    "node_key": ""
   },
   "expected": {
    "trigger": "false"
   }
  },
  {
   "id": "26-1-stagger",
   "chapter": "26",
   "section": "1",
   "title": "A node's stagger offset is FNV-1a of its key modulo the window plus one",
   "kind": "26-schedule",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "interval": "172800",
    "min_height": "760",
    "height": "172800",
    "timestamp": "1793600000",
    "block_time": "15",
    "expiration_override": "0",
    "node_key": "eb89f581920cac9343663a33911d76cef5c89390f25865651d902792b881ad65"
   },
   "expected": {
    "trigger": "true",
    "expiration": "1801376000",
    "stagger_window": "60"
   }
  },
  {
   "id": "26-1-too-low",
   "chapter": "26",
   "section": "1",
   "title": "A height at or below the depth has no snapshot",
   "kind": "26-schedule",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "interval": "240",
    "min_height": "80",
    "height": "80",
    "timestamp": "0",
    "block_time": "15",
    "expiration_override": "0",
    "node_key": ""
   },
   "expected": {
    "error": "Invalid snapshot height"
   }
  },
  {
   "id": "26-1-no-fast-sync-before",
   "chapter": "26",
   "section": "1",
   "title": "Before TestNet block 172,800 there is no manifest, so no fast sync",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "value": "every TestNet node syncs from genesis until the first snapshot is published at tip 172,800"
   }
  },
  {
   "id": "26-2-minimal",
   "chapter": "26",
   "section": "2",
   "title": "A minimal document: sorted keys, minimal integers, 165 bytes",
   "kind": "26-document",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedBlocks\":[],\"FundedTransactions\":[],\"SnapshotFormat\":3,\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"height\"],\"Rows\":[[0,1],[1,2]]},\"bridge_coin\":{\"Columns\":[],\"Rows\":[]}}}"
   },
   "expected": {
    "cbor": "A574457363726F7765645472616E73616374696F6E73806C46756E646564426C6F636B73807246756E6465645472616E73616374696F6E73806E536E617073686F74466F726D6174036B53746174655461626C6573A26B6272696467655F636F696EA267436F6C756D6E738064526F7773806E737572766976616C5F7374617465A267436F6C756D6E7382666163746976656668656967687464526F777382820001820102",
    "length": "165",
    "full_file_hash": "169263781B6EF81747432AA279B3D23508508E046D77728BC524B78C8CD1683B",
    "directory": "FpJjeBtu-BdHQyqiebPSNQhQjgRtd3KLxSS3jIzRaDs="
   }
  },
  {
   "id": "26-2-minimal-one-chunk",
   "chapter": "26",
   "section": "2",
   "title": "The minimal document is one chunk whose hash is the document's",
   "kind": "26-chunks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "document": "A574457363726F7765645472616E73616374696F6E73806C46756E646564426C6F636B73807246756E6465645472616E73616374696F6E73806E536E617073686F74466F726D6174036B53746174655461626C6573A26B6272696467655F636F696EA267436F6C756D6E738064526F7773806E737572766976616C5F7374617465A267436F6C756D6E7382666163746976656668656967687464526F777382820001820102",
    "length": "0",
    "mod": "1"
   },
   "expected": {
    "chunk_sizes": "165",
    "chunk_hashes": "169263781B6EF81747432AA279B3D23508508E046D77728BC524B78C8CD1683B",
    "chunk_names": "FpJjeBtu-BdHQyqiebPSNQhQjgRtd3KLxSS3jIzRaDs="
   }
  },
  {
   "id": "26-2-bytes-negative",
   "chapter": "26",
   "section": "2",
   "title": "Blobs are byte strings, text is text, negatives use major type 1",
   "kind": "26-document",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "document": "{\"B\":\"h'0102'\",\"T\":\"ab\",\"N\":-1,\"Z\":null,\"L\":1000000}"
   },
   "expected": {
    "cbor": "A56142420102614C1A000F4240614E206154626162615AF6",
    "length": "24"
   },
   "note": "Keys sorted B, L, N, T, Z; the blob h'0102' is major type 2, 1,000,000 a four-byte integer, -1 the byte 20, null F6."
  },
  {
   "id": "26-2-format-2",
   "chapter": "26",
   "section": "2",
   "title": "A document of format 2 is refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedBlocks\":[],\"FundedTransactions\":[],\"SnapshotFormat\":2,\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"height\"],\"Rows\":[[0,1],[1,2]]},\"bridge_coin\":{\"Columns\":[],\"Rows\":[]}}}",
    "held_survival": ""
   },
   "expected": {
    "error": "Snapshot format 2 is not accepted: this node reads format 3 only. Take the snapshot from a node running the same release, or sync from genesis."
   },
   "note": "The chapter abbreviates the text after 'is not accepted'."
  },
  {
   "id": "26-2-no-format",
   "chapter": "26",
   "section": "2",
   "title": "A document without SnapshotFormat reads as format 1 and is refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedBlocks\":[],\"FundedTransactions\":[],\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"height\"],\"Rows\":[[0,1],[1,2]]},\"bridge_coin\":{\"Columns\":[],\"Rows\":[]}}}",
    "held_survival": ""
   },
   "expected": {
    "error": "Snapshot format 1 is not accepted: this node reads format 3 only. Take the snapshot from a node running the same release, or sync from genesis."
   }
  },
  {
   "id": "26-2-no-escrowed",
   "chapter": "26",
   "section": "2",
   "title": "A document without EscrowedTransactions is refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "{\"FundedBlocks\":[],\"FundedTransactions\":[],\"SnapshotFormat\":3,\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"height\"],\"Rows\":[[0,1],[1,2]]},\"bridge_coin\":{\"Columns\":[],\"Rows\":[]}}}",
    "held_survival": ""
   },
   "expected": {
    "error": "snapshot has no EscrowedTransactions section: this node would lack the transactions of pending escrows"
   }
  },
  {
   "id": "26-2-no-funded-blocks",
   "chapter": "26",
   "section": "2",
   "title": "A document without FundedBlocks is refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedTransactions\":[],\"SnapshotFormat\":3,\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"height\"],\"Rows\":[[0,1],[1,2]]},\"bridge_coin\":{\"Columns\":[],\"Rows\":[]}}}",
    "held_survival": ""
   },
   "expected": {
    "error": "snapshot has no FundedBlocks section: this node would hold funded transactions without the headers of their blocks"
   }
  },
  {
   "id": "26-2-no-funded-transactions",
   "chapter": "26",
   "section": "2",
   "title": "A document without FundedTransactions is refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedBlocks\":[],\"SnapshotFormat\":3,\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"height\"],\"Rows\":[[0,1],[1,2]]},\"bridge_coin\":{\"Columns\":[],\"Rows\":[]}}}",
    "held_survival": ""
   },
   "expected": {
    "error": "snapshot has no FundedTransactions section (rule snapshot_funded_transactions): built before the rule; this node would hold nothing of what the deposits keep alive"
   }
  },
  {
   "id": "26-2-no-state-tables",
   "chapter": "26",
   "section": "2",
   "title": "A document without StateTables is refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedBlocks\":[],\"FundedTransactions\":[],\"SnapshotFormat\":3}",
    "held_survival": ""
   },
   "expected": {
    "error": "Snapshot has no StateTables section"
   }
  },
  {
   "id": "26-2-testnet-windows",
   "chapter": "26",
   "section": "2",
   "title": "TestNet S = 172,040: the RecentTransactions window is interval + depth, the Blocks from 170,600 (1,441 headers)",
   "kind": "26-windows",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "snapshot_height": "172040",
    "min_height": "760",
    "interval": "172800",
    "min_block_interval": "15",
    "receipt_lookback": "40"
   },
   "expected": {
    "replay": "6924",
    "recent_window": "173560",
    "recent_from": "1",
    "blocks_from": "170600",
    "block_count": "1441",
    "receipts_from": "171280"
   },
   "note": "Blocks from min(S - 60, S - 760, S - 1,440) = min(171,980, 171,280, 170,600)."
  },
  {
   "id": "26-2-devnet-windows",
   "chapter": "26",
   "section": "2",
   "title": "DevNet: 6,924 blocks of transactions and the headers from S - 1,440",
   "kind": "26-windows",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "snapshot_height": "10000",
    "min_height": "80",
    "interval": "240",
    "min_block_interval": "15",
    "receipt_lookback": "40"
   },
   "expected": {
    "replay": "6924",
    "recent_window": "6924",
    "recent_from": "3076",
    "blocks_from": "8560",
    "block_count": "1441",
    "receipts_from": "9920"
   }
  },
  {
   "id": "26-2-devnet-early",
   "chapter": "26",
   "section": "2",
   "title": "DevNet S = 400: the bound is below 0, so blocks 1 to 400",
   "kind": "26-windows",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "snapshot_height": "400",
    "min_height": "80",
    "interval": "240",
    "min_block_interval": "15",
    "receipt_lookback": "40"
   },
   "expected": {
    "recent_from": "1",
    "blocks_from": "0",
    "block_count": "400",
    "receipts_from": "320"
   }
  },
  {
   "id": "26-2-table-list",
   "chapter": "26",
   "section": "2",
   "title": "The 65 state tables in the writer's order, and the five with a gate of their own",
   "kind": "26-state-tables",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "count": "65",
    "tables": "account_balance\naccount_token_balance\naccount_split_policy\naccount_group\naccount_group_member\nspent_foreign_message\ntoken\naccount_dataset\ndataset_object\ndataset_delete_vote\nstored_file\nstorage_proof\nlongevity\nlongevity_funder\nlongevity_deposit\nlongevity_vote\nfile_deposit\nescrow_transaction\nescrow_request\nliquid_payment_transaction\ntrigger_schedule\npending_transaction\npending_signature\nmultisignature_info\nmultisignature_participant\nswap_offer\nmarket\norder_book\ntrade\napp\napp_settlement\nnode_registry\nparticipation_score\nnode_admission_timestamp\nskipped_blocksmith\nnode_liveness\nqueue_attendance\nqueue_state\nliveness_expulsion\nscore_unit_clock\nsurvival_state\nreadiness_bundle_decision\nlock_release\nnode_claim\nnode_exit\nseat_change\nroll_call\nequivocation_charge\nspine_equivocation_charge\narchival_registry\ngateway_registry\nrelay_registry\nrelease_authority\nrelease_registry\nconsensus_parameters\nconsensus_parameter_change\nfee_scale\nfee_vote_commitment_vote\nfee_vote_reveal_vote\noracle_attestation\noracle_result\nbridge_withdrawal_request\nnetwork_topology\nbridge_coin\nchain_metadata",
    "gated": "survival_state survival_mode\nreadiness_bundle_decision readiness_decision_state\nspine_equivocation_charge spine_equivocation_report\nbridge_withdrawal_request bridge_withdrawal_credit\nchain_metadata escrow_commission_nonnegative"
   },
   "note": "Every gate is active from height 0 on every chain, so all 65 tables travel; the column dataset_object.last_billing_height travels under dataset_rent_object_clock."
  },
  {
   "id": "26-3-three-chunks",
   "chapter": "26",
   "section": "3",
   "title": "A 250,000-byte document cut into three chunks",
   "kind": "26-chunks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "document": ""
   },
   "expected": {
    "chunk_sizes": "102400\n102400\n45200",
    "full_file_hash": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30",
    "directory": "spWzKZg1R8Kt2MQvd5uZh8K1KDm3PXlX2sV5ihZ43DA=",
    "chunk_names": "FPYeC1MqlWaAE1nDI4zPwltmssZIFTk0mP_B9g_HMeY=\n07SBXgM30orafWCfJQNlXLVHXZFcPEqaldmRvno0MNs=\nI90pRVbfeGcHD-sHhBD8KklO6Iq2YxVYpnEI0bznCHg="
   }
  },
  {
   "id": "26-3-exact-multiple",
   "chapter": "26",
   "section": "3",
   "title": "A document of exactly two chunk sizes makes two full chunks",
   "kind": "26-chunks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "document": "",
    "length": "204800",
    "mod": "251"
   },
   "expected": {
    "chunk_sizes": "102400\n102400"
   }
  },
  {
   "id": "26-4-serve-three",
   "chapter": "26",
   "section": "4",
   "title": "A request for the three names returns three chunks in request order",
   "kind": "26-serve-chunks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "snapshot_hash": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30",
    "names": "FPYeC1MqlWaAE1nDI4zPwltmssZIFTk0mP_B9g_HMeY=\n07SBXgM30orafWCfJQNlXLVHXZFcPEqaldmRvno0MNs=\nI90pRVbfeGcHD-sHhBD8KklO6Iq2YxVYpnEI0bznCHg="
   },
   "expected": {
    "chunk_sizes": "102400\n102400\n45200",
    "failed": ""
   }
  },
  {
   "id": "26-4-serve-reordered",
   "chapter": "26",
   "section": "4",
   "title": "Chunks come back in the order they were asked for",
   "kind": "26-serve-chunks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "snapshot_hash": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30",
    "names": "I90pRVbfeGcHD-sHhBD8KklO6Iq2YxVYpnEI0bznCHg=\nFPYeC1MqlWaAE1nDI4zPwltmssZIFTk0mP_B9g_HMeY="
   },
   "expected": {
    "chunk_sizes": "45200\n102400",
    "failed": ""
   }
  },
  {
   "id": "26-4-traversal",
   "chapter": "26",
   "section": "4",
   "title": "A name with '..' goes to Failed",
   "kind": "26-serve-chunks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "snapshot_hash": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30",
    "names": "../x\nFPYeC1MqlWaAE1nDI4zPwltmssZIFTk0mP_B9g_HMeY="
   },
   "expected": {
    "chunk_sizes": "102400",
    "failed": "../x"
   }
  },
  {
   "id": "26-4-unknown-name",
   "chapter": "26",
   "section": "4",
   "title": "An unknown name goes to Failed",
   "kind": "26-serve-chunks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "snapshot_hash": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30",
    "names": "nope"
   },
   "expected": {
    "chunk_sizes": "",
    "failed": "nope"
   }
  },
  {
   "id": "26-4-long-name",
   "chapter": "26",
   "section": "4",
   "title": "A name over 128 characters goes to Failed",
   "kind": "26-serve-chunks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "snapshot_hash": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30",
    "names": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
   },
   "expected": {
    "failed": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
   }
  },
  {
   "id": "26-4-empty-hash",
   "chapter": "26",
   "section": "4",
   "title": "An empty snapshot hash is refused",
   "kind": "26-serve-chunks",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "snapshot_hash": "",
    "names": "FPYeC1MqlWaAE1nDI4zPwltmssZIFTk0mP_B9g_HMeY="
   },
   "expected": {
    "error": "empty snapshot hash"
   }
  },
  {
   "id": "26-4-no-names",
   "chapter": "26",
   "section": "4",
   "title": "A request without names is refused",
   "kind": "26-serve-chunks",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "snapshot_hash": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30",
    "names": ""
   },
   "expected": {
    "error": "request does not contain any file name"
   }
  },
  {
   "id": "26-4-too-many",
   "chapter": "26",
   "section": "4",
   "title": "More than 32 names are refused",
   "kind": "26-serve-chunks",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "snapshot_hash": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30",
    "names": "n0\nn1\nn2\nn3\nn4\nn5\nn6\nn7\nn8\nn9\nn10\nn11\nn12\nn13\nn14\nn15\nn16\nn17\nn18\nn19\nn20\nn21\nn22\nn23\nn24\nn25\nn26\nn27\nn28\nn29\nn30\nn31\nn32"
   },
   "expected": {
    "error": "Too many file chunks requested"
   }
  },
  {
   "id": "26-5-walk",
   "chapter": "26",
   "section": "5",
   "title": "A node at 1,000: the walk lists 1,840, 1,600 and 1,360",
   "kind": "26-manifest-walk",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "manifests": "1360\n1600\n1840",
    "target": "1900",
    "floor": "1000"
   },
   "expected": {
    "points": "1840\n1600\n1360"
   },
   "note": "The target (the best peer's height) is not stated; any height from 1,840 up gives the same list."
  },
  {
   "id": "26-5-walk-unavailable",
   "chapter": "26",
   "section": "5",
   "title": "After 1,840 failed to download it is skipped and 1,600 is the first point",
   "kind": "26-manifest-walk",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "manifests": "1840 unavailable\n1600\n1360",
    "target": "1900",
    "floor": "1000"
   },
   "expected": {
    "points": "1600\n1360"
   }
  },
  {
   "id": "26-5-walk-floor",
   "chapter": "26",
   "section": "5",
   "title": "At height 1,700 the floor leaves only 1,840",
   "kind": "26-manifest-walk",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "manifests": "1840\n1600\n1360",
    "target": "1900",
    "floor": "1700"
   },
   "expected": {
    "points": "1840"
   }
  },
  {
   "id": "26-5-walk-none",
   "chapter": "26",
   "section": "5",
   "title": "At 1,700 with 1,840 unavailable no sync point is left (block-by-block sync)",
   "kind": "26-manifest-walk",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "manifests": "1840 unavailable\n1600\n1360",
    "target": "1900",
    "floor": "1700"
   },
   "expected": {
    "error": "No valid sync point among 3 manifest(s): the snapshot of height 1360 is not above this node's height 1700"
   }
  },
  {
   "id": "26-5-walk-refused",
   "chapter": "26",
   "section": "5",
   "title": "A refused newest manifest ends the walk with an error",
   "kind": "26-manifest-walk",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "manifests": "1840 refused\n1600\n1360",
    "target": "1900",
    "floor": "1000"
   },
   "expected": {
    "error": "Manifest refused 0 min ago: its state disagreed with registered peers"
   }
  },
  {
   "id": "26-5-walk-refused-later",
   "chapter": "26",
   "section": "5",
   "title": "A refused manifest after a usable one ends the walk there",
   "kind": "26-manifest-walk",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "manifests": "1840\n1600 refused\n1360",
    "target": "1900",
    "floor": "1000"
   },
   "expected": {
    "points": "1840"
   }
  },
  {
   "id": "26-5-walk-ahead",
   "chapter": "26",
   "section": "5",
   "title": "A manifest above the target is skipped",
   "kind": "26-manifest-walk",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "manifests": "1840\n1600\n1360",
    "target": "1700",
    "floor": "1000"
   },
   "expected": {
    "points": "1600\n1360"
   }
  },
  {
   "id": "26-5-walk-empty",
   "chapter": "26",
   "section": "5",
   "title": "No manifest at all",
   "kind": "26-manifest-walk",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "manifests": "",
    "target": "1900",
    "floor": "0"
   },
   "expected": {
    "error": "No manifest for this chain"
   }
  },
  {
   "id": "26-5-walk-limit",
   "chapter": "26",
   "section": "5",
   "title": "Only the newest 8 manifests are walked",
   "kind": "26-manifest-walk",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "manifests": "240\n480\n720\n960\n1200\n1440\n1680\n1920\n2160\n2400",
    "target": "5000",
    "floor": "0"
   },
   "expected": {
    "points": "2400\n2160\n1920\n1680\n1440\n1200\n960\n720"
   }
  },
  {
   "id": "26-5-testnet-genesis-sync",
   "chapter": "26",
   "section": "5",
   "title": "TestNet: no manifest before block 172,800",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "value": "until the first manifest every node syncs from genesis",
    "min_blocks_behind": "100"
   }
  },
  {
   "id": "26-6-in-order",
   "chapter": "26",
   "section": "6",
   "title": "The three chunks are requested in index order and the whole verifies",
   "kind": "26-download",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "tamper": "",
    "manifest_full_hash": ""
   },
   "expected": {
    "requested": "FPYeC1MqlWaAE1nDI4zPwltmssZIFTk0mP_B9g_HMeY=\n07SBXgM30orafWCfJQNlXLVHXZFcPEqaldmRvno0MNs=\nI90pRVbfeGcHD-sHhBD8KklO6Iq2YxVYpnEI0bznCHg=",
    "verified": "true"
   }
  },
  {
   "id": "26-6-tampered",
   "chapter": "26",
   "section": "6",
   "title": "A copy of chunk 1 with one byte changed ends the attempt",
   "kind": "26-download",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "tamper": "1",
    "manifest_full_hash": ""
   },
   "expected": {
    "error": "Chunk 1 verification failed"
   }
  },
  {
   "id": "26-6-full-mismatch",
   "chapter": "26",
   "section": "6",
   "title": "Chunks that match but a different full_file_hash fail the whole",
   "kind": "26-download",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "length": "250000",
    "mod": "251",
    "tamper": "",
    "manifest_full_hash": "1111111111111111111111111111111111111111111111111111111111111111"
   },
   "expected": {
    "error": "Full file hash mismatch"
   }
  },
  {
   "id": "26-7-apply",
   "chapter": "26",
   "section": "7",
   "title": "Applying the minimal document replaces survival_state and empties bridge_coin",
   "kind": "26-snapshot-read",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedBlocks\":[],\"FundedTransactions\":[],\"SnapshotFormat\":3,\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"height\"],\"Rows\":[[0,1],[1,2]]},\"bridge_coin\":{\"Columns\":[],\"Rows\":[]}}}",
    "held_survival": "1-900"
   },
   "expected": {
    "survival_state": "height 1 active 0\nheight 2 active 1",
    "bridge_coin": "0"
   }
  },
  {
   "id": "26-7-short-row",
   "chapter": "26",
   "section": "7",
   "title": "A row with one value for two columns is refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedBlocks\":[],\"FundedTransactions\":[],\"SnapshotFormat\":3,\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"height\"],\"Rows\":[[0]]},\"bridge_coin\":{\"Columns\":[],\"Rows\":[]}}}",
    "held_survival": "1-900"
   },
   "expected": {
    "error": "Malformed snapshot row in survival_state"
   }
  },
  {
   "id": "26-7-rows-no-columns",
   "chapter": "26",
   "section": "7",
   "title": "Rows without columns are refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedBlocks\":[],\"FundedTransactions\":[],\"SnapshotFormat\":3,\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"height\"],\"Rows\":[[0,1],[1,2]]},\"bridge_coin\":{\"Columns\":[],\"Rows\":[[1]]}}}",
    "held_survival": "1-900"
   },
   "expected": {
    "error": "Snapshot table bridge_coin has rows but no columns"
   }
  },
  {
   "id": "26-7-unknown-column",
   "chapter": "26",
   "section": "7",
   "title": "A column this node does not have is refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedBlocks\":[],\"FundedTransactions\":[],\"SnapshotFormat\":3,\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"flag\"],\"Rows\":[[0,1]]}}}",
    "held_survival": "1-900"
   },
   "expected": {
    "error": "Snapshot column survival_state.flag does not exist on this node: the snapshot is from a different release"
   }
  },
  {
   "id": "26-7-no-lists",
   "chapter": "26",
   "section": "7",
   "title": "A table without a Rows list is refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedBlocks\":[],\"FundedTransactions\":[],\"SnapshotFormat\":3,\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"height\"]}}}",
    "held_survival": ""
   },
   "expected": {
    "error": "Snapshot table survival_state has no Columns or Rows list"
   }
  },
  {
   "id": "26-7-fraction",
   "chapter": "26",
   "section": "7",
   "title": "A fractional value is refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "{\"EscrowedTransactions\":[],\"FundedBlocks\":[],\"FundedTransactions\":[],\"SnapshotFormat\":3,\"StateTables\":{\"survival_state\":{\"Columns\":[\"active\",\"height\"],\"Rows\":[[0.5,1]]}}}",
    "held_survival": ""
   },
   "expected": {
    "error": "Malformed snapshot value in survival_state.active"
   }
  },
  {
   "id": "26-7-not-object",
   "chapter": "26",
   "section": "7",
   "title": "A document that is not a map is refused",
   "kind": "26-snapshot-read",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "document": "[1]",
    "held_survival": ""
   },
   "expected": {
    "error": "Snapshot payload is not an object"
   }
  },
  {
   "id": "26-7-blocks-gone",
   "chapter": "26",
   "section": "7",
   "title": "Every main-chain block above height 0 not in the document is gone after the apply",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "value": "the node holds block 0, the document's Blocks and FundedBlocks, and nothing else of the main chain"
   }
  },
  {
   "id": "26-8-catch-up",
   "chapter": "26",
   "section": "8",
   "title": "A node fast-synced to 1,600 pulls 1,601 onward in batches of 50",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "first_block": "1601",
    "batch": "50",
    "until": "the peer's tip"
   }
  },
  {
   "id": "26-9-generations",
   "chapter": "26",
   "section": "9",
   "title": "Four generations, 880 in three rows: 400's directory goes, every row stays",
   "kind": "26-retention",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "manifests": "1 400\n2 640\n3 880\n4 880\n5 880\n6 1120",
    "keep": "3",
    "interval": "240"
   },
   "expected": {
    "removed_ids": "1",
    "kept_heights": "1120\n880\n640",
    "horizon": "880"
   }
  },
  {
   "id": "26-9-one-generation",
   "chapter": "26",
   "section": "9",
   "title": "With one generation the horizon is one interval below it",
   "kind": "26-retention",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "manifests": "1 880\n2 880\n3 880",
    "keep": "3",
    "interval": "240"
   },
   "expected": {
    "removed_ids": "",
    "kept_heights": "880",
    "horizon": "640"
   }
  },
  {
   "id": "26-9-rows-stay",
   "chapter": "26",
   "section": "9",
   "title": "Manifest rows are never deleted",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "value": "only the directories of older generations are removed"
   }
  },
  {
   "id": "26-10a-sample-44",
   "chapter": "26",
   "section": "10a",
   "title": "Sample(G, 44, 8): the seed is the vectors' identity G",
   "kind": "26-sample",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "seed": "e003e4e3557ef19f0519bd345009dea7fb43b3445eaa043920c5dc23b3302871",
    "population": "44",
    "k": "8"
   },
   "expected": {
    "indexes": "43\n11\n8\n18\n23\n30\n10\n1"
   }
  },
  {
   "id": "26-10a-sample-13",
   "chapter": "26",
   "section": "10a",
   "title": "Sample(G, 13, 8): the seed is the vectors' identity G",
   "kind": "26-sample",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "seed": "e003e4e3557ef19f0519bd345009dea7fb43b3445eaa043920c5dc23b3302871",
    "population": "13",
    "k": "8"
   },
   "expected": {
    "indexes": "2\n8\n11\n10\n5\n7\n6\n3"
   }
  },
  {
   "id": "26-10a-sample-5",
   "chapter": "26",
   "section": "10a",
   "title": "Sample(G, 5, 8): the seed is the vectors' identity G",
   "kind": "26-sample",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "seed": "e003e4e3557ef19f0519bd345009dea7fb43b3445eaa043920c5dc23b3302871",
    "population": "5",
    "k": "8"
   },
   "expected": {
    "indexes": "0\n3\n1\n2\n4"
   }
  },
  {
   "id": "26-10a-sample-empty",
   "chapter": "26",
   "section": "10a",
   "title": "An empty population gives no sample",
   "kind": "26-sample",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "seed": "e003e4e3557ef19f0519bd345009dea7fb43b3445eaa043920c5dc23b3302871",
    "population": "0",
    "k": "8"
   },
   "expected": {
    "indexes": ""
   }
  },
  {
   "id": "26-10a-attest-agree",
   "chapter": "26",
   "section": "10a",
   "title": "Attestation: 2 agree, 0 contradict, narrow round gives Agree",
   "kind": "26-attest",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "agree": "2",
    "contradict": "0",
    "silent": "1",
    "wide": "false"
   },
   "expected": {
    "verdict": "Agree"
   }
  },
  {
   "id": "26-10a-attest-insufficient",
   "chapter": "26",
   "section": "10a",
   "title": "Attestation: 1 agree, 0 contradict, narrow round gives Insufficient",
   "kind": "26-attest",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "agree": "1",
    "contradict": "0",
    "silent": "1",
    "wide": "false"
   },
   "expected": {
    "verdict": "Insufficient"
   }
  },
  {
   "id": "26-10a-attest-majority",
   "chapter": "26",
   "section": "10a",
   "title": "Attestation: 2 agree, 1 contradict, narrow round gives Agree",
   "kind": "26-attest",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "agree": "2",
    "contradict": "1",
    "silent": "1",
    "wide": "false"
   },
   "expected": {
    "verdict": "Agree"
   }
  },
  {
   "id": "26-10a-attest-escalate",
   "chapter": "26",
   "section": "10a",
   "title": "Attestation: 1 agree, 1 contradict, narrow round gives Escalate",
   "kind": "26-attest",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "agree": "1",
    "contradict": "1",
    "silent": "1",
    "wide": "false"
   },
   "expected": {
    "verdict": "Escalate"
   }
  },
  {
   "id": "26-10a-attest-wide-agree",
   "chapter": "26",
   "section": "10a",
   "title": "Attestation: 5 agree, 2 contradict, wide round gives Agree",
   "kind": "26-attest",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "agree": "5",
    "contradict": "2",
    "silent": "1",
    "wide": "true"
   },
   "expected": {
    "verdict": "Agree"
   }
  },
  {
   "id": "26-10a-attest-wide-disagree",
   "chapter": "26",
   "section": "10a",
   "title": "Attestation: 4 agree, 3 contradict, wide round gives Disagree",
   "kind": "26-attest",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "agree": "4",
    "contradict": "3",
    "silent": "1",
    "wide": "true"
   },
   "expected": {
    "verdict": "Disagree"
   }
  },
  {
   "id": "26-10b-event",
   "chapter": "26",
   "section": "10b",
   "title": "The archive attestation of the 250,000-byte document at S = 172,040",
   "kind": "26-archive",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "reference_height": "172040",
    "full_file_hash": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30",
    "chunk_count": "3",
    "indexes": "0"
   },
   "expected": {
    "event_id": "ZBCSNAP1:172040",
    "value": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30:3",
    "chunk_names": "737132CC56BF0AC8E6ABE1FB73A451A1D1DE681EC120B00704CA918775F61B3A"
   }
  },
  {
   "id": "26-10b-parse",
   "chapter": "26",
   "section": "10b",
   "title": "The attestation reads back as a snapshot",
   "kind": "26-archive-parse",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCSNAP1:172040",
    "value": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30:3"
   },
   "expected": {
    "snapshot": "true",
    "reference_height": "172040",
    "chunk_count": "3"
   }
  },
  {
   "id": "26-10b-parse-upper-hex",
   "chapter": "26",
   "section": "10b",
   "title": "Not a snapshot: upper hex",
   "kind": "26-archive-parse",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCSNAP1:172040",
    "value": "B295B329983547C2ADD8C42F779B9987C2B52839B73D7957DAC5798A1678DC30:3"
   },
   "expected": {
    "snapshot": "false"
   }
  },
  {
   "id": "26-10b-parse-leading-zero",
   "chapter": "26",
   "section": "10b",
   "title": "Not a snapshot: leading zero",
   "kind": "26-archive-parse",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCSNAP1:0172040",
    "value": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30:3"
   },
   "expected": {
    "snapshot": "false"
   }
  },
  {
   "id": "26-10b-parse-zero-chunks",
   "chapter": "26",
   "section": "10b",
   "title": "Not a snapshot: zero chunks",
   "kind": "26-archive-parse",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCSNAP1:172040",
    "value": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30:0"
   },
   "expected": {
    "snapshot": "false"
   }
  },
  {
   "id": "26-10b-parse-too-many-chunks",
   "chapter": "26",
   "section": "10b",
   "title": "Not a snapshot: too many chunks",
   "kind": "26-archive-parse",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCSNAP1:172040",
    "value": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30:4194305"
   },
   "expected": {
    "snapshot": "false"
   }
  },
  {
   "id": "26-10b-parse-signed",
   "chapter": "26",
   "section": "10b",
   "title": "Not a snapshot: signed",
   "kind": "26-archive-parse",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCSNAP1:+172040",
    "value": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30:3"
   },
   "expected": {
    "snapshot": "false"
   }
  },
  {
   "id": "26-10b-parse-short-hash",
   "chapter": "26",
   "section": "10b",
   "title": "Not a snapshot: short hash",
   "kind": "26-archive-parse",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCSNAP1:172040",
    "value": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc:3"
   },
   "expected": {
    "snapshot": "false"
   }
  },
  {
   "id": "26-10b-max-chunks",
   "chapter": "26",
   "section": "10b",
   "title": "2^22 chunks is the largest count",
   "kind": "26-archive-parse",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "event_id": "ZBCSNAP1:4294967295",
    "value": "b295b329983547c2add8c42f779b9987c2b52839b73d7957dac5798a1678dc30:4194304"
   },
   "expected": {
    "snapshot": "true",
    "reference_height": "4294967295",
    "chunk_count": "4194304"
   }
  },
  {
   "id": "26-10b-budget",
   "chapter": "26",
   "section": "10b",
   "title": "The epoch budget: 10 % of the pool, rounded down",
   "kind": "26-archive-budget",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "pool": "1234567891",
    "ppm": "100000"
   },
   "expected": {
    "budget": "123456789"
   }
  },
  {
   "id": "26-10b-budget-cap",
   "chapter": "26",
   "section": "10b",
   "title": "The share is capped at 500,000 ppm",
   "kind": "26-archive-budget",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "pool": "1000",
    "ppm": "900000"
   },
   "expected": {
    "budget": "500"
   }
  },
  {
   "id": "26-10b-piece-request",
   "chapter": "26",
   "section": "10b",
   "title": "The signed piece-request preimage and the 300-second window",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "preimage": "\"ZBC-PIECE-REQ\" || genesis hash (32) || piece id (32) || timestamp i64 LE || requester key (32)",
    "window_seconds": "300"
   }
  }
 ]
}
