tlsnotary / tlsn

Rust implementation of the TLSNotary protocol
https://tlsnotary.org
263 stars 69 forks source link

Investigate hanging `tlsn/crates/tls/mpc/tests/test.rs` #559

Closed th4s closed 1 month ago

th4s commented 1 month ago

When running the tls-mpc-test with a tracing configuration that emits New and Close FmtSpans we were able to capture the following log trace_hang.txt.

After filtering for lines that contain decode_key_private and writing all these Leader events into this file decode_key_private.txt and doing the same for decode_key_blind and writing these Follower events into this file decode_key_blind.txt I notice that decode_key_private is called twice on the Leader site (line 1 and 21). This is not true for the follower, where it is called only once (line 1). This is what causes the leader site to be hanging in ot_receive_active_encodings (line 14389 in trace_hang.txt).

The cause for this might be that commit which calls decode_key_privateis called twice:

themighty1 commented 1 month ago

Most likelydecode_key_private is called twice due to a race. It happens under these conditions:

The fix is to not allow commit to be called more than once, unless there is a reason to do so @sinui0

th4s commented 1 month ago

While working on #539 I encountered the same test hanging. I isolated it into a new investigation-branch.

th4s commented 1 month ago

While working on #539 I encountered the same test hanging. I isolated it into a new investigation-branch.

This is fixed now and was caused by the changes of #539. But the original bug from the trace_hang.txt still needs to be adressed.

th4s commented 1 month ago

Closed by #568