You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
op-node, kona: require a minimal snappy length preamble in gossip from the next topic version #24280
op-node and kona-node accept a gossiped block whose snappy length preamble (the uvarint in front of a snappy block) is padded to as many as ten bytes. A minimal preamble for a gossip payload takes at most four. This issue tracks tightening that rule, which can only happen where every node switches at once.
Current state
The snappy decoders both clients build against, golang/snappy and snap 1.1.2, reject a preamble longer than five bytes. Released nodes were built against decoders that accept ten. Because the message ID hashes the decompressed payload, a released node gives a padded copy of a block the canonical message ID and forwards it. A node that rejected the padded copy would drop the block and down-score the honest peers that sent it.
So both clients re-encode an overlong preamble minimally before they check the length and decode (#24176): minimalSnappyPreamble in op-node and minimal_snappy_preamble in kona. The two test suites pin the same vectors.
Proposal
Adopt a strict rule with the next block gossip topic version, which a fork introduces: on that topic a frame whose preamble is not the minimal encoding of its length is invalid. Every node on the new topic runs a version that knows the rule, so no two nodes disagree. The re-encoding then applies only to the older topics and goes away with them.
To settle:
Minimal encoding only, or any preamble of up to five bytes as the decoders accept today? Minimal only leaves exactly one valid frame preamble per payload.
Does the rule belong in the specs' gossip section with the topic version?
Related
Two frame shapes that released kona-node and released op-node already treat differently, both hand-crafted and neither produced by an encoder: a ten-byte preamble whose last byte is above one (kona accepted, op-node rejected) and a literal with an extended length tag near the end of the input (kona rejected, op-node accepted). From #24176 on, kona follows op-node on both.
Activity