fix(storage): buffer advancement in Compact::from_compact for alloy wrappers #19899
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.
This change corrects the remainder handling in Compact::from_compact implementations for AlloyWithdrawal, AlloyHeader, and AlloyGenesisAccount by returning the advanced buffer slice produced by the inner helper’s from_compact rather than the original input slice. The Compact trait contract in storage/codecs/src/lib.rs explicitly requires from_compact to return the object and the buffer advanced past the consumed bytes; the previous code violated this by discarding the advanced slice. While vector decoding masks this behavior in some contexts by ignoring the inner remainder and manually advancing, these wrappers still broke the contract and could lead to subtle parsing errors in composed decoders that rely on the returned remainder. The fix is minimal and consistent with other alloy implementations (e.g., authorization_list and all transaction wrappers) that already propagate the advanced buffer correctly, ensuring correctness and future-proofing without changing encoding layouts or introducing allocations.