Consensys / linea-sequencer

Linea Sequencer Implementation
Other
18 stars 17 forks source link

`linea_estimateGas`: calculate the gas limit the sender according to his balance #86

Closed fab-10 closed 1 month ago

fab-10 commented 1 month ago

linea_estimateGas now takes in consideration the balance of the sender to set the gasLimit for the first estimation, to avoid that setting the gasLimit to the max allowed by the configuration, could result in failures with not enough balance to pay for gas, so capping the gasLimit to what the sender can afford to pay, prevents this issue.

For linea_estimateGas to work, the in-process RPC must be enabled and ETH methods exposed, since the plugin need to be able to call eth_getBalance:

  1. Xin-process-rpc-enabled=true
  2. Xin-process-rpc-apis=["ETH"]

I also took the opportunity to fix the logId used to correlate log lines for a specific request.