View on GitHub
File Changes
  -- ^ Number of core nodes
  -> GenesisFile
  -> RequiresNetworkMagic
-
  -> Maybe Double
  -> Maybe DelegationCertFile
  -> Maybe SigningKeyFile
  -> Update
  -> Protocol
  -> ExceptT ProtocolInstantiationError IO SomeProtocol
-
fromProtocol _ _ _ _ _ _ _ _ _ ByronLegacy =
+
fromProtocol _ _ _ _ _ _ _ _  ByronLegacy =
  left ByronLegacyProtocolNotImplemented
-
fromProtocol _ nId mNumCoreNodes _ _ _ _ _ _ BFT =
+
fromProtocol _ nId mNumCoreNodes _ _ _ _ _ BFT =
  hoistEither $ mockSomeProtocol nId mNumCoreNodes $ \cid numCoreNodes ->
    Consensus.ProtocolMockBFT numCoreNodes cid mockSecurityParam mockSlotLengths
-
fromProtocol _ nId mNumCoreNodes _ _ _ _ _ _ Praos =
+
fromProtocol _ nId mNumCoreNodes _ _ _ _ _ Praos =
  hoistEither $ mockSomeProtocol nId mNumCoreNodes $ \cid numCoreNodes ->
    Consensus.ProtocolMockPraos numCoreNodes cid PraosParams {
        praosSecurityParam = mockSecurityParam
      , praosLifetimeKES   = 1000000
      , praosSlotLength    = slotLengthFromSec 2
    }
-
fromProtocol _ nId mNumCoreNodes _ _ _ _ _ _ MockPBFT =
+
fromProtocol _ nId mNumCoreNodes _ _ _ _ _ MockPBFT =
  hoistEither $ mockSomeProtocol nId mNumCoreNodes $ \cid [email protected](NumCoreNodes numNodes) ->
    Consensus.ProtocolMockPBFT numCoreNodes cid
      PBftParams { pbftSecurityParam      = mockSecurityParam
                 , pbftNumNodes           = fromIntegral numNodes
                 , pbftSignatureThreshold = (1.0 / fromIntegral numNodes) + 0.1
                 , pbftSlotLength         = mockSlotLength
                 }
-
fromProtocol gHash _ _ genFile nMagic sigThresh delCertFp sKeyFp update RealPBFT = do
+
fromProtocol gHash _ _ genFile nMagic delCertFp sKeyFp update RealPBFT = do
    let genHash = either panic identity $ decodeHash gHash

                      
    gc <- firstExceptT LedgerConfigError $ Genesis.mkConfigFromFile
                                   delCertFp
                                   sKeyFp

                      
-
    let p = protocolConfigRealPbft update sigThresh gc optionalLeaderCredentials
+
    let p = protocolConfigRealPbft update Nothing gc optionalLeaderCredentials

                      
    case Consensus.runProtocol p of
      Dict -> return $ SomeProtocol p
      , ncNodeId :: Maybe NodeId
      , ncNumCoreNodes :: Maybe Int
      , ncReqNetworkMagic :: RequiresNetworkMagic
-
      , ncPbftSignatureThresh :: Maybe Double
      , ncLoggingSwitch :: Bool
      , ncLogMetrics :: Bool
      , ncViewMode :: ViewMode
                  ptcl <- v .: "Protocol"
                  numCoreNode <- v .:? "NumCoreNodes"
                  rNetworkMagic <- v .: "RequiresNetworkMagic"
-
                  pbftSignatureThresh <- v .:? "PBftSignatureThreshold"
                  loggingSwitch <- v .: "TurnOnLogging"
                  vMode <- v .: "ViewMode"
                  logMetrics <- v .: "TurnOnLogMetrics"
                           nId
                           numCoreNode
                           rNetworkMagic
-
                           pbftSignatureThresh
                           loggingSwitch
                           logMetrics
                           vMode
                                 (ncNumCoreNodes nc)
                                 (caGenesisFile)
                                 (ncReqNetworkMagic nc)
-
                                 (ncPbftSignatureThresh nc)
                                 (caDelegationCertFp)
                                 (caSigningKeyFp)
                                 (ncUpdate nc)
  -> Maybe Int
  -> GenesisFile
  -> RequiresNetworkMagic
-
  -> Maybe Double
  -> Maybe DelegationCertFile
  -> Maybe SigningKeyFile
  -> Update
        => Consensus.Protocol ByronBlock
        -> ExceptT RealPBFTError IO a)
  -> ExceptT RealPBFTError IO a
-
withRealPBFT gHash nId mNumNodes genFile nMagic sigThresh delCertFp sKeyFp update ptcl action = do
+
withRealPBFT gHash nId mNumNodes genFile nMagic delCertFp sKeyFp update ptcl action = do
  SomeProtocol p <- firstExceptT
                      FromProtocolError
                      $ fromProtocol
                          mNumNodes
                          genFile
                          nMagic
