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

make ExUnit type parameteric, but hide details #2515

Merged
merged 1 commit into from Oct 12, 2021
Merged

Conversation

JaredCorduan
Copy link
Contributor

This should make it easier for consensus to add a BoundedMeasure instance to ExUnits.

Copy link
Contributor

@nc6 nc6 left a comment

Choose a reason for hiding this comment

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

How does this help consensus? Presumably they still have no BoundedMeasure for ExUnits. Do they convert to another format which has a bound?

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs Outdated Show resolved Hide resolved

instance NoThunks ExUnits

instance NFData ExUnits

pattern ExUnits :: Natural -> Natural -> ExUnits
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we might want some comments here explaining why this is needed, otherwise it's a bit weird!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great point!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added some prose. Let me know if you think it makes sense.

@JaredCorduan
Copy link
Contributor Author

How does this help consensus? Presumably they still have no BoundedMeasure for ExUnits. Do they convert to another format which has a bound?

That right, they will use ExUnits (Infinite Natural), which just slaps ω on top of Natural.

@nc6 nc6 merged commit 6de4d38 into master Oct 12, 2021
@iohk-bors iohk-bors bot deleted the jc/flexible-exunits branch October 12, 2021 07:11
@nfrisby
Copy link
Contributor

nfrisby commented Oct 13, 2021

@JaredCorduan @nc6 Apologies for the delayed response!

I think Consensus will also need unWrap and ExUnits' to be exported (I think that's the minimal set we'd need). Relatedly, I would suggest unWrapExUnits instead of just unWrap. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants