p2p: Clean up signaling error types, doctests#2202
Open
iostat wants to merge 3 commits intoio/p2p-remove-legacy-multiaddrfrom
Open
p2p: Clean up signaling error types, doctests#2202iostat wants to merge 3 commits intoio/p2p-remove-legacy-multiaddrfrom
iostat wants to merge 3 commits intoio/p2p-remove-legacy-multiaddrfrom
Conversation
This was referenced Mar 26, 2026
✓ Code Reference Verification PassedAll code references in the documentation have been verified successfully! Total references checked: 1 The documentation is in sync with the codebase on the |
36f9071 to
8727166
Compare
0dc9c49 to
cf771bd
Compare
8727166 to
c18a737
Compare
richardpringle
approved these changes
Mar 27, 2026
| // | ||
| // We deliberately respond with SignalDecryptionFailed | ||
| // rather than a specific mismatch error to avoid leaking | ||
| // information to a potential attacker. |
Collaborator
There was a problem hiding this comment.
There should probably be some kind of log here, right?
8636532 to
ce8ce87
Compare
c18a737 to
a0366ff
Compare
ce8ce87 to
9ed333e
Compare
(#2193) Add AnswerNotProvided variant to P2pConnectionErrorResponse to distinguish empty relay answers from generic internal errors in the discovery signaling path. Add OfferDecryptErrorKind enum to distinguish actual decryption failures from identity key mismatches in the exchange signaling path. Key mismatches now log a security warning while still responding with SignalDecryptionFailed to avoid leaking information to potential attackers.
Fix 11 doc tests that never compiled: wrong crate name (mina:: -> mina_p2p::), missing imports, undefined variables, and missing error handling wrappers. All doc tests are now self-contained and pass.
a0366ff to
d7eb1e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(stacked PRs: this is 3 of 3, merge #2200 then #2201 before this)
Description
Improve error types across WebRTC connection signaling:
OfferDecryptErrorKindenum to distinguish decryption failure fromidentity key mismatch, with a warning log for potential relay tampering.
AnswerNotProvidedvariant toP2pConnectionErrorResponse(previouslymapped to the generic
InternalError).webrtcmodule (connection_auth,signaling_method/http,signaling_method/mod) by replacing pseudocodesnippets with compilable examples.
Related Issue(s)
Closes #2193
Type of Change
Testing
cargo test --doc -p mina-p2ppasses (previously broken).Changelog Entry
Fixed: P2P: Improved error types for WebRTC connection signaling and fixed broken doc tests in the webrtc module (#2202)