# Runlog gas lanes

## Background

### What are 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.

### How do we achieve this?

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

## Setting it up

{% hint style="danger" %}
In some versions of the Chainlink node, the `ETH_MAX_GAS_PRICE_GWEI` env var will override the gas lane settings. Make sure you're not using this env var with gas lanes prior to v1.5.0.
{% endhint %}

### 1. Configuring the accounts

{% hint style="info" %}
Remember to take note of which gas lane you configure each account for!
{% endhint %}

#### Updating existing accounts

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:

```bash
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
```

#### Add new accounts

To add new accounts to the node (and set their gas lane), you can use the following command:

```bash
chainlink keys eth create --maxGasPriceGWei <gas price>
# Example to create a 300 Gwei gas lane:
chainlink keys eth create --maxGasPriceGWei 300
```

### 2. Setting up the jobs

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.:

```toml
submit_tx    [type="ethtx"
               from="<The account address for the desired gas lane>"
               to="0x049bd8c3adc3fe7d3fc2a44541d955a537c2a484"
               data="$(encode_tx)"]
```

Once we create this job, it will use the account we defined in the `from` param - which means that this job will not use a gas price higher than what we defined for this account.

{% hint style="warning" %}
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!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fiews.io/chainlink/chainlink-node-guides/runlog-gas-lanes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
