-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clarify gas metering #59
Comments
Extra info: If you set the gas per all ops to 0 and the gas per byte to 1 gas per byte, then you exactly have metering per byte. In terms on gas limit, the implicit gas limit should be the deterministic gas cost of a tx, not infinity. If it's infinity, accounts won't have sufficient balance to pay fees and the txs will be invalid. Of course, this point depends on where the implicit gas limit is injected; if after the validity checks then there's less of an issue. |
The example mentioned is the default that we're using, so gas is determined strictly per byte basis. Unless we add some additional operational gas cost, that will be zero too. What the default mechanism doesn't account for, is that we process messages before calling the function that deducts gas during |
I think we can close with after #397 |
we also have our resource pricing specs https://github.com/celestiaorg/celestia-app/blob/main/specs/src/specs/resource_pricing.md so this feels safe to close |
Summary
Clarify how to meter for gas for messages and state-relevant Txs too.
Context
Dropping some raw notes from discussions we had:
Transaction cost metering should only be based on bytes .
potenial workarounds: implicitly set gas limit to infinity (maybe not infinity, maybe use gas used purely for byte cost). This means no need for gas limit field in tx.
Some context:
In the SDK applications can define gas metering as they please.
Here is an example of metering based on bytes: https://github.com/cosmos/cosmos-sdk/blob/eb8aaf939513d3bf6e82bd13691cfbe9ef4ad28c/x/auth/ante/basic.go#L88-L95
more docs:
https://docs.cosmos.network/master/basics/gas-fees.html#block-gas-meter
and the AnteHandler: https://docs.cosmos.network/master/basics/gas-fees.html#antehandler
Timeline / Action Items
Note the implementation can happen for the incentivized testnet but we should definitely "de-risk" this earlier, i.e. we should start looking into what exact changes will be necessary certainly before the test-net milsetone.
The text was updated successfully, but these errors were encountered: