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

fix(app): register wasm snapshot extension for state-sync #2114

Merged
merged 6 commits into from
Feb 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,18 @@

app.SetAnteHandler(initAnteHandlers(encodingConfig, keys, keepers, appOpts))

// Register snapshot extensions to enable state-sync for wasm.
// MUST be done before loading the version
// Requires the snapshot store to be created and registered as a BaseAppOption
if manager := app.SnapshotManager(); manager != nil {
err := manager.RegisterExtensions(
wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), getKeeper[wasm.Keeper](keepers)),
)
if err != nil {
panic(fmt.Errorf("failed to register snapshot extension: %s", err))

Check warning on line 349 in app/app.go

View check run for this annotation

Codecov / codecov/patch

app/app.go#L345-L349

Added lines #L345 - L349 were not covered by tests
}
}

milapsheth marked this conversation as resolved.
Show resolved Hide resolved
if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
tmos.Exit(err.Error())
Expand Down
Loading