-
                          sigThresh
                          delCertFp
                          sKeyFp
                          update
          (coNumCoreNodes ccCore)
          (GenesisFile $ coGenesisFile ccCore)
          (coRequiresNetworkMagic ccCore)
-
          (coPBftSigThd ccCore)
          (DelegationCertFile <$> (coStaticKeyDlgCertFile ccCore))
          (SigningKeyFile <$> (coStaticKeySigningKeyFile ccCore))
          (SocketFile ccSocketDir)
                (coNumCoreNodes ccCore)
                (GenesisFile $ coGenesisFile ccCore)
                (coRequiresNetworkMagic ccCore)
-
                (coPBftSigThd ccCore)
                (DelegationCertFile <$> (coStaticKeyDlgCertFile ccCore))
                (SigningKeyFile <$> (coStaticKeySigningKeyFile ccCore))
                ccUpdate
                 (coNumCoreNodes ccCore)
                 (GenesisFile $ coGenesisFile ccCore)
                 (coRequiresNetworkMagic ccCore)
-
                 (coPBftSigThd ccCore)
                 (DelegationCertFile <$> (coStaticKeyDlgCertFile ccCore))
                 (SigningKeyFile <$> (coStaticKeySigningKeyFile ccCore))
                 ccUpdate
         (coNumCoreNodes ccCore)
         (GenesisFile $coGenesisFile ccCore)
         (coRequiresNetworkMagic ccCore)
-
         (coPBftSigThd ccCore)
         (DelegationCertFile <$> coStaticKeyDlgCertFile ccCore)
         (SigningKeyFile <$> coStaticKeySigningKeyFile ccCore)
         ccUpdate
  -- ^ Number of core nodes.
  -> GenesisFile
  -> RequiresNetworkMagic
-
  -> Maybe Double
  -> Maybe DelegationCertFile
  -> Maybe SigningKeyFile
  -> Update
  mNumCoreNodes
  genFile
  nMagic
-
  sigThresh
  delCertFp
  sKeyFp
  update
  ptcl
  sk =
-
    withRealPBFT gHash (Just nId) mNumCoreNodes genFile nMagic sigThresh delCertFp sKeyFp update ptcl
+
    withRealPBFT gHash (Just nId) mNumCoreNodes genFile nMagic delCertFp sKeyFp update ptcl
      $ \(Consensus.ProtocolRealPBFT gc _ _ _ _)-> do
          case txSpendGenesisUTxOByronPBFT gc sk genRichAddr outs of
            [email protected](ByronTx txid _) -> do
  -- ^ Number of core nodes.
  -> GenesisFile
  -> RequiresNetworkMagic
-
  -> Maybe Double
  -> Maybe DelegationCertFile
  -> Maybe SigningKeyFile
  -> Update
  mNumCoreNodes
  genFile
  nMagic
-
  sigThresh
  delCertFp
  sKeyFp
  update
  ptcl
  key = do
-
    withRealPBFT gHash (Just nId) mNumCoreNodes genFile nMagic sigThresh delCertFp sKeyFp update ptcl $
+
    withRealPBFT gHash (Just nId) mNumCoreNodes genFile nMagic delCertFp sKeyFp update ptcl $
      \(Consensus.ProtocolRealPBFT gc _ _ _ _)-> do
        case txSpendUTxOByronPBFT gc key ins outs of
          [email protected](ByronTx txid _) -> do
  -- ^ Number of core nodes
  -> GenesisFile
  -> RequiresNetworkMagic
-
  -> Maybe Double
  -> Maybe DelegationCertFile
  -> Maybe SigningKeyFile
  -> SocketFile
  mNumCoreNodes
  genFile
  nMagic
-
  sigThresh
  delCertFp
  sKeyFp
  socketFp
  update
  ptcl
  gentx =
-
    withRealPBFT gHash (Just nId) mNumCoreNodes genFile nMagic sigThresh delCertFp sKeyFp update ptcl $
+
    withRealPBFT gHash (Just nId) mNumCoreNodes genFile nMagic delCertFp sKeyFp update ptcl $
        _ <- case gentx of
               ByronTx txid _ -> pure . putTextLn
                                         (ncNumCoreNodes nc)
                                         (genesisFile $ mscFp nCli)
                                         (ncReqNetworkMagic nc)
-
                                         (ncPbftSignatureThresh nc)
                                         (delegCertFile $ mscFp nCli)
                                         (signKeyFile $ mscFp nCli)
                                         (ncUpdate nc)
                                    (ncNumCoreNodes nc)
                                    gFile
                                    (ncReqNetworkMagic nc)
-
                                    (ncPbftSignatureThresh nc)
                                    delegCertFile
                                    sKeyFile
                                    (ncUpdate nc)