refactor(relay): revise public API to follow naming convention#3238
refactor(relay): revise public API to follow naming convention#3238mergify[bot] merged 34 commits intolibp2p:masterfrom
Conversation
thomaseizinger
left a comment
There was a problem hiding this comment.
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? 🙏 |
thomaseizinger
left a comment
There was a problem hiding this comment.
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.
thomaseizinger
left a comment
There was a problem hiding this comment.
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? 🙏 |
thomaseizinger
left a comment
There was a problem hiding this comment.
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! |
thomaseizinger
left a comment
There was a problem hiding this comment.
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.
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.
ehe yeah done. Also deleted the ClientEvent and RelayEvent that's what you were meaning right? And also removed from the examples.
thomaseizinger
left a comment
There was a problem hiding this comment.
Great improvement :)
Can you open an issue to investigate how we can have the CI pipeline complain about deprecated APIs in docs?
opened #3282 |
Description
Continues addressing #2217.
Notes
Per commit review is suggested :)
Links to any relevant issues
Open Questions
Change checklist