mirror of
https://github.com/luxfi/node.git
synced 2026-10-30 15:24:05 +00:00
Three structs — the signature preimage, the envelope over it, and the block — stated their offsets by hand in wire.hpp and used them by hand in wire.cpp. They are now schema/wire.zap, and zapgen prints the readers and the builders. 340 lines become 43 of schema and what is left of wire.cpp, which is the canonicality rule, the size bound, and the walk over the length vector — the things that are about a Q-chain block rather than about a buffer. One behaviour changed, and it is the one the schema buys. TxLens is a run of u32, so the generated reader takes the stride and the wire layer now refuses a length word the message cannot hold — where the strideless read accepted it and left every element accessor answering zero. The chain's own bound still names a count the BLOB cannot back; the wire's bound now names one the MESSAGE cannot hold, and parse_tx_set tells the two apart by the absent list rather than losing the reason to a later non-canonical. Both refuse; both say why. The regeneration target moved into zap.cmake as zap_schema(), so a chain declares its schema in one line and no chain spells the generator invocation twice. Green, and the two that matter are Go's own bytes: AnUnsignedTransactionSerializesAsGoDoes and ABlockCarryingAnUnsignedTransactionHasGosID. 13/13, and xvm still 59/59.