Skip to content

Commit

Permalink
ethereum: fix GETH_ETH_CALL_ERRORS_ENV
Browse files Browse the repository at this point in the history
Previously if `GETH_ETH_CALL_ERRORS_ENV` is not set, then any error
returned from eth_call would be considered deterministic. This is
because calling `split` on an empty string returns `[""]`, not `[]`,
and all strings contain `""`. This affects release 0.24 and can
cause subgraph failures on subgraphs using contract calls,
and most severely incorrect data on subgraphs using `try_` calls.
  • Loading branch information
leoyvens committed Sep 9, 2021
1 parent 7d9eeb6 commit c62b751
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions chain/ethereum/src/ethereum_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,8 @@ lazy_static! {
/// Additional deterministic errors that have not yet been hardcoded. Separated by `;`.
static ref GETH_ETH_CALL_ERRORS_ENV: Vec<String> = {
std::env::var("GRAPH_GETH_ETH_CALL_ERRORS")
.unwrap_or_default()
.split(';')
.map(ToOwned::to_owned)
.collect()
.map(|s| s.split(';').map(ToOwned::to_owned).collect())
.unwrap_or(Vec::new())
};
}

Expand Down

0 comments on commit c62b751

Please sign in to comment.