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

Add state export in CI #2648

Closed
jackzampolin opened this issue Oct 31, 2018 · 6 comments
Closed

Add state export in CI #2648

jackzampolin opened this issue Oct 31, 2018 · 6 comments
Assignees
Labels

Comments

@jackzampolin
Copy link
Member

Add a test in CI that exports network state from a simulation and tries to import it to start a new chain.

@cwgoes
Copy link
Contributor

cwgoes commented Nov 1, 2018

We need a way to compare two states, equality of root hash won't work since IAVL is insertion-order-dependent. I guess we can iterate through the whole keyspace of each store and compare key-by-key? Might be time-consuming but I can't immediately think of a faster way.

Any ideas @ValarDragon?

@ValarDragon
Copy link
Contributor

ValarDragon commented Nov 1, 2018

That's the only option which immediately comes to mind, without changing data structure / representation. (Storing every state chsnge would absolutely be more expensive)

I guess it shouldn't be too slow if it's from a simulation created in CI

@alexanderbez
Copy link
Contributor

Does it not suffice to just check the app hash?

@ValarDragon
Copy link
Contributor

ValarDragon commented Nov 1, 2018

equality of root hash won't work since IAVL is insertion-order-dependent

Because of that, the app hashes won't be the same.

@alexanderbez
Copy link
Contributor

Ohhh right. Derp. Ok, I guess we can do direct store comparisons.

@cwgoes cwgoes self-assigned this Nov 5, 2018
@cwgoes
Copy link
Contributor

cwgoes commented Nov 5, 2018

Dump to a file for comparison and ease-of-inspection, format e.g.

# STORE = "stake", HEIGHT = 123
(<KEY BYTES>\t<VALUE BYTES>\n)*
# STORE = "gov", HEIGHT = 123
(<KEY BYTES>\t<VALUE BYTES>\n)*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants