Skip to content
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

(WIP) Prototyping the new Accounts DB storage #28790

Closed
wants to merge 1 commit into from
Closed

(WIP) Prototyping the new Accounts DB storage #28790

wants to merge 1 commit into from

Conversation

yhchiang-sol
Copy link
Contributor

WIP.

Based on #28550

@yhchiang-sol yhchiang-sol marked this pull request as draft November 11, 2022 10:15
@yhchiang-sol
Copy link
Contributor Author

yhchiang-sol commented Dec 2, 2022

Hello, @jeffwashington. If you want to test out the PR, this can be done by compiling the ledger-tool and run the following command:

solana-ledger-tool new_ads_file --append-vec <append_vec_path> --ads-file-name <new_file_path> --ledger <ledger>

Here's my script for running it for example:

 /ds-file-nameUsers/keelar/solana/yhchiang-sol/target/debug/solana-ledger-tool new_ads_file --append-vec /Users/keelar/solana/account-db-data/$1 --ads-file-name /Users/keelar/solana/account-db-data/ads-$1 --ledger /Users/keelar/solana/disks/ledger/

The above command will create the new accounts-data-storage file from the specified append_vec. It will also verify whether the two files have the same account meta and data.

For each account, the command will dump its data from both append_vec and the new format and verify whether they are the same:

[2022-12-02T20:28:01.556305000Z INFO  solana_ledger_tool] verifing account ByMuSmKJUYTqFpUZWDDCgqPHwCzBeGNWkN2SZmyM24Rs
[2022-12-02T20:28:01.556333000Z INFO  solana_ledger_tool]     lamport: append_vec(2039280) vs ads_file (2039280)
entry = AccountMetaStorageEntry { lamports: 2039280, block_offset: 1697855, owner_local_id: 0, uncompressed_length: 165, local_offset: 1041 }
[2022-12-02T20:28:01.556393000Z INFO  solana_ledger_tool]  StoredMeta: append_vec(StoredMeta { write_version: 457658454976, pubkey: ByMuSmKJUYTqFpUZWDDCgqPHwCzBeGNWkN2SZmyM24Rs, data_len: 165 })
[2022-12-02T20:28:01.556425000Z INFO  solana_ledger_tool]              ads_file  (StoredMeta { write_version: 457658454976, pubkey: ByMuSmKJUYTqFpUZWDDCgqPHwCzBeGNWkN2SZmyM24Rs, data_len: 165 })
[2022-12-02T20:28:01.556458000Z INFO  solana_ledger_tool]  AccountSharedData: append_vec(Account { lamports: 2039280, data.len: 165, owner: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA, executable: false, rent_epoch: 358, data: 0b3338a0ab2cc841d5b014bc6a3cf756291874b319c9517d9bbfa9e4e9661ef96a9b111acda5f839cc36127979c2d0f29a3089fe40509696e77b210d04595108 })
[2022-12-02T20:28:01.556512000Z INFO  solana_ledger_tool]                     ads_file  (Account { lamports: 2039280, data.len: 165, owner: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA, executable: false, rent_epoch: 358, data: 0b3338a0ab2cc841d5b014bc6a3cf756291874b319c9517d9bbfa9e4e9661ef96a9b111acda5f839cc36127979c2d0f29a3089fe40509696e77b210d04595108 })

In my experiment, the new format could save up to 75% of the storage size:

-rw-r--r--  1 keelar  staff  21524480 Dec  2 00:05 154931095.1633108
-rw-r--r--  1 keelar  staff   5545380 Dec  2 12:23 ads-154931095.1633108

@@ -4330,6 +4350,78 @@ fn main() {
eprintln!("{}", err);
}
}
("new_ads_file", Some(arg_matches)) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jeffwashington: FYI: this is the command that creates the new accounts-data-storage from from an append_vec file and verify its correctness.

@github-actions github-actions bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Jan 26, 2023
@github-actions github-actions bot removed the stale [bot only] Added to stale content; results in auto-close after a week. label Feb 1, 2023
@yhchiang-sol yhchiang-sol changed the title (WIP) Introduce AccountsStateStorage (WIP) Prototyping the new Accounts DB storage Feb 14, 2023
@yhchiang-sol yhchiang-sol closed this by deleting the head repository Feb 22, 2023
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.

1 participant