Skip to content

Conversation

@acul71
Copy link
Contributor

@acul71 acul71 commented Jan 29, 2026

Updates / supersedes #788. Same bump-go changes but from my fork so the latest commit (fix: make go new transport spec compliant) is included.

@acul71
Copy link
Contributor Author

acul71 commented Jan 29, 2026

Hi @MarcoPolo @dhuseby

I've upgrade go-v0.47 to the new transport specs. here I included the patch file.

I've opened a PR in go libp2p/go-libp2p#3456 but I'm having difficulties to make local CI/CD transport integration.

Here in test-plans all test passes except for

Collecting results...
 ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  → Results:
    → Total: 181Passed: 180Failed: 1
    - go-v0.47-pre x rust-v0.56 (webrtc-direct)

  → Total time: 00:02:471 test(s) failed

The test is failing because of a WebRTC SRTP key length mismatch between Go and Rust, not because of your transport-spec or harness changes.

What happens

  1. Rust listener panics in the SRTP (encryption) layer:

    • Assertion: left: 32 vs right: 16 in webrtc_srtp::key_derivation::aes_cm_key_derivation
    • So the Rust webrtc_srtp code expects a 16-byte key (AES-128-GCM) but gets 32 bytes (what Go is sending).
  2. Go dialer then fails with “Failed to connect to other peer” because the Rust side has already crashed.

Why

  • Go’s WebRTC stack is deriving/sending a 32-byte SRTP key (e.g. for AES-256-GCM or a different key format).
  • Rust’s webrtc_srtp (and its use of generic-array in CipherAeadAesGcm::new) is built for a 16-byte key (AES-128-GCM).
  • So the two stacks disagree on key size during DTLS/SRTP setup; this is an interop bug between go-libp2p and rust-libp2p WebRTC, not a bug in your test configuration.

What you can do

  • Ignore this combo in CI: e.g. keep using --test-ignore "~failing" if go-v0.47-pre x rust-v0.56 (webrtc-direct) is already in the “failing” set, or add it so this test is skipped until the implementations are fixed.
  • Fix the implementations: align Go and Rust WebRTC stacks on SRTP key length and cipher (e.g. both use 16-byte keys for AES-128-GCM, or both support the same 32-byte setup) in the respective libp2p/WebRTC repos.

So: the test is failing because of a known Go ↔ Rust WebRTC SRTP key-size mismatch, not because of your recent changes.

Log:

(venv) luca@r17:~/PNL_Launchpad_Curriculum/Libp2p/test-plans-fork/transport/.cache/test-run/transport-5b1281e3-010814-29-01-2026/logs$ cat go-v0_47-pre_x_rust-v0_56__webrtc-direct_.log
[2026-01-29 01:08:44] INFO: Running: go-v0.47-pre x rust-v0.56 (webrtc-direct)
time="2026-01-29T01:08:44+01:00" level=warning msg="No services to build"
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener Creating 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener Created 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer Creating 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer Created 
Attaching to go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer, go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener Starting 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener Started 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer Starting 
go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer  | 2026/01/29 00:08:52 My multiaddr is:  [/ip4/127.0.0.1/udp/40498/webrtc-direct/certhash/uEiDZZ9oj_lLi8hT2k4a1oK9CvUvvCKAXgTJwJI40zqORkA /ip4/172.17.0.5/udp/40498/webrtc-direct/certhash/uEiDZZ9oj_lLi8hT2k4a1oK9CvUvvCKAXgTJwJI40zqORkA]
go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer  | 2026/01/29 00:08:52 Other peer multiaddr is:  /ip4/172.17.0.32/udp/56741/webrtc-direct/certhash/uEiDbC9Bu62gkosBt6GUOPl7o1Wtqzq3ugI5DGgbOizPRFQ/p2p/12D3KooWLZALioBmkSTEV3R52FbNz56V85j1yLetGwrKEb7fCyJG
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer Started 
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  | 
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  | thread 'tokio-runtime-worker' (31) panicked at /usr/local/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/generic-array-0.14.7/src/lib.rs:572:9:
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  | assertion `left == right` failed
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   left: 32
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |  right: 16
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  | stack backtrace:
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |    0: __rustc::rust_begin_unwind
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |    1: core::panicking::panic_fmt
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |    2: core::panicking::assert_failed_inner
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |    3: core::panicking::assert_failed
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |    4: webrtc_srtp::key_derivation::aes_cm_key_derivation
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |    5: webrtc_srtp::cipher::cipher_aead_aes_gcm::CipherAeadAesGcm::new
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |    6: webrtc_srtp::context::Context::new
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |    7: webrtc_srtp::session::Session::new::{{closure}}
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |    8: webrtc::dtls_transport::RTCDtlsTransport::start::{{closure}}
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |    9: webrtc::peer_connection::RTCPeerConnection::set_remote_description::{{closure}}::{{closure}}::{{closure}}
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   10: webrtc::peer_connection::operation::Operations::new::{{closure}}
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   11: tokio::runtime::task::core::Core<T,S>::poll
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   12: tokio::runtime::task::harness::Harness<T,S>::poll
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   13: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   14: tokio::runtime::scheduler::multi_thread::worker::Context::run
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   15: tokio::runtime::context::scoped::Scoped<T>::set
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   16: tokio::runtime::context::runtime::enter_runtime
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   17: tokio::runtime::scheduler::multi_thread::worker::run
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   18: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   19: tokio::runtime::task::core::Core<T,S>::poll
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   20: tokio::runtime::task::harness::Harness<T,S>::poll
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  |   21: tokio::runtime::blocking::pool::Inner::run
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener  | note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer    | 2026/01/29 00:08:57 Failed to connect to other peer
go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer exited with code 1
 Compose Stopping Aborting on container exit...
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer Stopping 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer Stopped 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener Stopping 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener Stopped 
go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener exited with code 143

[2026-01-29 01:09:00] ERROR:   ✗ Test failed
[2026-01-29 01:09:00] DEBUG:   Cleaning up containers...
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer Stopping 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer Stopped 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer Removing 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__dialer Removed 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener Stopping 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener Stopped 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener Removing 
 Container go-v0_47-pre_x_rust-v0_56__webrtc-direct__listener Removed 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants