Skip to content

Commit afe68e0

Browse files
committed
db-sync: Parse PBftSignatureThreshold field of node config
This value defaults to 'Nothing' and is not used on mainnet and testnet. It is used on the 'shelley-qa' testnet and must be parsed correctly.
1 parent eb58508 commit afe68e0

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

cardano-db-sync/src/Cardano/DbSync/Config.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ coalesceConfig pcfg ncfg adjustGenesisPath = do
6969
, dncRequiresNetworkMagic = ncRequiresNetworkMagic ncfg
7070
, dncEnableLogging = pcEnableLogging pcfg
7171
, dncEnableMetrics = pcEnableMetrics pcfg
72+
, dncPBftSignatureThreshold = ncPBftSignatureThreshold ncfg
7273
, dncByronGenesisFile = adjustGenesisFilePath adjustGenesisPath (ncByronGenesisFile ncfg)
7374
, dncByronGenesisHash = ncByronGenesisHash ncfg
7475
, dncShelleyGenesisFile = adjustGenesisFilePath adjustGenesisPath (ncShelleyGenesisFile ncfg)

cardano-db-sync/src/Cardano/DbSync/Config/Cardano.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ mkProtocolCardano ge =
113113
ProtocolCardano
114114
-- Byron parameters
115115
byronGenesis
116-
Nothing -- Maybe PBftSignatureThreshold
116+
(Consensus.PBftSignatureThreshold <$> dncPBftSignatureThreshold dnc)
117117
(dncByronProtocolVersion dnc)
118118
(dncByronSoftwareVersion dnc)
119119
Nothing -- Maybe ByronLeaderCredentials

cardano-db-sync/src/Cardano/DbSync/Config/Node.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import qualified Ouroboros.Consensus.Cardano.CanHardFork as Shelley
3434

3535
data NodeConfig = NodeConfig
3636
{ ncProtocol :: !DbSyncProtocol
37+
, ncPBftSignatureThreshold :: !(Maybe Double)
3738
, ncByronGenesisFile :: !GenesisFile
3839
, ncByronGenesisHash :: !GenesisHashByron
3940
, ncShelleyGenesisFile :: !GenesisFile
@@ -62,6 +63,7 @@ instance FromJSON NodeConfig where
6263
parse o =
6364
NodeConfig
6465
<$> o .: "Protocol"
66+
<*> o .:? "PBftSignatureThreshold"
6567
<*> fmap GenesisFile (o .: "ByronGenesisFile")
6668
<*> fmap GenesisHashByron (o .: "ByronGenesisHash")
6769
<*> fmap GenesisFile (o .: "ShelleyGenesisFile")

cardano-db-sync/src/Cardano/DbSync/Config/Types.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ data DbSyncNodeConfig = DbSyncNodeConfig
102102
, dncRequiresNetworkMagic :: !RequiresNetworkMagic
103103
, dncEnableLogging :: !Bool
104104
, dncEnableMetrics :: !Bool
105+
, dncPBftSignatureThreshold :: !(Maybe Double)
105106
, dncByronGenesisFile :: !GenesisFile
106107
, dncByronGenesisHash :: !GenesisHashByron
107108
, dncShelleyGenesisFile :: !GenesisFile

0 commit comments

Comments
 (0)