Skip to content

refactor(rendezvous): rewrite using libp2p-request-response#4051

Merged
mergify[bot] merged 37 commits intolibp2p:masterfrom
dgarus:3878-rendezvous-based-on-req-resp
Jun 14, 2023
Merged

refactor(rendezvous): rewrite using libp2p-request-response#4051
mergify[bot] merged 37 commits intolibp2p:masterfrom
dgarus:3878-rendezvous-based-on-req-resp

Conversation

@dgarus
Copy link
Copy Markdown
Contributor

@dgarus dgarus commented Jun 8, 2023

Description

Fixes #3878.

Notes & open questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@dgarus
Copy link
Copy Markdown
Contributor Author

dgarus commented Jun 8, 2023

@thomaseizinger
Hello, Thomas!
I did the first version of the PR, could you please take a look?
I have a problem with the can_combine_client_and_server test and while I don't catch why.

Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work! I'll do an in-depth review early next week!

@dgarus dgarus marked this pull request as ready for review June 9, 2023 12:38
@thomaseizinger
Copy link
Copy Markdown
Contributor

Clippy seems to be unhappy :)

@dgarus
Copy link
Copy Markdown
Contributor Author

dgarus commented Jun 9, 2023

Clippy seems to be unhappy :)

Clippy is satisfied now

Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This is a really high-quality contribution!

A few minor comments but overall this looks really good :)

dgarus and others added 3 commits June 12, 2023 22:38
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
@thomaseizinger thomaseizinger changed the title feat: Rendezvous based on libp2p-request-response protocol refactor(rendezvous): rewrite using libp2p-request-response Jun 13, 2023
@dgarus
Copy link
Copy Markdown
Contributor Author

dgarus commented Jun 13, 2023

Thank you! This is a really high-quality contribution!

A few minor comments but overall this looks really good :)

Thanks for your high estimation of my contribution, it really motivates me!

@dgarus
Copy link
Copy Markdown
Contributor Author

dgarus commented Jun 13, 2023

@thomaseizinger
I fixed your comments, please, take a look.

Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I am looking forward to merging this.

A few more comments.

@dgarus
Copy link
Copy Markdown
Contributor Author

dgarus commented Jun 14, 2023

@thomaseizinger
Hello!
Thank you so much for the review.

I fixed your comments, please, take a look.

Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up commits. A few more things but this is very close to being ready :)

None
}
_ => unreachable!(),
_ => unreachable!("rendezvous clients never receive requests"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't safe. We cannot statically ensure that we don't receive a request, the remote could send us any message.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In follow-up work, we could redesign this to have two enums: one for requests and one for responses. Then our codec could ensure that and inbound message on the client is always a response.

@dgarus
Copy link
Copy Markdown
Contributor Author

dgarus commented Jun 14, 2023

@thomaseizinger

I removed RendezvousCodec and implemented Decoder/Encoder for Codec.
Looks good to me )) Could you please review?

Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done, just one final comment!

@thomaseizinger
Copy link
Copy Markdown
Contributor

I removed RendezvousCodec and implemented Decoder/Encoder for Codec.

Good idea!!

Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for doing this refactoring!

It is one of the main remaining blockers for #3268 which is an improvement I am very much looking forward to!

@thomaseizinger
Copy link
Copy Markdown
Contributor

We didn't have to touch a single line in the tests! A picture-perfect refactoring!

@dgarus
Copy link
Copy Markdown
Contributor Author

dgarus commented Jun 14, 2023

Thanks a lot for doing this refactoring!

It is one of the main remaining blockers for #3268 which is an improvement I am very much looking forward to!

Thank you a lot for the review!

@mergify mergify bot merged commit b8ceecc into libp2p:master Jun 14, 2023
@dgarus dgarus deleted the 3878-rendezvous-based-on-req-resp branch June 15, 2023 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rendezvous: rewrite using libp2p-request-response

2 participants