{
 "format": "zoobc-conformance-vectors/1",
 "edition": "0.6.1",
 "chapter": "28",
 "license": "CC BY 4.0, ZooBC Foundation",
 "cases": [
  {
   "id": "28-1-evict",
   "chapter": "28",
   "section": "1",
   "title": "A full table evicts its gossiped entry before a chain-verified one seen 2 h ago",
   "kind": "28-peer-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "G 203.0.113.7:8001\nU1 203.0.113.7:8002 connected\nU2 203.0.113.7:8003 connected\nV 198.51.100.9:8001 chain seen=7200\nfill 1020 connected",
    "events": "add N 192.0.2.1:8001",
    "hosts": "203.0.113.7"
   },
   "expected": {
    "results": "added",
    "evicted": "G",
    "counts": "2"
   },
   "note": "G is gossiped (its key never handshook here) at a host holding three unregistered entries; V is chain-verified."
  },
  {
   "id": "28-1-full",
   "chapter": "28",
   "section": "1",
   "title": "A full table of connected peers refuses a new key",
   "kind": "28-peer-event",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "table": "G 203.0.113.7:8001 connected\nU1 203.0.113.7:8002 connected\nU2 203.0.113.7:8003 connected\nV 198.51.100.9:8001 connected chain seen=7200\nfill 1020 connected",
    "events": "add N 192.0.2.1:8001",
    "watch": "N"
   },
   "expected": {
    "results": "Peer table full",
    "evicted": "none",
    "entry": "none"
   }
  },
  {
   "id": "28-1-ninth",
   "chapter": "28",
   "section": "1",
   "title": "A ninth unregistered key from one host",
   "kind": "28-peer-event",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "table": "U1 203.0.113.7:8001\nU2 203.0.113.7:8002\nU3 203.0.113.7:8003\nU4 203.0.113.7:8004\nU5 203.0.113.7:8005\nU6 203.0.113.7:8006\nU7 203.0.113.7:8007\nU8 203.0.113.7:8008",
    "events": "add N9 203.0.113.7:8009",
    "hosts": "203.0.113.7"
   },
   "expected": {
    "results": "Too many unregistered peers from host 203.0.113.7",
    "entry": "none",
    "counts": "8"
   }
  },
  {
   "id": "28-1-verified-moved-host",
   "chapter": "28",
   "section": "1",
   "title": "A chain-verified entry whose handshake arrives from another host stays; that address is dialled",
   "kind": "28-peer-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "K 203.0.113.7:8001 connected chain",
    "events": "inbound K 198.51.100.9 198.51.100.9:8001"
   },
   "expected": {
    "results": "accepted",
    "entry": "203.0.113.7:8001 handshake=true chain=true from=-",
    "pending": "198.51.100.9:8001"
   }
  },
  {
   "id": "28-1-verified-dialled",
   "chapter": "28",
   "section": "1",
   "title": "The key answering this node's dial at the new address moves the entry",
   "kind": "28-peer-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "K 203.0.113.7:8001 connected chain",
    "events": "inbound K 198.51.100.9 198.51.100.9:8001\ndial K 198.51.100.9:8001 expect K"
   },
   "expected": {
    "results": "accepted\nconnected",
    "entry": "198.51.100.9:8001 handshake=true chain=true from=-",
    "pending": "none"
   }
  },
  {
   "id": "28-1-verified-failing",
   "chapter": "28",
   "section": "1",
   "title": "After three failed dials of its address the handshake moves the entry at once",
   "kind": "28-peer-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "K 203.0.113.7:8001 chain failures=3",
    "events": "inbound K 198.51.100.9 198.51.100.9:8001"
   },
   "expected": {
    "results": "accepted",
    "entry": "198.51.100.9:8001 handshake=true chain=false from=-",
    "pending": "none"
   },
   "note": "A move by a handshake clears chain_verified: no dial of this node has reached the new address yet."
  },
  {
   "id": "28-1-verified-failing-dialled",
   "chapter": "28",
   "section": "1",
   "title": "The moved entry is chain-verified again once this node's dial reaches the key there",
   "kind": "28-peer-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "K 203.0.113.7:8001 chain failures=3",
    "events": "inbound K 198.51.100.9 198.51.100.9:8001\ndial K 198.51.100.9:8001 expect K"
   },
   "expected": {
    "results": "accepted\nconnected",
    "entry": "198.51.100.9:8001 handshake=true chain=true from=-",
    "pending": "none"
   }
  },
  {
   "id": "28-1-evict-gossip-first",
   "chapter": "28",
   "section": "1",
   "title": "Between an inbound-only key seen 2 h ago and a gossiped one seen now, the gossiped one goes",
   "kind": "28-peer-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "I - handshake from=203.0.113.7 seen=7200\nG 198.51.100.9:8001\nfill 1022 connected",
    "events": "add N 192.0.2.1:8001"
   },
   "expected": {
    "results": "added",
    "evicted": "G"
   }
  },
  {
   "id": "28-1-evict-oldest",
   "chapter": "28",
   "section": "1",
   "title": "Within one tier and one count per host the entry seen longest ago goes; a registered one never",
   "kind": "28-peer-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "R 192.0.2.10:8001 registered seen=9000\nO 192.0.2.11:8001 seen=7200\nY 192.0.2.12:8001 seen=600\nfill 1021 connected",
    "events": "add N 192.0.2.1:8001"
   },
   "expected": {
    "results": "added",
    "evicted": "O"
   }
  },
  {
   "id": "28-1-room",
   "chapter": "28",
   "section": "1",
   "title": "A table below 1,024 entries takes the key without eviction",
   "kind": "28-peer-event",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "table": "O 192.0.2.11:8001 seen=7200\nfill 1022 connected",
    "events": "add N 192.0.2.1:8001"
   },
   "expected": {
    "results": "added",
    "evicted": "none",
    "entry": "192.0.2.1:8001 handshake=false chain=false from=-"
   }
  },
  {
   "id": "28-1-gossiped-nat-capped",
   "chapter": "28",
   "section": "1",
   "title": "A gossiped key handshaking from behind NAT at a host holding eight others",
   "kind": "28-peer-event",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "table": "G 198.51.100.9:8001\nU1 203.0.113.7:8001\nU2 203.0.113.7:8002\nU3 203.0.113.7:8003\nU4 203.0.113.7:8004\nU5 203.0.113.7:8005\nU6 203.0.113.7:8006\nU7 203.0.113.7:8007\nU8 203.0.113.7:8008",
    "events": "inbound G 203.0.113.7 0.0.0.0:8001"
   },
   "expected": {
    "results": "Too many unregistered peers from host 203.0.113.7",
    "entry": "198.51.100.9:8001 handshake=false chain=false from=-"
   },
   "note": "The entry is unchanged and the key is still not handshake-verified."
  },
  {
   "id": "28-1-dial-capped",
   "chapter": "28",
   "section": "1",
   "title": "This node's dial of 203.0.113.7:8001 answered by that key",
   "kind": "28-peer-event",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "table": "G 198.51.100.9:8001\nU1 203.0.113.7:8001\nU2 203.0.113.7:8002\nU3 203.0.113.7:8003\nU4 203.0.113.7:8004\nU5 203.0.113.7:8005\nU6 203.0.113.7:8006\nU7 203.0.113.7:8007\nU8 203.0.113.7:8008",
    "events": "inbound G 203.0.113.7 0.0.0.0:8001\ndial G 203.0.113.7:8001"
   },
   "expected": {
    "results": "Too many unregistered peers from host 203.0.113.7\nNot moved to 203.0.113.7:8001: already 8 unregistered peers from host 203.0.113.7; the entry keeps 198.51.100.9:8001 and this dial verified nothing",
    "entry": "198.51.100.9:8001 handshake=false chain=false from=-",
    "failure": "false"
   }
  },
  {
   "id": "28-2-public-ip",
   "chapter": "28",
   "section": "2",
   "title": "A stated public_ip fills the advertised address; nothing is looked up",
   "kind": "28-public-ip",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "public_ip": "203.0.113.7",
    "listen_address": "0.0.0.0:8001",
    "advertise_address": "",
    "timestamp": "1794211200"
   },
   "expected": {
    "advertised": "203.0.113.7:8001",
    "lookup": "false",
    "signed": "GET:/api/v1/node/public-ip:1794211200:"
   }
  },
  {
   "id": "28-2-public-ip-port",
   "chapter": "28",
   "section": "2",
   "title": "A public_ip with a port is a configuration error",
   "kind": "28-public-ip",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "public_ip": "203.0.113.7:8001",
    "listen_address": "0.0.0.0:8001",
    "advertise_address": "",
    "timestamp": "1794211200"
   },
   "expected": {
    "error": "Invalid public_ip '203.0.113.7:8001' (an IPv4 address without a port, e.g. 203.0.113.7)"
   }
  },
  {
   "id": "28-2-start-gate",
   "chapter": "28",
   "section": "2",
   "title": "The start-up sync gate",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "attempts": "30 of one second",
    "peers_considered": "connected, seen within 120 s",
    "passes": "our height >= their highest (or after 5 attempts when both are 0)",
    "loop_starts_s": "heartbeat 0, sync 5, discovery 10, recovery 15, announcement 10"
   }
  },
  {
   "id": "28-3-pending",
   "chapter": "28",
   "section": "3",
   "title": "An address that refuses TCP",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "retries": "every 30-60 s by the recovery loop",
    "forgotten_after_attempt": "10",
    "duration": "roughly 5-10 minutes"
   }
  },
  {
   "id": "28-3-other-key",
   "chapter": "28",
   "section": "3",
   "title": "A gossiped K at 203.0.113.7:8001 whose dial is answered by L",
   "kind": "28-peer-event",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "table": "K 203.0.113.7:8001",
    "events": "dial L 203.0.113.7:8001 expect K",
    "watch": "K"
   },
   "expected": {
    "results": "dial answered by another key",
    "entry": "203.0.113.7:8001 handshake=false chain=false from=-",
    "failure": "true"
   },
   "note": "K's entry takes a failure and stays unverified."
  },
  {
   "id": "28-3-other-key-not-stored",
   "chapter": "28",
   "section": "3",
   "title": "Nothing is stored for the key that answered",
   "kind": "28-peer-event",
   "validity": "invalid",
   "source": "computed",
   "inputs": {
    "table": "K 203.0.113.7:8001",
    "events": "dial L 203.0.113.7:8001 expect K",
    "watch": "L"
   },
   "expected": {
    "results": "dial answered by another key",
    "entry": "none"
   }
  },
  {
   "id": "28-4-targets",
   "chapter": "28",
   "section": "4",
   "title": "Heartbeat targets per cycle",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "connected_registered": "10",
    "priority": "8",
    "per_cycle": "8",
    "every_third_cycle": "10"
   }
  },
  {
   "id": "28-4-stale",
   "chapter": "28",
   "section": "4",
   "title": "Stale cleanup: 3,600 s for registered peers, 600 s for the others",
   "kind": "28-stale",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "peers": "3601 true\n3599 true\n601 false\n600 false"
   },
   "expected": {
    "removed": "true\nfalse\ntrue\nfalse"
   }
  },
  {
   "id": "28-5-registered",
   "chapter": "28",
   "section": "5",
   "title": "A registered peer failing every heartbeat",
   "kind": "28-backoff",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "true",
    "failures": "10"
   },
   "expected": {
    "backoffs": "15\n30\n60\n120\n240\n480\n600\n600\n600\n600",
    "disconnect_at": "10"
   },
   "note": "The chapter lists the first nine backoffs; the tenth failure also stamps 600 s and disconnects the peer."
  },
  {
   "id": "28-5-unregistered",
   "chapter": "28",
   "section": "5",
   "title": "An unregistered peer's backoff stops at 120 s",
   "kind": "28-backoff",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "false",
    "failures": "6"
   },
   "expected": {
    "backoffs": "15\n30\n60\n120\n120\n120",
    "disconnect_at": "0"
   }
  },
  {
   "id": "28-5-recovery",
   "chapter": "28",
   "section": "5",
   "title": "Re-dial of a disconnected peer",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "registered_redial_after_s": "30",
    "unregistered_redial_after_s": "60",
    "loop_period_s": "30 (10 while fewer than 3 peers are connected)"
   }
  },
  {
   "id": "28-6-unsigned",
   "chapter": "28",
   "section": "6",
   "title": "A block claiming registered K, with no receipt signature, in a call signed by another key",
   "kind": "28-charge-identity",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "claimed": "EB89F581920CAC9343663A33911D76CEF5C89390F25865651D902792B881AD65",
    "registered": "true",
    "verified": "false",
    "require_signed": "true",
    "entry_host": "203.0.113.7",
    "source": "203.0.113.7",
    "call_key": "F5692B269E6323FF07078505671DCAA4CF40A0753423D02C54EC9B110977CDD3"
   },
   "expected": {
    "identity": "addr:203.0.113.7"
   }
  },
  {
   "id": "28-6-bound-by-call",
   "chapter": "28",
   "section": "6",
   "title": "The same block in a call signed by K itself",
   "kind": "28-charge-identity",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "claimed": "EB89F581920CAC9343663A33911D76CEF5C89390F25865651D902792B881AD65",
    "registered": "true",
    "verified": "false",
    "require_signed": "true",
    "entry_host": "",
    "source": "203.0.113.7",
    "call_key": "EB89F581920CAC9343663A33911D76CEF5C89390F25865651D902792B881AD65"
   },
   "expected": {
    "identity": "eb89f581920cac9343663a33911d76cef5c89390f25865651d902792b881ad65"
   }
  },
  {
   "id": "28-6-bound-by-entry",
   "chapter": "28",
   "section": "6",
   "title": "The same sender bound by a chain-verified peer entry while the switch is off",
   "kind": "28-charge-identity",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "claimed": "EB89F581920CAC9343663A33911D76CEF5C89390F25865651D902792B881AD65",
    "registered": "true",
    "verified": "false",
    "require_signed": "false",
    "entry_host": "203.0.113.7",
    "source": "203.0.113.7"
   },
   "expected": {
    "identity": "eb89f581920cac9343663a33911d76cef5c89390f25865651d902792b881ad65"
   }
  },
  {
   "id": "28-6-bound-by-signature",
   "chapter": "28",
   "section": "6",
   "title": "A registered sender whose receipt-request signature verifies",
   "kind": "28-charge-identity",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "claimed": "EB89F581920CAC9343663A33911D76CEF5C89390F25865651D902792B881AD65",
    "registered": "true",
    "verified": "true",
    "require_signed": "true",
    "entry_host": "",
    "source": "203.0.113.7"
   },
   "expected": {
    "identity": "eb89f581920cac9343663a33911d76cef5c89390f25865651d902792b881ad65"
   }
  },
  {
   "id": "28-6-unregistered-bound",
   "chapter": "28",
   "section": "6",
   "title": "A bound but unregistered sender is charged by address",
   "kind": "28-charge-identity",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "claimed": "EB89F581920CAC9343663A33911D76CEF5C89390F25865651D902792B881AD65",
    "registered": "false",
    "verified": "true",
    "require_signed": "true",
    "entry_host": "",
    "source": "203.0.113.7"
   },
   "expected": {
    "identity": "addr:203.0.113.7"
   }
  },
  {
   "id": "28-6-ladder",
   "chapter": "28",
   "section": "6",
   "title": "An unregistered peer banned four times within 24 h",
   "kind": "28-bad-blocks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "false",
    "reason": "InvalidSignature",
    "count": "10",
    "rounds": "4",
    "active_peers": "5"
   },
   "expected": {
    "bans": "300\n300\n300\n300",
    "reason": "Sent 10 bad blocks: InvalidSignature"
   },
   "note": "Each ban has expired before the next offence; the expired entry is erased with its offence count."
  },
  {
   "id": "28-6-nine",
   "chapter": "28",
   "section": "6",
   "title": "Nine bad blocks do not ban",
   "kind": "28-bad-blocks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "false",
    "reason": "InvalidSignature",
    "count": "9",
    "rounds": "1",
    "active_peers": "5"
   },
   "expected": {
    "bans": "none"
   }
  },
  {
   "id": "28-6-registered-50",
   "chapter": "28",
   "section": "6",
   "title": "A registered peer sending 50 blocks refused as \"InvalidSignature\"",
   "kind": "28-bad-blocks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "true",
    "reason": "InvalidSignature",
    "count": "50",
    "rounds": "1",
    "active_peers": "5"
   },
   "expected": {
    "bans": "none"
   },
   "note": "The pattern match is case-sensitive: \"InvalidSignature\" does not contain \"signature\"."
  },
  {
   "id": "28-6-registered-50-lower",
   "chapter": "28",
   "section": "6",
   "title": "A registered peer sending 50 blocks refused as \"Invalid block signature\"",
   "kind": "28-bad-blocks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "true",
    "reason": "Invalid block signature",
    "count": "50",
    "rounds": "1",
    "active_peers": "5"
   },
   "expected": {
    "bans": "300",
    "reason": "Sent 50 bad blocks (registered node, elevated threshold): Invalid block signature"
   }
  },
  {
   "id": "28-6-registered-sync",
   "chapter": "28",
   "section": "6",
   "title": "A registered peer's bad block reported from sync is never recorded",
   "kind": "28-bad-blocks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "true",
    "reason": "Block at height 100 failed to add during sync: Invalid block signature",
    "count": "50",
    "rounds": "1",
    "active_peers": "5"
   },
   "expected": {
    "bans": "none"
   },
   "note": "The reason contains \"sync\", one of the stress words ignored for a registered peer."
  },
  {
   "id": "28-6-floor",
   "chapter": "28",
   "section": "6",
   "title": "No ban while it would leave 3 or fewer active peers",
   "kind": "28-bad-blocks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "false",
    "reason": "InvalidSignature",
    "count": "10",
    "rounds": "1",
    "active_peers": "2"
   },
   "expected": {
    "bans": "none"
   }
  },
  {
   "id": "28-6-fork-weight",
   "chapter": "28",
   "section": "6",
   "title": "Fork-related refusals count every second one",
   "kind": "28-bad-blocks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "false",
    "reason": "fork detected",
    "count": "19",
    "rounds": "1",
    "active_peers": "5"
   },
   "expected": {
    "bans": "none"
   }
  },
  {
   "id": "28-6-non-fault",
   "chapter": "28",
   "section": "6",
   "title": "A timing refusal is not recorded",
   "kind": "28-bad-blocks",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "registered": "false",
    "reason": "invalid timestamp",
    "count": "30",
    "rounds": "1",
    "active_peers": "5"
   },
   "expected": {
    "bans": "none"
   }
  },
  {
   "id": "28-6-unsigned-calls",
   "chapter": "28",
   "section": "6",
   "title": "Five unsigned calls from one host within 60 s throttle the host's blocks",
   "kind": "27-call-strikes",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "unsigned_calls": "5"
   },
   "expected": {
    "strikes": "5",
    "throttled": "true",
    "answer": "RESOURCE_EXHAUSTED: Invalid block rate limit exceeded for unbound sender"
   }
  },
  {
   "id": "28-6-rate-registered",
   "chapter": "28",
   "section": "6",
   "title": "A registered relay may send 2,000 transactions a minute",
   "kind": "28-tx-rate",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "tier": "registered",
    "count": "2001"
   },
   "expected": {
    "first_refused": "2001"
   }
  },
  {
   "id": "28-7-known",
   "chapter": "28",
   "section": "7",
   "title": "Peers that relayed a block back are skipped",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "peers": "10",
    "all_relayed_it_back_first": "true",
    "pushes": "0"
   }
  },
  {
   "id": "28-8-fan-out",
   "chapter": "28",
   "section": "8",
   "title": "A produced block's fan-out",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "connected": "10",
    "priority": "8",
    "sent_to": "10",
    "returns_after": "min(3, ceil(10/2)) = 3 receipts or 3,000 ms"
   }
  },
  {
   "id": "28-9-quorum",
   "chapter": "28",
   "section": "9",
   "title": "Three of four registered peers agree: the stalled node syncs from one of them",
   "kind": "28-registry-quorum",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "reports": "k1 12465 D1\nk2 12465 D1\nk3 12465 D1\nk4 12470 D2",
    "our_height": "12000"
   },
   "expected": {
    "answers": "4",
    "needed": "3",
    "target": "12465 D1"
   }
  },
  {
   "id": "28-9-no-quorum",
   "chapter": "28",
   "section": "9",
   "title": "Two against two: no quorum",
   "kind": "28-registry-quorum",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "reports": "k1 12465 D1\nk2 12465 D1\nk3 12470 D2\nk4 12470 D2",
    "our_height": "12000"
   },
   "expected": {
    "answers": "4",
    "needed": "3",
    "target": "none"
   }
  },
  {
   "id": "28-9-too-few",
   "chapter": "28",
   "section": "9",
   "title": "Two answers are too few",
   "kind": "28-registry-quorum",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "reports": "k1 12465 D1\nk2 12465 D1",
    "our_height": "12000"
   },
   "expected": {
    "answers": "2",
    "needed": "2",
    "target": "none"
   }
  },
  {
   "id": "28-9-far-ahead",
   "chapter": "28",
   "section": "9",
   "title": "A sync block whose round opens 1,000 s ahead",
   "kind": "reference",
   "validity": "invalid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "result": "a bad block from that peer, the pass ends",
    "error": "sync block dated far ahead of its round",
    "limit_s": "900"
   }
  },
  {
   "id": "28-9-cooldown",
   "chapter": "28",
   "section": "9",
   "title": "The divergent cool-down: 10, 20, 40, 80, then 120 minutes",
   "kind": "28-divergent",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "notes": "6"
   },
   "expected": {
    "cooldowns": "600\n1200\n2400\n4800\n7200\n7200"
   }
  },
  {
   "id": "28-9a-unregistered",
   "chapter": "28",
   "section": "9a",
   "title": "An unregistered peer 1,000 blocks ahead of height 500 does not hold production",
   "kind": "28-production-gate",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "our_height": "500",
    "claim": "1500",
    "registered": "false",
    "confirmed": "false",
    "times": "0\n30"
   },
   "expected": {
    "holds": "0:false\n30:false"
   }
  },
  {
   "id": "28-9a-unregistered-early",
   "chapter": "28",
   "section": "9a",
   "title": "The same at our height 5: no hold in the first blocks either",
   "kind": "28-production-gate",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "our_height": "5",
    "claim": "1005",
    "registered": "false",
    "confirmed": "false",
    "times": "0\n30"
   },
   "expected": {
    "holds": "0:false\n30:false"
   }
  },
  {
   "id": "28-9a-unconfirmed",
   "chapter": "28",
   "section": "9a",
   "title": "A registered, unconfirmed claim holds for 60 s",
   "kind": "28-production-gate",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "our_height": "12000",
    "claim": "13000",
    "registered": "true",
    "confirmed": "false",
    "times": "0\n30\n59\n60\n300"
   },
   "expected": {
    "holds": "0:true\n30:true\n59:true\n60:false\n300:false"
   }
  },
  {
   "id": "28-9a-confirmed",
   "chapter": "28",
   "section": "9a",
   "title": "A confirmed heavier target holds up to 3,600 s",
   "kind": "28-production-gate",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "our_height": "12000",
    "claim": "13000",
    "registered": "true",
    "confirmed": "true",
    "times": "0\n500\n1000\n1500\n2000\n2500\n3000\n3599\n3600"
   },
   "expected": {
    "holds": "0:true\n500:true\n1000:true\n1500:true\n2000:true\n2500:true\n3000:true\n3599:true\n3600:false"
   }
  },
  {
   "id": "28-9a-sync",
   "chapter": "28",
   "section": "9a",
   "title": "A running sync holds production for at most 45 s",
   "kind": "28-sync-hold",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "elapsed": "0\n44\n45"
   },
   "expected": {
    "holds": "true\ntrue\nfalse"
   }
  },
  {
   "id": "28-9b-skewed",
   "chapter": "28",
   "section": "9b",
   "title": "Offsets +10, +12, +9: skewed",
   "kind": "28-clock-skew",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "offsets": "10\n12\n9",
    "gap": "15"
   },
   "expected": {
    "known": "true",
    "skewed": "true",
    "median": "10",
    "behind": "3",
    "ahead": "0"
   }
  },
  {
   "id": "28-9b-one-off",
   "chapter": "28",
   "section": "9b",
   "title": "Offsets +1000, 0, 0: not skewed",
   "kind": "28-clock-skew",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "offsets": "1000\n0\n0",
    "gap": "15"
   },
   "expected": {
    "known": "true",
    "skewed": "false",
    "median": "0",
    "behind": "1",
    "ahead": "0"
   }
  },
  {
   "id": "28-9b-two",
   "chapter": "28",
   "section": "9b",
   "title": "Two peers: the clock is not known",
   "kind": "28-clock-skew",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "offsets": "8\n0",
    "gap": "15"
   },
   "expected": {
    "known": "false"
   }
  },
  {
   "id": "28-9b-even",
   "chapter": "28",
   "section": "9b",
   "title": "An even count takes the lower-mid average",
   "kind": "28-clock-skew",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "offsets": "-20\n-9\n-8\n3",
    "gap": "15"
   },
   "expected": {
    "known": "true",
    "skewed": "true",
    "median": "-8",
    "behind": "0",
    "ahead": "3"
   }
  },
  {
   "id": "28-10-announcements",
   "chapter": "28",
   "section": "10",
   "title": "Announcement rounds over 15,360 s",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "rounds": "512",
    "period_s": "30"
   }
  },
  {
   "id": "28-11-discovery",
   "chapter": "28",
   "section": "11",
   "title": "Discovery asks per 1,800 s",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "connected": "10",
    "max_asks_per_1800_s": "10"
   }
  },
  {
   "id": "28-12-flood",
   "chapter": "28",
   "section": "12",
   "title": "A flood of 2,400 TPS: Emergency after three samples",
   "kind": "28-health",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "samples": "1200*3"
   },
   "expected": {
    "levels": "Normal\nNormal\nEmergency",
    "level": "Emergency",
    "max_txs": "100",
    "accepting": "false"
   }
  },
  {
   "id": "28-12-cooldown",
   "chapter": "28",
   "section": "12",
   "title": "Twenty calmer samples inside 180 s only reach Critical",
   "kind": "28-health",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "samples": "1200*3\n150*20"
   },
   "expected": {
    "level": "Critical",
    "max_txs": "200",
    "accepting": "true"
   }
  },
  {
   "id": "28-12-recovered",
   "chapter": "28",
   "section": "12",
   "title": "Twenty calmer samples after 180 s drop to Warning",
   "kind": "28-health",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "samples": "1200*3\nwait 180\n150*20"
   },
   "expected": {
    "level": "Warning",
    "max_txs": "300",
    "accepting": "true"
   }
  },
  {
   "id": "28-12-nineteen",
   "chapter": "28",
   "section": "12",
   "title": "Nineteen calmer samples are not enough",
   "kind": "28-health",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "samples": "1200*3\nwait 180\n150*19"
   },
   "expected": {
    "level": "Emergency",
    "max_txs": "100",
    "accepting": "false"
   }
  },
  {
   "id": "28-13-grace",
   "chapter": "28",
   "section": "13",
   "title": "A DevNet node without peers runs its storage pass after 37 s",
   "kind": "28-storage-grace",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "epoch_blocks": "10",
    "block_seconds": "15"
   },
   "expected": {
    "grace": "37"
   }
  },
  {
   "id": "28-13-grace-clamped",
   "chapter": "28",
   "section": "13",
   "title": "The wait stays within 15 s and 2 minutes",
   "kind": "28-storage-grace",
   "validity": "valid",
   "source": "computed",
   "inputs": {
    "epoch_blocks": "2",
    "block_seconds": "15"
   },
   "expected": {
    "grace": "15"
   }
  },
  {
   "id": "28-14-defaults",
   "chapter": "28",
   "section": "14",
   "title": "The [advanced] defaults",
   "kind": "reference",
   "validity": "valid",
   "source": "computed",
   "inputs": {},
   "expected": {
    "min_active_peers": "3",
    "stale_peer_timeout": "600",
    "stale_registered_peer_timeout": "3600",
    "max_consecutive_failures": "10",
    "ban_levels": "300/900/2100/3600",
    "offense_reset_period": "86400",
    "bad_blocks_threshold": "10",
    "bad_block_window": "600",
    "invalid_tx_threshold": "5",
    "invalid_tx_window": "300",
    "validation_failure_threshold": "3",
    "tx_rate_limits": "stray 10 / queued 20 / registry 2000 per minute"
   }
  }
 ]
}
