feat(mpc-tls): use concurrent ot setup and gc preprocessing (#910)

* feat(mpc-tls): use concurrent ot setup and gc preprocessing

* bump mpz

* increase muxer stream count

* update Cargo.lock

---------

Co-authored-by: sinu.eth <65924192+sinui0@users.noreply.github.com>
This commit is contained in:
dan
2025-06-06 22:39:35 +00:00
committed by GitHub
parent c128ab16ce
commit bc1eba18c9
5 changed files with 35 additions and 37 deletions

42
Cargo.lock generated
View File

@@ -1741,7 +1741,7 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
[[package]]
name = "clmul"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"bytemuck",
"cfg-if",
@@ -3764,7 +3764,7 @@ checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3"
[[package]]
name = "matrix-transpose"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"thiserror 1.0.69",
]
@@ -3908,7 +3908,7 @@ dependencies = [
[[package]]
name = "mpz-circuits"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"bincode",
"itybity 0.3.1",
@@ -3924,7 +3924,7 @@ dependencies = [
[[package]]
name = "mpz-cointoss"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"futures",
"mpz-cointoss-core",
@@ -3937,7 +3937,7 @@ dependencies = [
[[package]]
name = "mpz-cointoss-core"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"mpz-core",
"opaque-debug",
@@ -3948,7 +3948,7 @@ dependencies = [
[[package]]
name = "mpz-common"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"async-trait",
"bytes",
@@ -3970,7 +3970,7 @@ dependencies = [
[[package]]
name = "mpz-core"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"aes 0.9.0-rc.0",
"bcs",
@@ -3996,7 +3996,7 @@ dependencies = [
[[package]]
name = "mpz-fields"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"ark-ff 0.4.2",
"ark-secp256r1",
@@ -4016,7 +4016,7 @@ dependencies = [
[[package]]
name = "mpz-garble"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"async-trait",
"derive_builder 0.11.2",
@@ -4043,7 +4043,7 @@ dependencies = [
[[package]]
name = "mpz-garble-core"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"aes 0.9.0-rc.0",
"bitvec",
@@ -4074,7 +4074,7 @@ dependencies = [
[[package]]
name = "mpz-hash"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"itybity 0.3.1",
"mpz-circuits",
@@ -4086,7 +4086,7 @@ dependencies = [
[[package]]
name = "mpz-memory-core"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"blake3",
"futures",
@@ -4101,7 +4101,7 @@ dependencies = [
[[package]]
name = "mpz-ole"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"async-trait",
"futures",
@@ -4119,7 +4119,7 @@ dependencies = [
[[package]]
name = "mpz-ole-core"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"hybrid-array",
"itybity 0.3.1",
@@ -4135,7 +4135,7 @@ dependencies = [
[[package]]
name = "mpz-ot"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"async-trait",
"cfg-if",
@@ -4159,7 +4159,7 @@ dependencies = [
[[package]]
name = "mpz-ot-core"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"aes 0.9.0-rc.0",
"blake3",
@@ -4190,7 +4190,7 @@ dependencies = [
[[package]]
name = "mpz-share-conversion"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"async-trait",
"mpz-common",
@@ -4206,7 +4206,7 @@ dependencies = [
[[package]]
name = "mpz-share-conversion-core"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"mpz-common",
"mpz-core",
@@ -4220,7 +4220,7 @@ dependencies = [
[[package]]
name = "mpz-vm-core"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"async-trait",
"futures",
@@ -4233,7 +4233,7 @@ dependencies = [
[[package]]
name = "mpz-zk"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"async-trait",
"blake3",
@@ -4250,7 +4250,7 @@ dependencies = [
[[package]]
name = "mpz-zk-core"
version = "0.1.0-alpha.3"
source = "git+https://github.com/privacy-scaling-explorations/mpz?tag=v0.1.0-alpha.3#3bd2f557a541797d50e0aaac41be1e1a03e895d7"
source = "git+https://github.com/privacy-scaling-explorations/mpz?rev=2159fcc#2159fccca21a07f66a0823fd41c901432be48f26"
dependencies = [
"blake3",
"cfg-if",

View File

@@ -74,19 +74,19 @@ tlsn-harness-runner = { path = "crates/harness/runner" }
tlsn-wasm = { path = "crates/wasm" }
tlsn-verifier = { path = "crates/verifier" }
mpz-circuits = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-memory-core = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-common = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-core = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-vm-core = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-garble = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-garble-core = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-ole = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-ot = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-share-conversion = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-fields = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-zk = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-hash = { git = "https://github.com/privacy-scaling-explorations/mpz", tag = "v0.1.0-alpha.3" }
mpz-circuits = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-memory-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-common = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-vm-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-garble = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-garble-core = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-ole = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-ot = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-share-conversion = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-fields = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-zk = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
mpz-hash = { git = "https://github.com/privacy-scaling-explorations/mpz", rev = "2159fcc" }
rangeset = { version = "0.2" }
serio = { version = "0.2" }

View File

@@ -72,7 +72,7 @@ pub fn attach_mux<T: AsyncWrite + AsyncRead + Send + Unpin + 'static>(
role: Role,
) -> (MuxFuture, MuxControl) {
let mut mux_config = yamux::Config::default();
mux_config.set_max_num_streams(32);
mux_config.set_max_num_streams(36);
let mux_role = match role {
Role::Prover => yamux::Mode::Client,

View File

@@ -191,7 +191,6 @@ impl MpcTlsFollower {
.map_err(MpcTlsError::preprocess)
},
async move |ctx| {
vm.flush(ctx).await.map_err(MpcTlsError::preprocess)?;
vm.preprocess(ctx).await.map_err(MpcTlsError::preprocess)?;
vm.flush(ctx).await.map_err(MpcTlsError::preprocess)?;

View File

@@ -226,7 +226,6 @@ impl MpcTlsLeader {
.map_err(MpcTlsError::preprocess)
},
async move |ctx| {
vm_lock.flush(ctx).await.map_err(MpcTlsError::preprocess)?;
vm_lock
.preprocess(ctx)
.await