-
Notifications
You must be signed in to change notification settings - Fork 957
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(relay): revise public API to follow naming convention #3238
Conversation
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.
Thanks, just one question :)
This pull request has merge conflicts. Could you please resolve them @jxs? 🙏 |
and use them across the crate. Deprecate the old ones.
and use them across the crate. Deprecate the v2 ones.
With libp2p#2712 merged, this can be marked as done.
Currently, we create a new cache for each workflow run for each crate. That ends up blowing the maximum allowed cache size of 10GB and GitHub deletes the least-recently used cache again. Effectively, this means we don't have any caching. This patch introduces a cache factory workflow that only runs on master and always _saves_ a new cache. The CI workflow run for pull-requests on the other hand only restore these caches but don't save them.
) This patch deprecates 3 out of 4 functions on `PollParameters`: - `local_peer_id` - `listened_addresses` - `external_addresses` The addresses can be obtained by inspecting the `FromSwarm` event. To make this easier, we introduce two utility structs in `libp2p-swarm`: - `ExternalAddresses` - `ListenAddresses` A node's `PeerId` is always known to the caller, thus we can require them to pass it in. Related: libp2p#3124.
This pull request has merge conflicts. Could you please resolve them @jxs? 🙏 |
This pull request has merge conflicts. Could you please resolve them @jxs? 🙏 |
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.
Very nice! Thank you!
- rename RelayTransport in client doc to transport - make behaviour mod private re-exporting CircuitId - make client mod private re-exporting pub types.
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.
Thanks for pushing this forward, some more thoughts!
- dcutr tests use relay::client instead of just client:: - rename RelayedConnection to RelayedConnection - improve deprcated wording for types, remove the renamed references.
rename RelayedDial to Dial.
This pull request has merge conflicts. Could you please resolve them @jxs? 🙏 |
1 similar comment
This pull request has merge conflicts. Could you please resolve them @jxs? 🙏 |
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.
Sorry to add some more comments, I've had another thorough look and I think we can polish this a bit more :)
no, thank you for doing it so we caught things like the wrong PR link in the changelog! |
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.
Two more things! :)
protocols/relay/tests/lib.rs
Outdated
#[derive(Debug)] | ||
enum ClientEvent { | ||
Relay(client::Event), | ||
Relay(relay::client::Event), | ||
Ping(ping::Event), | ||
} | ||
|
||
impl From<client::Event> for ClientEvent { | ||
fn from(event: client::Event) -> Self { | ||
impl From<relay::client::Event> for ClientEvent { | ||
fn from(event: relay::client::Event) -> Self { | ||
ClientEvent::Relay(event) | ||
} | ||
} |
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.
If you are feeling like deleting a bit more code, we could turn on event_process = true
(which is the default) and remove this. Can easily be done in a follow-up though.
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.
ehe yeah done. Also deleted the ClientEvent
and RelayEvent
that's what you were meaning right? And also removed from the examples.
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.
Yes!
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.
Great improvement :)
Can you open an issue to investigate how we can have the CI pipeline complain about deprecated APIs in docs?
opened #3282 |
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.
Appreciate the work here!
Description
Continues addressing #2217.
Notes
Per commit review is suggested :)
Links to any relevant issues
Open Questions
Change checklist