network: clean up stateless vpack decode error messages#6494
network: clean up stateless vpack decode error messages#6494cce merged 1 commit intoalgorand:masterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves error message readability in the stateless vote compression system by removing msgpack field marker bytes from error messages. Instead of displaying raw bytes like \xa3per, error messages now show clean field names like per.
- Introduced
stripMsgpFieldMarkerhelper function to clean field names in error messages - Updated all error message formatting calls to use the new helper
- Updated test assertions to expect cleaner error strings
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| network/vpack/vpack.go | Added stripMsgpFieldMarker function and applied it to all error messages in decoder methods |
| network/vpack/vpack_test.go | Updated test expectations to match cleaner error messages, removed unused fmt import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6494 +/- ##
==========================================
- Coverage 47.56% 47.42% -0.15%
==========================================
Files 666 659 -7
Lines 88478 88397 -81
==========================================
- Hits 42088 41918 -170
- Misses 43619 43704 +85
- Partials 2771 2775 +4 ☔ View full report in Codecov by Sentry. |
Summary
When the stateless vote compression system #6276 reports an error while decoding a message, it can print a scary-looking log message like:
We can make it a little less scary-looking by removing the msgp marker byte at the beginning so it looks like
Test Plan
Tests updated to assert cleaner error strings (they were asserting the ugly ones before)