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 block header with block header view where appropriate #2505

Merged
merged 1 commit into from
Oct 5, 2021

Conversation

JaredCorduan
Copy link
Contributor

@JaredCorduan JaredCorduan commented Sep 30, 2021

A new type BHeaderView has been added to cardano-ledger-core, it contains the information from the block header that the BBODY rule needs. The function isOverlaySlot has also been moved next to the BHeaderView definition (it would be nice to move it to cardano-protocol-tpraos, but it is still needed in the BBODY rule).

The BBODY rule no longer takes a Block as a signal, but a pair of a BHeaderView and a TxSeq. Additionally, the applyBlock API function now uses the BHeaderView as well. The cardano-protocol-tpraos package provides a translation from transitional-praos block headers to the view.

closes #2460

@JaredCorduan JaredCorduan force-pushed the jc/blockheader-view branch 2 times, most recently from 3d70666 to 7ecb39c Compare October 4, 2021 17:33
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.

Looks good! Can we now drop the dependency on cardano-protocol-tpraos in cardano-ledger-shelley and beyond?

import Cardano.Ledger.Slot (SlotNo (..), (-*))
import Numeric.Natural (Natural)

data BHeaderView crypto = BHeaderView
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 it would be helpful to add some explanatory documentation here!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes indeed, thanks!

@nc6
Copy link
Contributor

nc6 commented Oct 5, 2021

Seems like the answer to that question is "not yet".

@JaredCorduan
Copy link
Contributor Author

Seems like the answer to that question is "not yet".

yea, but we are getting closer! I'll have a follow up PR that will parameterize the Block type by the header type. After that we will be very close, maybe just PoolDistr and a couple other stragglers.

@JaredCorduan JaredCorduan merged commit 0ab2075 into master Oct 5, 2021
@iohk-bors iohk-bors bot deleted the jc/blockheader-view branch October 5, 2021 18:10
@JaredCorduan
Copy link
Contributor Author

JaredCorduan commented Oct 5, 2021

@nc6 I updated #2462 with all the work left to remove cardano-protocol-tpraos from all the era impl packages.

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.

BBODY to use BHView
2 participants