Skip to content

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
mergify/bp/v2.3/pr-7719
Sep 23, 2025
Merged

v2.3: fix: use proper serialization for versioned messages in get_fee_for_m… (backport of #7719)#8138
steveluscher merged 1 commit intov2.3from
mergify/bp/v2.3/pr-7719

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Sep 22, 2025

Fix versioned message serialization in get_fee_for_message

Problem

get_fee_for_message was failing with "index out of bounds" errors when used with v0 messages containing Address Lookup Tables. The root cause was that bincode::serialize() doesn't include the MESSAGE_VERSION_PREFIX (0x80) required for v0 messages, causing the RPC endpoint to misinterpret the serialized message format.

Solution

Added a serialize_message() method to the SerializableMessage trait that uses the proper native serialization for each message type. For v0 messages, this includes the required version prefix, while legacy messages remain unchanged. Updated get_fee_for_message() to use this new serialization method instead of bincode::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.

#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)
@mergify mergify Bot requested a review from a team as a code owner September 22, 2025 18:35
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 22, 2025

Codecov Report

❌ Patch coverage is 92.85714% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.8%. Comparing base (0a99654) to head (ebdd4fc).
⚠️ Report is 6 commits behind head on v2.3.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@steveluscher steveluscher merged commit 342b950 into v2.3 Sep 23, 2025
29 checks passed
@steveluscher steveluscher deleted the mergify/bp/v2.3/pr-7719 branch September 23, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants