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

[Marketplace] Builder API adjustments #3493

Merged
merged 1 commit into from
Jul 26, 2024
Merged

[Marketplace] Builder API adjustments #3493

merged 1 commit into from
Jul 26, 2024

Conversation

QuentinI
Copy link
Contributor

@QuentinI QuentinI commented Jul 26, 2024

Closes #0000

This PR:

  • Adjusts bundle type signature
  • Adds /bundle to marketplace builder API
  • Removes old endpoints from marketplace builder API
  • Removes dead code in transaction task
  • Lifts fetching bundles from AuctionResultsProvider to transaction task, as it needs to use the builder client, which isn't available in hotshot-types

This PR does not:

  • Implement full bundle-fetching algorithm analogous to legacy block-claiming algorithm
  • Implement test builders for new builder API

Key places to review:

Everything

Comment on lines +243 to +272
let start = Instant::now();

if let Ok(Ok(urls)) = async_timeout(
self.builder_timeout,
self.auction_results_provider
.fetch_auction_result(block_view),
)
.await
{
let mut futures = Vec::new();

for url in urls.urls() {
futures.push(async_timeout(
self.builder_timeout.saturating_sub(start.elapsed()),
async {
let client = crate::builder::v0_3::BuilderClient::new(url);
client.bundle(*block_view).await
},
));
}

let mut bundles = Vec::new();

for bundle in join_all(futures).await {
match bundle {
Ok(Ok(b)) => bundles.push(b),
_ => continue,
}
}

Copy link
Member

Choose a reason for hiding this comment

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

This section looks good to me

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks fine to me too, though I think it would be nice to have this logic be a separate function. We can make an issue for that/do it later though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we can do it when implementing this part of the spec:

Query all builders in parallel, have a timeout that is constrained by a max system timeout of 1 second, and a minimum set by 2/3 of the builders, then add 10% additional time for the remaining 1/3 to resolve.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although I'm not opposed to factoring it out now, won't take long.

Copy link
Contributor

@ss-es ss-es left a comment

Choose a reason for hiding this comment

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

I'm not particularly familiar with this portion of the code, but as far as I can tell it looks good to me!

@QuentinI QuentinI merged commit ba87d32 into main Jul 26, 2024
36 checks passed
@QuentinI QuentinI deleted the ag/bundle branch July 26, 2024 15:22
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