[Low] EncodeVote drops Vote.Weight, which JSON gossip/votesync carries
Report
Summary
EncodeVote drops Vote.Weight, which JSON gossip/votesync carry. The binary vote codec has no Weight field, so a binary round-trip loses the vote's weight. Latent (the binary codec has no callers outside encoding.go + crypto.go), same standing as accepted #100.
Root Cause
Vote.Weight(core/types.go:157) is set on every received vote (core/vote.go:145-151) and every locally cast vote (core/finalization.go:335), and JSONVoteMsg/VoteResponse(net/messages.go:12,net/votesync.go:25) serialize it.EncodeVote/DecodeVote(core/encoding.go:678/:696) have no Weight field.
Verification
Executed PoC:
in Weight=123456789 out Weight=0
JSON of the same vote contains "Weight":123456789
Note on related reports
Searched EncodeVote Weight and vote weight binary — no hits. Distinct from #563 (DecodeVote uint16 sig-length panic) and #655 (nonzero final byte).
Suggested fix
Add the Weight field to the binary vote codec, or document that binary votes are weightless.
Thread
Thanks for the report. We read it against the code and could not confirm a bug in what it describes.
This report is closed as invalid. If we have missed something, file a new report that links https://bounty.xe.network/XE-16993 and says what; it is read like any other.