Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a single set of credentials for all Shelley-based eras
For each era, there will be a thread periodically trying to evolve the KES key and securely forget the previous one. Previously, we required a set of credentials for each Shelley-based era, e.g., Shelley, Allegra, and Mary. In practice, most users will want to use the same credentials for, e.g., Shelley and Allegra. However, when using the same in-memory KES key for multiple eras, multiple threads will try to evolve and secure forget the *same KES key*. Depending on the implementation of secure forgetting for KES keys, this could lead to segfaults. Instead of having a separate set of credentials per Shelley-based era (this remains independent of how Byron credentials are handled), we now share a single set of credentials for all of them. We use the new `shelleySharedBlockForging` function to do this in a safe way, i.e., by sharing the same thread-safe `HotKey` across the threads. We refactor the protocol parameters for Shelley/Allegra/Mary to handle the shared key: we now have a `ProtocolParamsShelleyBased` record which contains everything needed for a Shelley-based chain, i.e., the genesis config and the credentials. This record should be combined with the right era-specific ones. This also paves the way for adding a Mary-only mode.
- Loading branch information
Showing
7 changed files
with
184 additions
and
109 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
Oops, something went wrong.