Skip to content

[ante] use infinite gas meter for transactions

akrokr requested to merge akh/infinite_gas into develop

Fixes #1549 (closed)

We do not use cosmos gas but our app still consumes gas and panics if the signer does not specify enough. Gas-wanted can be set to anything (it's fake, not used) and we've had issues in the past where we've needed to increase the recommended fake gas to avoid panics.

This wraps the ctx used for transaction processing with an infinite gas meter. It avoids out-of-gas panics in tx processing and also allows implementation changes to be made without consensus failure as long as the final state of the block is correct.

Note on regression tests: I set the gas wanted to 0 for tests. Previous version migrations which backdate their version then fail since they need gas. So I wired in an optional gas field for reg txs similar to sequence number. This works but if there's a better way, I'm all ears.

Edited by akrokr

Merge request reports