Contributing
Required Checks
cargo fmt --all -- --checkcargo check-allcargo test-allcargo lint
CI (.github/workflows/ci.yml) runs all four; format drift is now a hard gate.
Devcontainer Networking
- NtN/P2P uses TCP. Bind listener rehearsals to
0.0.0.0:<port>when another container or host process must connect;127.0.0.1:<port>is only for in-container loopback tests. - NtC uses a Unix socket, not a TCP port. The devcontainer exports
CARDANO_NODE_SOCKET_PATH=/workspaces/Cardano-node/tmp/preview-producer/run/preview-producer.socksocardano-cliandyggdrasil-node querycan target the preview producer by default. - Forwarded development ports are
3001for the standard NtN peer port,13001for the local preview relay P2P rehearsal,12798for docker-compose metrics,19002for the preview producer metrics, and the runbook metrics ports9001,9099, and9101. - Keep socket paths under the workspace or
/tmpso they are accessible to tools launched inside the container. For host-side Cardano tools, prefer running them inside the devcontainer unless the host OS reliably supports Unix sockets on the workspace mount.
Expectations
- Preserve crate boundaries and avoid reaching across them casually.
- Keep error types explicit in library crates.
- Do not use
unwrap,dbg!, ortodo!in committed code. - Add tests for new domain logic, especially in consensus, ledger, and crypto code.
- Keep
AGENTS.md,README.md, and docs in sync with implemented behavior whenever milestones shift.
CBOR Codecs
- Per-era
CborEncode/CborDecodeimpls undercrates/ledger/src/eras/*/cbor.rsare hand-coded against upstream CDDL. - Upstream CDDL is the authoritative spec source:
.reference-haskell-cardano-node/deps/cardano-ledger/eras/<era>/impl/cddl/data/<era>.cddl. - Cite the relevant CDDL rule (and the Haskell
Cardano.Ledger.<Era>.<Module>module) in the doc comment of each codec. - Pin canonical-encoding behavior with golden round-trip tests against upstream test vectors under
specs/upstream-test-vectors/andcrates/ledger/tests/.
Unsafe Code
- Unsafe code is not expected during the foundation phase.
- Any future unsafe code must be isolated, justified with
SAFETY:comments, and reviewed explicitly.