diff --git a/CHANGELOG.md b/CHANGELOG.md index 0788ab1519..552027d03e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ * (build) [\#195](https://github.com/line/lfb-sdk/pull/195) Build properly when using libsecp256k1 * (perf) [\#198](https://github.com/line/lfb-sdk/pull/198) Caching paramset * (global) [\#200](https://github.com/line/lfb-sdk/pull/200) Add a env prefix +* (store) [\#202](https://github.com/line/lfb-sdk/pull/202) param store doesn't use gas kv * (store) [\#202](https://github.com/line/lfb-sdk/pull/202) Param store doesn't use gas kv * (store) [\#203](https://github.com/line/lfb-sdk/pull/203) Remove transient store that is not used now * (perf) [\#204](https://github.com/line/lfb-sdk/pull/204) Apply rw mutex to cachekv @@ -46,6 +47,7 @@ * (global) [\#230](https://github.com/line/lfb-sdk/pull/230) Modify module name to lfb-sdk * (bump-up) [\#246](https://github.com/line/lfb-sdk/pull/246) Bump up ostracon to not flush wal when receive consensus msgs * (wasm) [\#250](https://github.com/line/lfb-sdk/pull/250) Migrate linkwasmd to the latest commit +* (wasm) [\#253](https://github.com/line/lfb-sdk/pull/253) remove MaxGas const * (wasm) [\#254](https://github.com/line/lfb-sdk/pull/254) Specify wasm event types * (x) [\#255](https://github.com/line/lfb-sdk/pull/255) Remove legacy from modules diff --git a/x/wasm/alias.go b/x/wasm/alias.go index 2c6c0289fe..ee99d1da3c 100644 --- a/x/wasm/alias.go +++ b/x/wasm/alias.go @@ -25,7 +25,6 @@ const ( ProposalTypeMigrateContract = types.ProposalTypeMigrateContract ProposalTypeUpdateAdmin = types.ProposalTypeUpdateAdmin ProposalTypeClearAdmin = types.ProposalTypeClearAdmin - MaxGas = keeper.MaxGas QueryListContractByCode = keeper.QueryListContractByCode QueryGetContract = keeper.QueryGetContract QueryGetContractState = keeper.QueryGetContractState diff --git a/x/wasm/internal/keeper/keeper.go b/x/wasm/internal/keeper/keeper.go index b4be3dfaeb..3b9bf9e591 100644 --- a/x/wasm/internal/keeper/keeper.go +++ b/x/wasm/internal/keeper/keeper.go @@ -20,10 +20,6 @@ import ( wasmvmtypes "github.com/line/wasmvm/types" ) -// MaxGas was restriction is increased to 0x7FFFFFFFFFFFFFFF in CosmWasm 0.10. -// This const is not needed now and we can manage it in another way. -const MaxGas = 10_000_000_000 - // contractMemoryLimit is the memory limit of each contract execution (in MiB) // constant value so all nodes run with the same limit. const contractMemoryLimit = 32 @@ -957,9 +953,6 @@ func gasForContract(ctx sdk.Context, gasMultiplier uint64) uint64 { return 0 } remaining := (meter.Limit() - meter.GasConsumedToLimit()) * gasMultiplier - if remaining > MaxGas { - return MaxGas - } return remaining } diff --git a/x/wasm/internal/keeper/relay_test.go b/x/wasm/internal/keeper/relay_test.go index fa7a4b74b9..aabf345c37 100644 --- a/x/wasm/internal/keeper/relay_test.go +++ b/x/wasm/internal/keeper/relay_test.go @@ -3,6 +3,7 @@ package keeper import ( "encoding/json" "errors" + "math" "testing" sdk "github.com/line/lfb-sdk/types" @@ -32,7 +33,7 @@ func TestOnOpenChannel(t *testing.T) { }, "consume max gas": { contractAddr: example.Contract, - contractGas: MaxGas, + contractGas: math.MaxUint64 / types.DefaultGasMultiplier, }, "consume gas on error": { contractAddr: example.Contract,