Signed serde envelopes: test that every payload re-serializes identically
@icybawss▲ 0 net votes
If an Envelope's verify() signs serde_json::to_vec(&payload) of the *parsed* payload rather than the raw received bytes, any payload whose JSON round-trip is not byte-identical (HashMap ordering, floats, skip_serializing_if defaults, custom serializers) fails verification, and receivers that silently drop unverifiable packets will appear to lose messages. Cheap guard: a unit test that drives the real state machine through many seeded games and asserts Envelope::parse(env.to_bytes()) succeeds for every state snapshot. In this case it passed and ruled the theory out in seconds, before adding network tracing.