Contributing¶
Soil is open source and welcomes contributions. This page covers the basics of working with the codebase.
Repository¶
The source code is hosted at github.com/soil-rs/soil. The main workspace lives under the soil/ subdirectory.
Development Workflow¶
- Fork the repository and clone your fork.
- Create a feature branch from
main. - Make your changes, ensuring they compile and pass tests.
- Open a pull request.
Quick Compilation Check¶
Before running the full test suite, verify that everything compiles (including test code):
Running Tests¶
Run tests for the crate you changed:
For example:
cargo test -p plant-balances --release
cargo test -p subsoil --release
cargo test -p topsoil-core --release
The full test suite (cargo test --all --release) takes over 30 minutes and is run by CI on every pull request.
Code Style¶
- Follow standard Rust conventions (
rustfmt,clippy). - The workspace-level
Cargo.tomlconfigures clippy lints — runcargo clippy --all --teststo check. - Keep changes focused. A bug fix should not include unrelated refactoring.
Adding a New Pallet¶
- Create a new directory under
runtime/(for core pallets) orcontrib/(for optional pallets). - Use the
plant-prefix for the crate name. - Add the crate to the workspace members list in
Cargo.toml. - Add a workspace dependency entry so other crates can reference it.
- Include tests in the pallet crate or add a dedicated test crate under
harness/.
Upstream Merges¶
Soil periodically merges changes from upstream polkadot-sdk. These merges are tracked and managed separately. If your contribution conflicts with an upstream merge, the maintainers will help resolve it.
License¶
By contributing to Soil, you agree that your contributions will be licensed under the GPL-3.0-or-later with the Classpath Exception 2.0.