Description
We've identified a bug in the downloading of genesis states that is used on Holesky and Chiado (introduced in #4653).
The problem is that we use the reqwest::blocking::Client to download the state, which can panic if called from an async context:
|
use reqwest::blocking::Client; |
|
info!( |
|
log, |
|
"Downloading genesis state"; |
|
"server" => &redacted_url, |
|
"timeout" => ?timeout, |
|
"info" => "this may take some time on testnets with large validator counts" |
|
); |
|
|
|
let client = Client::new(); |
We call it from an async context via genesis_state here:
|
let genesis_state = genesis_state(&runtime_context, &config, log)?; |
and here:
|
let genesis_state = genesis_state(&runtime_context, &config, log)?; |
and here:
|
let genesis_state = genesis_state(&runtime_context, &config, log)?; |
i.e. in all the cases where we are starting the client for the first time: genesis sync, and checkpoint sync from state on-disk or a URL
Version
Lighthouse v4.4.1
Impact
- Has so far only been observed in debug mode (not
--release).
- Only occurs on first start-up. Once the state is downloaded it is subsequently read from the DB.
- Can be worked around.
Workaround
Instead of --network holesky, use --testnet-dir pointed to the custom_config_data for Holesky.
Steps to resolve
- Option 1: wrap the calls in
spawn_blocking or similar.
- Option 2: use the async reqwest client in
Eth2NetworkConfig and propagate the async-ness (this might be painful).
Description
We've identified a bug in the downloading of genesis states that is used on Holesky and Chiado (introduced in #4653).
The problem is that we use the
reqwest::blocking::Clientto download the state, which can panic if called from an async context:lighthouse/common/eth2_network_config/src/lib.rs
Line 17 in 2841f60
lighthouse/common/eth2_network_config/src/lib.rs
Lines 378 to 386 in 2841f60
We call it from an async context via
genesis_statehere:lighthouse/beacon_node/client/src/builder.rs
Line 259 in 2841f60
and here:
lighthouse/beacon_node/client/src/builder.rs
Line 279 in 2841f60
and here:
lighthouse/beacon_node/client/src/builder.rs
Line 380 in 2841f60
i.e. in all the cases where we are starting the client for the first time: genesis sync, and checkpoint sync from state on-disk or a URL
Version
Lighthouse v4.4.1
Impact
--release).Workaround
Instead of
--network holesky, use--testnet-dirpointed to the custom_config_data for Holesky.Steps to resolve
spawn_blockingor similar.Eth2NetworkConfigand propagate the async-ness (this might be painful).