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

Implement boundless adapter #1356

Open
wants to merge 12 commits into
base: nightly
Choose a base branch
from
Open

Conversation

ercecan
Copy link
Member

@ercecan ercecan commented Oct 18, 2024

Description

Implements risc0 boundless adapter
cannot merge yet since boundless repos require ssh access

Linked Issues

@ercecan ercecan added the HOLD-MERGE PR is not draft but should not be merged yet label Oct 18, 2024
@ercecan ercecan marked this pull request as ready for review October 21, 2024 14:35
@ercecan ercecan removed the HOLD-MERGE PR is not draft but should not be merged yet label Oct 21, 2024
@ercecan ercecan changed the title Erce/implement boundless adapter Implement boundless adapter Oct 21, 2024
@ercecan ercecan added the HOLD-MERGE PR is not draft but should not be merged yet label Oct 21, 2024
@@ -0,0 +1,51 @@
[package]
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry but i am very opinionated about introducing crates. Especially this when we have risc0-bonsai and risc0-boundless where both can live in a single proving-clients crate or something like that.

use tracing::{debug, error, info, instrument, trace, warn};
use url::Url;

// TODO: Remove blocking wrapper once the boundless client has blocking api
Copy link
Contributor

Choose a reason for hiding this comment

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

This TODO seems to be in the wrong place...

proof_market_address: Address,
set_verifier_address: Address,
) -> Self {
macro_rules! unwrap_boundless_response {
Copy link
Contributor

Choose a reason for hiding this comment

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

Move macro outside the the impl block.

);
}
let (queue, mut rx) = tokio::sync::mpsc::unbounded_channel();
let join_handle = tokio::spawn(async move {
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this async block into it's own function...

Suggested change
let join_handle = tokio::spawn(async move {
let join_handle = tokio::spawn(handle_response(client))

.await
.unwrap();

'queue: loop {
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Is it a good idea to retry indefinitely?
  2. Wouldn't it be better if somehow we return an error that the call-site can handle in a backoff-retry fashion or maybe keep pending list of requests and retry later?
  3. Handle errors in the call-site for more control over what happens if this keeps failing.

self.queue
.send(BoundlessRequest::UploadImg { elf, notify })
.unwrap();
tokio::task::block_in_place(|| rx.blocking_recv().unwrap())
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use block_in_place when you can make this method async + you're calling this method from an async block?

fn upload_input_to_boundless(&mut self, input: &[u8]) {
let client = self.client.clone();

// Retry backoff
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a TODO? Otherwise, this is not retry-backoff

@eyusufatik eyusufatik added HOLD-MERGE PR is not draft but should not be merged yet and removed HOLD-MERGE PR is not draft but should not be merged yet labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HOLD-MERGE PR is not draft but should not be merged yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Risc0 Boundless adapter
3 participants