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
6 changes: 3 additions & 3 deletions chain/ethereum/src/call_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down
12 changes: 6 additions & 6 deletions chain/ethereum/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
pub rpc_eth_call_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 @@ -114,8 +114,8 @@ impl From<Inner> 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)
Expand Down Expand Up @@ -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,

Expand Down
Loading