Runlog gas lanes
Gas lanes allow us to create runlog jobs with different maximum gas prices. This allows us to create cheap runlog jobs that will not be fulfilled during gas spikes and more expensive runlog jobs that are guaranteed to be fulfilled during the highest gas spikes. This is especially useful for runlog users who do not need requests to be fulfilled at high gas prices, making it cheaper overall.
If we were to create runlog jobs with different max gas prices using the same Ethereum account, we would likely end up in a situation where a low gas price transaction is holding up a queue of high gas price transactions. Luckily, the Chainlink node supports using multiple Ethereum accounts. This allows us to purpose each account for its own gas lane.
As an example, we could have this setup of accounts on the node:
- Account A: max gas price = 50 Gwei
- Account B: max gas price = 500 Gwei
- Account C: max gas price = 5,000 Gwei
In some versions of the Chainlink node, the
ETH_MAX_GAS_PRICE_GWEIenv var will override the gas lane settings. Make sure you're not using this env var with gas lanes prior to v1.5.0.
Remember to take note of which gas lane you configure each account for!
The Chainlink node will automatically create a new account on the initial setup. To set the gas lane of this account or any other additional accounts you've added to the node, you can use the command below:
chainlink keys eth update --maxGasPriceGWei <gas price> <address>
# Example to use this account as the 300 Gwei gas lane:
chainlink keys eth update --maxGasPriceGWei 300 0x481df95742cc38b387871e789913659a2469daa6
To add new accounts to the node (and set their gas lane), you can use the following command:
chainlink keys eth create --maxGasPriceGWei <gas price>
# Example to create a 300 Gwei gas lane:
chainlink keys eth create --maxGasPriceGWei 300
Next, we need to configure jobs to use the correct gas lane. We do this by defining the "from" address in the ethTx task of the jobs, e.g.:
from="<The account address for the desired gas lane>"
Once we create this job, it will use the account we defined in the
fromparam - which means that this job will not use a gas price higher than what we defined for this account.
If you have existing jobs on your node, you will probably want to modify them to specify which gas lane to use - otherwise it will choose one at random!