Skip to content

p0: enforce coherent block-size limits before certified finality and transport #205

Open

Description

@the-code-learner

Refs #42 and #128; follow-up to PR #204. The signed certified-block inbound HTTP endpoint now has a hard 64 MiB body limit, including streamed requests, to prevent unbounded hash/JSON memory exhaustion by a compromised validator. However internal/tx/envelope.go does not currently impose a memo byte cap and MaxTransactionsPerBlock limits only count, not the encoded size. A block may therefore be locally produced/finalized whose signed delivery JSON exceeds the inbound cap, causing peers to reject the quorum evidence (HTTP 413), breaking liveness despite valid local finality. This issue is release-blocking until resolved. Required implementation: (1) make the maximum encoded candidate/certified delivery size an explicit protocol admission/production invariant, not just an HTTP receiver limit; (2) bound transaction memo/envelope and total block byte size before consensus voting and commit, including proposer and validator checks so all honest nodes agree; (3) reject oversized candidates before quorum with a deterministic error, never silently truncate or adjust quorum; (4) enforce and test outbound signed delivery limits consistent with inbound; (5) adversarial tests at exact limit, limit+1, JSON escapes, streaming/chunked transport, 7-validator recovery, persistence/restart and multiple heights, with race detector; (6) benchmark impact and independently verify strict 8s proposer and original 5s lab benchmark; (7) all exact-head 5/5 and exact-main 3/3 protected gates, independent multihost evidence before any mainnet GO. Do not claim the new inbound cap alone proves end-to-end liveness. P0 #42/#54/#55 remain OPEN, mainnet NO-GO.

2026-11-13 — independent follow-up review (still P0 NO-GO)

2026-11-13 — GitHub-first targets, tracked in #208

