dtl: configurable gas price backend
Adds a new config option `--l1-gas-price-backend` or `DATA_TRANSPORT_LAYER_L1_GAS_PRICE_BACKEND` that can be set to `l1` or `l2`. This impacts the behavior of the HTTP endpoint `GET /eth/gasprice` by changing what is queried to return the L1 gas price. The L1 gas price is required to compute the L2 fee since the L2 fee consists of `L1 gas price * L1 gas used + L1 gas price * L2 gas limit`. If the L1 gas price differs too much between different L2 providers, then users using `eth_estimateGas` may submit transactions with too low of a fee and be unable to submit transactions to the sequencer. By configuring the DTL to use L2 as the L1 gas price backend, it will call the Sequencer's RPC endpoint `rollup_gasPrices` which returns the L1 and L2 gas prices from the point of view of the sequencer. The L2 gas price exists in the state, so that will always be the same between the sequencer and any replicas. The L1 gas price does not live on chain, so querying for it from the sequencer directly will ensure that users send transactions with a fee that is large enough. Also adds eth/gasprice info to README.
Showing
Please register or sign in to comment