Skip to content

p2p: remove deprecated legacy WebRTC address format#2201

Open
iostat wants to merge 4 commits intoio/p2p-fix-identify-rejectfrom
io/p2p-remove-legacy-multiaddr
Open

p2p: remove deprecated legacy WebRTC address format#2201
iostat wants to merge 4 commits intoio/p2p-fix-identify-rejectfrom
io/p2p-remove-legacy-multiaddr

Conversation

@iostat
Copy link
Copy Markdown
Contributor

@iostat iostat commented Mar 26, 2026

(stacked PRs: this is 2 of 3, merge #2200 first and then #2202 after)

Description

Remove the deprecated legacy WebRTC address format
(/{peer_id}/{signaling_method}/...) and simplify FromStr for
P2pConnectionOutgoingInitOpts to only accept standard multiaddr. The legacy
format was deprecated with warnings in place; this completes the removal.

Also cleans up the error enum: replaces NotEnoughArgs, PeerIdParseError,
SignalingMethodParseError, and the catch-all Other with three specific
variants: InvalidMultiaddr, InvalidMultiaddrStructure, InvalidPeerId.

Related Issue(s)

Closes #2074

Type of Change

  • Breaking change (fix or feature that would cause existing functionality
    to not work as expected)
  • This change requires a documentation update

Testing

  • Legacy format test removed alongside the code path.
  • All remaining multiaddr parsing tests pass.

Changelog Entry

Removed: P2P: Deprecated legacy WebRTC address format (/{peer_id}/{signaling}); only standard multiaddr is now accepted (#2201)

@github-actions
Copy link
Copy Markdown

OCaml Reference Validation Results

Repository: https://github.com/MinaProtocol/mina.git
Branch: compatible
Status: ❌ Validation failed

Click to see full validation output
Checking OCaml references against https://github.com/MinaProtocol/mina.git (branch: compatible)
Fetching current commit from compatible...
Current OCaml commit: 0f6d42160bf554d526589cc47150a010ab35d5a4

Validating references...
========================
[OK] VALID: crates/ledger/src/account/account.rs:1273 -> src/lib/mina_base/account.ml L:201-224
  [WARN] STALE COMMIT: fc6be4c58091c761f827c858229c2edf9519e941 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[ERROR] INVALID: crates/ledger/src/scan_state/transaction_logic/for_tests.rs:63
   Code at L:2285-2285 differs between commit 5da42ccd72e791f164d4d200cf1ce300262873b3 and current branch
   Referenced: https://github.com/MinaProtocol/mina/blob/5da42ccd72e791f164d4d200cf1ce300262873b3/src/lib/transaction_logic/mina_transaction_logic.ml#L2285-L2285
   Current:    https://github.com/MinaProtocol/mina/blob/compatible/src/lib/transaction_logic/mina_transaction_logic.ml#L2285-L2285
[ERROR] INVALID: crates/ledger/src/scan_state/transaction_logic/for_tests.rs:67
   Code at L:2351-2356 differs between commit 5da42ccd72e791f164d4d200cf1ce300262873b3 and current branch
   Referenced: https://github.com/MinaProtocol/mina/blob/5da42ccd72e791f164d4d200cf1ce300262873b3/src/lib/transaction_logic/mina_transaction_logic.ml#L2351-L2356
   Current:    https://github.com/MinaProtocol/mina/blob/compatible/src/lib/transaction_logic/mina_transaction_logic.ml#L2351-L2356
[ERROR] INVALID: crates/ledger/src/scan_state/transaction_logic/for_tests.rs:76
   Code at L:2407-2407 differs between commit 5da42ccd72e791f164d4d200cf1ce300262873b3 and current branch
   Referenced: https://github.com/MinaProtocol/mina/blob/5da42ccd72e791f164d4d200cf1ce300262873b3/src/lib/transaction_logic/mina_transaction_logic.ml#L2407-L2407
   Current:    https://github.com/MinaProtocol/mina/blob/compatible/src/lib/transaction_logic/mina_transaction_logic.ml#L2407-L2407
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/mod.rs:118 -> src/lib/mina_base/transaction_status.ml L:9-51
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/mod.rs:234 -> src/lib/mina_base/transaction_status.ml L:452-454
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/mod.rs:250 -> src/lib/mina_base/with_status.ml L:6-10
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/mod.rs:320 -> src/lib/mina_base/fee_transfer.ml L:76-80
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/mod.rs:345 -> src/lib/mina_base/fee_transfer.ml L:68-69
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/mod.rs:420 -> src/lib/mina_base/coinbase.ml L:17-21
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/mod.rs:1049 -> src/lib/transaction/transaction.ml L:8-11
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/signed_command.rs:17 -> src/lib/mina_base/signed_command_payload.ml L:34-48
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/signed_command.rs:43 -> src/lib/mina_base/stake_delegation.ml L:11-13
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/signed_command.rs:70 -> src/lib/mina_base/signed_command_payload.ml L:179-181
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/signed_command.rs:81 -> src/lib/mina_base/signed_command_payload.ml L:239-243
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[OK] VALID: crates/ledger/src/scan_state/transaction_logic/signed_command.rs:112 -> src/lib/mina_base/signed_command_payload.ml L:352-362
  [WARN] STALE COMMIT: 5da42ccd72e791f164d4d200cf1ce300262873b3 (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)
[ERROR] INVALID: crates/p2p-messages/src/string.rs:14
   Code at L:140-140 differs between commit c0c9d702b8cba34a603a28001c293ca462b1dfec and current branch
   Referenced: https://github.com/MinaProtocol/mina/blob/c0c9d702b8cba34a603a28001c293ca462b1dfec/src/lib/mina_base/zkapp_account.ml#L140-L140
   Current:    https://github.com/MinaProtocol/mina/blob/compatible/src/lib/mina_base/zkapp_account.ml#L140-L140
[OK] VALID: crates/p2p-messages/src/string.rs:16 -> src/lib/mina_base/account.ml L:92-92
  [WARN] STALE COMMIT: c0c9d702b8cba34a603a28001c293ca462b1dfec (current: 0f6d42160bf554d526589cc47150a010ab35d5a4)

Summary
=======
Total references found: 18
Valid references: 14
Invalid references: 4
Stale commits: 14

[ERROR] Validation failed: 4 invalid reference(s) found

@iostat iostat changed the base branch from develop to io/p2p-fix-identify-reject March 26, 2026 20:47
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 26, 2026

✓ Code Reference Verification Passed

All code references in the documentation have been verified successfully!

Total references checked: 1
Valid references: 1

The documentation is in sync with the codebase on the develop branch.

("/path", "https://example.com:443/path/mina/webrtc/signal"),
("path/", "https://example.com:443/path/mina/webrtc/signal"),
("/path/", "https://example.com:443/path/mina/webrtc/signal"),
];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iostat iostat force-pushed the io/p2p-remove-legacy-multiaddr branch from cf771bd to 8636532 Compare March 31, 2026 15:08
@iostat iostat force-pushed the io/p2p-fix-identify-reject branch from c7157e7 to 4edae62 Compare March 31, 2026 15:21
@iostat iostat force-pushed the io/p2p-remove-legacy-multiaddr branch from 8636532 to ce8ce87 Compare March 31, 2026 15:22
@iostat iostat force-pushed the io/p2p-fix-identify-reject branch from 4edae62 to 045fa7b Compare March 31, 2026 16:39
iostat added 4 commits March 31, 2026 12:40
(#2074)

Remove the fragile legacy /{peer_id}/{signaling_method}/...
fallback from P2pConnectionOutgoingInitOpts::from_str.
Only standard multiaddr format is now accepted.

Restructure P2pConnectionOutgoingInitOptsParseError with
typed variants (InvalidMultiaddr, InvalidMultiaddrStructure,
InvalidPeerId) replacing the catch-all Other(String).
Remove deprecated legacy format section from webrtc.md and
the legacy format mention from local-web-node-docker.mdx,
matching the code removal in the previous commit.
Remove FromStr implementations for SignalingMethod and
HttpSignalingInfo that used fragile slash-delimited string
parsing. These are no longer reachable from user input after
the legacy address format removal, and were only used by
custom Serialize/Deserialize impls.

Switch to derived Serialize/Deserialize for SignalingMethod,
HttpSignalingInfo, PathPrefix, and ProxyScheme.
@iostat iostat force-pushed the io/p2p-remove-legacy-multiaddr branch from ce8ce87 to 9ed333e Compare March 31, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Fix fragile legacy webrtc-multiaddrish parsing code in p2p crate

2 participants