Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace EpochInfo Identity by EpochInfo (Except PastHorizonException) #2126

Closed
edsko opened this issue May 21, 2020 · 1 comment · Fixed by #3098
Closed

Replace EpochInfo Identity by EpochInfo (Except PastHorizonException) #2126

edsko opened this issue May 21, 2020 · 1 comment · Fixed by #3098
Labels
consensus issues related to ouroboros-consensus enhancement New feature or request transition

Comments

@edsko
Copy link
Contributor

edsko commented May 21, 2020

The Shelley ledger as well as the TPraos implementation require an EpochInfo Identity in their config. Such a thing is really an impossibility: the EpochInfo changes as the ledger changes. The hard fork combinator alleviates this problem to some extent by introducing the concept of a partial config, and constructing the right EpochInfo on the fly. However, the EpochInfo that we pass to the ledger and to TPraos nonetheless has a limited range, and any attempt to use it beyond that range will result in a pure exception. It would be much better if the EpochInfo we construct as type EpochInfo (Except PastHorizonException), so that an attempt to look past that horizon will result in an error we can more reliably catch.

The changes consensus side are trivial (in fact, we have to do extra work to turn these exceptions into pure exceptions); the more laborious part is updating the TPraos and Shelley ledger implementations.

That said, this is mostly to aid debugging: any attempt to look past the horizon would be a bug.

@edsko edsko added enhancement New feature or request consensus issues related to ouroboros-consensus transition labels May 21, 2020
@mrBliss
Copy link
Contributor

mrBliss commented Jun 30, 2020

With IntersectMBO/ouroboros-consensus#681, the need for this will be significantly reduced.

@iohk-bors iohk-bors bot closed this as completed in a5ca9bc Apr 29, 2021
coot pushed a commit that referenced this issue May 16, 2022
3098: consensus: HFC now provides EpochInfo in Except monad r=nfrisby a=nfrisby

Fixes #2126. Also resolves the first draft of CAD-2713 on Jira.

This PR is a single commit; see the message.

Co-authored-by: Nicolas Frisby <nick.frisby@iohk.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus issues related to ouroboros-consensus enhancement New feature or request transition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants