Skip to content

Commit

Permalink
increase network layer observation window's length
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Jan 20, 2020
1 parent fe138cc commit 76bf85a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/core/src/Cardano/Pool/Metrics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ monitorStakePools tr nl db@DBLayer{..} = do
readPoolRegistration poolId >>= \case
Nothing -> putPoolRegistration sl0 r
Just{} -> pure ()
readPoolProductionCursor k
readPoolProductionCursor (max 100 k)

forward
:: NonEmpty Block
Expand Down
11 changes: 9 additions & 2 deletions lib/jormungandr/src/Cardano/Wallet/Jormungandr/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,16 @@ mkRawNetworkLayer (block0, bp) batchSize st j = NetworkLayer
_getAccountBalance
}
where
-- security parameter, the maximum number of unstable blocks
-- security parameter, the maximum number of unstable blocks.
-- When @k@ is too small, we use an arbitrary bigger (although still
-- reasonably sized) value to make sure that our observation window is
-- big-enough. This allows for re-syncing faster when connecting to a
-- network after a long period of time where the node might have drifted
-- completely. In theory, nodes can't switch to chains that are longer than
-- @k@ but in practice with Jörmungandr, nodes can make jumps longer than
-- that.
k :: Quantity "block" Word32
k = getEpochStability bp
k = (max 100) <$> getEpochStability bp

genesis :: Hash "Genesis"
genesis = getGenesisBlockHash bp
Expand Down

0 comments on commit 76bf85a

Please sign in to comment.