-
Notifications
You must be signed in to change notification settings - Fork 11
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
upgrade gnark/mpc tools #2579
base: main
Are you sure you want to change the base?
upgrade gnark/mpc tools #2579
Conversation
09fa1d8
to
43019fd
Compare
App 🤌🌎 Deploying... |
5fdf997
to
9f97236
Compare
c7eee4a
to
723fad4
Compare
Awaiting Consensys/gnark#1230 to rebase and merge. |
2e2c90b
to
d396e24
Compare
99afd08
to
64ce6d8
Compare
8c88160
to
9e20456
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
c31af66
to
5082157
Compare
|
||
This project contains the client and coordinator to conduct Groth16 multi-party computation for the circuit SRS. | ||
Three components are in play: | ||
- Supabase : host the state machine in postgresql and exposes api and storage services to upload contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Supabase : host the state machine in postgresql and exposes api and storage services to upload contributions. | |
- Supabase: host the state machine in postgresql and exposes api and storage services to upload contributions. |
- `POST /contribute` a `Contribute` object in body. Returns : | ||
- a `202 Accepted` if the contribution started. | ||
- a `503 Unavailable` if the client is busy (likely already contributing). | ||
- `GET /contribute` returns : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `GET /contribute` returns : | |
- `GET /contribute` returns: |
if is_already_successful().await { | ||
return Ok(()); | ||
} | ||
let mut secret_key = if let Ok(_) = tokio::fs::metadata(CONTRIB_SK_PATH).await { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clippy will probably tell you to use .is_ok()
here
if lock | ||
.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst) | ||
.is_ok() => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writing to an atomic bool in an if guard is interesting, i would recommend pulling this out into the arm expression for clarity/ least surprise
tokio::select! { | ||
Ok((stream, _)) = listener.accept() => { | ||
let io = TokioIo::new(stream); | ||
let status_clone = status_clone.clone(); | ||
let tx_status_clone = tx_status_clone.clone(); | ||
let lock_clone = lock.clone(); | ||
let conn = hyper::server::conn::http1::Builder::new().serve_connection( | ||
io, | ||
service_fn(move |req| { | ||
handle( | ||
lock_clone.clone(), | ||
tx_status_clone.clone(), | ||
status_clone.clone(), | ||
req, | ||
) | ||
}), | ||
); | ||
let fut = graceful.watch(conn); | ||
tokio::task::spawn(async move { | ||
let _ = fut.await; | ||
}); | ||
} | ||
_ = token_clone.cancelled() => { | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match client | ||
.current_contributor() | ||
.await? | ||
.ok_or(Error::ContributorNotFound) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not match on the Option
directly?
No description provided.