Skip to content

Conversation

@cce
Copy link
Contributor

@cce cce commented Nov 12, 2025

Summary

This removes warning log messages for the case where a peer sends valid-seeming uncompressed AV messages instead of stateless-compressed votes.

Test Plan

New tests added.

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.44%. Comparing base (a51dbb4) to head (7e56769).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6495      +/-   ##
==========================================
- Coverage   47.59%   47.44%   -0.15%     
==========================================
  Files         666      659       -7     
  Lines       88484    88409      -75     
==========================================
- Hits        42110    41945     -165     
- Misses      43611    43691      +80     
- Partials     2763     2773      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cce cce requested review from algorandskiy and Copilot November 12, 2025 20:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds silent fallback handling when a peer sends uncompressed vote messages to a stateless decoder that expects compressed data. Instead of logging warnings for this valid scenario, the code now detects the uncompressed msgpack pattern and falls back gracefully without error messages.

Key Changes:

  • Added detection for uncompressed msgpack vote data that mimics the expected compressed format
  • Introduced ErrLikelyUncompressed error type to distinguish uncompressed data from corrupted data
  • Suppressed warning logs when uncompressed votes are received by the stateless decoder

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
network/vpack/vpack.go Added detection logic for uncompressed msgpack and new error type to distinguish from corruption
network/vpack/parse_test.go Added test coverage for both uncompressed msgpack detection and corrupted vpack non-detection scenarios
network/msgCompressor.go Modified error handling to suppress warnings for uncompressed votes while maintaining them for other errors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if c.avdec.enabled {
res, err := c.avdec.convert(data)
if err != nil {
c.log.Warnf("peer %s vote decompress error: %v", c.origin, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote for disconnecting from nodes who advertised vpack compression but fail to fulfill it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants