diff --git a/chain/ethereum/src/call_helper.rs b/chain/ethereum/src/call_helper.rs index ef0b85fc293..0dec6fc470b 100644 --- a/chain/ethereum/src/call_helper.rs +++ b/chain/ethereum/src/call_helper.rs @@ -59,13 +59,13 @@ const RPC_EXECUTION_ERRORS: &[&str] = &[ "invalidfeopcode", ]; -/// Helper that checks if a geth style RPC error message corresponds to a revert. +/// Helper that checks if a RPC error message corresponds to a revert. fn is_rpc_revert_message(message: &str) -> bool { - let env_geth_call_errors = ENV_VARS.geth_eth_call_errors.iter(); + let env_rpc_call_errors = ENV_VARS.rpc_eth_call_errors.iter(); let mut execution_errors = RPC_EXECUTION_ERRORS .iter() .copied() - .chain(env_geth_call_errors.map(|s| s.as_str())); + .chain(env_rpc_call_errors.map(|s| s.as_str())); execution_errors.any(|e| message.to_lowercase().contains(e)) } diff --git a/chain/ethereum/src/env.rs b/chain/ethereum/src/env.rs index 027a26b623f..230e4c27a49 100644 --- a/chain/ethereum/src/env.rs +++ b/chain/ethereum/src/env.rs @@ -13,9 +13,9 @@ lazy_static! { pub struct EnvVars { /// Additional deterministic errors that have not yet been hardcoded. /// - /// Set by the environment variable `GRAPH_GETH_ETH_CALL_ERRORS`, separated + /// Set by the environment variable `GRAPH_RPC_ETH_CALL_ERRORS`, separated /// by `;`. - pub geth_eth_call_errors: Vec, + pub rpc_eth_call_errors: Vec, /// Set by the environment variable `GRAPH_ETH_GET_LOGS_MAX_CONTRACTS`. The /// default value is 2000. pub get_logs_max_contracts: usize, @@ -114,8 +114,8 @@ impl From for EnvVars { fn from(x: Inner) -> Self { Self { get_logs_max_contracts: x.get_logs_max_contracts, - geth_eth_call_errors: x - .geth_eth_call_errors + rpc_eth_call_errors: x + .rpc_eth_call_errors .split(';') .filter(|s| !s.is_empty()) .map(str::to_string) @@ -158,8 +158,8 @@ impl Default for EnvVars { #[derive(Clone, Debug, Envconfig)] struct Inner { - #[envconfig(from = "GRAPH_GETH_ETH_CALL_ERRORS", default = "")] - geth_eth_call_errors: String, + #[envconfig(from = "GRAPH_RPC_ETH_CALL_ERRORS", default = "")] + rpc_eth_call_errors: String, #[envconfig(from = "GRAPH_ETH_GET_LOGS_MAX_CONTRACTS", default = "2000")] get_logs_max_contracts: usize,