fix(protobuf): tolerate empty custom fields#2789
Open
richard-ramos wants to merge 1 commit into
Open
Conversation
8de3dc9 to
4f25aaa
Compare
4f25aaa to
ef4de71
Compare
gmelodie
approved these changes
Jul 8, 2026
rlve
approved these changes
Jul 8, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2789 +/- ##
==========================================
- Coverage 81.32% 81.29% -0.03%
==========================================
Files 171 171
Lines 31013 31023 +10
Branches 12 12
==========================================
Hits 25221 25221
- Misses 5792 5802 +10
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Treat present-but-empty protobuf payloads for single-value custom
MultiAddress,PeerId,PublicKey, andSignaturefields as an unsuccessful field decode instead of raising from the custom decoder.Non-empty malformed payloads still raise
ProtobufValueError, preserving fatal decode behavior for corrupt field contents.Affected Areas
Impact on Library Users
Optional fields encoded as empty bytes are now handled like absent field values at the field decoder level, so they do not abort the surrounding protobuf decode solely because the optional field is empty.
Risk Assessment
Low. Successful decoding is unchanged, and malformed non-empty values continue to fail as before.