Add new flag to set blocks per eth1 query (#1931)

## Issue Addressed

NA

## Proposed Changes

Users on Discord (and @protolambda) have experienced this error (or variants of it):

```
Failed to update eth1 cache: GetDepositLogsFailed("Eth1 node returned error: {\"code\":-32005,\"message\":\"query returned more than 10000 results\"}")
```

This PR allows users to reduce the span of blocks searched for deposit logs and therefore reduce the size of the return result. Hopefully experimentation with this flag can lead to finding a better default value.


## Additional Info

NA
This commit is contained in:
Paul Hauner
2020-11-18 22:18:59 +00:00
parent 0c2c2cef93
commit bcc7f6b143
2 changed files with 15 additions and 0 deletions

View File

@@ -197,6 +197,12 @@ pub fn get_config<E: EthSpec>(
client_config.eth1.endpoint = val.to_string();
}
if let Some(val) = cli_args.value_of("eth1-blocks-per-log-query") {
client_config.eth1.blocks_per_log_query = val
.parse()
.map_err(|_| "eth1-blocks-per-log-query is not a valid integer".to_string())?;
}
if let Some(freezer_dir) = cli_args.value_of("freezer-dir") {
client_config.freezer_db_path = Some(PathBuf::from(freezer_dir));
}