Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions chain/ethereum/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ pub struct EnvVars {
/// Set by the environment variable `GRAPH_RPC_ETH_CALL_ERRORS`, separated
/// by `;`.
pub rpc_eth_call_errors: Vec<String>,
/// Additional `eth_getLogs` error messages that mean the request exceeded
/// the provider's block-range or result cap, so the range should shrink
/// rather than the request be retried. Matched case-insensitively as
/// substrings of the error message.
///
/// Set by the environment variable `GRAPH_RPC_ETH_GET_LOGS_ERRORS`,
/// separated by `;`.
pub rpc_eth_get_logs_errors: Vec<String>,
/// Set by the environment variable `GRAPH_ETH_GET_LOGS_MAX_CONTRACTS`. The
/// default value is 2000.
pub get_logs_max_contracts: usize,
Expand Down Expand Up @@ -120,6 +128,12 @@ impl From<Inner> for EnvVars {
.filter(|s| !s.is_empty())
.map(str::to_string)
.collect(),
rpc_eth_get_logs_errors: x
.rpc_eth_get_logs_errors
.split(';')
.filter(|s| !s.is_empty())
.map(str::to_lowercase)
.collect(),
trace_stream_step_size: x.trace_stream_step_size,
max_event_only_range: x.max_event_only_range,
block_batch_size: x.block_batch_size,
Expand Down Expand Up @@ -160,6 +174,8 @@ impl Default for EnvVars {
struct Inner {
#[envconfig(from = "GRAPH_RPC_ETH_CALL_ERRORS", default = "")]
rpc_eth_call_errors: String,
#[envconfig(from = "GRAPH_RPC_ETH_GET_LOGS_ERRORS", default = "")]
rpc_eth_get_logs_errors: String,
#[envconfig(from = "GRAPH_ETH_GET_LOGS_MAX_CONTRACTS", default = "2000")]
get_logs_max_contracts: usize,

Expand Down
Loading
Loading