Skip to content

Commit 3dff0d8

Browse files
committed
ethereum: fix GETH_ETH_CALL_ERRORS_ENV
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.
1 parent ecd5b5e commit 3dff0d8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

chain/ethereum/src/ethereum_adapter.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,8 @@ lazy_static! {
111111
/// Additional deterministic errors that have not yet been hardcoded. Separated by `;`.
112112
static ref GETH_ETH_CALL_ERRORS_ENV: Vec<String> = {
113113
std::env::var("GRAPH_GETH_ETH_CALL_ERRORS")
114-
.unwrap_or_default()
115-
.split(';')
116-
.map(ToOwned::to_owned)
117-
.collect()
114+
.map(|s| s.split(';').filter(|s| s.len() > 0).map(ToOwned::to_owned).collect())
115+
.unwrap_or(Vec::new())
118116
};
119117
}
120118

0 commit comments

Comments
 (0)