-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(transports): filter circuit addresses #2060
Conversation
Use exact matchers for filtering webtransport and webrtc addresses so those transports do not try to dial (for example) p2p-circuit addresses, instead leaving the more specific address to other transports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm but question on test
|
||
it('transport filter filters out invalid multiaddrs', async () => { | ||
const valid = [ | ||
multiaddr('/ip4/1.2.3.4/udp/1234/quic-v1/webtransport/certhash/uEiAUqV7kzvM1wI5DYDc1RbcekYVmXli_Qprlw3IkiEg6tQ/certhash/uEiAUqV7kzvM1wI5DYDc1RbcekYVmXli_Qprlw3IkiEg6tQ/p2p/12D3KooWGDMwwqrpcYKpKCgxuKT2NfqPqa94QnkoBBpqvCaiCzWd') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a webtransport relay address here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first entry in the invalid
array is a webtransport relay address, unless I'm misunderstanding you. Maybe suggest an edit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiaddr('/ip4/1.2.3.4/udp/1234/quic-v1/webtransport/certhash/uEiAUqV7kzvM1wI5DYDc1RbcekYVmXli_Qprlw3IkiEg6tQ/certhash/uEiAUqV7kzvM1wI5DYDc1RbcekYVmXli_Qprlw3IkiEg6tQ/p2p/12D3KooWGDMwwqrpcYKpKCgxuKT2NfqPqa94QnkoBBpqvCaiCzWd') | |
multiaddr('/ip4/1.2.3.4/udp/1234/quic-v1/webtransport/certhash/uEiAUqV7kzvM1wI5DYDc1RbcekYVmXli_Qprlw3IkiEg6tQ/certhash/uEiAUqV7kzvM1wI5DYDc1RbcekYVmXli_Qprlw3IkiEg6tQ/p2p/12D3KooWGDMwwqrpcYKpKCgxuKT2NfqPqa94QnkoBBpqvCaiCzWd'), | |
multiaddr('/ip4/167.235.53.235/udp/4001/quic-v1/webtransport/certhash/uEiDCKMoprQ0dsmyQ874-yN7h5Nwd1NVMFTeW5Rgg6RXD3Q/certhash/uEiBBN1_poJQS1J7pkbR7nDsFqFjRgrN51RuBlXsgwdA4Ag/p2p/12D3KooWPKRSU7mX3JiiasLBKYsFhPgiGZNcdv5SxBZrbrU7C8Jw/p2p-circuit/p2p/12D3KooWRG7hywMqYLDWh6EhzoYn5nUMJnHytjjuEK4UvKu2b1JQ') |
or into invalid addresses if that's where it belongs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not the same sort of address as the first entry in the invalid list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im blind. My bad, lgtm
Use exact matchers for filtering webtransport and webrtc addresses so those transports do not try to dial (for example) p2p-circuit addresses, instead leaving the more specific address to other transports.
Use exact matchers for filtering webtransport and webrtc addresses so those transports do not try to dial (for example) p2p-circuit addresses, instead leaving the more specific address to other transports.
Refs: ipfs/helia#267