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

Extend the twin test to use snapshot file to load the DB. Not a full zipped archive of a DB. #274

Open
saki-osive opened this issue Jul 9, 2024 · 3 comments

Comments

@saki-osive
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently the twin tests use the full zipped archive of a DB.

Describe the solution you'd like
Extend the twin test to use snapshot file to load the DB

  • Download a snapshot archive & unzip
  • Turn archive snapshot into genesis.blob (bytes for initial state of blockchain).
  • Start twin from a saved genesis.blob which came from the snapshot

Ideally the CLI interface for the twin tests has three db options
a) use a full directory --db-path
b) use a snapshot --snapshot-path
c) (nice to have) use a genesis.blob --genesis-blob, which would have been generated in a previous test run. Speeds up testing

Twin tests location:
https://github.com/0LNetworkCommunity/libra-framework/blob/main/tools/rescue/src/twin.rs

Storage: read snapshot
https://github.com/0LNetworkCommunity/libra-framework/blob/main/tools/storage/src/read_snapshot.rs

It might might be possible to import read_snapshot into twin.rs

  • TASK ONE: try to make the twin CLI accept a --snapshot-path file. Likely integrating read_snapshot.rs
  • TASK TWO: Add a standard test: can we upgrade a Twin chain with a new "framework upgrade" procedure.
  • TASK THREE: Set up github actions to have a new workflow which runs the Twin upgradeability tests. Using the prior night's snapshot in epoch_archive

Here is a test using the twin with a local copy db https://github.com/0LNetworkCommunity/libra-framework/blob/0c279849dd48081bd738a1388ad73f68db742439/tools/rescue/tests/upgrade_multi_action.rs

Repo of snapshots:
https://github.com/0LNetworkCommunity/epoch-archive-mainnet
Alternative to TASK ONE: take the libra binary, and start in fullnode mode, to populate a ./db/ which then can be used for twin

@0o-de-lally 0o-de-lally added this to Eng Jul 12, 2024
@0o-de-lally 0o-de-lally moved this to In progress in Eng Jul 12, 2024
@0o-de-lally
Copy link
Contributor

  1. Read snapshot
  2. Test for snapshot (not passing)
  3. TODO: Add test for upgradeability
  4. TODO: (nice to have) use a genesis.blob to speed up.

@0o-de-lally 0o-de-lally linked a pull request Jul 12, 2024 that will close this issue
@0o-de-lally
Copy link
Contributor

@saki-osive Try to confirm that the twin tool is creating the relevant directories for swarm. This should be one of the check a meta test. (There is a swam method that reveals the directory of each node, note that it may be a temp folder).

@saki-osive
Copy link
Contributor Author

  1. Read snapshot
  2. Test for snapshot (not passing)
  3. TODO: Add test for upgradeability
  4. TODO: (nice to have) use a genesis.blob to speed up.
  1. Read snapshot
  • Integrated read_snaphost in the twin
  • Added check to use snapshot file to load the DB if provided
  • Updated the twin cli to accept the snapshot file

@0o-de-lally 0o-de-lally moved this from In progress to In review in Eng Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

2 participants