Skip to content

Commit

Permalink
chore: misc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
themighty1 committed Sep 12, 2023
1 parent be9da5b commit f4c831e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/tls/tls-mpc/src/follower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::{
MpcTlsChannel, MpcTlsError, MpcTlsFollowerConfig,
};

/// Wrapper for protocol instances of the follower
/// The follower of the MPC TLS protocol.
pub struct MpcTlsFollower {
config: MpcTlsFollowerConfig,
channel: MpcTlsChannel,
Expand Down
2 changes: 1 addition & 1 deletion components/tls/tls-mpc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This crate provides tooling for instantiating our MPC machinery for leader and follower.
//! This crate provides tooling for instantiating MPC TLS machinery for leader and follower.

//! The main API objects are [MpcTlsLeader] and [MpcTlsFollower], which wrap the necessary
//! cryptographic machinery and also an [MpcTlsChannel] for communication.
Expand Down
7 changes: 5 additions & 2 deletions tlsn/tlsn-prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ use crate::error::OTShutdownError;
#[cfg(feature = "tracing")]
use tracing::{debug, debug_span, instrument, Instrument};

/// Bincode for serialization, multiplexing with Yamux.
/// A muxer which uses Bincode for serialization, Yamux for multiplexing.
type Mux = BincodeMux<UidYamuxControl>;

/// Prover future which must be polled for the connection to make progress.
/// Prover future which must be polled for the TLS connection to make progress.
pub struct ProverFuture {
#[allow(clippy::type_complexity)]
fut: Pin<Box<dyn Future<Output = Result<Prover<Closed>, ProverError>> + Send + 'static>>,
Expand Down Expand Up @@ -386,6 +386,7 @@ impl Prover<Notarize> {
}
}

/// Performs a setup of the various MPC subprotocols.
#[cfg_attr(feature = "tracing", instrument(level = "debug", skip_all, err))]
#[allow(clippy::type_complexity)]
async fn setup_mpc_backend(
Expand Down Expand Up @@ -504,6 +505,7 @@ async fn setup_mpc_backend(
Ok((mpc_tls, vm, ot_recv, gf2, ot_fut))
}

/// A future which must be polled for the muxer to make progress.
struct MuxFuture {
fut: Pin<Box<dyn FusedFuture<Output = Result<(), ProverError>> + Send + 'static>>,
}
Expand All @@ -525,6 +527,7 @@ impl FusedFuture for MuxFuture {
}
}

/// A future which must be polled for the Oblivious Transfer protocol to make progress.
struct OTFuture {
fut: Pin<Box<dyn FusedFuture<Output = Result<(), ProverError>> + Send + 'static>>,
}
Expand Down
2 changes: 2 additions & 0 deletions tlsn/tlsn-prover/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ opaque_debug::implement!(Initialized);

/// State after MPC setup has completed.
pub struct Setup {
/// A muxer for communication with the Notary
pub(crate) notary_mux: Mux,
pub(crate) mux_fut: MuxFuture,

Expand Down Expand Up @@ -48,6 +49,7 @@ opaque_debug::implement!(Closed);

/// The state for the [Prover](crate::Prover) during notarization
pub struct Notarize {
/// A muxer for communication with the Notary
pub(crate) notary_mux: Mux,
pub(crate) mux_fut: MuxFuture,

Expand Down

0 comments on commit f4c831e

Please sign in to comment.