v2.3: fix: use proper serialization for versioned messages in get_fee_for_m… (backport of #7719)#8138
Merged
steveluscher merged 1 commit intov2.3from Sep 23, 2025
Merged
Conversation
#7719) * fix: use proper serialization for versioned messages in get_fee_for_message * Clippy satiated Co-authored-by: kirill lykov <lykov.kirill@gmail.com> * Try harder to satiate clippy --------- Co-authored-by: Steven Luscher <steveluscher@users.noreply.github.com> Co-authored-by: kirill lykov <lykov.kirill@gmail.com> (cherry picked from commit 3f25767)
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v2.3 #8138 +/- ##
=========================================
- Coverage 82.8% 82.8% -0.1%
=========================================
Files 850 850
Lines 380075 380144 +69
=========================================
+ Hits 314907 314938 +31
- Misses 65168 65206 +38 🚀 New features to boost your workflow:
|
t-nelson
approved these changes
Sep 22, 2025
KirillLykov
approved these changes
Sep 23, 2025
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.
Fix versioned message serialization in
get_fee_for_messageProblem
get_fee_for_messagewas failing with "index out of bounds" errors when used with v0 messages containing Address Lookup Tables. The root cause was thatbincode::serialize()doesn't include theMESSAGE_VERSION_PREFIX(0x80) required for v0 messages, causing the RPC endpoint to misinterpret the serialized message format.Solution
Added a
serialize_message()method to theSerializableMessagetrait that uses the proper native serialization for each message type. For v0 messages, this includes the required version prefix, while legacy messages remain unchanged. Updatedget_fee_for_message()to use this new serialization method instead ofbincode::serialize().The fix ensures that both legacy messages and v0 messages with Address Lookup Tables are properly serialized when calling
get_fee_for_message(). Added comprehensive tests to verify the serialization behavior and ensure no regressions.Closes #7563
Can you pls check this @KirillLykov @0xbrw
This is an automatic backport of pull request #7719 done by Mergify.