Files
zeekay 6e50a2c1f1 p2p: state the gossip wire as a schema, and carry the fields it names
p2p.zap is the wire a peer speaks, in the IDL: 30 structs, both
discriminator tables, and the framing rule the IDL has no word for.
codec_schema_test.go reads it and holds codec.go to it — every message
encoded, walked back with nothing but the schema, then decoded by the
codec itself, so neither a field the encoder forgets nor one the decoder
skips can pass.

Writing it down found three fields the codec never carried:

  Handshake.AllChains and GetPeerList.AllChains say "send me every
  network's IPs". peer.go reads msg.AllChains into Network.Peers, and
  read false however the sender set it, so a node tracking all chains
  asked and was answered as though it had not.

  Chits.AcceptedHeight is filled from the responder's accepted frontier
  and arrived zero.

and five of the nine BFT variants: EmptyVote, FinalizeVote, Notarization,
EmptyNotarization and Finalization encoded to a bare discriminator 0 and
decoded to a BFT holding nothing, with no error either side. They take
the numbers 3..7 the table left for them, and an unknown variant is now
refused rather than silently dropped.

node/zap/schema reads a .zap. zapgen has a parser, but it is in a main
package and nothing else can import it, so a schema shipped beside a
codec was prose no test could check.
2026-08-29 14:10:21 -07:00
..