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

Initialize the new app with a deep SMT instead of populating the empty SMT #266

Closed
Tracked by #514
Manav-Aggarwal opened this issue Aug 20, 2022 · 1 comment
Closed
Tracked by #514
Assignees
Labels
C: Cevmos Changes related to the cevmos branches C:Store

Comments

@Manav-Aggarwal
Copy link
Member

Manav-Aggarwal commented Aug 20, 2022

Currently, when a new baseapp is set from the contents of a fraudproof, when setting key/value pairs in the store of the baseapp, we start with an empty SMT with no predefined root. However, we must start with a deep SMT with a predefined root taken from the given fraudproof. This lets the new app's substore hashes to be the same.

Right now, since we load the key/value pairs on an empty SMT we don't get the same root as the pre-state root of a challenged transaction.

Starting point:

func SetupBaseAppFromParams(appName string, logger log.Logger, db dbm.Connection, txDecoder sdk.TxDecoder, storeKeyNames []string, blockHeight int64, storeToLoadFrom map[string]types.KVStore, options ...AppOption) (*BaseApp, error) {

@Manav-Aggarwal Manav-Aggarwal changed the title Initialize the new app with a deep subtree instead of populating the empty SMT on startup Initialize the new app with a deep SMT instead of populating the empty SMT on startup Aug 20, 2022
@Manav-Aggarwal Manav-Aggarwal self-assigned this Aug 20, 2022
@Manav-Aggarwal Manav-Aggarwal added C: Cevmos Changes related to the cevmos branches C:Store labels Aug 20, 2022
@Manav-Aggarwal Manav-Aggarwal changed the title Initialize the new app with a deep SMT instead of populating the empty SMT on startup Initialize the new app with a deep SMT instead of populating the empty SMT Aug 20, 2022
@Manav-Aggarwal
Copy link
Member Author

We use IAVL store type now. Closed by: rollkit#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Cevmos Changes related to the cevmos branches C:Store
Projects
None yet
1 participant