Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jstarry
Copy link
Contributor

@jstarry jstarry commented Oct 15, 2025

Versioned messages are not properly supported for human readable de/ser due to special handling of the version prefix byte. This is a breaking change to how versioned messages (including v0 and legacy) are serialized and deserialized when using a human readable serialization format. More context about the consequences of this lack of support can be found in #311

Old serialization:

[
  128,
  {
    "header": {
      "numRequiredSignatures": 0,
      "numReadonlySignedAccounts": 0,
      "numReadonlyUnsignedAccounts": 0
    },
    "accountKeys": [..],
    "recentBlockhash": [..],
    [..]
  }
]

New serialization:

{                                                                                                                                                                                                          
  "version": "0",                                                                                                                                                                                          
  "message": {                                                                                                                                                                                             
    "header": {                                                                                                                                                                                            
      "numRequiredSignatures": 0,                                                                                                                                                                          
      "numReadonlySignedAccounts": 0,                                                                                                                                                                      
      "numReadonlyUnsignedAccounts": 0                                                                                                                                                                     
    },                                                                                                                                                                                                     
    "accountKeys": [..]              
    "recentBlockhash": [..],
    [..]
  }
}

@jstarry jstarry requested a review from a team as a code owner October 15, 2025 04:36
@jstarry jstarry force-pushed the fix/versioned-message-hr-deser branch 2 times, most recently from a0d108f to 29ad202 Compare October 15, 2025 04:46
@apfitzge
Copy link
Contributor

@jstarry can you add a description to the PR?

Copy link
Contributor

@apfitzge apfitzge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - please just add a description before merging. title is descriptive, but still weird to not have one imo

@jstarry jstarry changed the title fix: human readable de/ser for versioned message BREAKING: human readable de/ser for versioned message Oct 16, 2025
@jstarry jstarry changed the title BREAKING: human readable de/ser for versioned message fix: human readable de/ser for versioned message Oct 16, 2025
@jstarry
Copy link
Contributor Author

jstarry commented Oct 16, 2025

Thanks for the review @apfitzge! Sorry I was in the middle of updating the description but got side tracked while looking into another human readable serialization issue. I was thinking of marking this as breaking because any v0 messages serialized in the original compact format will not be deserializable. But since legacy messages were not deserializable I tend to think of this as a bug fix rather than a breaking change. Thoughts?

EDIT: Just conservatively marked this as breaking because my other change will definitely breaking

@jstarry jstarry changed the title fix: human readable de/ser for versioned message BREAKING: human readable de/ser for versioned message Oct 16, 2025
@joncinque joncinque added the breaking PR contains breaking changes label Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking PR contains breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants