Commit b6e737b
committed
feat(standard-contracts): prototype C++-driven address derivation in bb
Adds a new `bb derive_standard_contract_addresses` subcommand that reads
freshly-built Noir artifacts and stamps the standard-contract addresses
into `standard_addresses.nr` (in both the aztec-nr/aztec crate and the
aztec_sublib twin) before the rest of noir-contracts compiles against
them. This breaks the build-order chicken-and-egg in the current TS-based
generator: the TS generator depends on the yarn-project build, but the
addresses need to be baked in before noir-contracts finishes.
For auth_registry and public_checks the derived address is byte-identical
to the TS-derived one (verified against the existing pinned values).
Known prototype limitations:
- `artifact_hash` and `private_functions_root` are READ from a sidecar
manifest (`standard_contract_class_id_preimages.json`) instead of being
derived from the artifact in C++. Porting their TS derivation
(sha256-reduced-to-Fr merkle over selectors + metadata hashes, plus
deterministic-JSON-stringify of contract outputs) is the natural
follow-up.
- Bootstrap integration only handles auth_registry + public_checks;
extending to multi_call_entrypoint is mechanical.
- The TS generator (`generate:data`) is left in place as a drift check —
it still produces the same `standard_addresses.nr`, so any divergence
fails the build loudly.1 parent d1ad5e9 commit b6e737b
5 files changed
Lines changed: 677 additions & 10 deletions
File tree
- barretenberg/cpp/src/barretenberg
- api
- bb
- noir-projects/noir-contracts
- yarn-project/standard-contracts/src
0 commit comments