Summary
Implement deterministic gas estimation for MsgPayForBlobs transactions.
Parent: #4
Design
Recreate the gas estimation formula from scratch rather than importing celestia-app:
gas = gasToConsume(blobSizes, gasPerBlobByte) + (txSizeCostPerByte * bytesPerBlobInfo * numBlobs) + pfbGasFixedCost
Constants (from celestia-app, may need updating per network version):
pfbGasFixedCost = 75,000
bytesPerBlobInfo = 70
gasPerBlobByte = 8
txSizeCostPerByte — governance parameter, query from chain or configure
Gas price
- Configurable default gas price in config
- Optional multiplier/buffer (e.g., 1.1x) to reduce "insufficient fee" rejections
- No dependency on celestia-node's gas estimator gRPC service
- Optionally query
QueryMinimumGasPrice() from a celestia-app RPC endpoint as a floor
[submission]
gas_price = 0.002 # utia per gas unit
gas_price_buffer = 1.1 # 10% buffer over minimum
max_gas_price = 0.2 # safety cap
Requirements
- Pure function: given blob sizes, return gas estimate
- No network calls required (deterministic)
- Unit tests validating against known celestia-app outputs
- Configurable constants for network upgrades
References
- celestia-app
x/blob/types/payforblob.go — DefaultEstimateGas(), GasToConsume()
Summary
Implement deterministic gas estimation for
MsgPayForBlobstransactions.Parent: #4
Design
Recreate the gas estimation formula from scratch rather than importing celestia-app:
Constants (from celestia-app, may need updating per network version):
pfbGasFixedCost = 75,000bytesPerBlobInfo = 70gasPerBlobByte = 8txSizeCostPerByte— governance parameter, query from chain or configureGas price
QueryMinimumGasPrice()from a celestia-app RPC endpoint as a floorRequirements
References
x/blob/types/payforblob.go—DefaultEstimateGas(),GasToConsume()