-
Notifications
You must be signed in to change notification settings - Fork 754
Move unpacking related code to agave_snapshots #8428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is 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:
|
08eb88d
to
520af0d
Compare
14cf5ca
to
d4874bd
Compare
log = { workspace = true } | ||
lz4 = { workspace = true } | ||
rand = { workspace = true } | ||
solana-accounts-db = { workspace = true } |
There was a problem hiding this comment.
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.
agave_snapshots::SnapshotInterval, | ||
agave_snapshots::{ | ||
hardened_unpack::{ | ||
open_genesis_config, OpenGenesisConfigError, MAX_GENESIS_ARCHIVE_UNPACKED_SIZE, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Can you add a link back the first PR? Sounds like this is intended to be an ongoing refactor over time to move everything. |
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)