-
Notifications
You must be signed in to change notification settings - Fork 38
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
accounts-db: initial implementation #40
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0xNineteen
changed the title
19/bank
snapshot logic: code to deserialize bank-fields + accountsdb-fields metadata
Oct 19, 2023
0xNineteen
changed the title
snapshot logic: code to deserialize bank-fields + accountsdb-fields metadata
snapshot logic: code to deserialize bank/accountsdb metadata
Oct 19, 2023
0xNineteen
changed the title
snapshot logic: code to deserialize bank/accountsdb metadata
snapshot logic: deserialize bank/accountsdb metadata
Oct 19, 2023
20 tasks
20 tasks
0xNineteen
changed the title
snapshot logic: deserialize bank/accountsdb metadata
snapshot: deserialize bank/accountsdb metadata
Dec 6, 2023
0xNineteen
changed the title
snapshot: deserialize bank/accountsdb metadata
accounts-db: deserialize bank/accountsdb metadata
Dec 7, 2023
`build.zig` - make it easy to add new executables with all the required modules `src/core/accounts_file.zig` - logic for parsing accounts out of a file `pubkey.zig` - removed `cached_str` optimization so we can directly case bytes to the pubkey struct (used when parsing account files) `src/cmd/snapshot_utils.zig` - snapshot utils for: - dumping the `accounts_db.bincode` from the full bank metadata (the full bank metadata is quite large, and we only need the accounts_db fields to correctly parse the append_vecs) - dump accounts found in append vec into a .csv format (_note_: current approach contains duplicate accounts (ie, multiple slots))
`src/common/accounts_db.zig` - loading account files + indexing pubkeys - verification of snapshot data `src/common/merkle_tree.zig` - simple merkle tree hash calculation `src/core/account.zig` - logic for hashing account `test_data` - new local snapshot .zstd (same size as genesis.bin) - matching genesis.bin - both used in the accounts-db test ### dev notes: - snapshot data / load / verification can take a long time because the mainnet snapshots are so big - so we use the validator + the `solana-ledger-tool` to create smaller local snapshots and load from those - _note:_ when doing this the accounts-hash will use the current slot in the hash calculation (because the local slot < feature activation slot) fyi
`bitvec.zig` / `bloom.zig` - move BitVecConfig from bloom.zig to bitvec.zig `clock.zig` -renamed-> `time.zig` `accounts_db.zig` - reorg functions to get accounts better `getAccount` (pubkey), `getAccountInner` (file_id, offset) `getAccountType` (get account + cast with data type) - read and validate status_cache code `validateStatusCache` `snapshot_fields.zig` - add error enums (required for status cache deser) `sysvars.zig` - add common sysvar pubkeys + structs `test_data` - add an example status_cache to read from for tests
`bincode.zig` - fix optional EOF fields parsing (we dont need this anymore) `accounts_db.zig` - main functions changes: - `loadFromSnapshot` now only takes accounts_db fields - `computeAccountHashesAndLamports`: computes the accounts hash + accounts-delta hash depending on validating a full snapshot or incremental - `validateLoadFromSnapshot`: only validates the accounts-db fields now - add full/incremental snapshot path parsing - needed for finding snapshots + matching incremental snapshots - `unpackZstdTarBall` - decompresses and untars a snapshot - `main` - the full flow of loading the accounts-db and validating (will turn into full validator code) `bank.zig` - rn just includes bank validation against genesis `snapshot_fields.zig` - changes to properly parse incremental snapshot fields + include additional tests - `validateStatusCache` `test_data` - use different snapshot files (still small - just needed to build a fresh set during testing)
0xNineteen
changed the title
accounts-db: deserialize bank/accountsdb metadata
accounts-db: initial implementation
Dec 15, 2023
0xNineteen
commented
Dec 15, 2023
0xNineteen
commented
Dec 15, 2023
0xNineteen
commented
Dec 15, 2023
0xNineteen
commented
Dec 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
downloading snapshots + genesis from gossip peers(ties in with gossip - better to be a different PR imo)