strangelove-ventures / interchaintest

e2e testing framework for the interchain
https://interchaintest-docs.vercel.app
Apache License 2.0
184 stars 116 forks source link

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

Open DavidNix opened 2 years ago

DavidNix commented 2 years ago

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

jackzampolin commented 2 years ago

A couple of notes:

agouin commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

andrews idea is the way ™️