This document defines contribution rules for Mbongo Chain. All contributors must comply with these requirements.
Canonical references:
- PROTOCOL_LOCK_v0.2.md — Frozen surfaces and forbidden changes
- CONTRIBUTION_TIERS.md — Tier 0/1/2 change rules
- RFC_PROCESS.md — How to propose changes to locked surfaces
Mbongo Chain is a deterministic verification layer for off-chain AI inference receipts. The protocol does not execute AI models on-chain. Validators verify receipts deterministically and settle economic outcomes.
Principles:
- Determinism is mandatory. Given the same inputs and chain state, every node must reach the same result. No non-deterministic behavior in protocol-critical paths.
- Protocol stability. v0.2-devnet-stable is frozen. Changes to locked surfaces require an RFC and version bump.
- Layer discipline. Respect crate boundaries. See ARCHITECTURE_GUARDRAILS.md.
The following require an RFC before any change:
| Surface | Examples |
|---|---|
| Block/tx SCALE encoding | Field set, field order, codec |
| Hashing | BLAKE3 inputs, Merkle scheme, display format |
apply_block rules |
All five validity rules, atomic write_batch |
| Storage trait semantics | get_block_by_height, get_latest_height, batch atomicity |
| P2P wire formats | SyncRequest, SyncResponse, SyncNotification, protocol strings |
| RPC v0.1 | Method names, param types, return types, error codes |
If your change touches a locked surface, file an RFC in docs/rfcs/ and obtain approval before implementing. See RFC_PROCESS.md.
Docs, tooling, CI, logging, metrics, SDK, CLI flags, test harnesses, internal refactors that preserve locked semantics.
- Search existing issues. Open a new issue if none exists.
- Include: reproduction steps, environment (OS, Rust version), expected vs actual behavior, logs.
- Submit a PR targeting
devwith a fix. Reference the issue.
- Locked surface: File an RFC first. Do not implement until RFC is accepted.
- Open surface: Open an issue for discussion. Implement and submit PR targeting
dev.
- Identify gaps in docs/.
- Submit PR with changes. Ensure links are valid and formatting is correct.
- Add unit tests for new logic. Add integration tests for new features.
- Ensure
cargo test --workspacepasses. No regressions.
main: Reserved for audited, stable milestones. Protected. Not a development branch.dev: Active development. All PRs must targetdev. No exceptions.
Rebase on dev before opening a PR:
git fetch origin
git rebase origin/dev- Rust: 1.75 or higher
- Components:
rustfmt,clippy
rustup update stable
rustup component add rustfmt clippycargo build --workspace
cargo test --workspace
cargo clippy --workspace -- -D warnings
cargo fmt --all -- --checkAll checks must pass before opening a PR.
Protocol-critical code must be deterministic. Prohibited in apply_block, block production, and state transitions:
- Random number generation (unless explicitly specified in protocol)
- System time for logic decisions (timestamp in block header is allowed)
- Non-deterministic floating point
- Unordered iteration over
HashMap/HashSetwhere order affects output
cargo fmt --all— Format before commitcargo clippy --workspace -- -D warnings— Zero warnings policy
- Use
Result<T, E>for fallible operations. Use?for propagation. - No
unwrap()orexpect()in production paths. Tests only. - No
unsafewithout explicit justification and review.
Conventional commits: type(scope): subject
feat: New featurefix: Bug fixdocs: Documentationtest: Testsrefactor: Code restructuringchore: Build, CI, dependencies
By contributing, you agree that your contributions are licensed under the Apache License 2.0.
Report security vulnerabilities to info@mbongochain.org. Do not open public issues for security vulnerabilities.
Include: description of the vulnerability, steps to reproduce, potential impact, suggested fix (if any).
PRs may be labeled by change scope:
- tier-0: Core protocol, storage, network,
apply_block. RFC required. Core Maintainer approval. - tier-1: Node orchestration, harnesses, metrics. No RFC. Reviewer approval. Must not break devnet harness.
- tier-2: Docs, tooling, CI, SDK. No RFC. Standard review.
See CONTRIBUTION_TIERS.md for full rules.
- README
- DEV_ONBOARDING.md — Quick start, CLI reference
- VISION_v1.md — Verification layer scope
- PROTOCOL_LOCK_v0.2.md
- RFC_PROCESS.md
- CONTRIBUTION_TIERS.md