-
Notifications
You must be signed in to change notification settings - Fork 86
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
Provide an 'EpochInfo' that can fail to ledger. #3770
Conversation
The ledger now supports an `EpochInfo (Either Text)`, and uses the `Left` constructor to indicate a horizon error. Unfortunately, while the epoch info being provided had the correct _type_, it was implemented in a degenerate way - the `Left` constructor would never be used and instead a pure error was thrown on failures. This PR instead provides a correct `EpochInfo` to the ledger, where the failure is reflected in the `Left` constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
To be more comprehensive I think we should audit the other uses of toPureEpochInfo
, and indeed perhaps rename it to make it clear it throws exceptions. We should file a TODO issue for that, it doesn't need to be in this PR of course.
I did go through the other uses of |
bors merge |
3770: Provide an 'EpochInfo' that can fail to ledger. r=nc6 a=nc6 The ledger now supports an `EpochInfo (Either Text)`, and uses the `Left` constructor to indicate a horizon error. Unfortunately, while the epoch info being provided had the correct _type_, it was implemented in a degenerate way - the `Left` constructor would never be used and instead a pure error was thrown on failures. This PR instead provides a correct `EpochInfo` to the ledger, where the failure is reflected in the `Left` constructor. Co-authored-by: Nicholas Clarke <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I wonder if SL.mkShelleyGlobals
used to take a pure EpochInfo
and was changed to take an Either
one, and the integration PR for that changed missed this because toPureEpochInfo
is polymorphic.
So, we could try changing toPureEpochInfo
to return Identity
instead of Applicative f => f
to try to prevent similar from happening again.
I created https://input-output.atlassian.net/browse/CAD-4433 for this tech debt ^^^.
I see a few remaining uses of
So I think we should fixup the |
Timed out. |
bors retry |
The ledger now supports an
EpochInfo (Either Text)
, and uses theLeft
constructor to indicate a horizon error. Unfortunately, while theepoch info being provided had the correct type, it was implemented in
a degenerate way - the
Left
constructor would never be used andinstead a pure error was thrown on failures.
This PR instead provides a correct
EpochInfo
to the ledger, where thefailure is reflected in the
Left
constructor.