CIP: Standardised Gas and Pricing Estimation Interface

This is a forum post centred on discussion about a possible new CIP which would introduce a standardised querying interface for clients to use to estimate gas usage and gas pricing for transactions. This is designed to promote the entry of third party providers specialising in this service and competing to offer the most reliable and accurate estimations.

6 Likes

The notion of urgency, or within how many blocks does the user want their transaction to be submitted may be a useful parameter in the future but is currently left out of the original interface.

How do you think the notion of urgency should be presented in the interface in the future? Do you think it will be likely a feature that is required from the get-go?

I think the best unit to describe urgency is “within how many heights do you expect your transaction to be committed”. I would likely modify the request object to allow the user to specify the urgency in blocks (with 1 being the most urgent). The response would still remain the same.

Alternatively, this could be reduced into three levels of urgency (say within 1 block, within 10 blocks, within 1000 blocks) with the response containing an estimated price for each of them

Here are some ideas around that. The probability of being included in the xth block could be more expressive. If I say, for example, that I want to be included in 1 block time, the gas estimator cannot guarantee the inclusion no matter the fee. Still, it can express the probability of being included.

For this strawman, let’s assume that the demand for the blockspace is constant and that the probability of inclusion does not change on a block-per-block basis.

With a 50% chance of being included per block, it would take ten blocks to get a 1 - (1 - 0.5)¹⁰ = 0.999 % chance of being included. With that, you could create a mapping of the number of blocks and the percentage. If I want to be included within 10 Blocks, the chance of me succeeding should be >0.999% after 10 Blocks, which then means that I should pay the amount of fees that get me a 50% chance of inclusion.

Being included on average after 10 Blocks and “definitely” (>0.999% chance ) is also a difference that could be differentiated in the Interface.