-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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,000bytesPerBlobInfo = 70gasPerBlobByte = 8txSizeCostPerByte— 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 capRequirements
- 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()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels