Skip to content

Conversation

kskalski
Copy link

@kskalski kskalski commented Oct 10, 2025

Problem

Code for unpacking snapshots is spread across solana-accounts-db and solana-runtime, especially the use of tar crate's objects and creating IO reader/writers spans those two crates.

Summary of Changes

Move unpacking code to agave-snapshots

(this is one step in factoring out snapshot-related code to a new crate, started in #8382)

@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 91.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.2%. Comparing base (769346a) to head (000014e).

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #8428     +/-   ##
=========================================
- Coverage    83.2%    83.2%   -0.1%     
=========================================
  Files         840      841      +1     
  Lines      367879   367882      +3     
=========================================
- Hits       306108   306097     -11     
- Misses      61771    61785     +14     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kskalski kskalski force-pushed the ks/snapshots_untar_move branch from 14cf5ca to d4874bd Compare October 13, 2025 23:21
log = { workspace = true }
lz4 = { workspace = true }
rand = { workspace = true }
solana-accounts-db = { workspace = true }
Copy link
Author

Choose a reason for hiding this comment

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

This is now necessary only to access file_io / buffered reader APIs, it should be possible to remove once we get a better place for those.

@kskalski kskalski marked this pull request as ready for review October 14, 2025 00:19
@kskalski kskalski requested review from brooksprumo, roryharr and steviez and removed request for brooksprumo October 14, 2025 00:20
agave_snapshots::SnapshotInterval,
agave_snapshots::{
hardened_unpack::{
open_genesis_config, OpenGenesisConfigError, MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
Copy link

@roryharr roryharr Oct 15, 2025

Choose a reason for hiding this comment

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

What a mess MAX_GENESIS_ARCHIVE_UNPACKED_SIZE makes this!

Is hardened unpack even the right place for it to live?

I guess it started out as a hard limit on the genesis size, but then became a configurable parameter, but was left in the hardened_unpack function.

Should it be part of genesis_config instead? I'm not familiar with that part of the code at all, so my suggestion may be very off base.

Copy link
Author

Choose a reason for hiding this comment

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

I think this is a kind of sanity check limit, but you are right, this is technically a global constraint that could as well be exposed as public constant in genesis_config...
Moving it there seems like a few steps, but I will prepare the change if that is desired, @steviez what do you think?

Copy link
Author

Choose a reason for hiding this comment

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

hm, actually this file doesn't really need this constant - it's only used in tests and can be replaced by a more aggressive constant easily (also can add test that actually hits the limit)

so for now I will extract it to a place closer to where it's actually used

Copy link

Choose a reason for hiding this comment

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

Haven't had the chance to review this yet, but happened to see #8489; will try to chime in tomorrow

@roryharr
Copy link

Problem

Code for unpacking snapshots is spread across solana-accounts-db and solana-runtime, especially the use of tar crate's objects and creating IO reader/writers spans those two crates.

Summary of Changes

Move unpacking code to agave-snapshots

Can you add a link back the first PR? Sounds like this is intended to be an ongoing refactor over time to move everything.
This clearly isn't all of the snapshot related code!

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