File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
11
11
"time"
12
12
13
13
"github.com/CosmWasm/wasmd/x/wasm"
14
+ wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
14
15
"github.com/cosmos/cosmos-sdk/baseapp"
15
16
"github.com/cosmos/cosmos-sdk/client"
16
17
"github.com/cosmos/cosmos-sdk/client/config"
@@ -251,6 +252,12 @@ func newApp(
251
252
panic (err )
252
253
}
253
254
255
+ wasmGasRegisterConfig := wasmkeeper .DefaultGasRegisterConfig ()
256
+ // This varies from the default value of 140_000_000 because we would like to appropriately represent the
257
+ // compute time required as a proportion of block gas used for a wasm contract that performs a lot of compute
258
+ // This makes it such that the wasm VM gas converts to sdk gas at a 6.66x rate vs that of the previous multiplier
259
+ wasmGasRegisterConfig .GasMultiplier = 21_000_000
260
+
254
261
return app .New (
255
262
logger ,
256
263
db ,
@@ -263,7 +270,13 @@ func newApp(
263
270
app .MakeEncodingConfig (),
264
271
wasm .EnableAllProposals ,
265
272
appOpts ,
266
- []wasm.Option {},
273
+ []wasm.Option {
274
+ wasmkeeper .WithGasRegister (
275
+ wasmkeeper .NewWasmGasRegister (
276
+ wasmGasRegisterConfig ,
277
+ ),
278
+ ),
279
+ },
267
280
[]aclkeeper.Option {},
268
281
baseapp .SetPruning (pruningOpts ),
269
282
baseapp .SetMinGasPrices (cast .ToString (appOpts .Get (server .FlagMinGasPrices ))),
You can’t perform that action at this time.
0 commit comments