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 27, 2024
1 parent 3164620 commit dcc6084
Showing 1 changed file with 3 additions and 2 deletions.
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 @@ -391,7 +391,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 dcc6084

Please sign in to comment.