Thank you for your interest in contributing to CipherBFT! This document provides guidelines and instructions for contributing.
Be respectful, constructive, and professional in all interactions.
git clone https://github.com/your-username/cipherbft.git
cd cipherbftgit checkout -b feature/my-new-feature- Write clear, documented code
- Follow Rust API guidelines
- Add tests for new functionality
- Run quality checks before committing
# Format code
cargo fmt
# Run linter
cargo clippy --all-targets --all-features -- -D warnings
# Run tests
cargo test
# Run all checks
cargo check-allFollow conventional commits:
feat: add new feature
fix: bug fix
refactor: code refactoring
perf: performance improvement
test: add tests
docs: documentation update
style: formatting
chore: build/tooling changes
Max 30 characters per commit message (Constitutional Principle X)
git push origin feature/my-new-featureThen create a PR on GitHub.
- Use
Result<T, E>for fallible operations - Use traits for polymorphism
- No
unwrap()in production code (useexpect()with clear messages in tests only) - Use
Option<T>appropriately
- Zero warnings policy
- Clippy pedantic + nursery lints enabled
- rustfmt applied to all code
- 80%+ test coverage
- All public APIs documented with rustdoc
- TDD workflow: Write tests before implementation
- Unit tests for all business logic
- Integration tests for ABCI communication
- Byzantine fault injection tests
- Network partition tests
- Property-based tests with proptest
- Benchmarks for performance-critical code
- Module-level documentation
- Rustdoc for all public types and functions
- Usage examples in rustdoc comments
- Inline comments for complex logic
- Use async/await for I/O
- Avoid blocking in async context
- Use
Bytesfor zero-copy message passing - Profile hot paths
- Validate all inputs at boundaries
- Use constant-time crypto operations
- Verify all signatures
- Handle Byzantine behavior gracefully
- Update tests: Ensure all tests pass
- Update docs: If changing public APIs
- Update CHANGELOG.md: Note your changes
- Request review: Tag maintainers
- Address feedback: Respond to review comments
- Squash commits: Before merge (if requested)
cargo test# Crate tests
cargo test -p consensus
# Integration tests
cargo test --test integration
# Single test
cargo test test_namecargo install cargo-tarpaulin
cargo tarpaulin --out Html
open tarpaulin-report.html# Run all benchmarks
cargo bench
# Specific benchmark
cargo bench --bench consensus_bench(For maintainers only)
- Update version in
Cargo.toml - Update
CHANGELOG.md - Create git tag:
git tag -a v0.1.0 -m "Release v0.1.0" - Push tag:
git push origin v0.1.0 - CI will build and publish release artifacts
- Open an issue for bugs or feature requests
- Join discussions in GitHub Discussions
- Check documentation in
specs/directory
Thank you for contributing!