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

[TASK] MPC refactor: add common functions to context derive #495

Closed
tbraun96 opened this issue Nov 21, 2024 · 1 comment · Fixed by #497
Closed

[TASK] MPC refactor: add common functions to context derive #495

tbraun96 opened this issue Nov 21, 2024 · 1 comment · Fixed by #497
Assignees
Labels
optimization ⚙️ Tasks that are refactor, optimize, or are considered chores. task ✔️

Comments

@tbraun96
Copy link
Collaborator

tbraun96 commented Nov 21, 2024

Now that we've built multiple MPCs, duplicated code can be abstracted away inside the SDK and test utils.

Various MPC-related functions could be added as auto-generated context functions

e.g.,

#[derive(Mpc)]
struct MyContext { // ... }
// ...
fn my_job(context: MyContext) {
    let (i, operators) = context.get_operators_and_self_party_index();
    // ...
}

As for testing, we can have the initialization handle much of the repetitive boilerplate. Afterward, there may be room for a macro to easily define tests, especially MPC-specific macros that often store keys locally using a call ID, and that call ID needs to be funneled into the next job (e.g., keygen -> signing) in order to retrieve data from the local store.

@tbraun96 tbraun96 added optimization ⚙️ Tasks that are refactor, optimize, or are considered chores. task ✔️ labels Nov 21, 2024
@tbraun96 tbraun96 self-assigned this Nov 21, 2024
@github-project-automation github-project-automation bot moved this to Not Started 🕧 in Webb Universe Nov 21, 2024
@drewstone
Copy link
Contributor

I would rather build this as a custom MPC context @tbraun96, we shouldn't add too many things directly on the env.

@tbraun96 tbraun96 changed the title [TASK] MPC refactor: gadget_sdk::mpc module and test-utils::mpc module [TASK] MPC refactor: add common functions to context derive Nov 22, 2024
@github-project-automation github-project-automation bot moved this from Building 🏗️ to Completed ✅ in Webb Universe Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization ⚙️ Tasks that are refactor, optimize, or are considered chores. task ✔️
Projects
Status: Completed ✅
Development

Successfully merging a pull request may close this issue.

2 participants