-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Genesis consensus mode alternate big ledger peer targets
This change equips peer selection and churn governor to appropriately respond to change in ledger state judgment when diffusion is running in Genesis consensus mode. A separate targets basis is made available in this mode which uses more hot big ledger peers when a node is syncing up. Additional changes in support of this were made to the configuration module, and some other minor refactorings were applied as well.
- Loading branch information
1 parent
8faa08c
commit 2c82a70
Showing
18 changed files
with
1,151 additions
and
521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
ouroboros-network-api/src/Ouroboros/Network/ConsensusMode.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{-# LANGUAGE DeriveAnyClass #-} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
|
||
module Ouroboros.Network.ConsensusMode where | ||
|
||
import Data.Aeson | ||
import GHC.Generics (Generic) | ||
|
||
-- | Diffusion layer configuration parameter. | ||
-- | ||
-- The two modes determine which `PeerSelectionTargets` basis is used | ||
-- by churn and OG. The node's configuration sets this, and diffusion | ||
-- is initiated and remains only in this mode. | ||
-- | ||
data ConsensusMode = | ||
GenesisMode | ||
-- ^ When `LedgerStateJudgement` is `TooOld`, the targets basis is changed | ||
-- from default to one specific for this mode, which uses more big ledger peers | ||
-- until syncing is complete. | ||
|
||
| PraosMode | ||
-- ^ The legacy mode which depends on official relays and/or bootstrap peers | ||
-- configuration. This mode uses only the default target basis irrespective | ||
-- ledger state. | ||
deriving (Eq, Show, Generic, FromJSON) | ||
|
||
|
||
defaultConsensusMode :: ConsensusMode | ||
defaultConsensusMode = PraosMode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.