-
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.
Shelley/Cardano: take the initial nonce as a parameter
Fixes #2005. This nonce will be used to construct Shelley's initial `PrtclState`, both when starting a fresh Shelley chain and when forking from Byron to Shelley (when translating the Byron `ChainDepState` to the Shelley one). We store the initial nonce in the `TPraosParams`, which is part of the `ConsensusConfig` for `TPraos`. We need it here, at run-time, because we need it when translating the Byron `ChainDepState` to the Shelley one. `protocolInfoShelley` and `protocolInfoCardano` (as well as `ProtocolRealTPraos` and `ProtocolCardano`) now take a `Nonce` argument that will be used as the initial nonce. Typically the `Nonce` passed to these functions (constructors) should be derived from the hash of the Shelley Genesis config JSON file. Moreover, this allows us to choose a different initial nonce for testing purposes, as required for #2235. NOTE: up until now we have used `SL.NeutralNonce` as the initial nonce for Shelley. When a different nonce is picked in `cardano-node`, i.e., one derived from the hash of the Shelley Genesis config JSON file, it would cause a hard fork.
- Loading branch information
Showing
8 changed files
with
50 additions
and
22 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
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
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