Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

pbft signing threshold config from CLI #19

Merged
merged 2 commits into from
Aug 13, 2019
Merged

Conversation

avieth
Copy link
Contributor

@avieth avieth commented Aug 13, 2019

use the --pbft-threshold parameter

use the --pbft-threshold parameter
src/exec/Main.hs Outdated
Opt.long "pbft-threshold" <>
Opt.metavar "DOUBLE" <>
-- FIXME ouroboros-consensus should export defaultPBftSignatureThreshold
-- That'd be better than putting this magic number here.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, I could make this an optional parameter with no default, and give Nothing to protocolInfoByron. Any strong arguments in either favour?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make this a Maybe field, since protocolInfoByron accepts a maybe, and it uses the default if you pass nothing. That'd be the simplest.

src/exec/Main.hs Outdated
Opt.long "pbft-threshold" <>
Opt.metavar "DOUBLE" <>
-- FIXME ouroboros-consensus should export defaultPBftSignatureThreshold
-- That'd be better than putting this magic number here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make this a Maybe field, since protocolInfoByron accepts a maybe, and it uses the default if you pass nothing. That'd be the simplest.

src/exec/Main.hs Outdated
@@ -507,7 +522,7 @@ main = do
(Cardano.ApplicationName (fromString "cardano-byron-proxy")) 2
protocolInfo = protocolInfoByron
newGenesisConfig
Nothing -- Default signature threshold.
(Just (bpoPBftSignatureThreshold bpo))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass the maybe though here, so it'll use the default in the nothing case.

@avieth
Copy link
Contributor Author

avieth commented Aug 13, 2019

Agreed that having an optional parameter is better than a default value here. Only downside is that the default remains obscure (it's not even exported).

Rather than have a default in CLI
The default is still there, by way of byronProtocolInfo from
ouroboros-consensus.
Copy link
Contributor

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect.

@avieth
Copy link
Contributor Author

avieth commented Aug 13, 2019

bors r+

iohk-bors bot added a commit that referenced this pull request Aug 13, 2019
19: pbft signing threshold config from CLI r=avieth a=avieth

use the --pbft-threshold parameter

Co-authored-by: Alexander Vieth <aovieth@gmail.com>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Aug 13, 2019

@iohk-bors iohk-bors bot merged commit a4be1d2 into master Aug 13, 2019
@iohk-bors iohk-bors bot deleted the avieth/pbft_threshold branch August 13, 2019 19:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants