Right now a call to wasmVM.Create is free of charge. It is up to the caller to charge gas for the call. This is not ideal as Create should not make it easy to forget gas tracking and take responsibility for its own resource usage.
Wasmd charged Create gas here. In other places of wasmd the call is not charged, which is not a problem but you get the point:
Right now a call to
wasmVM.Create
is free of charge. It is up to the caller to charge gas for the call. This is not ideal as Create should not make it easy to forget gas tracking and take responsibility for its own resource usage.Wasmd charged Create gas here. In other places of wasmd the call is not charged, which is not a problem but you get the point:
Other functions have gas metering and track their gas usage internally, maybe given cost configuration like deserialization cost, like here:
https://github.com/CosmWasm/wasmvm/blob/825dceaacd28f72bb6cf622a164991c5dade125c/lib.go#L161-L201
This addresses this comment: https://github.com/CosmWasm/wasmvm/blob/825dceaacd28f72bb6cf622a164991c5dade125c/lib.go#L58