From 9c2c4dbcd2cf262c019695cee9248c476745a698 Mon Sep 17 00:00:00 2001 From: Jonas Bostoen Date: Fri, 20 Dec 2024 16:36:07 +0100 Subject: [PATCH] fix(sidecar): discard inclusion requests for past slots --- bolt-sidecar/src/state/consensus.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bolt-sidecar/src/state/consensus.rs b/bolt-sidecar/src/state/consensus.rs index 76ac1501..b95e68a4 100644 --- a/bolt-sidecar/src/state/consensus.rs +++ b/bolt-sidecar/src/state/consensus.rs @@ -114,7 +114,10 @@ impl ConsensusState { /// If the request is valid, return the validator public key for the target slot. pub fn validate_request(&self, req: &InclusionRequest) -> Result { // Check if the slot is in the current epoch or next epoch (if unsafe lookahead is enabled) - if req.slot < self.epoch.start_slot || req.slot >= self.furthest_slot() { + if req.slot < self.epoch.start_slot || + req.slot >= self.furthest_slot() || + req.slot <= self.latest_slot + { return Err(ConsensusError::InvalidSlot(req.slot)); }