tl;dr — Every change (commit or PR) must include code + tests + docs and pass
fmt,clippy, and CI.
This repository implements an Amadeus blockchain node. Contributions are welcome and reviewed with a focus on the correctness, safety, determinism, maintainability, and performance.
- Mainline-first (trunk-based): short‑lived topic branches merge to
mainquickly; keep diffs small. - Single responsibility: each change solves one thing end‑to‑end.
- Public review: all code lands via review (even maintainer changes).
- Respectful conduct: see
CODE_OF_CONDUCT.md.
- License: Apache‑2.0. Add SPDX headers to new files.
- DCO required: sign off every commit with
git commit -sS(addsSigned-off-by: Name <email>and GPG signs). - CLA: Not required yet. We may introduce a CLA later.
- Default branch:
main(protected). - Create a fork and work in your local fork, feel free to use any branch name.
- Rebase locally to keep a linear history. Only force‑push your topic branch to amend the last commit.
- Short, imperative subject, e.g.
add ping protocol message,fix tokio memory leak. - Recommended (for tooling & changelogs): Conventional Commits minimal set:
feat: …,fix: …,perf: …,refactor: …,docs: …,test: …,chore: …,build: ….- Use
BREAKING CHANGE:in body (or!after type) when applicable.
- Keep subject ≤ 72 chars; wrap body at 80; reference issues
(#123)when relevant.
Even if you commit directly (during early rewrite), treat each commit like a PR: include code, tests, docs, and pass checks.
When opening PRs:
- One problem per PR; aim for small, focused diffs.
- Show how you tested (commands, data); link to design notes if behavior changes.
- Request at least 1 reviewer; 2 for consensus‑critical logic.
- Address review comments with new commits (not amend) until final squash; resolve threads explicitly.
- PRs may be closed if inactive for 30 days; re‑open with context.
PR Template (.github/PULL_REQUEST_TEMPLATE.md):
### Summary
### Rationale / design notes
### Risks & mitigations
### Testing done
- [ ] unit tests
- [ ] manual testing
- [ ] docs updated
### Checklist
- [ ] \`cargo test-all`
- [ ] \`cargo fmt --all --check\`
- [ ] \`cargo clippy --all-targets --all-features\`
- [ ] \`cargo deny check\`- Formatting:
rustfmtenforced; runcargo fmt --all --checkin CI. Configure viarustfmt.toml. - Clippy: treat warnings as errors in CI:
cargo clippy --all-targets --all-features. - Avoid
unsafeunless essential; justify and isolate it; test thoroughly. - Avoid
unwrap/expectin long‑running paths; prefer?or explicit error handling, add comments for justification. - Use
tracingfor logs; noprintln!in library/runtime code. - For unimplemented functions leave
todo!(),unimplemented!(), orunreachable!(). - For additional improvements, leave
// TODO: ...or// FIXME: ...comments
- Every change ships tests:
- Unit tests for new/changed code.
- Manual tests for overall correct node behavior.
- Determinism: consensus‑critical code must be deterministic across platforms; avoid time/locale/FS nondeterminism; fix RNG seeds.
- Concurrency: add tests for race conditions; use
loomwhere feasible. - Performance: add benchmarks for hot paths; include baseline comparisons when refactoring.
- Set
RUSTFLAGS='-D warnings'for tests.
- Public APIs have Rustdoc comments with examples.
- Record design decisions in
/docs/CONSENSUS.md(Architecture Decision Records). - Update protocol specs / message formats in
/docs/PROTOCOL.mdwith versioning. - Keep README quickstart up‑to‑date when CLI or config changes.
- Reporting: see
SECURITY.md. - Dependencies: check in
Cargo.lock; runcargo deny check. - Cryptography: use well‑reviewed crates; no home‑rolled crypto; constant‑time where applicable.
- Secrets: never commit keys or credentials; use env vars or secret managers.
- Fuzzing: maintain
cargo fuzztargets for parsers/decoders; run periodically. - Threat model docs for P2P, consensus, and RPC surfaces.
- Use SemVer in the core library; document MSRV bumps as breaking.
- Tag releases
vX.Y.Z; publish release notes derived from commits/PRs. - For protocol changes that break compatibility, bump the major version number.
Publishing the release (you need to run cargo install cargo-release):
# Example of creating a release without push to crates.io
cargo release --workspace -x --sign --no-publishrustup toolchain install stable
rustup component add rustfmt clippy
cargo build --workspace
cargo test --workspace --all-features
cargo fmt --all --check
cargo clippy --all-targets --all-features- Security issues: see
SECURITY.md. - Questions: open a discussion or issue.
We use a CODEOWNERS fallback team:
- Code owner team:
@amadeus-robot/core-maintainers.