Skip to content

Commit ff543e5

Browse files
Tumaspovi
authored andcommitted
Ignore sync committee messages and contributions if head slot is not available
1 parent a850e35 commit ff543e5

File tree

1 file changed

+14
-2
lines changed
  • operation_pools/src/sync_committee_agg_pool

1 file changed

+14
-2
lines changed

operation_pools/src/sync_committee_agg_pool/tasks.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,13 @@ impl<P: Preset, W: Wait> HandleExternalContributionTask<P, W> {
198198
return Ok(ValidationOutcome::Ignore(false));
199199
}
200200

201-
let beacon_state = controller.preprocessed_state_at_current_slot()?;
201+
let beacon_state = match controller.preprocessed_state_at_current_slot() {
202+
Ok(beacon_state) => beacon_state,
203+
Err(error) => {
204+
debug!("cannot validate sync committee contribution: {error:?}");
205+
return Ok(ValidationOutcome::Ignore(false));
206+
}
207+
};
202208

203209
let is_valid = validate_external_contribution_and_proof(
204210
controller.chain_config(),
@@ -302,7 +308,13 @@ impl<P: Preset, W: Wait> HandleExternalMessageTask<P, W> {
302308
return Ok(ValidationOutcome::Ignore(false));
303309
}
304310

305-
let beacon_state = controller.preprocessed_state_at_current_slot()?;
311+
let beacon_state = match controller.preprocessed_state_at_current_slot() {
312+
Ok(beacon_state) => beacon_state,
313+
Err(error) => {
314+
debug!("cannot validate sync committee message: {error:?}");
315+
return Ok(ValidationOutcome::Ignore(false));
316+
}
317+
};
306318

307319
let is_valid = validate_external_message(
308320
controller.chain_config(),

0 commit comments

Comments
 (0)