From 7f02f57f21c938e8f0253182efa3295112d251d1 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Wed, 15 Jul 2020 16:21:40 +0200 Subject: [PATCH] Increase and document the MaxGas limit --- x/wasm/internal/keeper/keeper.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x/wasm/internal/keeper/keeper.go b/x/wasm/internal/keeper/keeper.go index 88393785..3f725497 100644 --- a/x/wasm/internal/keeper/keeper.go +++ b/x/wasm/internal/keeper/keeper.go @@ -28,8 +28,10 @@ import ( // Rough timing have 88k gas at 90us, which is equal to 1k sdk gas... (one read) const GasMultiplier = 100 -// MaxGas for a contract is 900 million (enforced in rust) -const MaxGas = 900_000_000 +// MaxGas for a contract is 10 billion wasmer gas (enforced in rust to prevent overflow) +// The limit for v0.9.3 is defined here: https://github.com/CosmWasm/cosmwasm/blob/v0.9.3/packages/vm/src/backends/singlepass.rs#L15-L23 +// (this will be increased in future releases) +const MaxGas = 10_000_000_000 // InstanceCost is how much SDK gas we charge each time we load a WASM instance. // Creating a new instance is costly, and this helps put a recursion limit to contracts calling contracts.