Caplin: skip finalized error (#7595)

This commit is contained in:
Giulio rebuffo 2023-05-28 22:48:17 +02:00 committed by GitHub
parent 2d3b3c3b8d
commit 027d83b556
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,12 +18,12 @@ func (f *ForkChoiceStore) OnBlock(block *cltypes.SignedBeaconBlock, newPayload,
return err return err
} }
if f.Slot() < block.Block.Slot { if f.Slot() < block.Block.Slot {
return fmt.Errorf("block is too late compared to current_slot") return fmt.Errorf("block is too early compared to current_slot")
} }
// Check that block is later than the finalized epoch slot (optimization to reduce calls to get_ancestor) // Check that block is later than the finalized epoch slot (optimization to reduce calls to get_ancestor)
finalizedSlot := f.computeStartSlotAtEpoch(f.finalizedCheckpoint.Epoch()) finalizedSlot := f.computeStartSlotAtEpoch(f.finalizedCheckpoint.Epoch())
if block.Block.Slot <= finalizedSlot { if block.Block.Slot <= finalizedSlot {
return fmt.Errorf("block is too late compared to finalized") return nil
} }
config := f.forkGraph.Config() config := f.forkGraph.Config()