-
Notifications
You must be signed in to change notification settings - Fork 25
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
refactor: Improve rendezvous protocol usage #399
Merged
Merged
Changes from 24 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
7250f0a
chore: Add rendezvous config and PEM fixtures
bgins 2e270e3
chore: Add peer registered debug log
bgins 7fade98
test: Add rendezvous connect test
bgins e6d9e5e
chore: Add rendezvous server config with false default
bgins 5145d58
chore: Add max connected peers config
bgins d328de7
chore: Add rendezvous server registration expired debug log
bgins 7ea6ff5
test: Add rendezvous disconnect test
bgins 1acc08d
chore: Check identified peer before adding to external addresses
bgins e79ee5f
chore: Add check to not dial self on rendezvous discovery
bgins 24a1512
refactor: Improve dialing after rendezvous discovery
bgins 4e9135d
chore: Add rendezvous ttl config
bgins 0bab542
chore: Improve logs
bgins 2fc7ee8
chore: Add expired rendezvous peer re-discovery
bgins 6dfed94
chore: Add rendezvous discovery interval config
bgins 15f4d32
feat: Add rendezvous rediscovery and registration renewal
bgins 4e0f08d
chore: Add swarm dialing event debug log
bgins 5a5266c
chore: Require expiration cause for redisovery and registration renewal
bgins 5b37c6c
chore: Add extract timestamps test utility
bgins 89e114f
chore: Remove cache Expiration enum
bgins 9f0b227
chore: Add cache polling loop
bgins 4d7ad72
test: Add rendezvous registration renewal test
bgins e709f7c
test: Add rendezvous rediscovery test
bgins 0c5308b
test: Add rediscover on expiration test
bgins 189548e
chore: Update fixture ports and add peer ID comments
bgins fd04b65
chore: Add poll cache to event handler without ipfs feature
bgins b5f31df
chore: Rename our_registration to self_registration
bgins 402a412
chore: Remove unneeded sender clone
bgins e02ce80
chore: Move event handler rendezvous fields into a substruct
bgins c4bbd5f
chore: Move event handler connection fields into a substruct
bgins 0cec3b1
chore: Add poll cache interval config
bgins 263a871
chore: Upgrade to libp2p 0.52.4
bgins 0ea35d0
chore: updates
zeeshanlakhani 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
use_flake | ||
|
||
export RUST_LOG=homestar=debug,homestar_runtime=debug,libp2p=info,libp2p_gossipsub::behaviour=debug,tarpc=info,tower_http=debug | ||
export RUST_LOG=homestar=debug,homestar_runtime=debug,libp2p=info,libp2p_gossipsub::behaviour=debug,tarpc=info,tower_http=debug,moka=debug | ||
export RUST_BACKTRACE=full | ||
export RUSTFLAGS="--cfg tokio_unstable" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE= | ||
-----END PRIVATE KEY----- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI= | ||
-----END PRIVATE KEY----- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM= | ||
-----END PRIVATE KEY----- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ= | ||
-----END PRIVATE KEY----- |
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.
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.
@bgins thinking maybe we do have some substruct here: rendezvous, which has ttl and discovery interval and cookies? Trying to clean up this bit on length here. We may want the same for the two connected peers.
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.
Done! Also added
discovered_peers
to the rendezvous one because it is not relevant for peers discovered through mDNS. We may revisit if we use the proposed ambient discovery protocol in the future.Was slightly unsure about the naming for the connected peers one. Went with this struct:
homestar/homestar-runtime/src/event_handler.rs
Lines 104 to 108 in 1d4079b
Which on the event handler is:
homestar/homestar-runtime/src/event_handler.rs
Line 64 in 1d4079b
And when used we have
event_handler.connections.peers
andevent_handler.connections.max_peers
. In the first one, havingconnections
andpeers
seems a bit redundant? I might be overthinking it.