rundler icon indicating copy to clipboard operation
rundler copied to clipboard

[pool] Insufficient preVerificationGas throws off latency tracking metric

Open dancoombs opened this issue 7 months ago • 1 comments

Describe the bug On L2s that contain dynamic preVerificationGas, one of the filters for being eligible to mine is having a sufficient PVG value for the current network gas prices. If below, the UO will not get mined. This should not count against its time to mine latency in the mempool.

To reproduce Steps to reproduce the behavior:

  • Submit a UO that has an underpriced PVG
  • Watch time to mine metrics

Expected behavior A UO should only have its time to mine increased when it is eligible to be mined.

Additional context One way to solve this would be to re-calculate PVG on every block. This is already done by the builder. The solution here is likely to move this calculation down into the pool in a batched manner, limiting the amount of eth_call requests.

Its possible that we can start calculating the dynamic PVG without making an eth_call per UO. The calculation is only based on network constants that need to be queried once per block. Until we move the PVG calculation into Rundler its unlikely we'll be able to efficiently serve this. This move is healthy for Rundler in general as it limits RPC calls.

For example on optimism we can do this calculation directly: https://github.com/ethereum-optimism/optimism/blob/7f403ea5f316a9085061bc63b6618afcdbca1278/packages/contracts-bedrock/src/L2/GasPriceOracle.sol#L226 by only querying a few constants that only change once per block.

dancoombs avatar Jun 26 '24 21:06 dancoombs