Skip to content

Supports deserializing block id in snapshots#9644

Merged
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:simd333/snap/read-only-for-bp
Jan 15, 2026
Merged

Supports deserializing block id in snapshots#9644
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:simd333/snap/read-only-for-bp

Conversation

@brooksprumo
Copy link
Copy Markdown

@brooksprumo brooksprumo commented Dec 18, 2025

Problem

For SIMD 3331, the block id will be serialized to/deserialized from snapshots. In order to maintain snapshot compatibility between adjacent versions (edge <-> beta, and beta <-> stable), we must be able to deserialize (and ignore) the new field in adjacent versions before we serialize the new field into the snapshot.

Summary of Changes

Add support for deserializing the block id in snapshots.

Note, if the implementation of SIMD 333 is intended for v4.0, then this PR will need to be backported to v3.1.

Additional Testing
  • Load a snapshot with this PR that was created by v3.0 (one that does not populate the new block_id field): ✅
  • Load a snapshot with this PR that was created by master that does populate the new block_id: ✅

Footnotes

  1. https://github.com/solana-foundation/solana-improvement-documents/blob/main/proposals/0333-snapshot-include-block-id.md

@brooksprumo brooksprumo self-assigned this Dec 18, 2025
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.5%. Comparing base (0e27a67) to head (7367231).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #9644     +/-   ##
=========================================
- Coverage    82.5%    82.5%   -0.1%     
=========================================
  Files         901      901             
  Lines      323411   323411             
=========================================
- Hits       267096   267075     -21     
- Misses      56315    56336     +21     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@brooksprumo brooksprumo marked this pull request as ready for review January 15, 2026 18:30
/// This code is not truly dead though, as it enables newer versions to
/// populate this field and have older versions still load the snapshot.
#[allow(dead_code)]
#[serde(deserialize_with = "default_on_eof")]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I assume this default_on_eof makes things compatible if the block_id is not present?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yep, exactly! I'll add some more info to the PR description with additional testing I've done.

@brooksprumo brooksprumo added this pull request to the merge queue Jan 15, 2026
Merged via the queue into anza-xyz:master with commit b6e5717 Jan 15, 2026
47 checks passed
@brooksprumo brooksprumo deleted the simd333/snap/read-only-for-bp branch January 15, 2026 20:23
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.

4 participants