Execution target update (2026-11-13): fix deterministic pre-vote/commit full certified-delivery size invariant and exact-boundary adversarial regression using existing GitHub CI first; add Docker matrix once available (#208). No workload truncation, threshold change, masking failure, or production TPS extrapolation. Remains P0 GO blocker.

2026-11-13 — Draft PR #212: certified delivery budget before quorum

2026-11-13 — PR #212 protected merge (postmerge checks in progress)

  • Corrected exact PR head 8bac2fbaef9fb78488a31f8471e6a6c412a9800f passed five required workflows plus Docker smoke (6/6 COMPLETED/SUCCESS); dedicated pre-quorum budget and signed-vote race step passed in V2 Security Regression 43473880830. Real 180-second wait completed 17:33:07Z to 17:36:07Z.
  • Protected expected-head squash PR #212 MERGED to main 93e3a90a4eae867277c8f344e393e2541aa03556. Three independent main push checks started and require their own completed successes after a fresh real 180-second wait before final validation. Scope is deterministic conservative transport budget, not full performance/recovery evidence or launch approval.
  • Remaining p0: enforce coherent block-size limits before certified finality and transport #205: exact real certified JSON boundary and boundary+1, multiple heights, 7-validator and persistence/restart recovery, streaming/chunked attacks, benchmark and distributed multi-host evidence; remain P0 OPEN, mainnet NO-GO.

2026-11-13 — PR #212 exact-main 3/3 confirmed

Activity

  1. the-code-learner commented on Nov 13, 2026

    @the-code-learner
    OwnerAuthor

    2026-11-13 — PR #206 OPEN, current final candidate head fe6ec708e2ce7b9ea97bdb11b9c4dbc768bf5e1f against main 49899e70aead1db68a3e5e5bfd0a674307f2fc95. First P0 protocol constraint tranche following PR #204's signed delivery HTTP 64 MiB cap: tx.MaxEnvelopeJSONBytes=16 KiB measured on actual JSON-encoded signed Envelope, including signed Payload and escaping; early raw-string check bounds allocation; enforced in tx.ValidateStatic and direct ledger.Accept. Consensus.MaxConsensusBlockTransactions=512 enforced on signed proposal validation and imported blocks; legacy noncertified local production clamps selected transaction count to512. Negative tests cover byte boundary, giant raw memo, JSON control-character escaping amplification, 513-tx signed proposal and imported block, and direct oversized mempool bypass; Security Regression go test -race count10 for new tests; original proposer/lab/witness gates retained. Initial head 17c265a60592349d41b9ac3c5d2e5aaa8b00f5a2 failed gofmt in three files; corrected FINAL candidate fe6ec708... has five fresh workflows CI 43443546286, Lab 43443546314, Dependency Lock 43443546317, Devnet 43443547125, Security 43443546401, in_progress at 14:32Z. Real sleep180 started 14:31:53 UTC /tmp/zephyr_pr206_pre1.done due 14:34:53Z. NO MERGE until five exact-final-head completed SUCCESS + real timer, then protected expected-head merge and exact-main 3/3. Issue #205 REMAINS OPEN: still must bound aggregate certified delivery including signed proposal, votes/validator count and ensure fail-closed candidate rejection before votes and commit under exact 64 MiB wire cap; do not claim end-to-end proof or public mainnet GO. Related P0 #42/#54/#55 OPEN.

  2. the-code-learner commented on Nov 13, 2026

    @the-code-learner
    OwnerAuthor

    2026-11-13 — PR #206 first P0 protocol byte/count hardening MERGED protected expected-head squash to main 27187d8386ef6b09dfc827f5d452b53aca088129 from exact final PR head e58af5113342c650ee9055af7ba6d32e92385476. FIVE exact-head gates COMPLETED/SUCCESS CI 43444146679, Lab 43444146433, Dependency 43444146426, Devnet 43444146448, Security 43444146447, with new byte/count/HTTP413 -race count10 and original 8s proposer, 5s seven-validator, witness tests intact. Initial PR head 17c265a failed gofmt, corrected; subsequent e58af final includes explicit HTTP413. Real premerge sleep180 on prior corrected head 14:31:53→14:34:53; two real final-head sleep180 14:36:08→14:39:08 and 14:40:16→14:43:16 verified. New tx.MaxEnvelopeJSONBytes=16KiB actual signed JSON with escaping and canonical payload, early raw-size guard before signature; direct ledger.Accept enforces wire size; consensus.MaxConsensusBlockTransactions=512 for signed proposal, legacy selected count and inbound block; errors mapped to HTTP413. Independent exact-main 3 push workflow runs CI 43445598272, Lab 43445598303, Security 43445598352 started. At 14:46:37Z CI COMPLETED/SUCCESS, Lab/Security in_progress. Actual separate postmerge sleep180 started 14:45:41Z marker /tmp/zephyr_pr206_post1.done due 14:48:41Z; 3/3 NOT YET VERIFIED. Issue #205 MUST STAY OPEN: aggregate signed block+proposal+votes evidence byte cap, worst-case validator overhead, pre-vote/pre-commit rejection still need formal consistency and adversarial tests. Mainnet #42/#54/#55 NO-GO; do not claim public launch.

  3. the-code-learner commented on Nov 13, 2026

    @the-code-learner
    OwnerAuthor

    2026-11-13 — PR #206 FULLY VERIFIED 5/5 exact PR head + 3/3 exact main push. Protected expected-head squash merged main 27187d8386ef6b09dfc827f5d452b53aca088129 from final PR head e58af5113342c650ee9055af7ba6d32e92385476. Five exact-head workflow checks COMPLETED/SUCCESS: CI 43444146679, V2 Lab 43444146433, Dependency Lock 43444146426, Devnet Gate 43444146448, Security Regression 43444146447; dedicated wire-size/HTTP413 -race count10 step passed. Independently fetched GitHub public Actions API confirmed all three exact-main event=push COMPLETED/SUCCESS: CI 43445598272, Lab 43445598303, Security 43445598352 at 14:51:05 UTC. Real premerge sleep180 on final head 14:36:08→14:39:08 and second 14:40:16→14:43:16 fully verified. First actual postmerge sleep180 14:45:41→14:48:41 complete, second started 14:49:56 /tmp/zephyr_pr206_post2.done due 14:52:56 (not yet claimed). Protocol now restricts actual signed envelope JSON <=16KiB, max512 tx/proposal/block and HTTP413 for size violations, with consistent mempool, proposal and import checks. P0 #205 MUST REMAIN OPEN: total certified delivery including all votes and validator-set scaling still needs a deterministic upper bound proven BEFORE quorum voting and committing, outbound consistency and 3+ independent-host verification. No mainnet GO, P0 #42/#54/#55 and P1 #128/#92 open.

  4. the-code-learner commented on Nov 13, 2026

    @the-code-learner
    OwnerAuthor

    2026-11-13 — P0 coherent block/transport size work continues. PR #206 protected-merged main 27187d8386ef6b09dfc827f5d452b53aca088129 and independently verified exact-main push 3/3 completed SUCCESS: CI 43445598272, Lab 43445598303, Security 43445598352. Preexisting #204 inbound certified HTTP body cap 64MiB also merged. New PR #207 OPEN final candidate head 07864332183562712058c55ec8a90f6d6fcf41a2 on same main; validates outbound certified block encoded JSON <=64MiB after Marshal and before request construction, signed proof and HTTP transport. It returns typed errCertifiedDeliveryTooLarge locally and never sends oversized evidence. New adversarial test uses 11MiB of NUL memo amplified by JSON escape to >64MiB, confirms no network requests and that small delivery proceeds to separate missing-proof check; Security Regression runs -race count1, original strict consensus and witness tests intact. Initial head e732db1656cdecc6b21a62063dded8dbfd6a2eed CI Go formatting failed, corrected at final 07864332 and started all five new workflow runs: CI 43447028795, Lab 43447028490, Lock 43447028484, Devnet 43447028456, Security 43447028321; as of ~14:54 UTC Lock SUCCESS, others IN PROGRESS. Initial real sleep180 14:51:36→14:54:36 scheduled, exact final-head real sleep180 started 14:53:27→14:56:27 scheduled. Do NOT claim 5/5 or merge before final-head checks and actual wait; then protected expected-head merge and independent exact-main 3/3 push. #205 remains P0 OPEN: per-message aggregate proposal/vote/validator quorum and producer-wide end-to-end size constraints plus independent BFT multihost checks are still missing. #42/#54/#55 OPEN NO-GO.

  5. the-code-learner commented on Nov 13, 2026

    @the-code-learner
    OwnerAuthor

    2026-11-13 15:03 UTC — PR #207 outbound certified delivery size guard protected expected-head squash MERGED current main 07dd143134b9801340209c33fdff41abf982160b from FINAL PR head 07864332183562712058c55ec8a90f6d6fcf41a2, exact-head 5/5 completed SUCCESS: CI 43447028795, Lab 43447028490, Dependency 43447028484, Devnet 43447028456, Security 43447028321. First head e732db1 failed gofmt; corrected final head, no bypass. Real 180s waits: final head 14:53:27→14:56:27, second 14:57:09→15:00:09, both verified. Outbound httpPeerTransport.PostCertifiedBlock now detects actual encoded JSON >64MiB after marshal, returns typed errCertifiedDeliveryTooLarge BEFORE creating/sending HTTP or signing proof; regression with ~11MiB NUL memo JSON-amplified to >64MiB asserts no network hit and small packet proceeds to separate proof gate; -race count1 passed. On exact-main push SHA 07dd143, CI run 43448260030, Lab 43448260196 and Security 43448260133 all started, NOT YET 3/3 as of 15:03Z; real postmerge sleep180 started 15:01:17 and ends 15:04:17, marker /tmp/zephyr_pr207_post180.done. P0 #205 stays OPEN for end-to-end aggregate signed QC/validator count boundary guarantees, multihost liveness and independent audit; public mainnet #42/#54/#55 NO-GO. Do not call 3/3 until all exact-main push checks completed/success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions