Skip to content

Commit

Permalink
refactor(iroh): Modularize protocol (#2454)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
rklaehn authored Jul 4, 2024
1 parent d4c43c0 commit dbc8446
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dbc8446

Please sign in to comment.