Skip to content

Commit e616519

Browse files
committed
Try to get validator indices from head state when state at current slot is not available during validator registration
1 parent ff543e5 commit e616519

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operation_pools/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ eth1_api = { workspace = true }
1717
eth2_libp2p = { workspace = true }
1818
features = { workspace = true }
1919
fork_choice_control = { workspace = true }
20+
fork_choice_store = { workspace = true }
2021
futures = { workspace = true }
2122
good_lp = { workspace = true }
2223
helper_functions = { workspace = true }

operation_pools/src/attestation_agg_pool/tasks.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use bls::{traits::Signature as _, PublicKeyBytes};
1010
use eth1_api::ApiController;
1111
use features::Feature::DebugAttestationPacker;
1212
use fork_choice_control::Wait;
13+
use fork_choice_store::StateCacheError;
1314
use helper_functions::accessors;
1415
use log::warn;
1516
use prometheus_metrics::Metrics;
@@ -287,10 +288,14 @@ impl<P: Preset, W: Wait> PoolTask for SetRegisteredValidatorsTask<P, W> {
287288
let beacon_state = match controller.preprocessed_state_at_current_slot() {
288289
Ok(state) => state,
289290
Err(error) => {
290-
warn!(
291-
"failed get preprocessed state at current slot needed for validating registered validator pubkeys: {error}",
292-
);
293-
return Ok(());
291+
if let Some(StateCacheError::StateFarBehind { .. }) = error.downcast_ref() {
292+
controller.head_state().value
293+
} else {
294+
warn!(
295+
"failed get preprocessed state at current slot needed for validating registered validator pubkeys: {error}",
296+
);
297+
return Ok(());
298+
}
294299
}
295300
};
296301

0 commit comments

Comments
 (0)