Skip to content
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(iroh): Modularize protocol #2454

Merged
merged 17 commits into from
Jul 4, 2024
Merged

refactor(iroh): Modularize protocol #2454

merged 17 commits into from
Jul 4, 2024

Conversation

rklaehn
Copy link
Contributor

@rklaehn rklaehn commented Jul 3, 2024

Description

Use a newly created macro crate https://github.com/n0-computer/nested-enum-utils to allow for from/to conversions for deeply nested enums.

This allows us to split the protocol enum into multiple parts without changing anything about the basic concept of how things are handled.

Breaking Changes

Weirdly, I think there should be none since the protocol is private.

Notes & open questions

Obvious next steps would be

  • define the subsystem specific messages in submodules
  • publish the macro crate
  • (maybe) split up the handling of the different subsystems
  • (maybe) remove the subsystem prefixes from the messages

Not so obvious next steps (maybe next PR)

  • Allow moving the subsystem protocols to different crates. This is difficult because you can not set the target when generating the conversions.

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@rklaehn rklaehn changed the title Modularize protocol refactor(iroh): Modularize protocol Jul 3, 2024
Also a sizes test, just so we know where the bytes go...
@rklaehn rklaehn marked this pull request as ready for review July 3, 2024 16:38
@rklaehn
Copy link
Contributor Author

rklaehn commented Jul 4, 2024

There is a second thing we may or may not want to do: we might want to make the individual subsystem protocols self-contained so that they reexport all the things they need. But I would prefer to do this in a subsequent PR since this one is big enough as it is.

iroh/src/node/rpc.rs Outdated Show resolved Hide resolved
@rklaehn rklaehn enabled auto-merge July 4, 2024 17:00
@rklaehn rklaehn added this pull request to the merge queue Jul 4, 2024
Merged via the queue into main with commit 5aa3fb6 Jul 4, 2024
25 checks passed
matheus23 pushed a commit that referenced this pull request Nov 14, 2024
## Description

Use a newly created macro crate
https://github.com/n0-computer/nested-enum-utils to allow for from/to
conversions for deeply nested enums.

This allows us to split the protocol enum into multiple parts without
changing anything about the basic concept of how things are handled.

## Breaking Changes

Weirdly, I think there should be none since the protocol is private.

## Notes & open questions

Obvious next steps would be
- [x] define the subsystem specific messages in submodules
- [x] publish the macro crate
- [x] (maybe) split up the handling of the different subsystems
- [x] (maybe) remove the subsystem prefixes from the messages

Not so obvious next steps (maybe next PR)
- Allow moving the subsystem protocols to different crates. This is
difficult because you can not set the target when generating the
conversions.

## Change checklist

- [x] Self-review.
- [x] Documentation updates if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
@rklaehn rklaehn deleted the modularize-protocol branch November 20, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants