docs icon indicating copy to clipboard operation
docs copied to clipboard

docs: update for fee estimator (4168 on celestia-node)

Open jcstein opened this issue 9 months ago • 7 comments

This PR enables third-party estimation for the submit transactions in the node(besides PFB). By default, fee estimation relies on the consensus node to which the node is connected. But the user can now provide a non-default endpoint, so the node will query gas price and gas from it. It can be provided via cli(using "core.estimator.address"). The address will be added to the node's config as FeeEstimatorAddress.

Additionally, the user can now provide a maxGasPrice for every submit tx(via max.gas.price flag)- the max price that the user is willing to pay for the transaction. The transaction will not be submitted in case when estimated gas price exceeds the maxGasPrice (default: minGasPrice * 100)

Update docs for this https://github.com/celestiaorg/celestia-node/pull/4168

jcstein avatar Mar 20 '25 15:03 jcstein

ADR for ref: https://github.com/celestiaorg/celestia-node/pull/4048

jcstein avatar Mar 20 '25 15:03 jcstein

use --core.estimator.address in CLI to a separate core endpoint

jcstein avatar Mar 20 '25 15:03 jcstein

What does the error look like if the suggested price is greater than the maximum

"state: estimated gasPrice exceeds max gasPrice

"it's important that users set some value like 0.2utia (100x) the current minimum)" as an upper bound - they can ask the service to estimate the gas price for them but they can also add an upper bound in case it's too much compared to what they're willing to pay.

jcstein avatar Mar 24 '25 13:03 jcstein

--core.estimator.address string specifies the endpoint of the third-party service that should be used to calculatethe gas price and gas. Format: <address>:<port>. Default connection to the consensus node will be used if left empty.

jcstein avatar Mar 24 '25 20:03 jcstein

use --max.gas.price when posting blobs or other txs

jcstein avatar Mar 24 '25 21:03 jcstein

  • If no estimator address is provided via FeeEstimatorAddress field in config or --core.estimator.address via CLI; then the celestia-node will default to using the gRPC connection (that was passed via --core.ip) to estimate gas. Passing FeeEstimatorAddress will indicate to celestia-node to prioritise using that estimator for estimating gas rather than the core endpoint it’s connected to, meaning if the celestia-node wants to use an estimator service, the node will query that estimator service.

  • users do not need to set the max gas price for every tx as the default is 0.2utia. If they wish to increase or decrease that, then they can specify a different max via the max gas price flag in RPC CLI (if they’re submitting txs through that) or via the TxConfig if they’re doing it over RPC via the WithMaxGasPrice config option.

  • In order to “test” the fee estimation mechanism via an estimator endpoint, you should congest Arabica such that tx inclusion becomes more expensive, and then ensure that the node is connected to an estimator endpoint via --core.estimator.address and submit txs (not blobs). AFAIR, the core team will be testing this feature on Arabica as the estimation logic lives inside of app - not node.

  • per the ADR, the estimator logic is only for regular txs, not PFB submissions. PFB submissions will still use the app’s default gas estimation algo

renaynay avatar Mar 26 '25 11:03 renaynay

Pending https://github.com/celestiaorg/celestia-node/issues/4185

jcstein avatar Mar 26 '25 21:03 jcstein