mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-11 22:10:32 +00:00
193b807957
## Description Updates `CONTRIBUTING.md` to include some basic guidance to new contributors and instructions for maintainers for syncing quinn ## Breaking Changes n/a ## Notes & open questions Not meant to be super extensive. We could add more as we find what works best for this repo ## Change checklist <!-- Remove any that are not relevant. --> - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] This PR was created by a human that thought critically about the proposed change and wrote an as clear and concise description as they could. - [x] This PR isn't slop, and is carefully crafted to do have the intented effect. - [x] `cargo make` passes locally.
4.7 KiB
4.7 KiB
Contributing
Thanks for your interest in contributing to noq! noq is a QUIC implementation forked from Quinn, with added support for multipath QUIC, Address discovery and NAT traversal.
Workspace Layout
| Crate | Purpose |
|---|---|
noq |
Async user-facing API (tokio or smol) |
noq-proto |
Sans-io protocol state machine — no I/O, no clocks |
noq-udp |
Low-level UDP with ECN, GRO/GSO, cmsg |
bench |
Criterion benchmarks |
perf |
noq-perf binary for throughput/latency profiling |
fuzz |
libfuzzer targets |
docs/book |
mdBook source |
Architecture
The codebase has a deliberate two-tier split:
noq-protois a pure state machine: deterministic, testable in isolation, no sockets, no internal clock driving the state machine — time is always passed in by the caller. Feed it packets and events; it returns frames to transmit and state changes.noqwrapsnoq-protowith async I/O, timers, and a runtime abstraction. Publicnoqtypes re-export everything fromnoq-protoso callers rarely to depend onnoq-protodirectly.
Code contributions!
A great pull request to noq has:
- An issue linked to it. Discuss solutions with maintainers in the linked issue before diving in. This helps keep contributors and maintainers aligned.
- A title following this pattern:
<type>(<scope>): <description>. If the change is a breaking change it must also include a!:<type>(<scope>)!: <description>.- Types:
typeWhen to use featA new feature testChanges that exclusively affect tests, either by adding new ones or correcting existing ones fixA bug fix docsDocumentation only changes refactorA code change that neither fixes a bug nor adds a feature perfA code change that improves performance depsDependency only updates choreChanges to the build process or auxiliary tools and libraries - Scopes: These mostly mimic the crate. You will likely use one of
noq,proto,udp - Description: A short sentence stating what the changes achieve
- Types:
- A PR description. Please follow the PR template
- A green CI check. Use
cargo maketo catch most issues locally.
Formatting, linting and docs
- Documentation updates follow the style guide.
- Keep comments and docs at 100 character width.
- Run
cargo make formatto ensure your code follows the formatting rules of this repo.
For maintainers
Syncing quinn changes
- Assuming
upstreamis the local name you gave the quinn remote, usegit fetch upstream mainto get the latest changes. - Use
git log --oneline --reverse HEAD..upstream/main, while on updatedmainto check the missing changes. The first change is the oldest one/ first incoming changemaindoes not have - Use
cherry-pickselectively. Dependabot updates should not be cherry-picked, as they need to be fully replicated via the correspondingcargo update -p <dep> --precise <version>. Git can't meaningfully apply these commits only viadiffsinceCargo.lockis automatically generated. - Always use
cherry-pickwith-xe. Use-xto ensure the original commit hash is included in the commit message at the end. Use-eto adapt the commit message to our commits standards. This is necessary to generate a meaningfulCHANGELOG.md - Verify CI status for individual changes. Not everything can be caught via
cargo make, for example due to different targets.
Recording quinn merges in git
When all changes are done, let's call <quinn-hash> the last commit from
quinn we want to record as merged. Let's call <noq-hash> the last commit
that achieves this merged state, before the actual merge is recorded. Make sure
your syncing branch is not behind main, as this merge will be fast-forwards
one. In your syncing branch HEAD should point to <noq-hash>. Now do
git merge <quinn-hash>to begin the merge processgit checkout <noq-hash> .To update all paths to the state in<noq-hash>- Make sure there are no differences with
<noq-hash>, you might need togit rm -r quinn-protoand similar to achieve this. Thengit diff <noq-hash>should be clean. git merge --continueto finish the merge. Let's call<merge-hash>the resulting commit.git push. Always verify against CI that the merge commit is good to go.- After CI gives you green light, locally merge to
noq's main usinggit merge --ff-only <merge-hash>