Skip to content

Commit 5072a67

Browse files
authored
chore: Extract execution to own crate (#440)
* Pull down anyhow_error_and_log utility function (temp) * Add skeleton threshold-algebra crate * Add threshold-algebra crate * Use new threshold-algebra crate * Use new threshold-algebra crate * Fix feature-gated invocations of old location of algebra * Clean up error-utils * Cleanup features a bit * Don't re-export sharing from execution * Rename `gen` module to `ggen` to avoid clashing with Rust reserved keyword * Do not re-export Role * Extract threading utilities to own crate: `thread-handles`. * Sort out imports * Update Cargo.lock * Extract hashing to own crate * Cleanup TODOs * Merge conflicts * Don't build full debug info in the test profile. * chore: clippy fixes * fix clippy warnings * chore: clippy and test fixes * Fix wasm build (I hope) * Remove TODO * fix conditional imports * chore: extract execution and handle fallout. Not there yet. * chore: fix session-id * Moar files * Repo type checks! * Include execution in core-client * Hackfix networking tests * Ignore temp more broadly * Ignore temp everywhere * Move ddec test configs to the right place * Add TODO about mismatched DkgMode in integration test * Rename `ggen` to `proto_gen` * Remove "non-wasm" feature from `threshold-algebra` * Remove `algebra/slow_tests` feature just use `all_extension_degrees` * Remove TODO that I will not address here (or ever). * Cleanup thread-handles. Use anyhow_error_and_log consistently * Sort out TODO * `error-utils` doesn't need any features * Remove stale TODO * Merge main * move threshold/experimental into new threshold-experimental crate * Add Cargo.toml for new crate * fix threshold-experimental * Move core/threshold/experimental to own crate: threshold-experimental * Move BGV test scripts to new crate * Fix build command in shell scripts * Remove stale code * Sort out the circular dependency for the `moby` binary and ExperimentalChoreoGrpcChoreography * Sort out todos in session-id * Resolve some TODOs in networking * Crate description for execution * Crate descr for thershold-types * Crate descr for threshold-experimental * Cleanup threshold-fhe's Cargo.toml * Remove unused dependencies from threshold-networking * Remove feature gated trait methods and plenty of other code that must be feature gated as a consequence. * Remove unused deps from threshold-hashing * More cleanup of features and unused deps * Remove unused feature * Just use strum and remove strum_macros * Docs for ProtocolDescription * Clean up TODOs * Clean up TODOs * Remove unused `PARAMS_DIR` * Clean up TODOs * Cleanup more TODOs * Add new `test-utils` crate * Add test-utils mini-crate. Likely more stuff will move here over time. * Fix last usage of test-utils * Clean up trivial TODOs * Move randomness_checks to threshold-algebra * Fix an import * More cleanup * More cleaup * Fixed a few more todos * Move Role and some opening types to threshold-types * Adjust imports * Fix self-reference in execution that causes cargo deny to panic * formatting * Sort out wasm builds * Appease clippy * More test fixes * fix docker port * More feature threading * Propagate features * Fix CI, part 32783718: ensure no big ass keys get generated when they mustn't. * Clean up TODOs * Upgrade `rstest` and get rid of `async-std`. * Upgrade rstest to latest for less async-std * Specify the async runtime for rstests * chore: resolve an outstanding TODO * chore: resolve outdated TODO * chore: put back the funny looking test * chore: resolve TODO – we're keeping threshold-experimental in the workspace (for now...) * chore: trust the default feature * chore: put clippy allows on the specific points rather than whole module * Restore commented-out types in benchmarks * chore: cleaner Cargo.toml * chore: Restore spurious changes to backward-compatibility * chore: cleanup and make consistent * chore: move SessionId to threshold-types * chore: wire up session_id module, fix imports * chore: re-work the session_id tests suite to stop testing encryption/hashing * chore: move the *logic* related to commitments to threshold-algebra, while keeping types in threshold-types * chore: revert unrelated changes to sender_service * chore: don't use aliases for execution and networking * chore: Fix import
1 parent 1207eeb commit 5072a67

File tree

309 files changed

+3480
-2763
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+3480
-2763
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CLAUDE.md
22
.claude/
33
/target*
4-
/temp
4+
**/temp/*
55
/keys
66
/crs
77
/test-material

Cargo.lock

Lines changed: 158 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ members = [
55
"bc2wrap",
66
"core/grpc",
77
"core/service",
8+
"core/test-utils",
9+
"core/thread-handles",
810
"core/threshold",
911
"core/threshold-algebra",
12+
"core/threshold-execution",
13+
"core/threshold-experimental",
1014
"core/threshold-hashing",
11-
"core/thread-handles",
15+
"core/threshold-networking",
16+
"core/threshold-types",
1217
"core/error-utils",
1318
"core-client",
1419
"observability",
@@ -73,13 +78,18 @@ description = "Key Management System for the Zama Protocol."
7378
algebra = { package = "threshold-algebra", path = "./core/threshold-algebra", default-features = false }
7479
backward-compatibility = { path = "./backward-compatibility" } # Internal backward compatibility testing
7580
bc2wrap = { path = "./bc2wrap" } # Internal bincode wrapper custom implementation
81+
error-utils = { path = "./core/error-utils", default-features = false }
82+
threshold-execution = { path = "./core/threshold-execution", default-features = false }
83+
experimental = { package = "threshold-experimental", path = "./core/threshold-experimental", default-features = false }
7684
hashing = { package = "threshold-hashing", path = "./core/threshold-hashing", default-features = false }
7785
kms = { path = "./core/service", default-features = false } # Core KMS service
7886
kms-core-client = { path = "./core-client" } # Core KMS client library
7987
kms-grpc = { path = "./core/grpc", default-features = false } # KMS gRPC interface
88+
threshold-networking = { path = "./core/threshold-networking", default-features = false }
8089
observability = { path = "./observability" } # Internal observability module
90+
test-utils = { path = "./core/test-utils" }
8191
threshold-fhe = { path = "./core/threshold/", default-features = false } # Threshold FHE implementation
82-
error-utils = { path = "./core/error-utils", default-features = false }
92+
threshold-types = { path = "./core/threshold-types" } # Types share across the KMS
8393
thread-handles = { path = "./core/thread-handles" }
8494

8595
# External dependencies (alphabetically sorted)

core-client/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ attestation-doc-validation.workspace = true
5959
bc2wrap.workspace = true
6060
bytes.workspace = true
6161
clap = { workspace = true, features = ["derive"] }
62+
threshold-execution.workspace = true
6263
hashing.workspace = true
6364
hex.workspace = true
6465
k256.workspace = true

core-client/src/crsgen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use kms_lib::util::key_setup::test_tools::load_material_from_pub_storage;
1414
use std::collections::HashMap;
1515
use std::path::Path;
1616
use tfhe::zk::CompactPkeCrs;
17-
use threshold_fhe::execution::zk::ceremony::max_num_bits_from_crs;
17+
use threshold_execution::zk::ceremony::max_num_bits_from_crs;
1818
use tokio::task::JoinSet;
1919
use tonic::transport::Channel;
2020

@@ -350,7 +350,7 @@ mod tests {
350350
};
351351
use std::str::FromStr;
352352
use tfhe::zk::CompactPkeCrs;
353-
use threshold_fhe::execution::zk::ceremony::max_num_bits_from_crs;
353+
use threshold_execution::zk::ceremony::max_num_bits_from_crs;
354354

355355
#[tokio::test]
356356
async fn test_eip712_sigs() {

core-client/tests-utils/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ impl DockerComposeCmd {
103103
| KMSMode::ThresholdCustodianTestParameter => {
104104
&[50100, 50200, 50300, 50400, 50001, 50002, 50003, 50004]
105105
}
106+
// Must match the port as defined in kms/docker-compose-core-centralized.yml
106107
KMSMode::Centralized | KMSMode::CentralizedCustodian => &[50051],
107108
}
108109
}

core/grpc/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ hex.workspace = true
2626
prost.workspace = true
2727
rand = { workspace = true, features = ["std", "std_rng"] }
2828
serde = { workspace = true, features = ["derive", "rc"] }
29+
threshold-types.workspace = true
2930
strum.workspace = true
3031
strum_macros.workspace = true
3132
thiserror.workspace = true
@@ -38,9 +39,6 @@ tfhe = { workspace = true, features = [
3839
"experimental-force_fft_algo_dif4",
3940
] }
4041
tfhe-versionable.workspace = true
41-
threshold-fhe = { workspace = true, default-features = false, features = [
42-
"extension_degree_4",
43-
] }
4442
tracing = { workspace = true, features = ["log"] }
4543
wasm-bindgen.workspace = true
4644

0 commit comments

Comments
 (0)