Skip to content

Commit

Permalink
Fix the jump boundary check in CSJ
Browse files Browse the repository at this point in the history
  • Loading branch information
facundominguez committed Apr 30, 2024
1 parent 4d8c607 commit 8229a78
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ import qualified Data.Map.Strict as Map
import Data.Maybe (catMaybes)
import GHC.Generics (Generic)
import Ouroboros.Consensus.Block (HasHeader (getHeaderFields), Header,
Point (..), castPoint, pointSlot)
Point (..), castPoint, pointSlot, succWithOrigin)
import Ouroboros.Consensus.Ledger.SupportsProtocol
(LedgerSupportsProtocol)
import Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State
Expand Down Expand Up @@ -393,7 +393,8 @@ onRollForward context point = whenEnabled context () $
Disengaged -> pure ()
Jumper{} -> pure ()
Dynamo lastJumpSlot
| pointSlot point >= ((jumpSize context +) <$> lastJumpSlot) -> do
| let jumpBoundaryPlus1 = jumpSize context + succWithOrigin lastJumpSlot
, succWithOrigin (pointSlot point) >= jumpBoundaryPlus1 -> do
mJumpInfo <- readTVar (cschJumpInfo (handle context))
setJumps mJumpInfo
| otherwise -> pure ()
Expand Down

0 comments on commit 8229a78

Please sign in to comment.