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

Add version check for block header creation #3510

Merged
merged 8 commits into from
Jul 30, 2024
Merged

Conversation

ss-es
Copy link
Contributor

@ss-es ss-es commented Jul 29, 2024

This PR:

Correctly propagates marketplace fees and the auction result from PackedBundle through to block header creation, and adds a version check to call BlockHeader::new_marketplace when appropriate.

This PR does not:

Key places to review:

This is unfortunately a lot of small changes rather than a single big change, so there's not any specific place to focus on. You can safely ignore all the test files, since they were just updated to account for type changes.

@ss-es ss-es marked this pull request as ready for review July 29, 2024 18:40
@ss-es ss-es requested a review from bfish713 as a code owner July 29, 2024 18:40
crates/task-impls/src/consensus/handlers.rs Show resolved Hide resolved
@@ -732,7 +733,9 @@ pub struct CommitmentAndMetadata<TYPES: NodeType> {
/// Metadata for the block payload
pub metadata: <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata,
/// Builder fee data
pub fee: BuilderFee<TYPES>,
pub fees: Vec1<BuilderFee<TYPES>>,
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure a Vec1 is the best option. With the marketplace it will be possible to receive no builder bundles and therefore have no builder fees in a block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason I thought we were using a Vec1 for this in some other place, but let me look at it again!

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 the rationale in my original design was that, since BuilderFee was not an Option type, then we needed always put something in the fee field. Therefore, it seemed sensible to use vec1 for backwards compatibility to guarantee that the existing behavior stayed.

Copy link
Member

Choose a reason for hiding this comment

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

What does the current code do if there is an empty block? That would also result in no builder fee, right?

Copy link
Contributor Author

@ss-es ss-es Jul 30, 2024

Choose a reason for hiding this comment

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

I think we just put in null_block::builder_fee() currently, if we receive no bundles

Copy link
Member

@elliedavidson elliedavidson Jul 30, 2024

Choose a reason for hiding this comment

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

Okay, then I suppose we can do the same for the marketplace, which means a Vec1 would work fine.

/// This trait guarantees that a particular type has urls that can be extracted from it. This trait
/// essentially ensures that the results returned by the [`AuctionResultsProvider`] trait includes a
/// list of urls for the builders that HotShot must request from.
pub trait HasUrls {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good change, great idea here.

Copy link
Member

@elliedavidson elliedavidson left a comment

Choose a reason for hiding this comment

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

LGTM!

@ss-es ss-es merged commit 4b136c4 into main Jul 30, 2024
36 checks passed
@ss-es ss-es deleted the ss/marketplace-block-header branch July 30, 2024 17:46
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.

3 participants