Contributing
Thanks for helping. A few rules keep a consensus-critical codebase healthy.
Ground rules
- Determinism is sacred. Anything reachable from
executeBlockmust produce identical results on every node: noDate.now(),Math.random(), floating-point math, or iteration over unsorted maps. UseBigIntfor amounts. - Every state key a transaction touches must be in its access set (
src/tx.js). The lane scheduler relies on it.test/core.test.jsruns a randomized lane-order test; extend it when you add a transaction type. - Conservation must hold.
assertConserved()in the tests checkssupply == balances + bonded + unbonding + accrued rewards. New minting or burning paths need a test that keeps it green. - Consensus changes need a spec change in
docs/in the same pull request, plus a note inCHANGELOG.md. - Zero runtime dependencies. Prefer
node:built-ins. Discuss before adding one.
Workflow
npm test # unit tests + 4-node integration test (~10 s)
npm run bench # check you did not regress execution speed
npm run devnet # manual testing on your own machine (contributors only)Keep pull requests small and focused; include tests that fail without your change. Code style: CommonJS, 'use strict', 2-space indent, comments explain why.
Adding a transaction type
- Add an entry to
TYPESinsrc/tx.jswithcost,check,access,run. - Cost units:
compute~ work,state~ bytes written. Pick numbers by comparison with existing types. - Add tests: success, failure (fee still charged), conservation, and lane-order independence.
- Document it in
docs/protocol.mdandaurenctl.