Skip to content

Commit 9f60662

Browse files
docs: Document per-chain RPC settings in config and env vars
Add the full list of per-chain Ethereum RPC tuning settings to docs/config.md with env var fallback defaults, and add a cross-reference note in docs/environment-variables.md.
1 parent 1641ea6 commit 9f60662

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

docs/config.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,43 @@ The configuration for a chain `name` is specified in the section
123123
- `shard`: where chain data is stored
124124
- `protocol`: the protocol type being indexed, default `ethereum`
125125
(alternatively `near`, `cosmos`,`arweave`,`starknet`)
126-
- `polling_interval`: the polling interval for the block ingestor (default 500ms)
127126
- `amp`: the network name used by AMP for this chain; defaults to the chain name.
128127
Set this when AMP uses a different name than graph-node (e.g., `amp = "ethereum-mainnet"`
129128
on a chain named `mainnet`).
130129
- `cache_size`: number of blocks from the chain head for which to keep
131130
block data cached. Defaults to the section-level `cache_size`.
132131
- `provider`: a list of providers for that chain
133132

133+
Additionally, Ethereum chains support per-chain RPC tuning settings. When
134+
omitted, each setting falls back to its corresponding environment variable
135+
default (see [environment-variables.md](environment-variables.md) for
136+
details):
137+
138+
- `polling_interval`: block ingestor polling interval in milliseconds.
139+
Default: `ETHEREUM_POLLING_INTERVAL` (500ms).
140+
- `json_rpc_timeout`: timeout for JSON-RPC requests in seconds.
141+
Default: `GRAPH_ETHEREUM_JSON_RPC_TIMEOUT` (180s).
142+
- `request_retries`: number of times to retry failed JSON-RPC requests.
143+
Default: `GRAPH_ETHEREUM_REQUEST_RETRIES` (10).
144+
- `max_block_range_size`: maximum number of blocks to scan for triggers per
145+
request. Default: `GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE` (1000).
146+
- `block_batch_size`: number of blocks to request in parallel.
147+
Default: `ETHEREUM_BLOCK_BATCH_SIZE` (10).
148+
- `block_ptr_batch_size`: number of block pointers to request in parallel.
149+
Default: `ETHEREUM_BLOCK_PTR_BATCH_SIZE` (100).
150+
- `max_event_only_range`: maximum range for `eth_getLogs` requests that
151+
don't filter on contract address.
152+
Default: `GRAPH_ETHEREUM_MAX_EVENT_ONLY_RANGE` (500).
153+
- `target_triggers_per_block_range`: ideal number of triggers per batch.
154+
Default: `GRAPH_ETHEREUM_TARGET_TRIGGERS_PER_BLOCK_RANGE` (100).
155+
- `get_logs_max_contracts`: maximum contracts per `eth_getLogs` call.
156+
Default: `GRAPH_ETH_GET_LOGS_MAX_CONTRACTS` (2000).
157+
- `block_ingestor_max_concurrent_json_rpc_calls`: maximum concurrent
158+
JSON-RPC calls for transaction receipts during block ingestion.
159+
Default: `GRAPH_ETHEREUM_BLOCK_INGESTOR_MAX_CONCURRENT_JSON_RPC_CALLS_FOR_TXN_RECEIPTS` (1000).
160+
- `genesis_block_number`: genesis block number for this chain.
161+
Default: `GRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER` (0).
162+
134163
A `provider` is an object with the following characteristics:
135164

136165
- `label`: the name of the provider, which will appear in logs
@@ -181,6 +210,10 @@ cache_size = 500
181210
[chains.mainnet]
182211
shard = "vip"
183212
amp = "ethereum-mainnet"
213+
# Per-chain RPC tuning (all optional — omitted fields use env var defaults)
214+
json_rpc_timeout = 300
215+
request_retries = 15
216+
max_block_range_size = 2000
184217
provider = [
185218
{ label = "mainnet1", url = "http://..", features = [], headers = { Authorization = "Bearer foo" } },
186219
{ label = "mainnet2", url = "http://..", features = [ "archive", "traces" ] }

docs/environment-variables.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ those.
1010

1111
## JSON-RPC configuration for EVM chains
1212

13+
> **Note**: Many of these settings can now be overridden per-chain in the TOML
14+
> configuration file under `[chains.<name>]`. When a per-chain value is set in
15+
> the config file it takes precedence over the environment variable. See
16+
> [config.md](config.md#configuring-chains) for details.
17+
1318
- `ETHEREUM_REORG_THRESHOLD`: Maximum expected reorg size, if a larger reorg
1419
happens, subgraphs might process inconsistent data. Defaults to 250.
1520
- `ETHEREUM_POLLING_INTERVAL`: how often to poll Ethereum for new blocks (in ms,

0 commit comments

Comments
 (0)