mirror of
https://github.com/luxfi/proto.git
synced 2026-10-30 15:21:09 +00:00
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.