Contributing
This guide covers the contribution process and requirements for CoW Protocol Services.
Before You Start
Discussion First
Non-trivial changes require maintainer approval before development begins. Only minor updates like typos or small refactors bypass this requirement. Open a GitHub issue or discussion to propose your changes.
Workflow Process
- Fork the repository and create descriptive feature branches
- Make changes with accompanying tests for new functionality
- Run formatting tools:
just fmt and just fmt-toml
- Execute linting with Clippy:
cargo clippy --all-targets --all-features
- Test locally before pushing
- Create a PR with a completed template explaining the changes
Code Quality Standards
The project enforces strict formatting using the nightly Rust toolchain and Tombi for TOML files.
Always use the nightly toolchain for formatting. Never use stable cargo fmt.
# Rust formatting
cargo +nightly fmt
# TOML formatting
just fmt-toml
Testing
All pull requests must pass the complete test suite, including unit tests, database tests, and end-to-end tests where applicable.
Always use cargo nextest run, never cargo test.
Code Style
- Imports: Group by external crates, internal modules, and local imports
- Comments: Explain why changes were made rather than restating code logic
- Error handling: Use
anyhow::Result for consistent failure management
- Naming: Use descriptive, self-documenting names
Pull Request Requirements
Every PR should:
- Include tests for new functionality
- Pass all CI checks (formatting, linting, tests)
- Have a clear description of changes and motivation
- Follow the PR template provided in the repository
Contributors solving “help wanted” issues can earn financial rewards. Contributors need to provide a Gnosis Chain address for payment processing.