Skip to content

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

  1. Fork the repository and clone your fork.
  2. Create a feature branch from main.
  3. Make your changes, ensuring they compile and pass tests.
  4. Open a pull request.

Quick Compilation Check

Before running the full test suite, verify that everything compiles (including test code):

cd soil
cargo check --all --tests

Running Tests

Run tests for the crate you changed:

cargo test -p <crate-name> --release

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.toml configures clippy lints — run cargo clippy --all --tests to check.
  • Keep changes focused. A bug fix should not include unrelated refactoring.

Adding a New Pallet

  1. Create a new directory under runtime/ (for core pallets) or contrib/ (for optional pallets).
  2. Use the plant- prefix for the crate name.
  3. Add the crate to the workspace members list in Cargo.toml.
  4. Add a workspace dependency entry so other crates can reference it.
  5. 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.