-
Notifications
You must be signed in to change notification settings - Fork 963
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
feat(swarm)!: allow NetworkBehaviour
s to manage connections
#3254
Merged
Merged
Changes from all commits
Commits
Show all changes
199 commits
Select commit
Hold shift + click to select a range
9b01d61
Use GATs to avoid lifetimes on trait interface
thomaseizinger 4d246dc
Bump MSRV accordingly
thomaseizinger 74a2758
Bump MSRV of libp2p-metrics
thomaseizinger b25176f
Merge branch 'master' into feat-kademlia/use-gats
thomaseizinger c1e880c
Refactor dialling to have a more linear flow
thomaseizinger 82ae04d
Introduce new callbacks for connection management
thomaseizinger c494cd4
Fix up some more code
thomaseizinger 2c23ac2
Complete deprecation notice
thomaseizinger b65bbbc
Fix some more errors
thomaseizinger acfc50e
Refine deprecation message
thomaseizinger ca04985
Delegate to `addresses_of_peer` by default
thomaseizinger 6a73454
Add hack to clear listen addresses
thomaseizinger 644cbeb
Merge branch 'master' into feat-kademlia/use-gats
thomaseizinger ddea596
Merge branch 'feat-kademlia/use-gats' of github.com:libp2p/rust-libp2…
thomaseizinger e6e33c5
Add changelog entry
thomaseizinger e612feb
Merge branch 'master' into 2824-deprecate-into-connection-handler
thomaseizinger 9a5ce29
Use an atomic counter to avoid collisions on connection IDs
thomaseizinger 1662273
Fix minor compile error
thomaseizinger 5c944e6
Fill in a few more bits
thomaseizinger 59bcc9f
Don't be generic over transport
thomaseizinger a1c55b2
Remove type parameter for transport error
thomaseizinger 7132ff5
Remove unnecessary type hint
thomaseizinger 01efa8f
Remove type parameters from `ConcurrentDial`
thomaseizinger b0f2678
Fix rustfmt
thomaseizinger 52cbaf6
Merge branch 'feat-kademlia/use-gats' into 2824-deprecate-into-connec…
thomaseizinger 7efc3c5
Merge branch '2824-simplify-dial-opts' into 2824-deprecate-into-conne…
thomaseizinger db6fcc5
Merge branch '2824-no-generic-transport-pool' into 2824-deprecate-int…
thomaseizinger d3a259e
Remove `PendingConnectionDenied`
thomaseizinger e89ec57
Handle new DialError variants
thomaseizinger b0ee140
Make `libp2p-kad` compile
thomaseizinger 20d93bb
Fix a few more errors
thomaseizinger 138feb2
No more compile errors!
thomaseizinger 6f9298a
Merge branch 'master' into 2824-deprecate-into-connection-handler
thomaseizinger 796432a
Undo explicit `Sized` bound
thomaseizinger dfd349f
Let user know that we are discarding addresses
thomaseizinger 600791d
Fix unused variable warning
thomaseizinger 72fecc8
Fix unused import warnings
thomaseizinger 62b11aa
Port `dcutr` protocol
thomaseizinger 75d1f5a
Re-implement relay
thomaseizinger 03dd88f
Fix some deprecation warnings
thomaseizinger 760604f
Fix some deprecation warnings kad
thomaseizinger 87ad92b
Port autonat
thomaseizinger 6f5a2c8
Port identify
thomaseizinger e455317
Fix more deprecation warnings
thomaseizinger 912f35d
Ignore clippy warning
thomaseizinger c5cbfbd
Fix derive and remove todo
thomaseizinger 0b10f45
Make derive tests compile by using type alias
thomaseizinger dc59e81
Ignore clippy warnings in generated code
thomaseizinger ceda44c
Fix more warnings by allowing deprecations
thomaseizinger ec06475
Merge branch 'master' into 2824-deprecate-into-connection-handler
thomaseizinger 18426d1
Remove unnecessary `extern crate`
thomaseizinger bae533e
Revert let-else usage
thomaseizinger 80295ac
Less let else
thomaseizinger 05988cc
No let else in mdns
thomaseizinger f22f5a2
No let-else in dcutr
thomaseizinger c7871d1
No let else in rendezvous
thomaseizinger 10c3161
Last let-else usage
thomaseizinger de2d837
Remove fn from bad merge
thomaseizinger a6616aa
Minimize diff
thomaseizinger 848ac79
Attempt to minimize diff
thomaseizinger 65521e2
Undo re-ordering to reduce diff
thomaseizinger 6f7d7f0
Minimize diff (and fix bad merge)
thomaseizinger 27f04cc
Remove default impl for `ConnectionId` in favor of `next`
thomaseizinger 2b13bd4
Deprecate `IntoMultiHandler`
thomaseizinger e8c9942
Implement dial failure reporting
thomaseizinger f51f0aa
Fix formatting
thomaseizinger 3a84c14
Use single quotes to avoid running commands
thomaseizinger 458aa53
Use intermediary variable
thomaseizinger d0d8b77
Make connection IDs globally unique
thomaseizinger 11e5f74
Deprecate old new function
thomaseizinger 47cf01f
Add changelog entry
thomaseizinger 341d096
Merge branch 'master' into no-run-title-as-command
thomaseizinger f77e443
Remove `handler` field from `NetworkBehaviourAction::Dial`
thomaseizinger f6cf751
Port dcutr protocol
thomaseizinger 08c5160
Port relay protocol
thomaseizinger 8e0d7d8
Add changelog entry to swarm
thomaseizinger b337ec1
Merge branch 'no-run-title-as-command' into 2824-unique-connection-ids
thomaseizinger 3c4ab32
Merge branch '2824-unique-connection-ids' into 2824-no-handler-in-dial
thomaseizinger 1beec8c
Remove ordering functionality from `ConnectionId`
thomaseizinger eb48acb
Merge branch '2824-unique-connection-ids' of github.com:libp2p/rust-l…
thomaseizinger de9f152
Remove unnecessary visibility qualifiers
thomaseizinger 7692c77
Convert `DialOpts` to struct variant
thomaseizinger b492236
Eagerly set defaults in `DialOpts`
thomaseizinger 92b2985
Merge branch '2824-refactor-dial-opts' into 2824-no-handler-in-dial
thomaseizinger 951a0dc
Make `ConnectionId` part of `DialOpts`
thomaseizinger 41e49a5
Inline `_dial`
thomaseizinger 3547b53
Rustfmt
thomaseizinger 75b30ac
Fix wrong default
thomaseizinger 30df5c8
Merge branch '2824-refactor-dial-opts' into 2824-no-handler-in-dial
thomaseizinger 6e58cb9
Merge branch 'master' into 2824-deprecate-into-connection-handler
thomaseizinger 3d91173
Merge branch 'master' into 2824-unique-connection-ids
thomaseizinger aa19d69
Merge branch '2824-unique-connection-ids' of github.com:libp2p/rust-l…
thomaseizinger 0f53692
Merge branch 'master' into 2824-unique-connection-ids
thomaseizinger 4084846
Merge branch '2824-unique-connection-ids' into 2824-no-handler-in-dial
thomaseizinger 42c9758
Expand changelog entry
thomaseizinger 14b9841
Move most important changelog entry to the top
thomaseizinger 1a3a100
Add more text to changelog entry
thomaseizinger 5535395
Fix formatting
thomaseizinger 244c171
Merge branch 'master' into 2824-unique-connection-ids
thomaseizinger a82e087
Merge branch '2824-unique-connection-ids' into 2824-no-handler-in-dial
thomaseizinger 5c86d66
Merge branch '2824-no-handler-in-dial' into 2824-deprecate-into-conne…
thomaseizinger 70690da
Fix most errors
thomaseizinger b536773
Merge branch 'master' into 2824-unique-connection-ids
mergify[bot] 64a333d
Merge branch 'master' into 2824-unique-connection-ids
thomaseizinger 867c880
Merge branch '2824-unique-connection-ids' into 2824-no-handler-in-dial
thomaseizinger 74be0d7
Merge branch '2824-no-handler-in-dial' into 2824-deprecate-into-conne…
thomaseizinger 649745c
Fix implementation of dcutr
thomaseizinger 7216a1a
Reduce diff
thomaseizinger eb8f8b5
Undo accidential change
thomaseizinger 05337d5
Reduce diff
thomaseizinger 338c35a
Attempt to reduce diff
thomaseizinger e97d899
Merge branch 'master' into 2824-no-handler-in-dial
thomaseizinger c0a7d2a
Remove unnecessary `..`
thomaseizinger 5dce749
Merge branch '2824-no-handler-in-dial' into 2824-deprecate-into-conne…
thomaseizinger 04da3b4
WIP
thomaseizinger 2384c72
Remove unused error variant
thomaseizinger 49d2326
Apply suggestions from code review
thomaseizinger 6b335e9
Merge branch '2824-remove-unused-error' into 2824-introduce-listen-error
thomaseizinger 439628f
WIP
thomaseizinger 494d131
Remove unused `DialError::ConnectionIo` variant
thomaseizinger 9eed96e
Merge branch '2824-remove-unused-error' into 2824-remove-unused-conne…
thomaseizinger e389876
add changelog entry
thomaseizinger f5c2a0e
Fix missing colon
thomaseizinger 11eeed8
Merge branch '2824-remove-unused-connection-error' into 2824-introduc…
thomaseizinger a553ab7
Remove unused `ConnectionIo` variant from `ListenError`
thomaseizinger 717e2d7
Update docs
thomaseizinger be9bb13
Add changelog entry
thomaseizinger e2476a3
Update changelog
thomaseizinger 8e20996
Merge branch 'master' into 2824-no-handler-in-dial
thomaseizinger 62bd505
Merge branch '2824-introduce-listen-error' into 2824-deprecate-into-c…
thomaseizinger 130ef66
Report cause of denied connection
thomaseizinger dbebfd0
Introduce dedicated error type
thomaseizinger f545594
Don't comment docs
thomaseizinger 1c99ff1
Fix docs
thomaseizinger d9f8567
Migrate `CallTraceBehaviour`
thomaseizinger 478854e
Temporarily allow usage of `new_handler`
thomaseizinger 5da8dce
Refactor gossipsub config handler to avoid calls to trait functions
thomaseizinger 2a12efe
Undo bad doc comment change
thomaseizinger da9c926
Fix rustdocs
thomaseizinger 7651d4a
Fix deprecation warnings
thomaseizinger 096a303
Fix failing gossipsub test
thomaseizinger 0dcee3e
Fix more docs
thomaseizinger 0c706d5
Fix beta clippy
thomaseizinger c5f3320
Actually fix beta clippy
thomaseizinger ab35c11
Resolve remaining todos
thomaseizinger 9a420e4
Don't use else block if we return in the previous one
thomaseizinger f5f37ab
Remove closure in favor of spawning connection from the outside
thomaseizinger e867b26
Merge branch 'master' into 2824-no-handler-in-dial
thomaseizinger dd1eb8c
Add `ConnectionId` to `ListenFailure`
thomaseizinger 32a465b
Clean up pending commands on failure
thomaseizinger 91f942f
Add docs and fix bug
thomaseizinger 6f19246
Merge branch 'master' into 2824-no-handler-in-dial
thomaseizinger d704e89
Consistently use `THandlerInEvent`
thomaseizinger 55baab1
Use type alias
thomaseizinger 2c84f28
Remove unnecessary indentation and "quote"-ing
thomaseizinger cf77246
Fix bad changelog entry
thomaseizinger 72640a0
Merge branch '2824-no-handler-in-dial' into 2824-deprecate-into-conne…
thomaseizinger 55f922d
Spawn connection at right point in time
thomaseizinger a2dfc39
Attempt to reduce diff
thomaseizinger e38002e
Reduce diff further
thomaseizinger 5798081
Less diff ...
thomaseizinger 67577a7
Don't override deprecated callbacks anywhere
thomaseizinger 91a7a70
Better order of callbacks
thomaseizinger 92a9625
Spawn connection at right point in time
thomaseizinger 6df1c9a
Be consistent in order of parameters
thomaseizinger 87ef2be
Merge branch '2824-no-handler-in-dial' into 2824-deprecate-into-conne…
thomaseizinger 17db8b4
Reduce diff
thomaseizinger d90ac81
Fix rustdoc
thomaseizinger cfe9f95
One more missing rustdoc link
thomaseizinger b7fb23f
Merge branch '2824-no-handler-in-dial' into 2824-deprecate-into-conne…
thomaseizinger 3f8f73c
Remove `banned_peer_connections`
thomaseizinger 063ef5c
Fix test
thomaseizinger 751cad4
Remove duplication around detecting relayed addresses in `libp2p-relay`
thomaseizinger 9462dbe
Extract utility fn for dcutr protocol
thomaseizinger 639b9da
Remove unused import
thomaseizinger 0bcfe81
Remove underscore from used variable
thomaseizinger 26f6cf0
Merge branch 'master' into 2824-no-handler-in-dial
thomaseizinger 95cde92
Add changelog entry
thomaseizinger 2efe073
Add footnote
thomaseizinger 916fe57
Don't use footnotes
thomaseizinger c3ba2e3
Merge branch 'master' into 2824-no-handler-in-dial
thomaseizinger 3ecd623
Inline `spawn` function
thomaseizinger 02cbf42
Box future inside `spawn`
thomaseizinger 1c906db
Merge impl blocks
thomaseizinger 87cf5fd
Gracefully close connection to banned peer
thomaseizinger 5a2cc76
Merge branch '2824-no-handler-in-dial' into 2824-deprecate-into-conne…
thomaseizinger e74ea67
Ensure new connections are either spawned or gracefully closed
thomaseizinger f204859
Ignore error when closing connection
thomaseizinger ade4421
Merge branch '2824-no-handler-in-dial' into 2824-deprecate-into-conne…
thomaseizinger 31407ac
Merge branch 'master' into 2824-deprecate-into-connection-handler
thomaseizinger fb93cd6
Fix compile error
thomaseizinger 82e3aca
Restore `IntoEitherHandler`
thomaseizinger 2a44198
Don't underscore used variable
thomaseizinger 88e0e62
Merge branch 'master' into 2824-deprecate-into-connection-handler
thomaseizinger 7bae092
Undo merge conflicts with #3465
thomaseizinger 0ca08c1
Call out limitations in Rust compiler
thomaseizinger dd4e374
Move manage conn entry to top of changelog
thomaseizinger 392b0d2
Fix fmt
thomaseizinger 4f38189
Merge branch 'master' into 2824-deprecate-into-connection-handler
thomaseizinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Can you expand on this comment?
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.
"dcutr" cares about who the dialer and listener on a relayed connection is. Now that we have different callbacks for this, it is even more obvious that we could split this logic into two handlers instead of being conditional on the
ConnectedPoint
within the single handler. That would remove somepanic!
s in the implementation that are unreachable.