Skip to content

Commit

Permalink
fix upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Jan 19, 2024
1 parent 8416725 commit 2c8b1c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
14 changes: 6 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,18 +442,16 @@ func New(
}
ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{})

// Initialize pinned codes in wasmvm as they are not persisted there.
// We do not use the wasm light client's impl since we do not want ALL to be pinned.
// The WasmKeeper will handle is as expected.
if err := app.AppKeepers.WasmKeeper.InitializePinnedCodes(ctx); err != nil {
tmos.Exit(fmt.Sprintf("failed initialize pinned codes %s", err))
}

// https://github.com/cosmos/ibc-go/pull/5439
if err := wasmlckeeper.InitializePinnedCodes(ctx, appCodec); err != nil {
tmos.Exit(fmt.Sprintf("failed initialize pinned codes %s", err))
tmos.Exit(fmt.Sprintf("wasmlckeeper failed initialize pinned codes %s", err))
}

// we already load in with the wasmlc (all)
// if err := app.AppKeepers.WasmKeeper.InitializePinnedCodes(ctx); err != nil {
// tmos.Exit(fmt.Sprintf("app.AppKeepers.WasmKeeper failed initialize pinned codes %s", err))
// }

// Initialize and seal the capability keeper so all persistent capabilities
// are loaded in-memory and prevent any further modules from creating scoped
// sub-keepers.
Expand Down
9 changes: 2 additions & 7 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ func NewAppKeepers(

wasmOpts = append(wasmOpts, burnMessageHandler)

// create a shared VM instance (x/wasm <-> wasm light client)
mainWasmer, err := wasmvm.NewVM(wasmDir, wasmCapabilities, 32, wasmConfig.ContractDebugMode, wasmConfig.MemoryCacheSize)
if err != nil {
panic(fmt.Sprintf("failed to create juno wasm vm: %s", err))
Expand All @@ -553,8 +552,6 @@ func NewAppKeepers(
panic(fmt.Sprintf("failed to create juno wasm vm for 08-wasm: %s", err))
}

wasmOpts = append(wasmOpts, wasmkeeper.WithWasmEngine(mainWasmer))

appKeepers.WasmKeeper = wasmkeeper.NewKeeper(
appCodec,
appKeepers.keys[wasmtypes.StoreKey],
Expand All @@ -573,7 +570,7 @@ func NewAppKeepers(
wasmConfig,
wasmCapabilities,
govModAddress,
wasmOpts...,
append(wasmOpts, wasmkeeper.WithWasmEngine(mainWasmer))...,
)

// 08-wasm light client
Expand All @@ -591,16 +588,14 @@ func NewAppKeepers(
Stargate: wasmlctypes.AcceptListStargateQuerier(accepted),
}

wasmQuerierOption := wasmlckeeper.WithQueryPlugins(&wasmLightClientQuerier)

appKeepers.WasmClientKeeper = wasmlckeeper.NewKeeperWithVM(
appCodec,
appKeepers.keys[wasmlctypes.StoreKey],
appKeepers.IBCKeeper.ClientKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
lcWasmer,
bApp.GRPCQueryRouter(),
wasmQuerierOption,
wasmlckeeper.WithQueryPlugins(&wasmLightClientQuerier),
)

appKeepers.FeePayKeeper = feepaykeeper.NewKeeper(
Expand Down

0 comments on commit 2c8b1c7

Please sign in to comment.