Skip to content

Latest commit

 

History

History
71 lines (48 loc) · 1.95 KB

File metadata and controls

71 lines (48 loc) · 1.95 KB

Agent Guidelines

Formatting and Lints

Always run the following after any code modification:

cargo +nightly-2026-04-02 fmt
cargo clippy --workspace --all-targets --all-features -- -D warnings

Formatting requires the nightly .circleci/config.yml pins as fmt_nightly -- .rustfmt.toml uses nightly-only options, and plain cargo fmt drops them silently rather than refusing.

Code comments

Comments must describe the state of the code today -- not a previous state or an alternative state.

Exception: Comments may describe an alternative possible state of the code, if they are documenting a hazard that a future developer may otherwise walk into.

Comments must not describe the rationale for a change.

Rationale may appear in: the commit message and the pull request. You may self-comment on your own github pull request at select positions in the code to aide reviewers.

Comments must help someone who has never heard of this change you are making.

Comments must not state the obvious. Comments that explain what attributes do or how language constructs work are unhelpful.

Modifying BFT Code

When making changes to BFT-related code (anything under node/bft/), run the following checks in order:

1. Unit tests

cargo test -p snarkos-node-bft --lib

2. Build with test features

The CI scripts invoke snarkos by name, so the binary must be on PATH. Build it with the test_network feature and prepend the output directory to PATH:

cargo build --features test_network
export PATH="$PWD/target/debug:$PATH"

3. Devnet test

.ci/test_devnet.sh

4. Additional CI tests

Ask the user whether they want to run the following tests before merging. These cannot run concurrently and take significant time in total, so they are not always run on every change.

.ci/test_partial_upgrade.sh
.ci/test_full_upgrade.sh
.ci/test_restart_majority.sh
.ci/test_reset_minority.sh
.ci/test_restart_all.sh