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

Chain state should be cached on startup (opt-in) #71

Open
DavidNix opened this issue May 12, 2022 · 4 comments
Open

Chain state should be cached on startup (opt-in) #71

DavidNix opened this issue May 12, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@DavidNix
Copy link
Contributor

Problem

The test setup can take a long time (> 60s) to create clients, connections, channels, faucet accounts, test accounts, etc.

Proposal

Allow a developer (or perhaps an end user) to optionally specify a starting state that already has the above mentioned transactions. That way, we can skip the setup and quickly get into more interesting aspects of IBC such as transfering funds from one chain to another.

This option could be part of the matrix file or command line flags.

Goals

  • MVP supports cosmos chains only.
@DavidNix DavidNix added the enhancement New feature or request label May 12, 2022
@jackzampolin
Copy link
Member

jackzampolin commented May 12, 2022

A couple of notes:

  • I'm good with it just supporting cosmos chains
  • Might want to architect so that test runs first and leaves a folder with state the way dev wants it. maybe susequent runs would copy that state to a new dir and start up chain from there.

@agouin
Copy link
Member

agouin commented May 12, 2022

Great idea! There is the StartWithGenesisFile method that can be used in the tests. I think we could add a caching mechanism so that it does the ExportState method on a validator node after the chain start up and writes it to a cache dir, and then for future runs, if caching is enabled and the cached state file exists, it can just run with StartWithGenesisFile instead of Start. Once we have chain capabilities, caching after genesis could be one of them.

https://github.com/strangelove-ventures/interchaintest/tree/andrew/start_with_genesis

@DavidNix
Copy link
Contributor Author

All great options. I'm not sure on implementation details yet. There may be additional problems like the ability to ensure steps are idempotent (like creating channels) and/or the ability to no-op, ignore errors, or skip steps which don't need to be run as a result of using a cached state.

@jackzampolin
Copy link
Member

andrews idea is the way ™️

@DavidNix DavidNix self-assigned this May 18, 2022
@DavidNix DavidNix removed their assignment Aug 16, 2022
@jonathanpberger jonathanpberger changed the title Allow seeding chain state to speed up test setup time Chain state should be seed-able (to speed up test setup time) Mar 20, 2023
@Reecepbcups Reecepbcups changed the title Chain state should be seed-able (to speed up test setup time) Chain state should be cached on startup (opt-in) Mar 14, 2024
@Reecepbcups Reecepbcups pinned this issue Mar 14, 2024
@Reecepbcups Reecepbcups unpinned this issue Apr 28, 2024
@Reecepbcups Reecepbcups removed their assignment Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants