@@ -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+
134163A ` 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 ]
182211shard = " vip"
183212amp = " 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
184217provider = [
185218 { label = " mainnet1" , url = " http://.." , features = [], headers = { Authorization = " Bearer foo" } },
186219 { label = " mainnet2" , url = " http://.." , features = [ " archive" , " traces" ] }
0 commit comments