diff --git a/.github/workflows/bb-sanitizers.yml b/.github/workflows/bb-sanitizers.yml index cc2942c00d8e..02e01555c2f4 100644 --- a/.github/workflows/bb-sanitizers.yml +++ b/.github/workflows/bb-sanitizers.yml @@ -2,10 +2,10 @@ # Unlike most jobs uses free 4 core github runners of which we have lots of capacity (of total 1000 concurrency). name: BB MSAN on: - push: - branches: - - master - - "*/bb-sanitizers*" +# push: +# branches: +# - master +# - "*/bb-sanitizers*" workflow_dispatch: inputs: branch: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 719829774161..673bb2cd83b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -447,6 +447,7 @@ jobs: - name: Copy Network Logs if: always() run: scripts/copy_from_tester yarn-project/end-to-end/scripts/network-test.log network-test.log || true + - name: Upload Network Logs if: always() uses: actions/upload-artifact@v4 @@ -490,6 +491,7 @@ jobs: run: scripts/copy_from_tester barretenberg/cpp/bench.json bench.json || true - name: Store benchmark result if: github.ref == 'refs/heads/master' + continue-on-error: true uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29 with: name: C++ Benchmark diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index 83496bc3be01..b1074a4550d3 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -22,6 +22,11 @@ on: description: Whether to respect the Terraform lock required: false default: "true" + sepolia_deployment: + description: "Whether to deploy on Sepolia network (default: false)" + required: false + type: boolean + default: false concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -46,6 +51,7 @@ jobs: deployment_mnemonic_secret_name: ${{ github.event.inputs.deployment_mnemonic_secret_name }} deployment_salt: ${{ github.event.inputs.deployment_salt }} respect_tf_lock: ${{ github.event.inputs.respect_tf_lock }} + sepolia_deployment: ${{ github.event.inputs.sepolia_deployment }} secrets: GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} @@ -127,11 +133,20 @@ jobs: # wait for port-forwards to establish sleep 5 - docker run --rm --network host $AZTEC_DOCKER_IMAGE bootstrap-network \ - --rpc-url http://127.0.0.1:$PXE_PORT \ - --l1-rpc-url http://127.0.0.1:$ETHEREUM_PORT \ - --l1-chain-id "$L1_CHAIN_ID" \ - --mnemonic "$MNEMONIC" \ - --json | tee ./basic_contracts.json + if ${{ inputs.sepolia_deployment }}; then + docker run --rm --network host $AZTEC_DOCKER_IMAGE bootstrap-network \ + --rpc-url http://127.0.0.1:$PXE_PORT \ + --l1-rpc-url ${{ secrets.SEPOLIA_EXTERNAL_HOST }} \ + --l1-chain-id "$L1_CHAIN_ID" \ + --l1-private-key ${{ secrets.SEPOLIA_L1_DEPLOYMENT_PRIVATE_KEY }} \ + --json | tee ./basic_contracts.json + else + docker run --rm --network host $AZTEC_DOCKER_IMAGE bootstrap-network \ + --rpc-url http://127.0.0.1:$PXE_PORT \ + --l1-rpc-url http://127.0.0.1:$ETHEREUM_PORT \ + --l1-chain-id "$L1_CHAIN_ID" \ + --mnemonic "$MNEMONIC" \ + --json | tee ./basic_contracts.json + fi aws s3 cp ./basic_contracts.json ${{ env.CONTRACT_S3_BUCKET }}/devnet/basic_contracts.json diff --git a/.github/workflows/network-deploy.yml b/.github/workflows/network-deploy.yml index 5677fdea1cae..5a7e655da50f 100644 --- a/.github/workflows/network-deploy.yml +++ b/.github/workflows/network-deploy.yml @@ -17,7 +17,7 @@ on: type: string deployment_mnemonic_secret_name: description: The name of the secret which holds the boot node's contract deployment mnemonic - required: true + required: false type: string default: testnet-deployment-mnemonic deployment_salt: @@ -40,6 +40,11 @@ on: required: false type: string default: "master" + sepolia_deployment: + description: "Whether to deploy on Sepolia network (default: false)" + required: false + type: boolean + default: false secrets: GCP_SA_KEY: required: true @@ -56,7 +61,7 @@ on: required: true deployment_mnemonic_secret_name: description: The name of the secret which holds the boot node's contract deployment mnemonic - required: true + required: false default: testnet-deployment-mnemonic deployment_salt: description: The salt to use for this deployment. Defaults to random @@ -76,6 +81,11 @@ on: required: false type: string default: "master" + sepolia_deployment: + description: "Whether to deploy on Sepolia network (default: false)" + required: false + type: boolean + default: false jobs: network_deployment: @@ -154,26 +164,56 @@ jobs: # Destroy fails if the resources are already destroyed, so we continue on error continue-on-error: true run: | - terraform destroy -auto-approve \ - -var="RELEASE_NAME=${{ env.NAMESPACE }}" \ - -var="VALUES_FILE=${{ env.VALUES_FILE }}" \ - -var="GKE_CLUSTER_CONTEXT=${{ env.GKE_CLUSTER_CONTEXT }}" \ - -var="AZTEC_DOCKER_IMAGE=${{ env.AZTEC_DOCKER_IMAGE }}" \ - -var="L1_DEPLOYMENT_MNEMONIC=${{ steps.get-mnemonic.outputs.mnemonic }}" + if ${{ inputs.sepolia_deployment }}; then + terraform destroy -auto-approve \ + -var="RELEASE_NAME=${{ env.NAMESPACE }}" \ + -var="VALUES_FILE=${{ env.VALUES_FILE }}" \ + -var="GKE_CLUSTER_CONTEXT=${{ env.GKE_CLUSTER_CONTEXT }}" \ + -var="AZTEC_DOCKER_IMAGE=${{ env.AZTEC_DOCKER_IMAGE }}" \ + -var="L1_DEPLOYMENT_PRIVATE_KEY=${{ secrets.SEPOLIA_L1_DEPLOYMENT_PRIVATE_KEY }}" \ + -var="VALIDATOR_KEYS=${{ secrets.VALIDATOR_KEYS }}" \ + -var="BOOT_NODE_SEQ_PUBLISHER_PRIVATE_KEY=${{ secrets.BOOT_NODE_SEQ_PUBLISHER_PRIVATE_KEY }}" \ + -var="PROVER_PUBLISHER_PRIVATE_KEY=${{ secrets.PROVER_PUBLISHER_PRIVATE_KEY }}" \ + -var="ETHEREUM_EXTERNAL_HOST=${{ secrets.SEPOLIA_EXTERNAL_HOST }}" \ -lock=${{ inputs.respect_tf_lock }} + else + terraform destroy -auto-approve \ + -var="RELEASE_NAME=${{ env.NAMESPACE }}" \ + -var="VALUES_FILE=${{ env.VALUES_FILE }}" \ + -var="GKE_CLUSTER_CONTEXT=${{ env.GKE_CLUSTER_CONTEXT }}" \ + -var="AZTEC_DOCKER_IMAGE=${{ env.AZTEC_DOCKER_IMAGE }}" \ + -var="L1_DEPLOYMENT_MNEMONIC=${{ steps.get-mnemonic.outputs.mnemonic }}" + -lock=${{ inputs.respect_tf_lock }} + fi - name: Terraform Plan working-directory: ./spartan/terraform/deploy-release run: | - terraform plan \ - -var="RELEASE_NAME=${{ env.NAMESPACE }}" \ - -var="VALUES_FILE=${{ env.VALUES_FILE }}" \ - -var="GKE_CLUSTER_CONTEXT=${{ env.GKE_CLUSTER_CONTEXT }}" \ - -var="AZTEC_DOCKER_IMAGE=${{ env.AZTEC_DOCKER_IMAGE }}" \ - -var="L1_DEPLOYMENT_MNEMONIC=${{ steps.get-mnemonic.outputs.mnemonic }}" \ - -var="L1_DEPLOYMENT_SALT=${DEPLOYMENT_SALT:-$RANDOM}" \ - -out=tfplan \ - -lock=${{ inputs.respect_tf_lock }} + if ${{ inputs.sepolia_deployment }}; then + terraform plan \ + -var="RELEASE_NAME=${{ env.NAMESPACE }}" \ + -var="VALUES_FILE=${{ env.VALUES_FILE }}" \ + -var="GKE_CLUSTER_CONTEXT=${{ env.GKE_CLUSTER_CONTEXT }}" \ + -var="AZTEC_DOCKER_IMAGE=${{ env.AZTEC_DOCKER_IMAGE }}" \ + -var="L1_DEPLOYMENT_PRIVATE_KEY=${{ secrets.SEPOLIA_L1_DEPLOYMENT_PRIVATE_KEY }}" \ + -var="L1_DEPLOYMENT_SALT=${DEPLOYMENT_SALT:-$RANDOM}" \ + -var="VALIDATOR_KEYS=${{ secrets.VALIDATOR_KEYS }}" \ + -var="BOOT_NODE_SEQ_PUBLISHER_PRIVATE_KEY=${{ secrets.BOOT_NODE_SEQ_PUBLISHER_PRIVATE_KEY }}" \ + -var="PROVER_PUBLISHER_PRIVATE_KEY=${{ secrets.PROVER_PUBLISHER_PRIVATE_KEY }}" \ + -var="ETHEREUM_EXTERNAL_HOST=${{ secrets.SEPOLIA_EXTERNAL_HOST }}" \ + -out=tfplan \ + -lock=${{ inputs.respect_tf_lock }} + else + terraform plan \ + -var="RELEASE_NAME=${{ env.NAMESPACE }}" \ + -var="VALUES_FILE=${{ env.VALUES_FILE }}" \ + -var="GKE_CLUSTER_CONTEXT=${{ env.GKE_CLUSTER_CONTEXT }}" \ + -var="AZTEC_DOCKER_IMAGE=${{ env.AZTEC_DOCKER_IMAGE }}" \ + -var="L1_DEPLOYMENT_MNEMONIC=${{ steps.get-mnemonic.outputs.mnemonic }}" \ + -var="L1_DEPLOYMENT_SALT=${DEPLOYMENT_SALT:-$RANDOM}" \ + -out=tfplan \ + -lock=${{ inputs.respect_tf_lock }} + fi - name: Terraform Apply working-directory: ./spartan/terraform/deploy-release diff --git a/.github/workflows/vm_full_tests.yml b/.github/workflows/vm_full_tests.yml index a237aff696d2..1e3291e55d4e 100644 --- a/.github/workflows/vm_full_tests.yml +++ b/.github/workflows/vm_full_tests.yml @@ -33,6 +33,7 @@ jobs: uses: ./.github/ensure-tester timeout-minutes: 75 with: + ttl: 75 + runner_type: 128core-tester-x86 run: | - sudo shutdown -P 75 # hack until core part of the scripts scripts/earthly-ci --no-output ./barretenberg/cpp/+vm-full-test --hardware_concurrency=64 # limit our parallelism to half our cores diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8ce7b21d8c60..4526aabb1f49 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,7 +1,7 @@ { - ".": "0.67.1", + ".": "0.68.0", "yarn-project/cli": "0.35.1", - "yarn-project/aztec": "0.67.1", - "barretenberg": "0.67.1", - "barretenberg/ts": "0.67.1" + "yarn-project/aztec": "0.68.0", + "barretenberg": "0.68.0", + "barretenberg/ts": "0.68.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 54fb5c843e0c..09dfc528c05d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,593 @@ # Changelog +## [0.68.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.67.1...aztec-packages-v0.68.0) (2024-12-20) + + +### ⚠ BREAKING CHANGES + +* **stdlib:** Remove Schnorr (https://github.com/noir-lang/noir/pull/6749) +* lower public tx gas limit to 6M ([#10635](https://github.com/AztecProtocol/aztec-packages/issues/10635)) +* l2 gas maximum is per-TX-public-portion. AVM startup gas is now 20k. ([#10214](https://github.com/AztecProtocol/aztec-packages/issues/10214)) +* rm outgoing logs ([#10486](https://github.com/AztecProtocol/aztec-packages/issues/10486)) +* rename Header to BlockHeader ([#10372](https://github.com/AztecProtocol/aztec-packages/issues/10372)) +* several format string fixes and improvements (https://github.com/noir-lang/noir/pull/6703) +* remove `ec` module from stdlib (https://github.com/noir-lang/noir/pull/6612) +* Disallow `#[export]` on associated methods (https://github.com/noir-lang/noir/pull/6626) +* Require types of globals to be specified (https://github.com/noir-lang/noir/pull/6592) +* remove eddsa from stdlib (https://github.com/noir-lang/noir/pull/6591) +* Remove debug and winston in favor of pino ([#10355](https://github.com/AztecProtocol/aztec-packages/issues/10355)) +* remove SchnorrVerify opcode ([#9897](https://github.com/AztecProtocol/aztec-packages/issues/9897)) +* remove SharedImmutable ([#10183](https://github.com/AztecProtocol/aztec-packages/issues/10183)) +* rename sharedimmutable methods ([#10164](https://github.com/AztecProtocol/aztec-packages/issues/10164)) +* rename SharedMutable methods ([#10165](https://github.com/AztecProtocol/aztec-packages/issues/10165)) +* add AztecAddress.isValid and make random be valid ([#10081](https://github.com/AztecProtocol/aztec-packages/issues/10081)) + +### Features + +* `nargo test -q` (or `nargo test --format terse`) (https://github.com/noir-lang/noir/pull/6776) ([8956e28](https://github.com/AztecProtocol/aztec-packages/commit/8956e28269a045732e733b5197bdab5e46cdf354)) +* `std::hint::black_box` function. (https://github.com/noir-lang/noir/pull/6529) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Add `(x | 1)` optimization for booleans (https://github.com/noir-lang/noir/pull/6795) ([8956e28](https://github.com/AztecProtocol/aztec-packages/commit/8956e28269a045732e733b5197bdab5e46cdf354)) +* Add `array_refcount` and `slice_refcount` builtins for debugging (https://github.com/noir-lang/noir/pull/6584) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Add `BoundedVec::from_parts` and `BoundedVec::from_parts_unchecked` (https://github.com/noir-lang/noir/pull/6691) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Add `nargo test --format json` (https://github.com/noir-lang/noir/pull/6796) ([d74d0fc](https://github.com/AztecProtocol/aztec-packages/commit/d74d0fcec24c533abc28320302e027470843e80c)) +* Add a flag to disable fee payment checks in AVM simulator ([#10852](https://github.com/AztecProtocol/aztec-packages/issues/10852)) ([41407ce](https://github.com/AztecProtocol/aztec-packages/commit/41407ce1139d4deacd63240f611eba8c331346b5)) +* Add AztecAddress.isValid and make random be valid ([#10081](https://github.com/AztecProtocol/aztec-packages/issues/10081)) ([fbdf6b0](https://github.com/AztecProtocol/aztec-packages/commit/fbdf6b08e1860ca432aa1d8ee8ec2e26055da6c9)) +* Add gate count tracking for ivc constraints ([#10772](https://github.com/AztecProtocol/aztec-packages/issues/10772)) ([ebd6aba](https://github.com/AztecProtocol/aztec-packages/commit/ebd6aba915b822711166b4424cc4c81f226ddcfb)) +* Add memory report into the CI (https://github.com/noir-lang/noir/pull/6630) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Add priority fees to gas settings ([#10763](https://github.com/AztecProtocol/aztec-packages/issues/10763)) ([263eaad](https://github.com/AztecProtocol/aztec-packages/commit/263eaad065d607d7af2d2c163c5090b8d73216c1)) +* Add rollup circuit sample inputs ([#10608](https://github.com/AztecProtocol/aztec-packages/issues/10608)) ([775b459](https://github.com/AztecProtocol/aztec-packages/commit/775b459d0423e6dfe79e2b1a24e195fd61750171)) +* Add total mana used to header ([#9868](https://github.com/AztecProtocol/aztec-packages/issues/9868)) ([2478d19](https://github.com/AztecProtocol/aztec-packages/commit/2478d1909db2d79cc0cdd3063dc2ac4e1eaedce3)) +* Add tree equality assertions ([#10756](https://github.com/AztecProtocol/aztec-packages/issues/10756)) ([923826a](https://github.com/AztecProtocol/aztec-packages/commit/923826a9d1bbed6739527a82b34d5610600eca1b)) +* Add verify proof calls to private kernels ([#10533](https://github.com/AztecProtocol/aztec-packages/issues/10533)) ([ce0eee0](https://github.com/AztecProtocol/aztec-packages/commit/ce0eee0ef4a2084ec74b6dae0a75d18af5877ef8)) +* Add workflow_call trigger to network-deploy ([#10451](https://github.com/AztecProtocol/aztec-packages/issues/10451)) ([18254e6](https://github.com/AztecProtocol/aztec-packages/commit/18254e6518bdcb93006d8f4c7cac2c4e8da05cbf)) +* Added a UnivariateMonomial representation to reduce field ops in protogalaxy+sumcheck ([#10401](https://github.com/AztecProtocol/aztec-packages/issues/10401)) ([15475f4](https://github.com/AztecProtocol/aztec-packages/commit/15475f47bdc2ac02ea5157bdc9d1f5172ff6ed09)) +* Adding configurable data dir and p2p pk for testnet nodes ([#10422](https://github.com/AztecProtocol/aztec-packages/issues/10422)) ([77b0039](https://github.com/AztecProtocol/aztec-packages/commit/77b0039925ccdb322c8fa224cb05f91d82d8c0f1)) +* Adding fuzzer for ultra bigfield and relaxing ultra circuit checker ([#10433](https://github.com/AztecProtocol/aztec-packages/issues/10433)) ([da4c47c](https://github.com/AztecProtocol/aztec-packages/commit/da4c47c5dc8caea3e860ac15a58b9ff7f011e4f6)) +* Agent and broker expose OTEL metrics ([#10264](https://github.com/AztecProtocol/aztec-packages/issues/10264)) ([c2c8cc6](https://github.com/AztecProtocol/aztec-packages/commit/c2c8cc6f7336cf4b2fa14d9a7f1af1a30f1b8f79)) +* Allow filtering which SSA passes are printed (https://github.com/noir-lang/noir/pull/6636) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Allow ignoring test failures from foreign calls (https://github.com/noir-lang/noir/pull/6660) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Allow making range queries to prometheus in tests ([f9810cc](https://github.com/AztecProtocol/aztec-packages/commit/f9810cc48f7379a0c02c76d8fc897d3ffc9d6ad8)) +* Allow metrics to be instantly flushed ([f9810cc](https://github.com/AztecProtocol/aztec-packages/commit/f9810cc48f7379a0c02c76d8fc897d3ffc9d6ad8)) +* Allow querying block number for tree indices ([#10332](https://github.com/AztecProtocol/aztec-packages/issues/10332)) ([cf05a7a](https://github.com/AztecProtocol/aztec-packages/commit/cf05a7a346ea11853e940d5e9ac105ef0d629d35)) +* AMM ([#10153](https://github.com/AztecProtocol/aztec-packages/issues/10153)) ([90668c3](https://github.com/AztecProtocol/aztec-packages/commit/90668c35a8556c4e77fce9fb4e6e0de931c7f872)) +* Assert metrics in network tests ([#10215](https://github.com/AztecProtocol/aztec-packages/issues/10215)) ([9380c0f](https://github.com/AztecProtocol/aztec-packages/commit/9380c0f68bc01722b60539034a9f064606e1b119)) +* AVM inserts fee write on txs with public calls ([#10394](https://github.com/AztecProtocol/aztec-packages/issues/10394)) ([98ba747](https://github.com/AztecProtocol/aztec-packages/commit/98ba7475ac0130dac4424a2f5cabdbe37eba5cc8)) +* Avm inserts nullifiers from private ([#10129](https://github.com/AztecProtocol/aztec-packages/issues/10129)) ([3fc0c7c](https://github.com/AztecProtocol/aztec-packages/commit/3fc0c7c7d4b6b4052d185dbb795a7fe3d724f09f)) +* **avm:** Error handling for address resolution ([#9994](https://github.com/AztecProtocol/aztec-packages/issues/9994)) ([ceaeda5](https://github.com/AztecProtocol/aztec-packages/commit/ceaeda50d2fd391edda3ee8186b86558b7f092e2)), closes [#9131](https://github.com/AztecProtocol/aztec-packages/issues/9131) +* **avm:** Migrate simulator memory to a map ([#10715](https://github.com/AztecProtocol/aztec-packages/issues/10715)) ([64d5f2b](https://github.com/AztecProtocol/aztec-packages/commit/64d5f2bd0dffe637fbff436ea651eb240256ab2c)), closes [#10370](https://github.com/AztecProtocol/aztec-packages/issues/10370) +* **avm:** New public inputs witgen ([#10179](https://github.com/AztecProtocol/aztec-packages/issues/10179)) ([ac8f13e](https://github.com/AztecProtocol/aztec-packages/commit/ac8f13e4cd9a3f6b23d53ce5b06cc436324d5f7b)) +* Avoid incrementing reference counts in some cases (https://github.com/noir-lang/noir/pull/6568) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Avoid inserting an empty leaf in indexed trees on update ([#10281](https://github.com/AztecProtocol/aztec-packages/issues/10281)) ([5a04ca8](https://github.com/AztecProtocol/aztec-packages/commit/5a04ca880ae2a0f285b6a5a110286ba10bc4a6c3)) +* Avoid inserting an empty leaf in indexed trees on update ([#10334](https://github.com/AztecProtocol/aztec-packages/issues/10334)) ([80fad45](https://github.com/AztecProtocol/aztec-packages/commit/80fad4544a4d8c1b488f8b4b4f86fe508ed1f4cc)) +* **bb:** Define std::hash for field ([#10312](https://github.com/AztecProtocol/aztec-packages/issues/10312)) ([752bc59](https://github.com/AztecProtocol/aztec-packages/commit/752bc59c579710c21acf6cc97164e377f72c256c)) +* Better error message when trying to invoke struct function field (https://github.com/noir-lang/noir/pull/6661) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Better initialization for permutation mapping components ([#10750](https://github.com/AztecProtocol/aztec-packages/issues/10750)) ([1516d7f](https://github.com/AztecProtocol/aztec-packages/commit/1516d7f7bd6a2adbb650bd7cdd572b33db98dbfc)) +* Blobs 2. ([#10188](https://github.com/AztecProtocol/aztec-packages/issues/10188)) ([d0a4b2f](https://github.com/AztecProtocol/aztec-packages/commit/d0a4b2f011a25e59d5ef077cfefae4490ae1c263)) +* Blobs. ([#9302](https://github.com/AztecProtocol/aztec-packages/issues/9302)) ([03b7e0e](https://github.com/AztecProtocol/aztec-packages/commit/03b7e0eee49680e18fafa5b78199b24e8b60fd5d)) +* **blobs:** Add consensus client url to config ([#10059](https://github.com/AztecProtocol/aztec-packages/issues/10059)) ([1e15bf5](https://github.com/AztecProtocol/aztec-packages/commit/1e15bf58390f6c15afc3b430edd89b4c28137c2b)) +* Burn congestion fee ([#10231](https://github.com/AztecProtocol/aztec-packages/issues/10231)) ([20a33f2](https://github.com/AztecProtocol/aztec-packages/commit/20a33f2d097d7fd3bd67eabf2d2254b43d5723d0)) +* Calls to non-existent contracts in the AVM simulator return failure ([#10051](https://github.com/AztecProtocol/aztec-packages/issues/10051)) ([133384c](https://github.com/AztecProtocol/aztec-packages/commit/133384c8234c79b11488578c6a1520b3de4fda79)) +* Check max fees per gas ([#10283](https://github.com/AztecProtocol/aztec-packages/issues/10283)) ([4e59b06](https://github.com/AztecProtocol/aztec-packages/commit/4e59b06cd1956d43bc44a219448603b4bcf58d27)) +* **ci:** Initial compilation report on test_programs (https://github.com/noir-lang/noir/pull/6731) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* CIVC browser proveThenVerify ([#10431](https://github.com/AztecProtocol/aztec-packages/issues/10431)) ([8c064d4](https://github.com/AztecProtocol/aztec-packages/commit/8c064d484c686fdf00a100f65f1f740be4ef13cb)) +* Claim epoch proof rights without a block ([#10844](https://github.com/AztecProtocol/aztec-packages/issues/10844)) ([b721253](https://github.com/AztecProtocol/aztec-packages/commit/b721253797e37d2d80c0c5f5bf60e602a304dc44)), closes [#9404](https://github.com/AztecProtocol/aztec-packages/issues/9404) +* Cli wallet improvements ([#10425](https://github.com/AztecProtocol/aztec-packages/issues/10425)) ([cc8bd80](https://github.com/AztecProtocol/aztec-packages/commit/cc8bd80730f7ec269be9282d0e90fc2b6dc6561a)) +* Client IVC API ([#10217](https://github.com/AztecProtocol/aztec-packages/issues/10217)) ([cc54a1e](https://github.com/AztecProtocol/aztec-packages/commit/cc54a1e1ef75b29d160a02d03cf9b29e28d3e4ca)) +* **cli:** Run command on the package closest to the current directory (https://github.com/noir-lang/noir/pull/6752) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* **cli:** Verify `return` against ABI and `Prover.toml` (https://github.com/noir-lang/noir/pull/6765) ([8956e28](https://github.com/AztecProtocol/aztec-packages/commit/8956e28269a045732e733b5197bdab5e46cdf354)) +* **comptime:** Implement blackbox functions in comptime interpreter (https://github.com/noir-lang/noir/pull/6551) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Configure world state block history ([#10216](https://github.com/AztecProtocol/aztec-packages/issues/10216)) ([01eb392](https://github.com/AztecProtocol/aztec-packages/commit/01eb392f15995f344e40aa8f8e41a28f6f5b825d)) +* DB Metrics now use labels for easier querying ([#10572](https://github.com/AztecProtocol/aztec-packages/issues/10572)) ([adadfa5](https://github.com/AztecProtocol/aztec-packages/commit/adadfa5be51a33d6b089c59d3bad5d46073f8bc3)) +* Delete attestations older than a slot ([#10326](https://github.com/AztecProtocol/aztec-packages/issues/10326)) ([24abcfe](https://github.com/AztecProtocol/aztec-packages/commit/24abcfeba2cbf506cae79246a545c65913ea5c2f)) +* Deploy a network using master each night night ([#10536](https://github.com/AztecProtocol/aztec-packages/issues/10536)) ([015ec0e](https://github.com/AztecProtocol/aztec-packages/commit/015ec0e506f76610e8378a5ad223a9c0185f78c9)), closes [#10474](https://github.com/AztecProtocol/aztec-packages/issues/10474) [#10473](https://github.com/AztecProtocol/aztec-packages/issues/10473) +* Deploy devnet to k8s ([#10449](https://github.com/AztecProtocol/aztec-packages/issues/10449)) ([27506c1](https://github.com/AztecProtocol/aztec-packages/commit/27506c1112a224482f3b0479d92b2053dbf13512)) +* Deploy faucet ([#10580](https://github.com/AztecProtocol/aztec-packages/issues/10580)) ([09e95a1](https://github.com/AztecProtocol/aztec-packages/commit/09e95a1d033deb5c31d9967d5100a6aeb8485ab5)) +* Deploy networks via github actions ([#10381](https://github.com/AztecProtocol/aztec-packages/issues/10381)) ([7e19b39](https://github.com/AztecProtocol/aztec-packages/commit/7e19b3991ca34bcf9dd43284d4d21ded87824366)) +* Do not make unique revertible note hashes in the private kernels ([#10524](https://github.com/AztecProtocol/aztec-packages/issues/10524)) ([d327da1](https://github.com/AztecProtocol/aztec-packages/commit/d327da1aeac530e8497e3d21a25152bd920797e2)) +* **docs:** Applied structure feedback ([#9288](https://github.com/AztecProtocol/aztec-packages/issues/9288)) ([5b0b721](https://github.com/AztecProtocol/aztec-packages/commit/5b0b721ec00545794b5e54e0e24dbc0e14b1fdd8)) +* Don't store every block number in block indices DB ([#10658](https://github.com/AztecProtocol/aztec-packages/issues/10658)) ([a3fba84](https://github.com/AztecProtocol/aztec-packages/commit/a3fba8442fdd62f429054c3367984fd4206bbbeb)) +* E2e metrics reporting ([#9776](https://github.com/AztecProtocol/aztec-packages/issues/9776)) ([9cab121](https://github.com/AztecProtocol/aztec-packages/commit/9cab1212e7040fb4c31db9bbb24f7f43413e8ed1)) +* Emulating blocks and correct (non-partial) note discovery in txe ([#10356](https://github.com/AztecProtocol/aztec-packages/issues/10356)) ([6f209fb](https://github.com/AztecProtocol/aztec-packages/commit/6f209fb69fcce868c6e0fe9b79b5ac3f3a1e5c48)) +* Enable profiling with local PXE in cli-wallet ([#10736](https://github.com/AztecProtocol/aztec-packages/issues/10736)) ([dd10bd7](https://github.com/AztecProtocol/aztec-packages/commit/dd10bd70b27d2c4a527b12dda9d777a65e4d33f4)) +* Epoch cache, do not attest if not in committee or from current proposer ([#10327](https://github.com/AztecProtocol/aztec-packages/issues/10327)) ([9ebaa65](https://github.com/AztecProtocol/aztec-packages/commit/9ebaa65ce290481e5dc00174e92137561360549a)) +* Expose ENFORCE_FEES in helm chart ([#10488](https://github.com/AztecProtocol/aztec-packages/issues/10488)) ([607dc4b](https://github.com/AztecProtocol/aztec-packages/commit/607dc4b090c81b7fad9f44c3b13f1f45659922ad)) +* Expose P2P service API and clean up logs ([#10552](https://github.com/AztecProtocol/aztec-packages/issues/10552)) ([98cea58](https://github.com/AztecProtocol/aztec-packages/commit/98cea58dd9c7a4518daa8e625dd794a2b6f4b314)), closes [#10299](https://github.com/AztecProtocol/aztec-packages/issues/10299) +* Fee foresight support ([#10262](https://github.com/AztecProtocol/aztec-packages/issues/10262)) ([9e19244](https://github.com/AztecProtocol/aztec-packages/commit/9e19244c01440ce7900ba91c0557567e57f017a0)) +* Full IPA Recursive Verifier ([#10189](https://github.com/AztecProtocol/aztec-packages/issues/10189)) ([b5783d3](https://github.com/AztecProtocol/aztec-packages/commit/b5783d3945959056d24aa3d988e9ca9efd3ec224)) +* Gas Utils for L1 operations ([#9834](https://github.com/AztecProtocol/aztec-packages/issues/9834)) ([17fa214](https://github.com/AztecProtocol/aztec-packages/commit/17fa214a5af4eb8364b09fc3e148fcd3a8949779)) +* GETCONTRACTINSTANCE and bytecode retrieval perform nullifier membership checks ([#10445](https://github.com/AztecProtocol/aztec-packages/issues/10445)) ([9301253](https://github.com/AztecProtocol/aztec-packages/commit/9301253f0488e6d96ed12a8c9bde72a653aa7d36)), closes [#10377](https://github.com/AztecProtocol/aztec-packages/issues/10377) [#10379](https://github.com/AztecProtocol/aztec-packages/issues/10379) +* Handle nested calls in witgen ([#10384](https://github.com/AztecProtocol/aztec-packages/issues/10384)) ([1e21f31](https://github.com/AztecProtocol/aztec-packages/commit/1e21f31d430947f48dc9f5e52d0deb1af70ee705)) +* Improve parser recovery of constructor field with '::' instead of ':' (https://github.com/noir-lang/noir/pull/6701) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Improved data storage metrics ([#10020](https://github.com/AztecProtocol/aztec-packages/issues/10020)) ([c6ab0c9](https://github.com/AztecProtocol/aztec-packages/commit/c6ab0c9c7a270104fb3e9f6160be50a90ce5e77d)) +* Integrate base fee computation into rollup ([#10076](https://github.com/AztecProtocol/aztec-packages/issues/10076)) ([3417b22](https://github.com/AztecProtocol/aztec-packages/commit/3417b22eb3f9ea3e21e44ea546494c1bee31f838)) +* Integrate fee into rollup ([#10176](https://github.com/AztecProtocol/aztec-packages/issues/10176)) ([12744d6](https://github.com/AztecProtocol/aztec-packages/commit/12744d6bd9ca6f4c4c1ef43ddd919e81cffb7a17)) +* Integrate verify_proof calls in mock protocol circuits ([#9253](https://github.com/AztecProtocol/aztec-packages/issues/9253)) ([7ed89aa](https://github.com/AztecProtocol/aztec-packages/commit/7ed89aaa9d0968af6334c1c8abf6c06a42754c52)) +* Json output for get_node_info ([#10771](https://github.com/AztecProtocol/aztec-packages/issues/10771)) ([b086c52](https://github.com/AztecProtocol/aztec-packages/commit/b086c52110e5bc79a3d8eccbc2bc50cd68b3dc9b)) +* Keccak honk proving in bb.js ([#10489](https://github.com/AztecProtocol/aztec-packages/issues/10489)) ([e0d7431](https://github.com/AztecProtocol/aztec-packages/commit/e0d743121674bcfdd73f84836c17645a5bc2df92)) +* Leaf index requests to the native world state can now be performed as a batch query ([#10649](https://github.com/AztecProtocol/aztec-packages/issues/10649)) ([a437e73](https://github.com/AztecProtocol/aztec-packages/commit/a437e73558a936981f3eb3ba022b0770b75d9060)) +* Making testnet script write a docker compose file ([#10333](https://github.com/AztecProtocol/aztec-packages/issues/10333)) ([be54cc3](https://github.com/AztecProtocol/aztec-packages/commit/be54cc3e2e58b809c3795a2b85e76711cdff2216)) +* Manage enqueued calls & phases in AVM witgen ([#10310](https://github.com/AztecProtocol/aztec-packages/issues/10310)) ([e7ebef8](https://github.com/AztecProtocol/aztec-packages/commit/e7ebef8d09744fdc24a79cb0bf74638b0a8f5dc8)) +* Metrics via terraform ([#10594](https://github.com/AztecProtocol/aztec-packages/issues/10594)) ([e21069d](https://github.com/AztecProtocol/aztec-packages/commit/e21069db0b3fcdf5665b62bb821a5a1d2abe2cee)), closes [#10191](https://github.com/AztecProtocol/aztec-packages/issues/10191) [#10439](https://github.com/AztecProtocol/aztec-packages/issues/10439) +* Mock IVC state from arbitrary acir IVC recursion constraints ([#10314](https://github.com/AztecProtocol/aztec-packages/issues/10314)) ([ac7c0da](https://github.com/AztecProtocol/aztec-packages/commit/ac7c0da38ff05d6f11c4d6a6244c4526ac00232e)) +* Modify HonkRecursionConstraint to handle IPA claims ([#10469](https://github.com/AztecProtocol/aztec-packages/issues/10469)) ([a204d1b](https://github.com/AztecProtocol/aztec-packages/commit/a204d1b60514d6321c2db5063375cc2bbd507fe8)) +* Move busread and lookup block construction at the top of the trace ([#10707](https://github.com/AztecProtocol/aztec-packages/issues/10707)) ([e8480cb](https://github.com/AztecProtocol/aztec-packages/commit/e8480cbf1ecdee5d7228b08d1c9608308acdd624)) +* New 17 in 20 IVC bench added to actions ([#10777](https://github.com/AztecProtocol/aztec-packages/issues/10777)) ([9fbcff6](https://github.com/AztecProtocol/aztec-packages/commit/9fbcff60a63e0eca14c4e28677aed1fc5e6f2c14)) +* New proving broker ([#10174](https://github.com/AztecProtocol/aztec-packages/issues/10174)) ([6fd5fc1](https://github.com/AztecProtocol/aztec-packages/commit/6fd5fc18bd973b539fb9edfb372181fbe4617f75)) +* Note hash management in the AVM ([#10666](https://github.com/AztecProtocol/aztec-packages/issues/10666)) ([e077980](https://github.com/AztecProtocol/aztec-packages/commit/e077980f8cce1fc7922c27d368b6dbced956aad2)) +* One liner for nodes to join rough-rhino ([#10168](https://github.com/AztecProtocol/aztec-packages/issues/10168)) ([3a425e9](https://github.com/AztecProtocol/aztec-packages/commit/3a425e9faa9d1c13f28fb61279eb9f842897f516)) +* Optionally emit public bytecode ([#10365](https://github.com/AztecProtocol/aztec-packages/issues/10365)) ([84ff623](https://github.com/AztecProtocol/aztec-packages/commit/84ff623ea00d0c6da4db960653655d7d485bccb1)) +* Order attribute execution by their source ordering (https://github.com/noir-lang/noir/pull/6326) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Origin tags implemented in biggroup ([#10002](https://github.com/AztecProtocol/aztec-packages/issues/10002)) ([c8696b1](https://github.com/AztecProtocol/aztec-packages/commit/c8696b165425ee6dd7a2398f4b90b29f24d762f4)) +* **p2p:** Activate gossipsub tx validators ([#10695](https://github.com/AztecProtocol/aztec-packages/issues/10695)) ([9cce2c6](https://github.com/AztecProtocol/aztec-packages/commit/9cce2c6fbae00008451940157690e0b5b99d9e59)) +* **p2p:** Attestation pool persistence ([#10667](https://github.com/AztecProtocol/aztec-packages/issues/10667)) ([dacef9f](https://github.com/AztecProtocol/aztec-packages/commit/dacef9f7f9f11c8ec35ecd333748a9ae8c24d428)) +* **p2p:** Persist node private p2p keys ([#10324](https://github.com/AztecProtocol/aztec-packages/issues/10324)) ([1c32eda](https://github.com/AztecProtocol/aztec-packages/commit/1c32eda798158682db204a9e5efcd867694a6bd2)) +* **p2p:** Remaining p2p topic validators ([#10734](https://github.com/AztecProtocol/aztec-packages/issues/10734)) ([a17d319](https://github.com/AztecProtocol/aztec-packages/commit/a17d31916b3bf51e6887586c288c82aa1291d87c)) +* **p2p:** Snappy compress p2p messages ([#10417](https://github.com/AztecProtocol/aztec-packages/issues/10417)) ([c643a54](https://github.com/AztecProtocol/aztec-packages/commit/c643a540262dcfe3106d03da3c3ca9bbaef338f0)) +* **perf:** Track last loads per block in mem2reg and remove them if possible (https://github.com/noir-lang/noir/pull/6088) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Persistence in helm chart for validator and boot node ([#10543](https://github.com/AztecProtocol/aztec-packages/issues/10543)) ([f9810cc](https://github.com/AztecProtocol/aztec-packages/commit/f9810cc48f7379a0c02c76d8fc897d3ffc9d6ad8)) +* Process blocks in parallel during epoch proving ([#10263](https://github.com/AztecProtocol/aztec-packages/issues/10263)) ([a9d418c](https://github.com/AztecProtocol/aztec-packages/commit/a9d418c07268a38e0c5432983438ea00b97d233b)) +* Prover-client exec timing analysis scripts. ([82434a2](https://github.com/AztecProtocol/aztec-packages/commit/82434a296f267d517032b5c9b092d787c64af7bc)) +* PXE browser proving ([#10704](https://github.com/AztecProtocol/aztec-packages/issues/10704)) ([46da3cc](https://github.com/AztecProtocol/aztec-packages/commit/46da3cc8a9c1c407a8ad2857695eea794e334efd)) +* PXE in the browser ([#10353](https://github.com/AztecProtocol/aztec-packages/issues/10353)) ([676f673](https://github.com/AztecProtocol/aztec-packages/commit/676f673dfbcb14f5351a0068aef9ad9fa4ebf879)) +* PXE sync on demand ([#10613](https://github.com/AztecProtocol/aztec-packages/issues/10613)) ([b2f1159](https://github.com/AztecProtocol/aztec-packages/commit/b2f11596e5c79be0c11ad298e734885e9657e640)) +* Reduce bundle sizes, remove polyfills ([#10877](https://github.com/AztecProtocol/aztec-packages/issues/10877)) ([bbee6c6](https://github.com/AztecProtocol/aztec-packages/commit/bbee6c6dc5a870929adcbd11a8e4772dadd569b6)) +* Reduce memory consumption by storing array length as `u32` during SSA (https://github.com/noir-lang/noir/pull/6606) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Release please for release branch ([#10467](https://github.com/AztecProtocol/aztec-packages/issues/10467)) ([38941bf](https://github.com/AztecProtocol/aztec-packages/commit/38941bfec92ab2c61d2db25ac45c3c9f3312ee31)) +* Remove auto verify mode from ClientIVC ([#10599](https://github.com/AztecProtocol/aztec-packages/issues/10599)) ([b1d8b97](https://github.com/AztecProtocol/aztec-packages/commit/b1d8b978871948fbba639476465f4de6fb471292)) +* Remove SharedImmutable ([#10183](https://github.com/AztecProtocol/aztec-packages/issues/10183)) ([a9f3b5f](https://github.com/AztecProtocol/aztec-packages/commit/a9f3b5f6e7e5bc9d4bc9c0600b492a5e0cd2c1d9)) +* Rename Header to BlockHeader ([#10372](https://github.com/AztecProtocol/aztec-packages/issues/10372)) ([0803964](https://github.com/AztecProtocol/aztec-packages/commit/0803964015492db81001c17252aa4b724e43797b)) +* Rename sharedimmutable methods ([#10164](https://github.com/AztecProtocol/aztec-packages/issues/10164)) ([ef7cd86](https://github.com/AztecProtocol/aztec-packages/commit/ef7cd861c180b73000f7dab5807200ccdd5f1680)) +* Rename SharedMutable methods ([#10165](https://github.com/AztecProtocol/aztec-packages/issues/10165)) ([4fd70e8](https://github.com/AztecProtocol/aztec-packages/commit/4fd70e84c051c9cd05125d5ba94dfbe2c09e1cfe)) +* Replace quadratic removal of `rc` instructions (https://github.com/noir-lang/noir/pull/6705) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Replace quadratic removal of rc instructions ([#10416](https://github.com/AztecProtocol/aztec-packages/issues/10416)) ([9d833c5](https://github.com/AztecProtocol/aztec-packages/commit/9d833c53dea362599374802e5d64c7c9d62f76be)) +* Revert changes to `ValueMerger` and `Instruction::IfElse` (https://github.com/noir-lang/noir/pull/6673) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Rm outgoing logs ([#10486](https://github.com/AztecProtocol/aztec-packages/issues/10486)) ([c28beec](https://github.com/AztecProtocol/aztec-packages/commit/c28beec5014b14b7ea0b1f00d1642aab807fad87)) +* Sayonara old hints ([#10547](https://github.com/AztecProtocol/aztec-packages/issues/10547)) ([dede16e](https://github.com/AztecProtocol/aztec-packages/commit/dede16e035115e1c6971079d12f62e3046407b36)) +* Sequential insertion in indexed trees ([#10111](https://github.com/AztecProtocol/aztec-packages/issues/10111)) ([bfd9fa6](https://github.com/AztecProtocol/aztec-packages/commit/bfd9fa68be4147acb3e3feeaf83ed3c9247761be)) +* Several `nargo test` improvements (https://github.com/noir-lang/noir/pull/6728) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Several Updates in SMT verification module (part 1) ([#10437](https://github.com/AztecProtocol/aztec-packages/issues/10437)) ([0c37672](https://github.com/AztecProtocol/aztec-packages/commit/0c376725a29ec18e25a7c9a89c0df8f5a1e06ff4)) +* Show printable byte arrays as byte strings in SSA (https://github.com/noir-lang/noir/pull/6709) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Simplify `jmpif`s by reversing branches if condition is negated (https://github.com/noir-lang/noir/pull/5891) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Speed up transaction execution ([#10172](https://github.com/AztecProtocol/aztec-packages/issues/10172)) ([da265b6](https://github.com/AztecProtocol/aztec-packages/commit/da265b6b7d61a0d991fa23bd044f711513a0e86c)) +* **ssa:** Bring back tracking of RC instructions during DIE (https://github.com/noir-lang/noir/pull/6783) ([308c5ce](https://github.com/AztecProtocol/aztec-packages/commit/308c5cef519b68f5951750851124c0bf8f4ba7ee)) +* **ssa:** Deduplicate intrinsics with predicates (https://github.com/noir-lang/noir/pull/6615) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* **ssa:** Hoist MakeArray instructions during loop invariant code motion (https://github.com/noir-lang/noir/pull/6782) ([8956e28](https://github.com/AztecProtocol/aztec-packages/commit/8956e28269a045732e733b5197bdab5e46cdf354)) +* **ssa:** Hoisting of array get using known induction variable maximum (https://github.com/noir-lang/noir/pull/6639) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* **ssa:** Implement missing brillig constraints SSA check (https://github.com/noir-lang/noir/pull/6658) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* **ssa:** Loop invariant code motion (https://github.com/noir-lang/noir/pull/6563) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* **ssa:** Option to set the maximum acceptable Brillig bytecode increase in unrolling (https://github.com/noir-lang/noir/pull/6641) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* **ssa:** Simplify array get from set that writes to the same dynamic index (https://github.com/noir-lang/noir/pull/6684) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Staking integration ([#10403](https://github.com/AztecProtocol/aztec-packages/issues/10403)) ([ecd6c4f](https://github.com/AztecProtocol/aztec-packages/commit/ecd6c4ff914129236b23ab6f4924e4faa3e9d523)) +* Standalone ssd ([#10317](https://github.com/AztecProtocol/aztec-packages/issues/10317)) ([c324781](https://github.com/AztecProtocol/aztec-packages/commit/c3247819751b8efab646ed05b3b781be403653e1)) +* Sumcheck with disabled rows ([#10068](https://github.com/AztecProtocol/aztec-packages/issues/10068)) ([abd2226](https://github.com/AztecProtocol/aztec-packages/commit/abd2226da3a159e7efb7cbef099e41739f665ef1)) +* Swap polys to facilitate dynamic trace overflow ([#9976](https://github.com/AztecProtocol/aztec-packages/issues/9976)) ([b7b282c](https://github.com/AztecProtocol/aztec-packages/commit/b7b282cd0fb306abbe3951a55a1a4f4d42ed7f8e)) +* Switch to using an external noir implementation of Schnorr ([#10330](https://github.com/AztecProtocol/aztec-packages/issues/10330)) ([6cbd375](https://github.com/AztecProtocol/aztec-packages/commit/6cbd375c4fddc0108b72a3092fcd75816305adde)) +* Sync from aztec-packages (https://github.com/noir-lang/noir/pull/6576) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Sync from aztec-packages (https://github.com/noir-lang/noir/pull/6634) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Sync from aztec-packages (https://github.com/noir-lang/noir/pull/6656) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Sync from aztec-packages (https://github.com/noir-lang/noir/pull/6730) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Sync tags as sender ([#10071](https://github.com/AztecProtocol/aztec-packages/issues/10071)) ([122d2e4](https://github.com/AztecProtocol/aztec-packages/commit/122d2e49e4ede5ec35e42c8c51e3232f67c6c39b)) +* Terraform for alerting on metrics ([#10192](https://github.com/AztecProtocol/aztec-packages/issues/10192)) ([05c9e5d](https://github.com/AztecProtocol/aztec-packages/commit/05c9e5df89f4f4185490a940d1d9daa2751e7219)), closes [#9956](https://github.com/AztecProtocol/aztec-packages/issues/9956) +* Terraform for release deployments ([#10091](https://github.com/AztecProtocol/aztec-packages/issues/10091)) ([dc528da](https://github.com/AztecProtocol/aztec-packages/commit/dc528dadcf1c68643eb77c3ea4280161dd9ac225)), closes [#10144](https://github.com/AztecProtocol/aztec-packages/issues/10144) +* Test release network via ci workflow ([#10388](https://github.com/AztecProtocol/aztec-packages/issues/10388)) ([e6060ec](https://github.com/AztecProtocol/aztec-packages/commit/e6060ecca318ca4cdc60f1df77c1e7639a745f79)), closes [#10383](https://github.com/AztecProtocol/aztec-packages/issues/10383) +* **test:** Check that `nargo::ops::transform_program` is idempotent (https://github.com/noir-lang/noir/pull/6694) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* **tooling:** Skip program transformation when loaded from cache (https://github.com/noir-lang/noir/pull/6689) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Try to inline brillig calls with all constant arguments (https://github.com/noir-lang/noir/pull/6548) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* TXE detects duplicate nullifiers ([#10764](https://github.com/AztecProtocol/aztec-packages/issues/10764)) ([7f70110](https://github.com/AztecProtocol/aztec-packages/commit/7f701105c2ac44df9cafedc834d77d4eabd92710)) +* Ultra rollup flows ([#10162](https://github.com/AztecProtocol/aztec-packages/issues/10162)) ([c53f4cf](https://github.com/AztecProtocol/aztec-packages/commit/c53f4cf84c60b8d81cc62d5827ec4408da88cc4e)) +* UltraRollupRecursiveFlavor ([#10088](https://github.com/AztecProtocol/aztec-packages/issues/10088)) ([4418ef2](https://github.com/AztecProtocol/aztec-packages/commit/4418ef2a5768e0f627160b86e8dc8735d4bf00e7)) +* Unified create circuit from acir ([#10440](https://github.com/AztecProtocol/aztec-packages/issues/10440)) ([a4dfe13](https://github.com/AztecProtocol/aztec-packages/commit/a4dfe13c1c0af3d527f5c9b2fcc38fe059e9bc38)) +* Unify anvil versions ([#10143](https://github.com/AztecProtocol/aztec-packages/issues/10143)) ([adae143](https://github.com/AztecProtocol/aztec-packages/commit/adae14363c29591e01477ce131578189b82430e8)) +* Update and generate test Prover.tomls for protocol circuits ([#10659](https://github.com/AztecProtocol/aztec-packages/issues/10659)) ([eb5f18a](https://github.com/AztecProtocol/aztec-packages/commit/eb5f18a439c06afcbd90f5ea6339596a84ba4e8a)) +* Updated metrics ([#10885](https://github.com/AztecProtocol/aztec-packages/issues/10885)) ([79ac402](https://github.com/AztecProtocol/aztec-packages/commit/79ac402547fa5f801b71d9257e07c59365ecec31)) +* Using current gas prices in cli-wallet ([#10105](https://github.com/AztecProtocol/aztec-packages/issues/10105)) ([15ffeea](https://github.com/AztecProtocol/aztec-packages/commit/15ffeea8ef47b619f9922793be7e3380964297a3)) +* **val:** Reex ([#9768](https://github.com/AztecProtocol/aztec-packages/issues/9768)) ([2e58f0a](https://github.com/AztecProtocol/aztec-packages/commit/2e58f0a315ec037a212d7f33b8c73b1b0c30a2e2)) +* Zip and propagate private logs ([#10210](https://github.com/AztecProtocol/aztec-packages/issues/10210)) ([5c32747](https://github.com/AztecProtocol/aztec-packages/commit/5c327473994b9dd983f936809529c2bc07691130)) +* Zip and silo and propagate private logs ([#10308](https://github.com/AztecProtocol/aztec-packages/issues/10308)) ([90d4385](https://github.com/AztecProtocol/aztec-packages/commit/90d43858532712a2b7182bdd06f9073e10fa5d41)) + + +### Bug Fixes + +* [#10473](https://github.com/AztecProtocol/aztec-packages/issues/10473) ([015ec0e](https://github.com/AztecProtocol/aztec-packages/commit/015ec0e506f76610e8378a5ad223a9c0185f78c9)) +* [#10474](https://github.com/AztecProtocol/aztec-packages/issues/10474) ([015ec0e](https://github.com/AztecProtocol/aztec-packages/commit/015ec0e506f76610e8378a5ad223a9c0185f78c9)) +* Add curl to aztec nargo container ([#10173](https://github.com/AztecProtocol/aztec-packages/issues/10173)) ([2add6ae](https://github.com/AztecProtocol/aztec-packages/commit/2add6ae2b1c1011bf61525c2c3c96f5bdeb34f6c)) +* Add helm ([#10454](https://github.com/AztecProtocol/aztec-packages/issues/10454)) ([2eb9ade](https://github.com/AztecProtocol/aztec-packages/commit/2eb9ade6e778d247557fde534cd101391d3c3307)) +* Add inotify-tools ([#10841](https://github.com/AztecProtocol/aztec-packages/issues/10841)) ([f576e52](https://github.com/AztecProtocol/aztec-packages/commit/f576e52f097b51baf01c593694a2bc0550c1dec1)) +* Add log severity ([#10835](https://github.com/AztecProtocol/aztec-packages/issues/10835)) ([c9e2f82](https://github.com/AztecProtocol/aztec-packages/commit/c9e2f823d1e8715f748ad9b683506d8ac2c3cf40)) +* Add pako as a dependency in bb.js ([#10186](https://github.com/AztecProtocol/aztec-packages/issues/10186)) ([b773c14](https://github.com/AztecProtocol/aztec-packages/commit/b773c14a8fe8bf425dc755b3a156e500e9924c1e)) +* Add secret ([#10453](https://github.com/AztecProtocol/aztec-packages/issues/10453)) ([95601df](https://github.com/AztecProtocol/aztec-packages/commit/95601df9a38590e1d6acf499b5aa2d8dcfb84b0f)) +* Add type ([#10452](https://github.com/AztecProtocol/aztec-packages/issues/10452)) ([cd9699f](https://github.com/AztecProtocol/aztec-packages/commit/cd9699fdadaa1123aebcad35535b7e4bd0b06193)) +* Allow empty loop headers (https://github.com/noir-lang/noir/pull/6736) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Allow multiple `_` parameters, and disallow `_` as an expression you can read from (https://github.com/noir-lang/noir/pull/6657) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Always remove nullified notes ([#10722](https://github.com/AztecProtocol/aztec-packages/issues/10722)) ([5e4b46d](https://github.com/AztecProtocol/aztec-packages/commit/5e4b46d577ebf63114a5a5a1c5b6d2947d3b2567)) +* Always respect aztec image pull policy ([#10617](https://github.com/AztecProtocol/aztec-packages/issues/10617)) ([e7686f1](https://github.com/AztecProtocol/aztec-packages/commit/e7686f11811d1bd7cd6752116416687721dd62ed)) +* Always return an array of `u8`s when simplifying `Intrinsic::ToRadix` calls (https://github.com/noir-lang/noir/pull/6663) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Archiver does not jump the gun on epoch completed ([#10801](https://github.com/AztecProtocol/aztec-packages/issues/10801)) ([51d82aa](https://github.com/AztecProtocol/aztec-packages/commit/51d82aaf62b84885eb388b1565c1a119c60d849e)), closes [#10800](https://github.com/AztecProtocol/aztec-packages/issues/10800) +* Arm updating image bases ([8f9ea7a](https://github.com/AztecProtocol/aztec-packages/commit/8f9ea7a71c3fbd14bc28619148ca609054e5b5ac)) +* Attempt to fix flake in e2e cross chain messaging test ([#10634](https://github.com/AztecProtocol/aztec-packages/issues/10634)) ([a69502c](https://github.com/AztecProtocol/aztec-packages/commit/a69502c3bd177a5ae502b7b9d13f260ffe19314e)) +* Avm gas and non-member ([#10709](https://github.com/AztecProtocol/aztec-packages/issues/10709)) ([dd8cc7b](https://github.com/AztecProtocol/aztec-packages/commit/dd8cc7b93119c0376873a366a8310d2ebd2641de)) +* AVM witgen track gas for nested calls and external halts ([#10731](https://github.com/AztecProtocol/aztec-packages/issues/10731)) ([b8bdb52](https://github.com/AztecProtocol/aztec-packages/commit/b8bdb529719c1f72244e904ea667462458a43317)) +* **avm:** Execution test ordering ([#10226](https://github.com/AztecProtocol/aztec-packages/issues/10226)) ([49b4a6c](https://github.com/AztecProtocol/aztec-packages/commit/49b4a6c07f39711ad2a0477e1fad11e11b8ee23c)) +* **avm:** Set GITHUB_RUN_URL in github action config of AVM full tests ([#10882](https://github.com/AztecProtocol/aztec-packages/issues/10882)) ([d0660de](https://github.com/AztecProtocol/aztec-packages/commit/d0660de625880cbe77115b48e6898457b93929fa)) +* Await block unwind when a reorg happens ([#10380](https://github.com/AztecProtocol/aztec-packages/issues/10380)) ([5a02480](https://github.com/AztecProtocol/aztec-packages/commit/5a024803648e8a645cbafdeb4e2ab9f6bfa26117)) +* Aztec js e2e ([#10837](https://github.com/AztecProtocol/aztec-packages/issues/10837)) ([9981078](https://github.com/AztecProtocol/aztec-packages/commit/9981078470af8d63f3e6a2cf601f5a2f862c376e)) +* Aztec-nargo curl in the earthfile also ([#10199](https://github.com/AztecProtocol/aztec-packages/issues/10199)) ([985a678](https://github.com/AztecProtocol/aztec-packages/commit/985a678dcc4ae5112edd81dabbce314568e8fe36)) +* Bad merge on boxes ([#10579](https://github.com/AztecProtocol/aztec-packages/issues/10579)) ([9b26651](https://github.com/AztecProtocol/aztec-packages/commit/9b266516d706ef0ab371e21bf622420b228bf94e)) +* **bb.js:** Don't minify bb.js - webpack config ([#10170](https://github.com/AztecProtocol/aztec-packages/issues/10170)) ([6e7fae7](https://github.com/AztecProtocol/aztec-packages/commit/6e7fae7c78496b0b2241e2061b35ab22a3b3b186)) +* **bb.js:** Use globalThis instead of self ([#10747](https://github.com/AztecProtocol/aztec-packages/issues/10747)) ([309b5f7](https://github.com/AztecProtocol/aztec-packages/commit/309b5f74862089001e3159bdb52cbc8b60c71dc1)), closes [#10741](https://github.com/AztecProtocol/aztec-packages/issues/10741) +* Bbup cleanup and fix ([#10067](https://github.com/AztecProtocol/aztec-packages/issues/10067)) ([0ff8177](https://github.com/AztecProtocol/aztec-packages/commit/0ff81773da58f7c28621d4e5711ce130afd3e51b)) +* Block building test timeout ([#10812](https://github.com/AztecProtocol/aztec-packages/issues/10812)) ([2cad3e5](https://github.com/AztecProtocol/aztec-packages/commit/2cad3e59765a67ed14158ce556433120e9efd809)) +* Bootstrapping devnet ([#10396](https://github.com/AztecProtocol/aztec-packages/issues/10396)) ([f3c7294](https://github.com/AztecProtocol/aztec-packages/commit/f3c72942370a3ce01b73807bd729bb0d7500c177)) +* Bot waits for pxe synch ([#10316](https://github.com/AztecProtocol/aztec-packages/issues/10316)) ([ebd4165](https://github.com/AztecProtocol/aztec-packages/commit/ebd41651f5912fc2e0d1aa5d0df154620341c755)) +* Boxes webpack config ([#10548](https://github.com/AztecProtocol/aztec-packages/issues/10548)) ([49f9418](https://github.com/AztecProtocol/aztec-packages/commit/49f941848ce1d42530c56e2941de6133ab852c14)) +* Bump devbox image version ([#10836](https://github.com/AztecProtocol/aztec-packages/issues/10836)) ([b13bc93](https://github.com/AztecProtocol/aztec-packages/commit/b13bc93ae3e2d71259adc1a23c8cea462084ec08)) +* Bump hard coded SRS size for wasm from 2^19 to 2^10 ([#10596](https://github.com/AztecProtocol/aztec-packages/issues/10596)) ([a37f82d](https://github.com/AztecProtocol/aztec-packages/commit/a37f82d2ed6a4512eb38f8fa576f52a06ddbdfba)) +* Bump timeout for failing data store tests ([#10639](https://github.com/AztecProtocol/aztec-packages/issues/10639)) ([c75fee0](https://github.com/AztecProtocol/aztec-packages/commit/c75fee0ff34f5019ffc55d424089724a66182a6b)) +* Cache ([#10692](https://github.com/AztecProtocol/aztec-packages/issues/10692)) ([1b1306c](https://github.com/AztecProtocol/aztec-packages/commit/1b1306c7dbd9d363181146e02181af4727779b42)) +* Casting vk to rawbuffer before wasm so it reads from the correct offset ([#10769](https://github.com/AztecProtocol/aztec-packages/issues/10769)) ([6a5bcfd](https://github.com/AztecProtocol/aztec-packages/commit/6a5bcfd2dc1a2bef6df2b93e9afa137a9b4ea315)) +* **ci:** Bb-bench ([#10894](https://github.com/AztecProtocol/aztec-packages/issues/10894)) ([6c7c4f3](https://github.com/AztecProtocol/aztec-packages/commit/6c7c4f35559def6e4e5845e7c4965265ab859f8f)) +* **ci:** Boxes ([#10895](https://github.com/AztecProtocol/aztec-packages/issues/10895)) ([a99619c](https://github.com/AztecProtocol/aztec-packages/commit/a99619c0d3511da657426b46d3c42d0ccaaf58fd)) +* **ci:** Network-test timing ([#10725](https://github.com/AztecProtocol/aztec-packages/issues/10725)) ([9c9a2dc](https://github.com/AztecProtocol/aztec-packages/commit/9c9a2dcac8f7e14c1c5ec5d54d48a04a80284497)) +* Cl/ci3.1 ([#10888](https://github.com/AztecProtocol/aztec-packages/issues/10888)) ([2454a26](https://github.com/AztecProtocol/aztec-packages/commit/2454a262cce5d804420ad8e11c3e0b8f10a6e218)) +* Consider prereleases to be compatible with pre-1.0.0 releases (https://github.com/noir-lang/noir/pull/6580) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Correct signed integer handling in `noirc_abi` (https://github.com/noir-lang/noir/pull/6638) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Correct size in bytes of a complete address ([#10574](https://github.com/AztecProtocol/aztec-packages/issues/10574)) ([e72b988](https://github.com/AztecProtocol/aztec-packages/commit/e72b9889fe64dab5382b1352744f7ff4ac9884a1)) +* Correct type when simplifying `derive_pedersen_generators` (https://github.com/noir-lang/noir/pull/6579) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Correct types returned by constant EC operations simplified within SSA (https://github.com/noir-lang/noir/pull/6652) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Deploy preview master ([#10227](https://github.com/AztecProtocol/aztec-packages/issues/10227)) ([321a175](https://github.com/AztecProtocol/aztec-packages/commit/321a17531eb5d440f2726ff32bc6e157a732a8ed)) +* Destroy old masternet if we can ([#10584](https://github.com/AztecProtocol/aztec-packages/issues/10584)) ([679684d](https://github.com/AztecProtocol/aztec-packages/commit/679684da0e00799a6c861234f2a4c731c1d6fa61)) +* Disable failure persistance in nargo test fuzzing (https://github.com/noir-lang/noir/pull/6777) ([8956e28](https://github.com/AztecProtocol/aztec-packages/commit/8956e28269a045732e733b5197bdab5e46cdf354)) +* Disallow `#[export]` on associated methods (https://github.com/noir-lang/noir/pull/6626) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Do not abort blockstream loop during sync ([#10884](https://github.com/AztecProtocol/aztec-packages/issues/10884)) ([69aaefd](https://github.com/AztecProtocol/aztec-packages/commit/69aaefd717f8e66a104caa6e270b5cbdb9424af6)) +* Do not attempt proof quote on empty epoch ([#10557](https://github.com/AztecProtocol/aztec-packages/issues/10557)) ([39d3bc2](https://github.com/AztecProtocol/aztec-packages/commit/39d3bc286ab7ac33a83f27e09df7dd1a482fadf4)) +* Do not load pino-pretty in production bundles ([#10578](https://github.com/AztecProtocol/aztec-packages/issues/10578)) ([e515e6e](https://github.com/AztecProtocol/aztec-packages/commit/e515e6e7644180bab72eb693d83b9496919cc159)) +* Do not merge expressions that contain output witnesses (https://github.com/noir-lang/noir/pull/6757) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Do not start duplicate proving jobs if existing claim ([#10793](https://github.com/AztecProtocol/aztec-packages/issues/10793)) ([677c0f4](https://github.com/AztecProtocol/aztec-packages/commit/677c0f4c1fa5ad6c8eea4d16217e5f3ddef7926d)) +* Do not warn on unused functions marked with #[export] (https://github.com/noir-lang/noir/pull/6625) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Docker compose aztec up fix ([#10197](https://github.com/AztecProtocol/aztec-packages/issues/10197)) ([d7ae959](https://github.com/AztecProtocol/aztec-packages/commit/d7ae95908f14693e18fb6aefc50702ec4857f51a)) +* Docs preview on master ([#10254](https://github.com/AztecProtocol/aztec-packages/issues/10254)) ([37684cc](https://github.com/AztecProtocol/aztec-packages/commit/37684ccc686c04c4f2e069eee9e4c356e891a864)) +* Don't pass default value for --node-url ([#10427](https://github.com/AztecProtocol/aztec-packages/issues/10427)) ([5299481](https://github.com/AztecProtocol/aztec-packages/commit/5299481bb631fa57b9e59cb923139d161b71e6b6)), closes [#10419](https://github.com/AztecProtocol/aztec-packages/issues/10419) +* Don't remove necessary RC instructions in DIE pass (https://github.com/noir-lang/noir/pull/6585) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Don't report visibility errors when elaborating comptime value (https://github.com/noir-lang/noir/pull/6498) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Don't store indices of zero leaves. ([#10270](https://github.com/AztecProtocol/aztec-packages/issues/10270)) ([c22be8b](https://github.com/AztecProtocol/aztec-packages/commit/c22be8b23e6d16cf4a60509494b979c3edfdba9b)) +* Don't U128::from_integer(u128) ([#10865](https://github.com/AztecProtocol/aztec-packages/issues/10865)) ([3d00d34](https://github.com/AztecProtocol/aztec-packages/commit/3d00d34496676d5c342dceea4c1e7d0b3fc4e974)) +* Double slash in faucet URL ([#10883](https://github.com/AztecProtocol/aztec-packages/issues/10883)) ([9aff0e1](https://github.com/AztecProtocol/aztec-packages/commit/9aff0e1a1ba2782d3c7de850d7e699038ec7f7cf)) +* Ensure LMDB store metrics have hard coded descriptions ([#10642](https://github.com/AztecProtocol/aztec-packages/issues/10642)) ([043e2c2](https://github.com/AztecProtocol/aztec-packages/commit/043e2c2ad3101a81a197f14307d9d8b1b9f699d3)) +* Expect proper duplicate nullifier error patterns in e2e tests ([#10256](https://github.com/AztecProtocol/aztec-packages/issues/10256)) ([4ee8344](https://github.com/AztecProtocol/aztec-packages/commit/4ee83448a24be1944ca8c71d42ae8aa15049af10)) +* Flamegraph script (and enable > 1 circuit) ([#10065](https://github.com/AztecProtocol/aztec-packages/issues/10065)) ([0c3b7ef](https://github.com/AztecProtocol/aztec-packages/commit/0c3b7ef956774056d3ff51a52117b6656036d21b)) +* Formatting master ([#10583](https://github.com/AztecProtocol/aztec-packages/issues/10583)) ([79e49c9](https://github.com/AztecProtocol/aztec-packages/commit/79e49c9419ddd96cb0046c70bce527b289203d1f)) +* Get e2e jobs ([#10689](https://github.com/AztecProtocol/aztec-packages/issues/10689)) ([37e1999](https://github.com/AztecProtocol/aztec-packages/commit/37e1999f9f96271faa8cba2fda44858276266a0c)) +* Get node info from a PXE ([#10420](https://github.com/AztecProtocol/aztec-packages/issues/10420)) ([ed972f3](https://github.com/AztecProtocol/aztec-packages/commit/ed972f320c350c37628b583b0913a554ee1745df)) +* Git dependency trailing slash (https://github.com/noir-lang/noir/pull/6725) ([f4ed66b](https://github.com/AztecProtocol/aztec-packages/commit/f4ed66b6535818dc87d69ff451bb6aaabd2df8ec)) +* Give build:fast a try in build ([#10702](https://github.com/AztecProtocol/aztec-packages/issues/10702)) ([32095f6](https://github.com/AztecProtocol/aztec-packages/commit/32095f63f4e1585e66251369e234c742aab0fa04)) +* Handle calls to non-existent contracts in AVM witgen ([#10862](https://github.com/AztecProtocol/aztec-packages/issues/10862)) ([8820bd5](https://github.com/AztecProtocol/aztec-packages/commit/8820bd5f3004fedd6c286e2dbf5f8b24fc767fd2)) +* Hotfix master runner choice ([9e13b51](https://github.com/AztecProtocol/aztec-packages/commit/9e13b510dbe96e09066afa5f42e7a03621c52f19)) +* Improve type error when indexing a variable of unknown type (https://github.com/noir-lang/noir/pull/6744) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Increase default heartbeat ([#10891](https://github.com/AztecProtocol/aztec-packages/issues/10891)) ([3b131aa](https://github.com/AztecProtocol/aztec-packages/commit/3b131aa677a994b12af0a24aa3e14a4abd0cfc70)) +* Increase test timeouts ([#10205](https://github.com/AztecProtocol/aztec-packages/issues/10205)) ([195aa3d](https://github.com/AztecProtocol/aztec-packages/commit/195aa3d6a708a7e676416745552416d1f69aa6c3)) +* Increase timeouts ([#10412](https://github.com/AztecProtocol/aztec-packages/issues/10412)) ([d3b8838](https://github.com/AztecProtocol/aztec-packages/commit/d3b883877620783d2e818650b5435cb243c56c96)) +* Link in README.md ([#10471](https://github.com/AztecProtocol/aztec-packages/issues/10471)) ([fca9600](https://github.com/AztecProtocol/aztec-packages/commit/fca96007d6055dcf00b72a46630c680fcb6d190d)) +* Log level not honored with multi transport ([#10643](https://github.com/AztecProtocol/aztec-packages/issues/10643)) ([e1e5864](https://github.com/AztecProtocol/aztec-packages/commit/e1e586479840b18f52f3218c499a476691d93e48)) +* LSP auto-import text indent (https://github.com/noir-lang/noir/pull/6699) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* LSP code action wasn't triggering on beginning or end of identifier (https://github.com/noir-lang/noir/pull/6616) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* **LSP:** Use generic self type to narrow down methods to complete (https://github.com/noir-lang/noir/pull/6617) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Map entry point indexes after all ssa passes (https://github.com/noir-lang/noir/pull/6740) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Matching release branches ([#10842](https://github.com/AztecProtocol/aztec-packages/issues/10842)) ([96ebc0c](https://github.com/AztecProtocol/aztec-packages/commit/96ebc0cf40daee61644471369161fb7438c72431)) +* Memory leak in the broker ([#10567](https://github.com/AztecProtocol/aztec-packages/issues/10567)) ([ecc037f](https://github.com/AztecProtocol/aztec-packages/commit/ecc037f31fc2a5a02484762fdf90302059b34502)) +* Minimal change to avoid reverting entire PR [#6685](https://github.com/AztecProtocol/aztec-packages/issues/6685) (https://github.com/noir-lang/noir/pull/6778) ([8956e28](https://github.com/AztecProtocol/aztec-packages/commit/8956e28269a045732e733b5197bdab5e46cdf354)) +* Mispelled aztec ([#10491](https://github.com/AztecProtocol/aztec-packages/issues/10491)) ([866a5f7](https://github.com/AztecProtocol/aztec-packages/commit/866a5f75ff4d4c9145fc00b269ff858e84b14c6c)) +* Move spartan-script tf to spartan, use file in bucket ([#10395](https://github.com/AztecProtocol/aztec-packages/issues/10395)) ([5cef628](https://github.com/AztecProtocol/aztec-packages/commit/5cef62834e76f57514d0d09c24e4a2c98ea05485)) +* Nit ([#10392](https://github.com/AztecProtocol/aztec-packages/issues/10392)) ([d6985a8](https://github.com/AztecProtocol/aztec-packages/commit/d6985a80e82ee671a562866d7ed978c6f6e1b659)) +* Optimize array ref counts to copy arrays much less often (https://github.com/noir-lang/noir/pull/6685) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Optimizer to keep track of changing opcode locations (https://github.com/noir-lang/noir/pull/6781) ([8956e28](https://github.com/AztecProtocol/aztec-packages/commit/8956e28269a045732e733b5197bdab5e46cdf354)) +* **p2p:** Default peer score penalties ([#10896](https://github.com/AztecProtocol/aztec-packages/issues/10896)) ([73eec43](https://github.com/AztecProtocol/aztec-packages/commit/73eec43282f3bf8ebc0699c9a52b5bc21066d8eb)) +* **p2p:** Less verbose error ([#10886](https://github.com/AztecProtocol/aztec-packages/issues/10886)) ([ca51e15](https://github.com/AztecProtocol/aztec-packages/commit/ca51e151b9e00817731c330062b0812a6cf994fc)) +* **p2p:** Override msg Id ([#10415](https://github.com/AztecProtocol/aztec-packages/issues/10415)) ([990d11b](https://github.com/AztecProtocol/aztec-packages/commit/990d11b1d70126bb545e834724e51a5f8e46e64a)) +* Parse a bit more SSA stuff (https://github.com/noir-lang/noir/pull/6599) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Parser would hand on function type with colon in it (https://github.com/noir-lang/noir/pull/6764) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Pass salt to deploy-l1-contracts.sh ([#10586](https://github.com/AztecProtocol/aztec-packages/issues/10586)) ([d6be2c8](https://github.com/AztecProtocol/aztec-packages/commit/d6be2c84ba94ca69fd99a186374edc68afe3ebd6)) +* Pod anti affinity spans all namespaces ([#10475](https://github.com/AztecProtocol/aztec-packages/issues/10475)) ([2d4dc3d](https://github.com/AztecProtocol/aztec-packages/commit/2d4dc3dffc98af0361b54f2884a8a0a9f496bed1)) +* Preserve newlines between comments when formatting statements (https://github.com/noir-lang/noir/pull/6601) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Prevent hoisting binary instructions which can overflow (https://github.com/noir-lang/noir/pull/6672) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Print ssa blocks without recursion (https://github.com/noir-lang/noir/pull/6715) ([f4ed66b](https://github.com/AztecProtocol/aztec-packages/commit/f4ed66b6535818dc87d69ff451bb6aaabd2df8ec)) +* Println("{{}}") was printing "{{}}" instead of "{}" (https://github.com/noir-lang/noir/pull/6745) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Properly trace storage reads to slots never written before in AVM ([#10560](https://github.com/AztecProtocol/aztec-packages/issues/10560)) ([410c730](https://github.com/AztecProtocol/aztec-packages/commit/410c730d31773ce1f290f403e53f1e405fe6feda)) +* Prover-agent.yaml syntax ([#10131](https://github.com/AztecProtocol/aztec-packages/issues/10131)) ([a238fe6](https://github.com/AztecProtocol/aztec-packages/commit/a238fe654eb5d5c0f3ff09b401ab87a05876eea3)) +* **prover:** Handle starting blocks out of order in prover ([#10350](https://github.com/AztecProtocol/aztec-packages/issues/10350)) ([9106102](https://github.com/AztecProtocol/aztec-packages/commit/910610251e04bd9e50a4cc6da8a3230c20e49be6)) +* Publicly register contract classes ([#10385](https://github.com/AztecProtocol/aztec-packages/issues/10385)) ([94e6e1a](https://github.com/AztecProtocol/aztec-packages/commit/94e6e1a954911b81e6af85edff55c64f13595b20)) +* Publish-aztec-packages.yml ([#10880](https://github.com/AztecProtocol/aztec-packages/issues/10880)) ([8b4387d](https://github.com/AztecProtocol/aztec-packages/commit/8b4387d0874652b1ec3b05b2346d0187513e7160)) +* Race condition in block stream ([#10779](https://github.com/AztecProtocol/aztec-packages/issues/10779)) ([64bccd0](https://github.com/AztecProtocol/aztec-packages/commit/64bccd0e3423856aadc58890e6a689db4af08356)) +* Race condition when cleaning epoch proof quotes ([#10795](https://github.com/AztecProtocol/aztec-packages/issues/10795)) ([f540fbe](https://github.com/AztecProtocol/aztec-packages/commit/f540fbee724c2bfe29e0b0bca7759c721a8aaec8)) +* Reduce peer check interval for e2e tests ([#10890](https://github.com/AztecProtocol/aztec-packages/issues/10890)) ([394c9df](https://github.com/AztecProtocol/aztec-packages/commit/394c9df873db4055a716bcf3bda17d57724a388b)) +* Release l1-contracts ([#10095](https://github.com/AztecProtocol/aztec-packages/issues/10095)) ([29f0d7a](https://github.com/AztecProtocol/aztec-packages/commit/29f0d7af38f8663f49e9522120725992dc9975e5)) +* Remove `compiler_version` from new `Nargo.toml` (https://github.com/noir-lang/noir/pull/6590) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Remove auto verify in cbind ivc prove ([#10627](https://github.com/AztecProtocol/aztec-packages/issues/10627)) ([d773423](https://github.com/AztecProtocol/aztec-packages/commit/d773423fb4c701d830ac2a732ab9bbc205396a63)) +* Remove bench-summaryfuntil fixed ([ccfefab](https://github.com/AztecProtocol/aztec-packages/commit/ccfefab8cb0fd5c8f522d13121e888d45a33a26f)) +* Remove otel collector endpoint ([#10604](https://github.com/AztecProtocol/aztec-packages/issues/10604)) ([276a82c](https://github.com/AztecProtocol/aztec-packages/commit/276a82c2f34101fee1d2b7526f50dd76663c56cb)) +* Remove src build from doc build flow ([#10127](https://github.com/AztecProtocol/aztec-packages/issues/10127)) ([fbfe1b1](https://github.com/AztecProtocol/aztec-packages/commit/fbfe1b113ab8d870f9a72401c07202265aecd7a7)) +* Remove table shifts ([#10814](https://github.com/AztecProtocol/aztec-packages/issues/10814)) ([469476b](https://github.com/AztecProtocol/aztec-packages/commit/469476bc73606659da58d492b2640dea4ac924c2)) +* Retries in earthly-ci ([#10889](https://github.com/AztecProtocol/aztec-packages/issues/10889)) ([804cd7f](https://github.com/AztecProtocol/aztec-packages/commit/804cd7f8eef2489f0cfd04ec9a47c67bd1c1f130)) +* Revert "feat: Avoid inserting an empty leaf in indexed trees on update" ([#10319](https://github.com/AztecProtocol/aztec-packages/issues/10319)) ([887c011](https://github.com/AztecProtocol/aztec-packages/commit/887c01103255ea4cbbb6cb33c8771d47123b3bff)) +* Revert "feat: blobs. ([#9302](https://github.com/AztecProtocol/aztec-packages/issues/9302))" ([#10187](https://github.com/AztecProtocol/aztec-packages/issues/10187)) ([a415f65](https://github.com/AztecProtocol/aztec-packages/commit/a415f6552ae9893699747b4d1fc799553e9a9a7e)) +* Revert "feat: integrate base fee computation into rollup" ([#10166](https://github.com/AztecProtocol/aztec-packages/issues/10166)) ([1a207f5](https://github.com/AztecProtocol/aztec-packages/commit/1a207f59c76393b949750763b19193cd8b9bd804)) +* Revert "feat: zip and propagate private logs" ([#10302](https://github.com/AztecProtocol/aztec-packages/issues/10302)) ([9d70728](https://github.com/AztecProtocol/aztec-packages/commit/9d70728f0e494bbe63ecf7875877344de776d438)) +* **revert:** "chore: increase default peer discovery heartbeat to 30 seconds" ([#10887](https://github.com/AztecProtocol/aztec-packages/issues/10887)) ([852afb2](https://github.com/AztecProtocol/aztec-packages/commit/852afb2be8af4d643c47d7ec6db868f4795575b0)) +* Safely insert sibling paths ([#10423](https://github.com/AztecProtocol/aztec-packages/issues/10423)) ([41f7645](https://github.com/AztecProtocol/aztec-packages/commit/41f76457355fc10781613cdee7bfe0b7207f2fb4)) +* Sequencer negative histogram recodings ([#10490](https://github.com/AztecProtocol/aztec-packages/issues/10490)) ([623f3e2](https://github.com/AztecProtocol/aztec-packages/commit/623f3e240da5a1004b4b3fc025b17d9268482eb8)) +* Several format string fixes and improvements (https://github.com/noir-lang/noir/pull/6703) ([f4ed66b](https://github.com/AztecProtocol/aztec-packages/commit/f4ed66b6535818dc87d69ff451bb6aaabd2df8ec)) +* Simulation error enriching ([#10595](https://github.com/AztecProtocol/aztec-packages/issues/10595)) ([2c36088](https://github.com/AztecProtocol/aztec-packages/commit/2c36088c4009fef4054c2414bd50034b59e5f265)) +* Small fixes to avm witgen ([#10749](https://github.com/AztecProtocol/aztec-packages/issues/10749)) ([96887b6](https://github.com/AztecProtocol/aztec-packages/commit/96887b60c3a6a1aaf4fa5b7623e664917e7a68bc)) +* **ssa:** Don't deduplicate constraints in blocks that are not dominated (https://github.com/noir-lang/noir/pull/6627) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* **ssa:** Remove RC tracker in DIE (https://github.com/noir-lang/noir/pull/6700) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* **ssa:** Track all local allocations during flattening (https://github.com/noir-lang/noir/pull/6619) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Strip wasm debug ([#9987](https://github.com/AztecProtocol/aztec-packages/issues/9987)) ([62a6b66](https://github.com/AztecProtocol/aztec-packages/commit/62a6b662f1ef20a603177c55c199de4a79b65b5c)) +* Temporary fix for private kernel tail proving ([#10593](https://github.com/AztecProtocol/aztec-packages/issues/10593)) ([d194cdf](https://github.com/AztecProtocol/aztec-packages/commit/d194cdfeabe4d90f786b1ab36a093a27be9f71c3)) +* **testdata:** Relative path calculation ([#10791](https://github.com/AztecProtocol/aztec-packages/issues/10791)) ([5a530db](https://github.com/AztecProtocol/aztec-packages/commit/5a530db5c42743e6eff846669141527ae1344bfe)) +* Tf vars ([#10457](https://github.com/AztecProtocol/aztec-packages/issues/10457)) ([00aaef6](https://github.com/AztecProtocol/aztec-packages/commit/00aaef6a544580d8ec8a0bb64ca4c40a185b6410)) +* ToBlock argument in L1 getLogs is inclusive ([#10828](https://github.com/AztecProtocol/aztec-packages/issues/10828)) ([970ad77](https://github.com/AztecProtocol/aztec-packages/commit/970ad77966a17fd5c8071a7c3c3a405f83630c5d)) +* Track published bytecode ([#10636](https://github.com/AztecProtocol/aztec-packages/issues/10636)) ([cadb4ce](https://github.com/AztecProtocol/aztec-packages/commit/cadb4ce351fa83a55177e0cf50dadf09436b44a4)) +* Try fix e2e epochs in CI ([#10804](https://github.com/AztecProtocol/aztec-packages/issues/10804)) ([ba28788](https://github.com/AztecProtocol/aztec-packages/commit/ba28788de22b3209ec324633e91875b3b4b86332)) +* Tweaking Fr and Fq fromString functionality to distinguish number-only strings ([#10529](https://github.com/AztecProtocol/aztec-packages/issues/10529)) ([736fce1](https://github.com/AztecProtocol/aztec-packages/commit/736fce1f77533925943ef363d1803b2e55f83609)) +* Typo in u128 docs (https://github.com/noir-lang/noir/pull/6711) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Update run.sh for new devbox version ([#10851](https://github.com/AztecProtocol/aztec-packages/issues/10851)) ([e867e87](https://github.com/AztecProtocol/aztec-packages/commit/e867e87e4e5e4b140bf8ec3e5ee75abd24571bb1)) +* Url in bbup install ([#10456](https://github.com/AztecProtocol/aztec-packages/issues/10456)) ([1b0dfb7](https://github.com/AztecProtocol/aztec-packages/commit/1b0dfb77612cae9fa026da1d453bdf0d89442200)) +* Use correct size for databus_id ([#10673](https://github.com/AztecProtocol/aztec-packages/issues/10673)) ([95eb658](https://github.com/AztecProtocol/aztec-packages/commit/95eb658f90687c75589b345f95a904d96e2a8e62)) +* Use correct type for attribute arguments (https://github.com/noir-lang/noir/pull/6640) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Use current base fee for public fee payment ([#10230](https://github.com/AztecProtocol/aztec-packages/issues/10230)) ([f081d80](https://github.com/AztecProtocol/aztec-packages/commit/f081d8013ce37a2109750424d1ed615411d9056a)) +* Use e2e structure in cbind ([#10585](https://github.com/AztecProtocol/aztec-packages/issues/10585)) ([985aef1](https://github.com/AztecProtocol/aztec-packages/commit/985aef16ce612a9d3d7ff27b87b871a01911002e)) +* Use extension in docs link so it also works on GitHub (https://github.com/noir-lang/noir/pull/6787) ([8956e28](https://github.com/AztecProtocol/aztec-packages/commit/8956e28269a045732e733b5197bdab5e46cdf354)) +* Use throw instead of reject in broker facade ([#10735](https://github.com/AztecProtocol/aztec-packages/issues/10735)) ([cc6a72b](https://github.com/AztecProtocol/aztec-packages/commit/cc6a72be1c8dd5b133b5d82eac5224eef89d4ede)) +* Used signed division for signed modulo (https://github.com/noir-lang/noir/pull/6635) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Vm_full_tests.yml ([#10912](https://github.com/AztecProtocol/aztec-packages/issues/10912)) ([46c351d](https://github.com/AztecProtocol/aztec-packages/commit/46c351dc41c15a721ee3229e8c6c7284d3d5ace1)) +* Witness changes in file sponge.hpp ([#10345](https://github.com/AztecProtocol/aztec-packages/issues/10345)) ([4a38edf](https://github.com/AztecProtocol/aztec-packages/commit/4a38edfc1580aa1cb5113993ff8a2e5574076226)) +* Zero index is not always 0 ([#10135](https://github.com/AztecProtocol/aztec-packages/issues/10135)) ([bbac3d9](https://github.com/AztecProtocol/aztec-packages/commit/bbac3d9db1a4cd133c4949c3c25a17a7e39d14a2)) + + +### Miscellaneous + +* `contact` --> `sender` in PXE API ([#10861](https://github.com/AztecProtocol/aztec-packages/issues/10861)) ([8cb26e9](https://github.com/AztecProtocol/aztec-packages/commit/8cb26e929b9b9dc6822a56cc9b951d68547e20f4)) +* `getLogsByTags` request batching in `syncTaggedLogs` ([#10716](https://github.com/AztecProtocol/aztec-packages/issues/10716)) ([bbbf38b](https://github.com/AztecProtocol/aztec-packages/commit/bbbf38b35c7f04414eeb7991a1ee45b19b16664f)) +* 24 second epochs in CI ([#10646](https://github.com/AztecProtocol/aztec-packages/issues/10646)) ([6fe5d19](https://github.com/AztecProtocol/aztec-packages/commit/6fe5d19516ebef965f685d0dfbc0ccaf06a19795)) +* Add `Instruction::map_values_mut` (https://github.com/noir-lang/noir/pull/6756) ([308c5ce](https://github.com/AztecProtocol/aztec-packages/commit/308c5cef519b68f5951750851124c0bf8f4ba7ee)) +* Add `ram_blowup_regression` to memory report (https://github.com/noir-lang/noir/pull/6683) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Add a few regression tests for [#6674](https://github.com/AztecProtocol/aztec-packages/issues/6674) (https://github.com/noir-lang/noir/pull/6687) ([f4ed66b](https://github.com/AztecProtocol/aztec-packages/commit/f4ed66b6535818dc87d69ff451bb6aaabd2df8ec)) +* Add errors to abis ([#10697](https://github.com/AztecProtocol/aztec-packages/issues/10697)) ([5c8e017](https://github.com/AztecProtocol/aztec-packages/commit/5c8e0174aade70c418a2d02cd9dc0ded3baa0745)) +* Add gossip to default test set ([#10892](https://github.com/AztecProtocol/aztec-packages/issues/10892)) ([09caf4c](https://github.com/AztecProtocol/aztec-packages/commit/09caf4cc2f7b1f220c7cd78272b7677000172e7c)) +* Add panic for compiler error described in [#6620](https://github.com/AztecProtocol/aztec-packages/issues/6620) (https://github.com/noir-lang/noir/pull/6621) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Add retries for prover node p2p test ([#10699](https://github.com/AztecProtocol/aztec-packages/issues/10699)) ([4115bf9](https://github.com/AztecProtocol/aztec-packages/commit/4115bf985108e183f8a57aaf76289326251b8c7b)) +* Add script to check for critical libraries supporting a given Noir version (https://github.com/noir-lang/noir/pull/6697) ([f4ed66b](https://github.com/AztecProtocol/aztec-packages/commit/f4ed66b6535818dc87d69ff451bb6aaabd2df8ec)) +* Add spans to proving job ([#10794](https://github.com/AztecProtocol/aztec-packages/issues/10794)) ([df3c51b](https://github.com/AztecProtocol/aztec-packages/commit/df3c51bfdb9770a95f6223fc85baf8632ca93279)) +* Add traces and histograms to avm simulator ([#10233](https://github.com/AztecProtocol/aztec-packages/issues/10233)) ([e83726d](https://github.com/AztecProtocol/aztec-packages/commit/e83726dddbc7ea98c86b99a7439e39f076a63b25)), closes [#10146](https://github.com/AztecProtocol/aztec-packages/issues/10146) +* Added ref to env variables ([#10193](https://github.com/AztecProtocol/aztec-packages/issues/10193)) ([b51fc43](https://github.com/AztecProtocol/aztec-packages/commit/b51fc43a6fbd07eb89faae5bd518246182fa9d0f)) +* Average alerts across namespace for 1 hour ([#10827](https://github.com/AztecProtocol/aztec-packages/issues/10827)) ([962a7a2](https://github.com/AztecProtocol/aztec-packages/commit/962a7a25d71d208992b16fcfd21e86874db5ec05)) +* Avm-proving and avm-integration tests do not require simulator to export function with jest mocks ([#10228](https://github.com/AztecProtocol/aztec-packages/issues/10228)) ([f28fcdb](https://github.com/AztecProtocol/aztec-packages/commit/f28fcdb1e41aa353f0fdc2233ea66ae51ef745a4)) +* **avm:** Conditionally enable avm recursion unit tests based on an env variable ([#10873](https://github.com/AztecProtocol/aztec-packages/issues/10873)) ([7a9506c](https://github.com/AztecProtocol/aztec-packages/commit/7a9506c6f400a88cbdbc9fad75d7b2bd35bea2cf)) +* **avm:** Disable fake avm recursive verifier from the public base rollup ([#10690](https://github.com/AztecProtocol/aztec-packages/issues/10690)) ([b6c9c41](https://github.com/AztecProtocol/aztec-packages/commit/b6c9c4141b4ca6b1fc847068d352ee17590dea09)) +* **avm:** Extra column information in lookups ([#10905](https://github.com/AztecProtocol/aztec-packages/issues/10905)) ([ef247d4](https://github.com/AztecProtocol/aztec-packages/commit/ef247d4d68ce4aadb4c45b1f75d71a411e7102b6)) +* **avm:** Fake verification routine for avm recursion in public base rollup ([#10382](https://github.com/AztecProtocol/aztec-packages/issues/10382)) ([a1e5966](https://github.com/AztecProtocol/aztec-packages/commit/a1e5966ffe98351d848bfa47608a2f22c381acfb)), closes [#10243](https://github.com/AztecProtocol/aztec-packages/issues/10243) +* **avm:** Gas constants adjustment based on trace rows accounting ([#10614](https://github.com/AztecProtocol/aztec-packages/issues/10614)) ([fc729ef](https://github.com/AztecProtocol/aztec-packages/commit/fc729ef3af7ec33f48dbb9fae3820a59a4a26479)), closes [#10368](https://github.com/AztecProtocol/aztec-packages/issues/10368) +* **avm:** Handle parsing error ([#10203](https://github.com/AztecProtocol/aztec-packages/issues/10203)) ([3c623fc](https://github.com/AztecProtocol/aztec-packages/commit/3c623fc2d857d6792b557dc7d1ccb929274046bb)), closes [#9770](https://github.com/AztecProtocol/aztec-packages/issues/9770) +* **avm:** More pilcom compat changes ([#10569](https://github.com/AztecProtocol/aztec-packages/issues/10569)) ([f18d701](https://github.com/AztecProtocol/aztec-packages/commit/f18d701aa527c68a1adcc4b8acbb9c7bd239468a)) +* **avm:** Operands reordering ([#10182](https://github.com/AztecProtocol/aztec-packages/issues/10182)) ([69bdf4f](https://github.com/AztecProtocol/aztec-packages/commit/69bdf4f0341cbd95908e5e632b71a57da5df1433)), closes [#10136](https://github.com/AztecProtocol/aztec-packages/issues/10136) +* **avm:** Pilcom compatibility changes ([#10544](https://github.com/AztecProtocol/aztec-packages/issues/10544)) ([fbc8c0e](https://github.com/AztecProtocol/aztec-packages/commit/fbc8c0e864b10d2265373688457a33d61517bbb4)) +* **avm:** Radix opcode - remove immediates ([#10696](https://github.com/AztecProtocol/aztec-packages/issues/10696)) ([4ac13e6](https://github.com/AztecProtocol/aztec-packages/commit/4ac13e642c958392ce5606684c044ea014325e26)), closes [#10371](https://github.com/AztecProtocol/aztec-packages/issues/10371) +* **avm:** Reduce the number of gates for fake AVM recursive verifier ([#10619](https://github.com/AztecProtocol/aztec-packages/issues/10619)) ([0be44b2](https://github.com/AztecProtocol/aztec-packages/commit/0be44b2837c40e4332babc98f3c8bcc22bb0aa2f)) +* **avm:** Remove function selector from AvmExecutionEnvironment ([#10532](https://github.com/AztecProtocol/aztec-packages/issues/10532)) ([fef5f93](https://github.com/AztecProtocol/aztec-packages/commit/fef5f93c617640116bb0eea0fc64d7f230c7b763)) +* **avm:** Remove function selector type of getenv opcode ([#10406](https://github.com/AztecProtocol/aztec-packages/issues/10406)) ([38c0c14](https://github.com/AztecProtocol/aztec-packages/commit/38c0c14fe90a1a920818f2f99a7d3204f0211091)), closes [#9396](https://github.com/AztecProtocol/aztec-packages/issues/9396) +* **avm:** Remove initialization for non-derived polynomials ([#10103](https://github.com/AztecProtocol/aztec-packages/issues/10103)) ([c6fdf4b](https://github.com/AztecProtocol/aztec-packages/commit/c6fdf4bda5c9ef32ca355cda9a5a0c7ed3d1a100)), closes [#10096](https://github.com/AztecProtocol/aztec-packages/issues/10096) +* **avm:** Zero initialization in avm public inputs and execution test fixes ([#10238](https://github.com/AztecProtocol/aztec-packages/issues/10238)) ([0c7c4c9](https://github.com/AztecProtocol/aztec-packages/commit/0c7c4c9bb0c01067abe57ccd06962d71c7279aa0)) +* Batch archiver requests ([#10442](https://github.com/AztecProtocol/aztec-packages/issues/10442)) ([9443e8e](https://github.com/AztecProtocol/aztec-packages/commit/9443e8ea62237201342f111d846d321612fa2bb3)) +* Better reqresp logging + handle empty responses in snappy ([#10657](https://github.com/AztecProtocol/aztec-packages/issues/10657)) ([934107f](https://github.com/AztecProtocol/aztec-packages/commit/934107f35c2f2772ad422bfa34357bbd64f5049d)) +* Boot node has fixed peer id private key ([#10352](https://github.com/AztecProtocol/aztec-packages/issues/10352)) ([cae1203](https://github.com/AztecProtocol/aztec-packages/commit/cae1203ec4263d3b64fbc3fba5cfa281922004bd)) +* Boxes tests cause resource issues ([#10676](https://github.com/AztecProtocol/aztec-packages/issues/10676)) ([ccf1c78](https://github.com/AztecProtocol/aztec-packages/commit/ccf1c781c9658a486b6d05576641555f1de7f4ad)) +* Bump alert in gossip_network.test.ts ([#10430](https://github.com/AztecProtocol/aztec-packages/issues/10430)) ([2c2169b](https://github.com/AztecProtocol/aztec-packages/commit/2c2169be46d489a1b2023b80e5426a13702c32ab)) +* Bump avm tree test timeout ([323e2eb](https://github.com/AztecProtocol/aztec-packages/commit/323e2ebcbd39ae49366b30f33c2fa499a65160bb)) +* Bump exp1 config to 48 validators ([#10577](https://github.com/AztecProtocol/aztec-packages/issues/10577)) ([0379718](https://github.com/AztecProtocol/aztec-packages/commit/03797181c72443a5a4aa4ce96df99e2517325f57)) +* Bump jest default test timeout to 30s ([#10550](https://github.com/AztecProtocol/aztec-packages/issues/10550)) ([841bf48](https://github.com/AztecProtocol/aztec-packages/commit/841bf48c27767c3a4a53aacd0115582e8397910f)) +* Bump metrics and node pool ([#10745](https://github.com/AztecProtocol/aztec-packages/issues/10745)) ([9bb88bf](https://github.com/AztecProtocol/aztec-packages/commit/9bb88bf323e68f42f34cba74ec270681d76d9bd4)) +* Bump mocha timeout ([#10571](https://github.com/AztecProtocol/aztec-packages/issues/10571)) ([35e525f](https://github.com/AztecProtocol/aztec-packages/commit/35e525fc9689718adecd49d3bd9e12c14640278d)) +* Bump proven timeout ([#10680](https://github.com/AztecProtocol/aztec-packages/issues/10680)) ([3f5cf6c](https://github.com/AztecProtocol/aztec-packages/commit/3f5cf6c0cb8340c9db5f1cb9c968d824fa95936f)) +* Bump prover agents ([#10626](https://github.com/AztecProtocol/aztec-packages/issues/10626)) ([64eea72](https://github.com/AztecProtocol/aztec-packages/commit/64eea721e3bba20b72c5f6d8922abc2a48c2ed65)) +* Bump timeout for after-hook for data store test again ([#10240](https://github.com/AztecProtocol/aztec-packages/issues/10240)) ([52047f0](https://github.com/AztecProtocol/aztec-packages/commit/52047f05495ef95a778e8669fc4e115cacb590a0)) +* Centralized helm flag for proving and clean release tf deploys ([#10221](https://github.com/AztecProtocol/aztec-packages/issues/10221)) ([c2c1744](https://github.com/AztecProtocol/aztec-packages/commit/c2c1744cb40f91773988476b23e61eb00babdc84)) +* Change Id to use a u32 (https://github.com/noir-lang/noir/pull/6807) ([d74d0fc](https://github.com/AztecProtocol/aztec-packages/commit/d74d0fcec24c533abc28320302e027470843e80c)) +* Check artifact consistency ([#10271](https://github.com/AztecProtocol/aztec-packages/issues/10271)) ([6a49405](https://github.com/AztecProtocol/aztec-packages/commit/6a494050f85510c18870117f376280d8e10ed486)) +* Check yarn version during bootstrap ([#10910](https://github.com/AztecProtocol/aztec-packages/issues/10910)) ([cbf949c](https://github.com/AztecProtocol/aztec-packages/commit/cbf949cd9179ddbe938f0e9f385fcc5a7e406a75)) +* Ci3 phase 1 ([#10042](https://github.com/AztecProtocol/aztec-packages/issues/10042)) ([641da4b](https://github.com/AztecProtocol/aztec-packages/commit/641da4bbd7f12d5a66e5763c18f5fa8f7c627c76)) +* **ci:** Active rollup circuits in compilation report (https://github.com/noir-lang/noir/pull/6813) ([308c5ce](https://github.com/AztecProtocol/aztec-packages/commit/308c5cef519b68f5951750851124c0bf8f4ba7ee)) +* **ci:** Add bloblib to external checks (https://github.com/noir-lang/noir/pull/6818) ([381b0b8](https://github.com/AztecProtocol/aztec-packages/commit/381b0b84d87dd31f8ab5a3e62928f9992837d4c0)) +* **ci:** Disable e2e_cheat_codes.test.ts ([#10897](https://github.com/AztecProtocol/aztec-packages/issues/10897)) ([ade87d0](https://github.com/AztecProtocol/aztec-packages/commit/ade87d0bad7af93efe5b1340bf0408972c575a57)) +* **ci:** Extend compiler memory report to external repos (https://github.com/noir-lang/noir/pull/6768) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* **ci:** Handle external libraries in compilation timing report (https://github.com/noir-lang/noir/pull/6750) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* **ci:** Move playwright install to `+deps` ([#10293](https://github.com/AztecProtocol/aztec-packages/issues/10293)) ([d7bd306](https://github.com/AztecProtocol/aztec-packages/commit/d7bd306ad85b663b96c022048840c51370da99ef)) +* **ci:** Prune launch templates job ([#10561](https://github.com/AztecProtocol/aztec-packages/issues/10561)) ([d6e4f4c](https://github.com/AztecProtocol/aztec-packages/commit/d6e4f4c9d5ca0f3fa9a0074e5c196c04c6d244e7)) +* **ci:** Reenable `rerun-check` job ([#10653](https://github.com/AztecProtocol/aztec-packages/issues/10653)) ([b2c4f48](https://github.com/AztecProtocol/aztec-packages/commit/b2c4f48db6bed6f0205a56d8df88ff8e1b02aafd)) +* CIVC VK ([#10223](https://github.com/AztecProtocol/aztec-packages/issues/10223)) ([089c34c](https://github.com/AztecProtocol/aztec-packages/commit/089c34cc3e9fb5cb493096246525c2205e646204)) +* Clean up archiver logs ([#10429](https://github.com/AztecProtocol/aztec-packages/issues/10429)) ([4fcbc59](https://github.com/AztecProtocol/aztec-packages/commit/4fcbc592c963389a132b5b72f0f68d1f6526943b)) +* Cleanup after e2e tests ([#10748](https://github.com/AztecProtocol/aztec-packages/issues/10748)) ([284b0a4](https://github.com/AztecProtocol/aztec-packages/commit/284b0a496f42813b956e55fbcd41c864dd278241)) +* Cleanup unrolling pass (https://github.com/noir-lang/noir/pull/6743) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Configuration updates for exp-1 ([#10840](https://github.com/AztecProtocol/aztec-packages/issues/10840)) ([bd72997](https://github.com/AztecProtocol/aztec-packages/commit/bd72997daa6e088433030d8b9bc3f7203170ac10)) +* Consolidate some CI workflows to reduce sprawl (https://github.com/noir-lang/noir/pull/6696) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Contracts on a diet ([#10389](https://github.com/AztecProtocol/aztec-packages/issues/10389)) ([dddb008](https://github.com/AztecProtocol/aztec-packages/commit/dddb008d0fe69da64574df9a21e0e91533f9ab15)) +* Declare global types ([#10206](https://github.com/AztecProtocol/aztec-packages/issues/10206)) ([7b2e343](https://github.com/AztecProtocol/aztec-packages/commit/7b2e343a61eb9c74f365758530deca87b40891d0)) +* Deduplicate constants across blocks ([#9972](https://github.com/AztecProtocol/aztec-packages/issues/9972)) ([69bb64f](https://github.com/AztecProtocol/aztec-packages/commit/69bb64fa34667810e96ea85c7594595522ccdce1)) +* Delete old serialization methods ([#9951](https://github.com/AztecProtocol/aztec-packages/issues/9951)) ([10d3f6f](https://github.com/AztecProtocol/aztec-packages/commit/10d3f6fe851dc73f5f12edec26b028fe526f0be6)) +* Derive PartialEq and Hash for FieldElement (https://github.com/noir-lang/noir/pull/6610) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Disable ARM CI ([#10682](https://github.com/AztecProtocol/aztec-packages/issues/10682)) ([b16945b](https://github.com/AztecProtocol/aztec-packages/commit/b16945b9c9e26d8de5502f698d2bd71e22c53807)) +* Disable bb-sanitizers.yml ([#10901](https://github.com/AztecProtocol/aztec-packages/issues/10901)) ([c31a21d](https://github.com/AztecProtocol/aztec-packages/commit/c31a21d2464e303d780d9153177ff188d685ba73)) +* Disable broken test ([#10663](https://github.com/AztecProtocol/aztec-packages/issues/10663)) ([0771260](https://github.com/AztecProtocol/aztec-packages/commit/0771260db2d2026f1ad9bdcb5ba71bdca1424fa7)) +* Disable flake in e2e_fees/private_payments ([#10898](https://github.com/AztecProtocol/aztec-packages/issues/10898)) ([49583a5](https://github.com/AztecProtocol/aztec-packages/commit/49583a52270d57bc9bbda0195d0f47bab438fd9b)) +* Disable ivc integration yarn tests ([#10625](https://github.com/AztecProtocol/aztec-packages/issues/10625)) ([7c50107](https://github.com/AztecProtocol/aztec-packages/commit/7c5010759f98aab2ee15325d8cbd8f2091aa6df0)) +* Do not print entire functions when running debug trace (https://github.com/noir-lang/noir/pull/6814) ([308c5ce](https://github.com/AztecProtocol/aztec-packages/commit/308c5cef519b68f5951750851124c0bf8f4ba7ee)) +* Do not run e2e-2-pxes along with e2e pxe test ([#10155](https://github.com/AztecProtocol/aztec-packages/issues/10155)) ([f0f8d22](https://github.com/AztecProtocol/aztec-packages/commit/f0f8d2277ffec4457cca89feb3795aa74cb43cd3)) +* **docs:** Remove additional `DEBUG` references, add note on `LOG_LEVEL`s ([#10434](https://github.com/AztecProtocol/aztec-packages/issues/10434)) ([e1e5906](https://github.com/AztecProtocol/aztec-packages/commit/e1e5906c1dd1af4c3865572111438185c6ec8a41)) +* **docs:** Update branding (https://github.com/noir-lang/noir/pull/6759) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* **docs:** Update migration notes ([#10829](https://github.com/AztecProtocol/aztec-packages/issues/10829)) ([be7cadf](https://github.com/AztecProtocol/aztec-packages/commit/be7cadf12d25042d39e6a500ae32a5002102d3da)) +* **docs:** Update migration_notes.md ([#10874](https://github.com/AztecProtocol/aztec-packages/issues/10874)) ([ab57045](https://github.com/AztecProtocol/aztec-packages/commit/ab570457e65f035356bc41c4ae9317caaae991fd)) +* **docs:** Workaround (https://github.com/noir-lang/noir/pull/6819) ([381b0b8](https://github.com/AztecProtocol/aztec-packages/commit/381b0b84d87dd31f8ab5a3e62928f9992837d4c0)) +* Documenting convenient redirect to the spartan creator ([#10565](https://github.com/AztecProtocol/aztec-packages/issues/10565)) ([b94b8ee](https://github.com/AztecProtocol/aztec-packages/commit/b94b8eeaa24edc099472e205c5031c1096bf1f56)) +* Don't generate proofs of verifier circuits in test ([#10405](https://github.com/AztecProtocol/aztec-packages/issues/10405)) ([c00ebdd](https://github.com/AztecProtocol/aztec-packages/commit/c00ebdd60373aa579587b03eeb4b44ada0bb1155)) +* Dont import things that themselves import jest in imported functions ([#10260](https://github.com/AztecProtocol/aztec-packages/issues/10260)) ([9440c1c](https://github.com/AztecProtocol/aztec-packages/commit/9440c1cf3834eea380014d55eef6e81cff8ffee8)) +* Enable nightly tests ([#10542](https://github.com/AztecProtocol/aztec-packages/issues/10542)) ([4fa068c](https://github.com/AztecProtocol/aztec-packages/commit/4fa068c692872b0fa2a1043a2f9e0984fd3c0e3d)) +* Fast epoch building test ([#10045](https://github.com/AztecProtocol/aztec-packages/issues/10045)) ([fb791a2](https://github.com/AztecProtocol/aztec-packages/commit/fb791a2ffc3f477c4526d7e14baf06dbe200144d)), closes [#9809](https://github.com/AztecProtocol/aztec-packages/issues/9809) +* Faucet LB if public, proving devnet ([#10665](https://github.com/AztecProtocol/aztec-packages/issues/10665)) ([996d921](https://github.com/AztecProtocol/aztec-packages/commit/996d9214aaf67d48673bab6554fafbc794e7afa2)) +* Fix bad merge in integration l1 publisher ([#10272](https://github.com/AztecProtocol/aztec-packages/issues/10272)) ([b5a6aa4](https://github.com/AztecProtocol/aztec-packages/commit/b5a6aa4ce51a27b220162d48ba065a0077b9fcd8)) +* Fix build issue from bad merge ([85c0676](https://github.com/AztecProtocol/aztec-packages/commit/85c0676647d9f8f7b2bceaf5f2da011b794abf68)) +* Fix devbox ([#10201](https://github.com/AztecProtocol/aztec-packages/issues/10201)) ([323eaee](https://github.com/AztecProtocol/aztec-packages/commit/323eaee1128b64c0e9749823e9e10a5b246375d4)) +* Fix migration notes ([#10252](https://github.com/AztecProtocol/aztec-packages/issues/10252)) ([05bdcd5](https://github.com/AztecProtocol/aztec-packages/commit/05bdcd51d45f35a3ed683c1a90bb8e9370533fb0)) +* Fix migration notes ([#10656](https://github.com/AztecProtocol/aztec-packages/issues/10656)) ([333d6ce](https://github.com/AztecProtocol/aztec-packages/commit/333d6ceffaab6e0be505a8f6214eb838846dcda4)) +* Fix pool metrics ([#9652](https://github.com/AztecProtocol/aztec-packages/issues/9652)) ([233b387](https://github.com/AztecProtocol/aztec-packages/commit/233b387495ae9d9161b95a64761246cc43200073)) +* Fix public keys deserialization ([#10647](https://github.com/AztecProtocol/aztec-packages/issues/10647)) ([12473c8](https://github.com/AztecProtocol/aztec-packages/commit/12473c85a073ef1a25f4f70881f77f3c08f41252)) +* Fix sassy-salamander chores v1 ([#10218](https://github.com/AztecProtocol/aztec-packages/issues/10218)) ([7227b48](https://github.com/AztecProtocol/aztec-packages/commit/7227b487f97e26a3f8f2aa8086fb7c2c7b0de557)), closes [#10074](https://github.com/AztecProtocol/aztec-packages/issues/10074) [#10075](https://github.com/AztecProtocol/aztec-packages/issues/10075) [#10077](https://github.com/AztecProtocol/aztec-packages/issues/10077) +* Fix tests in `noirc_abi_wasm` (https://github.com/noir-lang/noir/pull/6688) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Fix traces endpoint url in native testnet script ([#10309](https://github.com/AztecProtocol/aztec-packages/issues/10309)) ([2367c62](https://github.com/AztecProtocol/aztec-packages/commit/2367c629de001f70e455abdcb7984851bf19458c)) +* Fix typo in test name (https://github.com/noir-lang/noir/pull/6589) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Fix warning when compiling `noir_wasm` (https://github.com/noir-lang/noir/pull/6686) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Fixing sol warnings ([#10276](https://github.com/AztecProtocol/aztec-packages/issues/10276)) ([3d113b2](https://github.com/AztecProtocol/aztec-packages/commit/3d113b212b4641b2a97e6b2b0b4835908f3957c8)) +* Flush archiver metrics on startup ([f9810cc](https://github.com/AztecProtocol/aztec-packages/commit/f9810cc48f7379a0c02c76d8fc897d3ffc9d6ad8)) +* Fpc optimization, cleanup + docs ([#10555](https://github.com/AztecProtocol/aztec-packages/issues/10555)) ([e23fd0d](https://github.com/AztecProtocol/aztec-packages/commit/e23fd0dd95f193070e4a646ce5953d22e8a09476)) +* Free memory for silenced warnings early (https://github.com/noir-lang/noir/pull/6748) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Give validators/boot-nodes 100Gi in network configs ([f9810cc](https://github.com/AztecProtocol/aztec-packages/commit/f9810cc48f7379a0c02c76d8fc897d3ffc9d6ad8)) +* Granular CLI imports to reduce start time ([#10778](https://github.com/AztecProtocol/aztec-packages/issues/10778)) ([e2fd046](https://github.com/AztecProtocol/aztec-packages/commit/e2fd046250664cd785269a718b036c0310dfcda7)) +* Handle errors in e2e teardown to fix e2e token ([#10590](https://github.com/AztecProtocol/aztec-packages/issues/10590)) ([5d4cdc1](https://github.com/AztecProtocol/aztec-packages/commit/5d4cdc11977ea2af5e465092ce9e635414c13710)) +* Ignore almost-empty directories in nargo_cli tests (https://github.com/noir-lang/noir/pull/6611) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Improve error message of `&T` (https://github.com/noir-lang/noir/pull/6633) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Increase default peer discovery heartbeat to 30 seconds ([#10881](https://github.com/AztecProtocol/aztec-packages/issues/10881)) ([721cf2c](https://github.com/AztecProtocol/aztec-packages/commit/721cf2c87734b18a8a4b5b4695650ce8a6efc23f)) +* Increase test timeout to reduce flakes ([#10641](https://github.com/AztecProtocol/aztec-packages/issues/10641)) ([4ade2ad](https://github.com/AztecProtocol/aztec-packages/commit/4ade2ad6ab6d5306ba236457f0373122cc4b8fef)) +* Initial draft of testnet-runbook ([#10085](https://github.com/AztecProtocol/aztec-packages/issues/10085)) ([598c1b1](https://github.com/AztecProtocol/aztec-packages/commit/598c1b1645bf802999ea33c3a9f1914ca0adc9be)) +* Inject k8s pod name and uid ([#10633](https://github.com/AztecProtocol/aztec-packages/issues/10633)) ([eb472ff](https://github.com/AztecProtocol/aztec-packages/commit/eb472ff8ef38f1045d2c586ad74b4c8774771ac0)) +* L2 gas maximum is per-TX-public-portion. AVM startup gas is now 20k. ([#10214](https://github.com/AztecProtocol/aztec-packages/issues/10214)) ([1365401](https://github.com/AztecProtocol/aztec-packages/commit/1365401cb379d7206e268dc01a33110cecae7293)) +* Load balancers for the boot node, longer epochs ([#10632](https://github.com/AztecProtocol/aztec-packages/issues/10632)) ([001bbb1](https://github.com/AztecProtocol/aztec-packages/commit/001bbb13c70df891f12d7dd1c67cc261d66e0c05)) +* Lock CI to use ubuntu 22.04 (https://github.com/noir-lang/noir/pull/6755) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Log error in retry module ([#10719](https://github.com/AztecProtocol/aztec-packages/issues/10719)) ([84ea539](https://github.com/AztecProtocol/aztec-packages/commit/84ea539145173a88bddfdc617051f16a7aba9834)) +* Log manual contract class registrations ([#10354](https://github.com/AztecProtocol/aztec-packages/issues/10354)) ([da1470d](https://github.com/AztecProtocol/aztec-packages/commit/da1470d074f4884e61b51e450a661432c6f0a10f)) +* Log when validator enters commitee ([#10615](https://github.com/AztecProtocol/aztec-packages/issues/10615)) ([7746a39](https://github.com/AztecProtocol/aztec-packages/commit/7746a395ed0f7488d80c6b37d451dc65f1b5938d)), closes [#10337](https://github.com/AztecProtocol/aztec-packages/issues/10337) +* Lower public tx gas limit to 6M ([#10635](https://github.com/AztecProtocol/aztec-packages/issues/10635)) ([9836036](https://github.com/AztecProtocol/aztec-packages/commit/9836036053f1b5f3e57bf4e19bf0eb1a692306bd)) +* Make tests not silent if DEBUG set ([#10130](https://github.com/AztecProtocol/aztec-packages/issues/10130)) ([95e8406](https://github.com/AztecProtocol/aztec-packages/commit/95e84068824d6b933f0cea3aa6f356b8ddca494a)) +* Making bbup a shell script ([#10426](https://github.com/AztecProtocol/aztec-packages/issues/10426)) ([1c29554](https://github.com/AztecProtocol/aztec-packages/commit/1c29554929268fe9f53961325ae6af3f9b799b1c)) +* Manage call stacks using a tree (https://github.com/noir-lang/noir/pull/6791) ([381b0b8](https://github.com/AztecProtocol/aztec-packages/commit/381b0b84d87dd31f8ab5a3e62928f9992837d4c0)) +* **master:** Release 0.64.0 ([#10043](https://github.com/AztecProtocol/aztec-packages/issues/10043)) ([12b1daa](https://github.com/AztecProtocol/aztec-packages/commit/12b1daafa121452a1ba2d17228be335b1a45b818)) +* **master:** Release 0.65.0 ([#10181](https://github.com/AztecProtocol/aztec-packages/issues/10181)) ([903bcb0](https://github.com/AztecProtocol/aztec-packages/commit/903bcb0a42f7fd83fb7da97a13b763cf761336bd)) +* **master:** Release 0.65.1 ([#10219](https://github.com/AztecProtocol/aztec-packages/issues/10219)) ([62fc917](https://github.com/AztecProtocol/aztec-packages/commit/62fc9175019cb5f3fabca1a5f5ff9e04d708695e)) +* **master:** Release 0.65.2 ([#10258](https://github.com/AztecProtocol/aztec-packages/issues/10258)) ([10754db](https://github.com/AztecProtocol/aztec-packages/commit/10754db0e6626047d4fc59cd0d7bbb320606152a)) +* **master:** Release 0.66.0 ([#10282](https://github.com/AztecProtocol/aztec-packages/issues/10282)) ([fc61b27](https://github.com/AztecProtocol/aztec-packages/commit/fc61b27dde7c8d30712bf4910d45081caaf0bb53)) +* **master:** Release 0.67.0 ([#10472](https://github.com/AztecProtocol/aztec-packages/issues/10472)) ([19a500f](https://github.com/AztecProtocol/aztec-packages/commit/19a500ffc09ab8bc367a78599dd73a07a04b426e)) +* **master:** Release 0.67.1 ([#10684](https://github.com/AztecProtocol/aztec-packages/issues/10684)) ([c90bb16](https://github.com/AztecProtocol/aztec-packages/commit/c90bb16a5880c42752809f383f517181e6f8a53a)) +* Merge queue CI ([#10629](https://github.com/AztecProtocol/aztec-packages/issues/10629)) ([835e6fd](https://github.com/AztecProtocol/aztec-packages/commit/835e6fde9416ebcdf65b9c016f8e53885145e24c)) +* Misc cleanup ([#10194](https://github.com/AztecProtocol/aztec-packages/issues/10194)) ([dd01417](https://github.com/AztecProtocol/aztec-packages/commit/dd014178f927fcd18f5dcacab5655ca01ff18629)) +* More bots for exp1 ([#10671](https://github.com/AztecProtocol/aztec-packages/issues/10671)) ([0ba2425](https://github.com/AztecProtocol/aztec-packages/commit/0ba242507e2e0c60cf0d9e8e2b1d1c92f31ebfc3)) +* More logs cleanup ([#10630](https://github.com/AztecProtocol/aztec-packages/issues/10630)) ([00c629c](https://github.com/AztecProtocol/aztec-packages/commit/00c629ca2a34c996968e2f52b697cbdeaff54a77)) +* Move decider PK allocation to methods ([#10670](https://github.com/AztecProtocol/aztec-packages/issues/10670)) ([1ab9e30](https://github.com/AztecProtocol/aztec-packages/commit/1ab9e30d339cfd7a80f333e408c367c1f8bf49f8)) +* Move some nr utils around ([#10553](https://github.com/AztecProtocol/aztec-packages/issues/10553)) ([d132f83](https://github.com/AztecProtocol/aztec-packages/commit/d132f83d595315565d54590bec69d25f7371559e)) +* Moving stuff from the aztec sequencer node guide into this README ([#10570](https://github.com/AztecProtocol/aztec-packages/issues/10570)) ([93b8b1b](https://github.com/AztecProtocol/aztec-packages/commit/93b8b1bcc5cc3e86b63f923005cb163db0c6cb2c)) +* **network_test.sh:** Work around 143 by disabling stern ([#10436](https://github.com/AztecProtocol/aztec-packages/issues/10436)) ([64f6dad](https://github.com/AztecProtocol/aztec-packages/commit/64f6dad8f95e4972ee4bef26b9e5da6d6b577f13)) +* No release please prs for release branches ([#10850](https://github.com/AztecProtocol/aztec-packages/issues/10850)) ([26c87a9](https://github.com/AztecProtocol/aztec-packages/commit/26c87a92521e1b30ac1c480afdcf4fb09ea69570)) +* Optimise grand product computation round based on active ranges ([#10460](https://github.com/AztecProtocol/aztec-packages/issues/10460)) ([7fa8f84](https://github.com/AztecProtocol/aztec-packages/commit/7fa8f844d9e389f8636118f1d3c3ecce707e771e)) +* Optimise older opcodes in reverse order (https://github.com/noir-lang/noir/pull/6476) ([f4ed66b](https://github.com/AztecProtocol/aztec-packages/commit/f4ed66b6535818dc87d69ff451bb6aaabd2df8ec)) +* Optimization of `syncTaggedLogsAsSender` ([#10811](https://github.com/AztecProtocol/aztec-packages/issues/10811)) ([a4be4a7](https://github.com/AztecProtocol/aztec-packages/commit/a4be4a7b113276d45ea9f6279efa41f475700417)) +* **p2p:** Move services into folders ([#10694](https://github.com/AztecProtocol/aztec-packages/issues/10694)) ([e28d12a](https://github.com/AztecProtocol/aztec-packages/commit/e28d12a3cdb182c905995a5ece4cc1b3d1d09482)) +* Parallelise construction of perturbator coefficients at each level ([#10304](https://github.com/AztecProtocol/aztec-packages/issues/10304)) ([ba335bd](https://github.com/AztecProtocol/aztec-packages/commit/ba335bdff645398d20241ce7baab02f63b20f55c)) +* Parallelise inverse polynomial construction for lookup relations ([#10413](https://github.com/AztecProtocol/aztec-packages/issues/10413)) ([427cf59](https://github.com/AztecProtocol/aztec-packages/commit/427cf594ec9ca4b472ec5d4a249c7b49805c78e2)) +* Pin foundry version in CI (https://github.com/noir-lang/noir/pull/6642) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* **prover:** Prover node should not gossip attestations ([#10672](https://github.com/AztecProtocol/aztec-packages/issues/10672)) ([41fc0f0](https://github.com/AztecProtocol/aztec-packages/commit/41fc0f047a6412b824dc33b49cf8fd98c99598aa)) +* Public inputs in unit tests with proving were incorrectly set ([#10300](https://github.com/AztecProtocol/aztec-packages/issues/10300)) ([0311bf3](https://github.com/AztecProtocol/aztec-packages/commit/0311bf333acb2def3be1373b36514b99b132623a)) +* Pull out cfg simplification changes ([#10279](https://github.com/AztecProtocol/aztec-packages/issues/10279)) ([c48ae90](https://github.com/AztecProtocol/aztec-packages/commit/c48ae90c5d72450a3a19b76e552df1607ff79953)) +* Pull out constant brillig inliner ([#10291](https://github.com/AztecProtocol/aztec-packages/issues/10291)) ([0577c1a](https://github.com/AztecProtocol/aztec-packages/commit/0577c1a70e9746bd06f07d2813af1be39e01ca02)) +* Pull out loop invariant optimization ([#10277](https://github.com/AztecProtocol/aztec-packages/issues/10277)) ([94cba37](https://github.com/AztecProtocol/aztec-packages/commit/94cba373c0807e66a2633e2bdaacea538838e2e7)) +* Pull out some sync changes ([#10245](https://github.com/AztecProtocol/aztec-packages/issues/10245)) ([1bfc15e](https://github.com/AztecProtocol/aztec-packages/commit/1bfc15e08873a1f0f3743e259f418b70426b3f25)) +* Pull out sync changes ([#10274](https://github.com/AztecProtocol/aztec-packages/issues/10274)) ([391a6b7](https://github.com/AztecProtocol/aztec-packages/commit/391a6b7377a5253f2c47fa5ec949f255b284da00)) +* Pull out sync changes ([#10292](https://github.com/AztecProtocol/aztec-packages/issues/10292)) ([49f80b3](https://github.com/AztecProtocol/aztec-packages/commit/49f80b30db59e2454347c4b742d536e317305f2e)) +* Pull value merger code from sync ([#10080](https://github.com/AztecProtocol/aztec-packages/issues/10080)) ([3392629](https://github.com/AztecProtocol/aztec-packages/commit/3392629818e6d51c01ca4c75c1ad916bb4b4fdb1)) +* Random typos ([#10393](https://github.com/AztecProtocol/aztec-packages/issues/10393)) ([ed47a42](https://github.com/AztecProtocol/aztec-packages/commit/ed47a42e838ffb75e17a7897bc0b77658f6e4b15)) +* Read function names from contract classes ([#10753](https://github.com/AztecProtocol/aztec-packages/issues/10753)) ([921febb](https://github.com/AztecProtocol/aztec-packages/commit/921febbbb337144aaf69cc3cfca9b8b5e77e9edc)) +* Redo typo PR by Dimitrolito ([#10364](https://github.com/AztecProtocol/aztec-packages/issues/10364)) ([da809c5](https://github.com/AztecProtocol/aztec-packages/commit/da809c58290f9590836f45ec59376cbf04d3c4ce)) +* Redo typo PR by Dimitrolito (https://github.com/noir-lang/noir/pull/6614) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Redo typo PR by donatik27 (https://github.com/noir-lang/noir/pull/6575) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Redo typo PR by leopardracer ([#10363](https://github.com/AztecProtocol/aztec-packages/issues/10363)) ([0d1b722](https://github.com/AztecProtocol/aztec-packages/commit/0d1b722ef7fdc501ca78cfca8f46009a29504c8f)) +* Redo typo PR by leopardracer ([#10444](https://github.com/AztecProtocol/aztec-packages/issues/10444)) ([3653c4c](https://github.com/AztecProtocol/aztec-packages/commit/3653c4c78e8ba3ab2036c6467e60c2c496db5811)) +* Redo typo PR by Madmaxs2 (https://github.com/noir-lang/noir/pull/6721) ([f4ed66b](https://github.com/AztecProtocol/aztec-packages/commit/f4ed66b6535818dc87d69ff451bb6aaabd2df8ec)) +* Reduce bb_prover_full_rollup to a single block epoch test ([#10679](https://github.com/AztecProtocol/aztec-packages/issues/10679)) ([0c2a4d9](https://github.com/AztecProtocol/aztec-packages/commit/0c2a4d9198c48a94939ce1475d60d201415849ae)) +* Refactor foreign call executors (https://github.com/noir-lang/noir/pull/6659) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Refactor indexed tree to use traits ([#10361](https://github.com/AztecProtocol/aztec-packages/issues/10361)) ([621cbaf](https://github.com/AztecProtocol/aztec-packages/commit/621cbafc49acee6fa4422fd5ebcccd6c27507670)) +* Refactor poseidon2 (https://github.com/noir-lang/noir/pull/6655) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Reinstate docs-preview, fix doc publish ([#10213](https://github.com/AztecProtocol/aztec-packages/issues/10213)) ([ed9a0e3](https://github.com/AztecProtocol/aztec-packages/commit/ed9a0e36827fc5e60e85ded7f21115b5725430b1)) +* Release Noir(1.0.0-beta.0) (https://github.com/noir-lang/noir/pull/6562) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Remove `ec` module from stdlib (https://github.com/noir-lang/noir/pull/6612) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Remove debug and winston in favor of pino ([#10355](https://github.com/AztecProtocol/aztec-packages/issues/10355)) ([c246aba](https://github.com/AztecProtocol/aztec-packages/commit/c246aba5dd51391e2b8a3bd8cdc67f0115b85a7a)) +* Remove default export for noir contracts js ([#10762](https://github.com/AztecProtocol/aztec-packages/issues/10762)) ([c8e7763](https://github.com/AztecProtocol/aztec-packages/commit/c8e77639bf7f30dffe98ae335d5d1137da838e55)) +* Remove default gas settings ([#10163](https://github.com/AztecProtocol/aztec-packages/issues/10163)) ([c9a4d88](https://github.com/AztecProtocol/aztec-packages/commit/c9a4d88b15c320e6cc6d79e0721d0f4062d2d840)) +* Remove docs from sync ([#10241](https://github.com/AztecProtocol/aztec-packages/issues/10241)) ([eeea0aa](https://github.com/AztecProtocol/aztec-packages/commit/eeea0aade045bfba73ee1e6458d5815163f55dd6)) +* Remove eddsa from stdlib (https://github.com/noir-lang/noir/pull/6591) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Remove handling of duplicates from the note hash tree ([#10016](https://github.com/AztecProtocol/aztec-packages/issues/10016)) ([ece1d45](https://github.com/AztecProtocol/aztec-packages/commit/ece1d455548bccd80a3c9660cc32149bcb129562)) +* Remove inliner override for `reference_counts` test (https://github.com/noir-lang/noir/pull/6714) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Remove Proxy from json rpc client ([#10554](https://github.com/AztecProtocol/aztec-packages/issues/10554)) ([93b1c45](https://github.com/AztecProtocol/aztec-packages/commit/93b1c45f3d6b6be9db8c0604c285a7d5d0e3960a)) +* Remove SchnorrVerify opcode ([#9897](https://github.com/AztecProtocol/aztec-packages/issues/9897)) ([93cd323](https://github.com/AztecProtocol/aztec-packages/commit/93cd323e493118ce91097934216a364855a991db)) +* Remove sequencer min/max seconds between blocks ([#10845](https://github.com/AztecProtocol/aztec-packages/issues/10845)) ([5062803](https://github.com/AztecProtocol/aztec-packages/commit/5062803b3bb314e1e8080da6531f5799f8edfd39)) +* Remove sinon in favor of a date provider ([#10705](https://github.com/AztecProtocol/aztec-packages/issues/10705)) ([3d3fabb](https://github.com/AztecProtocol/aztec-packages/commit/3d3fabb38b160c7f98636d0f4d7c6d3c22c6227e)) +* Remove spurious echo ([#10774](https://github.com/AztecProtocol/aztec-packages/issues/10774)) ([5538f8c](https://github.com/AztecProtocol/aztec-packages/commit/5538f8cfc94f617a5604706b53357f9018af1096)) +* Remove temporary allocations from `num_bits` (https://github.com/noir-lang/noir/pull/6600) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Remove unused dep ([#10295](https://github.com/AztecProtocol/aztec-packages/issues/10295)) ([2a07355](https://github.com/AztecProtocol/aztec-packages/commit/2a0735583eb1dfb8aad47daf6f70b267fc2eca20)) +* Remove unused imports ([#10134](https://github.com/AztecProtocol/aztec-packages/issues/10134)) ([8dbeda0](https://github.com/AztecProtocol/aztec-packages/commit/8dbeda0c87399090e88ff723f732e4e6a4d9d01c)) +* Remove warnings from protocol circuits ([#10556](https://github.com/AztecProtocol/aztec-packages/issues/10556)) ([e065e05](https://github.com/AztecProtocol/aztec-packages/commit/e065e0590f20ed13bed1d0756ea29781b1cabd95)) +* Rename logger modules ([#10404](https://github.com/AztecProtocol/aztec-packages/issues/10404)) ([7441767](https://github.com/AztecProtocol/aztec-packages/commit/7441767d7e8e7e7d602c447ca843dee43f8dc8f8)), closes [#10125](https://github.com/AztecProtocol/aztec-packages/issues/10125) +* Rename pxe script generate-package-info to generate ([#10534](https://github.com/AztecProtocol/aztec-packages/issues/10534)) ([ead9c0b](https://github.com/AztecProtocol/aztec-packages/commit/ead9c0b3f43ffb707b5226a36544832ffcc7c910)) +* Replace bbup.dev link ([#10908](https://github.com/AztecProtocol/aztec-packages/issues/10908)) ([6cdcdb3](https://github.com/AztecProtocol/aztec-packages/commit/6cdcdb32ae51b316b2bd454772026292f1979411)) +* Replace relative paths to noir-protocol-circuits ([9922bcb](https://github.com/AztecProtocol/aztec-packages/commit/9922bcb11dbafa46778697e8d814e6109af885d7)) +* Replace relative paths to noir-protocol-circuits ([136f0b4](https://github.com/AztecProtocol/aztec-packages/commit/136f0b4d57331cee9c9afb5e1641abcb2ff15aff)) +* Replace relative paths to noir-protocol-circuits ([8b3eb34](https://github.com/AztecProtocol/aztec-packages/commit/8b3eb340d82f558326a6f6fa25544395c39eec29)) +* Replace relative paths to noir-protocol-circuits ([f85fa3f](https://github.com/AztecProtocol/aztec-packages/commit/f85fa3f9078fc4f3626c564e06161bf9398e87a4)) +* Replace relative paths to noir-protocol-circuits ([b19c561](https://github.com/AztecProtocol/aztec-packages/commit/b19c56154d32050affa786620f95459bb5c29a6e)) +* Replace relative paths to noir-protocol-circuits ([1cafe27](https://github.com/AztecProtocol/aztec-packages/commit/1cafe27d5938ce6a3c779e92179ab16bb8661dcc)) +* Replace relative paths to noir-protocol-circuits ([acfd5df](https://github.com/AztecProtocol/aztec-packages/commit/acfd5df121d67ed75b2b22fe4efba82afb8c5949)) +* Replace relative paths to noir-protocol-circuits ([6c0533f](https://github.com/AztecProtocol/aztec-packages/commit/6c0533f15d221a6792edc2495c4cd8f870112831)) +* Replace relative paths to noir-protocol-circuits ([a245b95](https://github.com/AztecProtocol/aztec-packages/commit/a245b951a22e1df61fdecf566888aebba3ae6f8a)) +* Replace relative paths to noir-protocol-circuits ([153c720](https://github.com/AztecProtocol/aztec-packages/commit/153c72003bcc31988b90f8666f140b0f21416ca5)) +* Replace relative paths to noir-protocol-circuits ([a080436](https://github.com/AztecProtocol/aztec-packages/commit/a08043697bf41ad5de4256c8c366e4b4ef183be4)) +* Replace relative paths to noir-protocol-circuits ([8419f5a](https://github.com/AztecProtocol/aztec-packages/commit/8419f5a22d43432368a1d445bf79c84bbb2d6161)) +* Replace relative paths to noir-protocol-circuits ([8fd8236](https://github.com/AztecProtocol/aztec-packages/commit/8fd823689482c4ead689f24927ca57d7206c93a7)) +* Replace relative paths to noir-protocol-circuits ([5d11e24](https://github.com/AztecProtocol/aztec-packages/commit/5d11e24fa1bcdef097d4af0693f3f8556dbd4372)) +* Replace relative paths to noir-protocol-circuits ([e7a99f2](https://github.com/AztecProtocol/aztec-packages/commit/e7a99f28cdb54c7d462a43c8e971fa59696900f2)) +* Replace relative paths to noir-protocol-circuits ([2496118](https://github.com/AztecProtocol/aztec-packages/commit/2496118908db955d82222fe98514f4a55ff61e33)) +* Replace relative paths to noir-protocol-circuits ([d77dc96](https://github.com/AztecProtocol/aztec-packages/commit/d77dc96e699b3338ff624665be5f831b0d21afb7)) +* Replace relative paths to noir-protocol-circuits ([46d12e3](https://github.com/AztecProtocol/aztec-packages/commit/46d12e30bf9e4b523ccd5f5f4b2771498a72b8a5)) +* Replace relative paths to noir-protocol-circuits ([654d801](https://github.com/AztecProtocol/aztec-packages/commit/654d801dc762ce69589a300ef6a2d8fe590527a8)) +* Replace relative paths to noir-protocol-circuits ([e7690ca](https://github.com/AztecProtocol/aztec-packages/commit/e7690ca2e441ca71f8a02d39ed5fb2c7e9ba533d)) +* Replace relative paths to noir-protocol-circuits ([1650446](https://github.com/AztecProtocol/aztec-packages/commit/1650446e62b696b90857f12d264b8cf61b265113)) +* Replace relative paths to noir-protocol-circuits ([ccf6695](https://github.com/AztecProtocol/aztec-packages/commit/ccf6695e9f81190e7da7bad657ca814822b33cd7)) +* Require types of globals to be specified (https://github.com/noir-lang/noir/pull/6592) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Revert "fix: Don't remove necessary RC instructions in DIE pass (https://github.com/noir-lang/noir/pull/6585)" (https://github.com/noir-lang/noir/pull/6693) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Sassy network ([#10468](https://github.com/AztecProtocol/aztec-packages/issues/10468)) ([92eb377](https://github.com/AztecProtocol/aztec-packages/commit/92eb377ffb1ce192b608536fc39c85c5aa9ccfc4)) +* Secret derivation funcs naming cleanup ([#10637](https://github.com/AztecProtocol/aztec-packages/issues/10637)) ([5c50711](https://github.com/AztecProtocol/aztec-packages/commit/5c50711429b93f5eb63ba264af532abb81995b48)) +* Set max txs in spam test ([#10717](https://github.com/AztecProtocol/aztec-packages/issues/10717)) ([a50ff6c](https://github.com/AztecProtocol/aztec-packages/commit/a50ff6cf968f459ae09620d0e5b2e955ea56512f)) +* Silence logs to k8s port-forward ([#10768](https://github.com/AztecProtocol/aztec-packages/issues/10768)) ([6f1ad79](https://github.com/AztecProtocol/aztec-packages/commit/6f1ad792a2a8d5d3d770932fb61eaa8f0d497932)) +* Simplify MSM with constant folding (https://github.com/noir-lang/noir/pull/6650) ([f4ed66b](https://github.com/AztecProtocol/aztec-packages/commit/f4ed66b6535818dc87d69ff451bb6aaabd2df8ec)) +* Simplify otel config, 1val setup, fix pod dns, retries ([#10344](https://github.com/AztecProtocol/aztec-packages/issues/10344)) ([be91d80](https://github.com/AztecProtocol/aztec-packages/commit/be91d807c91fbd829181c8b5935f93308fef6dbb)) +* Skip A->B B->A e2e_2_pxes test ([#10297](https://github.com/AztecProtocol/aztec-packages/issues/10297)) ([b75bfd0](https://github.com/AztecProtocol/aztec-packages/commit/b75bfd0a40547eab1d4700da80819d51e15a4428)) +* Slack notifications for networks ([#10784](https://github.com/AztecProtocol/aztec-packages/issues/10784)) ([bab9f85](https://github.com/AztecProtocol/aztec-packages/commit/bab9f852c08f29f022bf526aacb8350732fcf4ac)) +* Split up protocol contract artifacts ([#10765](https://github.com/AztecProtocol/aztec-packages/issues/10765)) ([5a9ca18](https://github.com/AztecProtocol/aztec-packages/commit/5a9ca18ceee03ca2175605d1029153a7bf228ea9)) +* **ssa:** Activate loop invariant code motion on ACIR functions (https://github.com/noir-lang/noir/pull/6785) ([8956e28](https://github.com/AztecProtocol/aztec-packages/commit/8956e28269a045732e733b5197bdab5e46cdf354)) +* **stdlib:** Remove Schnorr (https://github.com/noir-lang/noir/pull/6749) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Stop tracing and limiting read requests in avm ([#10220](https://github.com/AztecProtocol/aztec-packages/issues/10220)) ([7d5c33d](https://github.com/AztecProtocol/aztec-packages/commit/7d5c33d1f046e1b8b3f367ff1682b9fd6272e2fd)) +* Sync grafana dashboard ([#10792](https://github.com/AztecProtocol/aztec-packages/issues/10792)) ([421fb65](https://github.com/AztecProtocol/aztec-packages/commit/421fb65d9f14b86df281b0d0dc0934859aa924bc)) +* Sync logging with jest ([#10459](https://github.com/AztecProtocol/aztec-packages/issues/10459)) ([6e33cb9](https://github.com/AztecProtocol/aztec-packages/commit/6e33cb916643eadb62159421ba00c829e5162386)) +* Tagging cleanup ([#10675](https://github.com/AztecProtocol/aztec-packages/issues/10675)) ([52b541a](https://github.com/AztecProtocol/aztec-packages/commit/52b541ab4e6295aea199a2181575208f20eaa7fc)) +* Teardown context in prover coordination test ([#10257](https://github.com/AztecProtocol/aztec-packages/issues/10257)) ([7ea3888](https://github.com/AztecProtocol/aztec-packages/commit/7ea38887e514a4bbdc7ff847efe19bd2d1b74baf)) +* Trace and handle errors in running promises ([#10645](https://github.com/AztecProtocol/aztec-packages/issues/10645)) ([4cc0a6d](https://github.com/AztecProtocol/aztec-packages/commit/4cc0a6d832e6ee1c3fcc6876517ed3f743f59d4b)) +* Try replace callstack with a linked list (https://github.com/noir-lang/noir/pull/6747) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Tweak validator logs ([#10597](https://github.com/AztecProtocol/aztec-packages/issues/10597)) ([9eaa527](https://github.com/AztecProtocol/aztec-packages/commit/9eaa5278766da48fd4a1eba4b9b03a49290df1b8)) +* Typo in oracles how to (https://github.com/noir-lang/noir/pull/6598) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Unprove devnet ([#10683](https://github.com/AztecProtocol/aztec-packages/issues/10683)) ([1c92f77](https://github.com/AztecProtocol/aztec-packages/commit/1c92f77047f99ede7f6ab26684633d7eb26a97a3)) +* Update external joiner script for new networks ([#10810](https://github.com/AztecProtocol/aztec-packages/issues/10810)) ([5f11cf4](https://github.com/AztecProtocol/aztec-packages/commit/5f11cf4bdc51fd21b8bd219ad1e81bf3afe585d9)) +* Update noir-bench-report version (https://github.com/noir-lang/noir/pull/6675) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Update pprof (https://github.com/noir-lang/noir/pull/6710) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Update release-please action (https://github.com/noir-lang/noir/pull/6704) ([3304046](https://github.com/AztecProtocol/aztec-packages/commit/3304046704e257902e32b86baf1aafc8b23bcaf6)) +* Update url to 2.5.4 (https://github.com/noir-lang/noir/pull/6741) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Use `NumericType` not `Type` for casts and numeric constants (https://github.com/noir-lang/noir/pull/6769) ([3166529](https://github.com/AztecProtocol/aztec-packages/commit/31665296c94a221098a473426e3686e56b4b9e96)) +* Use `troll-turtle` image in aztec-spartan ([#10856](https://github.com/AztecProtocol/aztec-packages/issues/10856)) ([c598bae](https://github.com/AztecProtocol/aztec-packages/commit/c598bae92535959f882d6c8e76c1a38ad6f11e04)) +* Use non default mnemonic for releases ([#10400](https://github.com/AztecProtocol/aztec-packages/issues/10400)) ([bb5f364](https://github.com/AztecProtocol/aztec-packages/commit/bb5f364e4a086f7308137ccb8f77668d33367f3a)) +* **val:** Reject proposals not for the current or next slot ([#10450](https://github.com/AztecProtocol/aztec-packages/issues/10450)) ([27620f5](https://github.com/AztecProtocol/aztec-packages/commit/27620f5ccd7bb23cf9d8cb8a913386338c47a08c)) +* Values for sepolia deployment ([#10362](https://github.com/AztecProtocol/aztec-packages/issues/10362)) ([74cfe0d](https://github.com/AztecProtocol/aztec-packages/commit/74cfe0dd663bc7ce57e83d91d8b4dd5f14b3fe87)), closes [#9926](https://github.com/AztecProtocol/aztec-packages/issues/9926) + ## [0.67.1](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.67.0...aztec-packages-v0.67.1) (2024-12-17) diff --git a/aztec-up/bin/aztec-wallet b/aztec-up/bin/aztec-wallet index 675b8bfeda6e..998e51157c1e 100755 --- a/aztec-up/bin/aztec-wallet +++ b/aztec-up/bin/aztec-wallet @@ -3,8 +3,11 @@ set -euo pipefail export SKIP_PORT_ASSIGNMENT=1 export WALLET_DATA_DIRECTORY=$(dirname $0)/wallet-data -export ENV_VARS_TO_INJECT="WALLET_DATA_DIRECTORY SSH_AUTH_SOCK" +export BB_WORKING_DIRECTORY=$(dirname $0)/bb-workdir +export BB_BINARY_PATH=$(which bb) +export ENV_VARS_TO_INJECT="WALLET_DATA_DIRECTORY SSH_AUTH_SOCK PXE_PROVER_ENABLED BB_BINARY_PATH BB_WORKING_DIRECTORY" +mkdir -p $BB_WORKING_DIRECTORY mkdir -p $WALLET_DATA_DIRECTORY $(dirname $0)/.aztec-run aztecprotocol/cli-wallet $@ \ No newline at end of file diff --git a/barretenberg/.gitrepo b/barretenberg/.gitrepo index 31a89cbf099c..3625cf9c564a 100644 --- a/barretenberg/.gitrepo +++ b/barretenberg/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/AztecProtocol/barretenberg branch = master - commit = 81584f06eb2395d2075e181b10714b5e93c501cd - parent = c598bae92535959f882d6c8e76c1a38ad6f11e04 + commit = a3f1434f97d2c808de018b552b0b4d13ee4901a8 + parent = 49583a52270d57bc9bbda0195d0f47bab438fd9b method = merge cmdver = 0.4.6 diff --git a/barretenberg/CHANGELOG.md b/barretenberg/CHANGELOG.md index ce20f60b5c69..506fb11bf99a 100644 --- a/barretenberg/CHANGELOG.md +++ b/barretenberg/CHANGELOG.md @@ -1,5 +1,124 @@ # Changelog +## [0.68.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.67.1...barretenberg-v0.68.0) (2024-12-20) + + +### ⚠ BREAKING CHANGES + +* lower public tx gas limit to 6M ([#10635](https://github.com/AztecProtocol/aztec-packages/issues/10635)) +* l2 gas maximum is per-TX-public-portion. AVM startup gas is now 20k. ([#10214](https://github.com/AztecProtocol/aztec-packages/issues/10214)) +* rename Header to BlockHeader ([#10372](https://github.com/AztecProtocol/aztec-packages/issues/10372)) +* remove SchnorrVerify opcode ([#9897](https://github.com/AztecProtocol/aztec-packages/issues/9897)) + +### Features + +* Add gate count tracking for ivc constraints ([#10772](https://github.com/AztecProtocol/aztec-packages/issues/10772)) ([ebd6aba](https://github.com/AztecProtocol/aztec-packages/commit/ebd6aba915b822711166b4424cc4c81f226ddcfb)) +* Add priority fees to gas settings ([#10763](https://github.com/AztecProtocol/aztec-packages/issues/10763)) ([263eaad](https://github.com/AztecProtocol/aztec-packages/commit/263eaad065d607d7af2d2c163c5090b8d73216c1)) +* Add total mana used to header ([#9868](https://github.com/AztecProtocol/aztec-packages/issues/9868)) ([2478d19](https://github.com/AztecProtocol/aztec-packages/commit/2478d1909db2d79cc0cdd3063dc2ac4e1eaedce3)) +* Add tree equality assertions ([#10756](https://github.com/AztecProtocol/aztec-packages/issues/10756)) ([923826a](https://github.com/AztecProtocol/aztec-packages/commit/923826a9d1bbed6739527a82b34d5610600eca1b)) +* Add verify proof calls to private kernels ([#10533](https://github.com/AztecProtocol/aztec-packages/issues/10533)) ([ce0eee0](https://github.com/AztecProtocol/aztec-packages/commit/ce0eee0ef4a2084ec74b6dae0a75d18af5877ef8)) +* Added a UnivariateMonomial representation to reduce field ops in protogalaxy+sumcheck ([#10401](https://github.com/AztecProtocol/aztec-packages/issues/10401)) ([15475f4](https://github.com/AztecProtocol/aztec-packages/commit/15475f47bdc2ac02ea5157bdc9d1f5172ff6ed09)) +* Adding fuzzer for ultra bigfield and relaxing ultra circuit checker ([#10433](https://github.com/AztecProtocol/aztec-packages/issues/10433)) ([da4c47c](https://github.com/AztecProtocol/aztec-packages/commit/da4c47c5dc8caea3e860ac15a58b9ff7f011e4f6)) +* Allow querying block number for tree indices ([#10332](https://github.com/AztecProtocol/aztec-packages/issues/10332)) ([cf05a7a](https://github.com/AztecProtocol/aztec-packages/commit/cf05a7a346ea11853e940d5e9ac105ef0d629d35)) +* AVM inserts fee write on txs with public calls ([#10394](https://github.com/AztecProtocol/aztec-packages/issues/10394)) ([98ba747](https://github.com/AztecProtocol/aztec-packages/commit/98ba7475ac0130dac4424a2f5cabdbe37eba5cc8)) +* **avm:** Error handling for address resolution ([#9994](https://github.com/AztecProtocol/aztec-packages/issues/9994)) ([ceaeda5](https://github.com/AztecProtocol/aztec-packages/commit/ceaeda50d2fd391edda3ee8186b86558b7f092e2)), closes [#9131](https://github.com/AztecProtocol/aztec-packages/issues/9131) +* **avm:** New public inputs witgen ([#10179](https://github.com/AztecProtocol/aztec-packages/issues/10179)) ([ac8f13e](https://github.com/AztecProtocol/aztec-packages/commit/ac8f13e4cd9a3f6b23d53ce5b06cc436324d5f7b)) +* Avoid inserting an empty leaf in indexed trees on update ([#10281](https://github.com/AztecProtocol/aztec-packages/issues/10281)) ([5a04ca8](https://github.com/AztecProtocol/aztec-packages/commit/5a04ca880ae2a0f285b6a5a110286ba10bc4a6c3)) +* Avoid inserting an empty leaf in indexed trees on update ([#10334](https://github.com/AztecProtocol/aztec-packages/issues/10334)) ([80fad45](https://github.com/AztecProtocol/aztec-packages/commit/80fad4544a4d8c1b488f8b4b4f86fe508ed1f4cc)) +* **bb:** Define std::hash for field ([#10312](https://github.com/AztecProtocol/aztec-packages/issues/10312)) ([752bc59](https://github.com/AztecProtocol/aztec-packages/commit/752bc59c579710c21acf6cc97164e377f72c256c)) +* Better initialization for permutation mapping components ([#10750](https://github.com/AztecProtocol/aztec-packages/issues/10750)) ([1516d7f](https://github.com/AztecProtocol/aztec-packages/commit/1516d7f7bd6a2adbb650bd7cdd572b33db98dbfc)) +* CIVC browser proveThenVerify ([#10431](https://github.com/AztecProtocol/aztec-packages/issues/10431)) ([8c064d4](https://github.com/AztecProtocol/aztec-packages/commit/8c064d484c686fdf00a100f65f1f740be4ef13cb)) +* Client IVC API ([#10217](https://github.com/AztecProtocol/aztec-packages/issues/10217)) ([cc54a1e](https://github.com/AztecProtocol/aztec-packages/commit/cc54a1e1ef75b29d160a02d03cf9b29e28d3e4ca)) +* Configure world state block history ([#10216](https://github.com/AztecProtocol/aztec-packages/issues/10216)) ([01eb392](https://github.com/AztecProtocol/aztec-packages/commit/01eb392f15995f344e40aa8f8e41a28f6f5b825d)) +* Don't store every block number in block indices DB ([#10658](https://github.com/AztecProtocol/aztec-packages/issues/10658)) ([a3fba84](https://github.com/AztecProtocol/aztec-packages/commit/a3fba8442fdd62f429054c3367984fd4206bbbeb)) +* Full IPA Recursive Verifier ([#10189](https://github.com/AztecProtocol/aztec-packages/issues/10189)) ([b5783d3](https://github.com/AztecProtocol/aztec-packages/commit/b5783d3945959056d24aa3d988e9ca9efd3ec224)) +* GETCONTRACTINSTANCE and bytecode retrieval perform nullifier membership checks ([#10445](https://github.com/AztecProtocol/aztec-packages/issues/10445)) ([9301253](https://github.com/AztecProtocol/aztec-packages/commit/9301253f0488e6d96ed12a8c9bde72a653aa7d36)), closes [#10377](https://github.com/AztecProtocol/aztec-packages/issues/10377) [#10379](https://github.com/AztecProtocol/aztec-packages/issues/10379) +* Handle nested calls in witgen ([#10384](https://github.com/AztecProtocol/aztec-packages/issues/10384)) ([1e21f31](https://github.com/AztecProtocol/aztec-packages/commit/1e21f31d430947f48dc9f5e52d0deb1af70ee705)) +* Improved data storage metrics ([#10020](https://github.com/AztecProtocol/aztec-packages/issues/10020)) ([c6ab0c9](https://github.com/AztecProtocol/aztec-packages/commit/c6ab0c9c7a270104fb3e9f6160be50a90ce5e77d)) +* Integrate verify_proof calls in mock protocol circuits ([#9253](https://github.com/AztecProtocol/aztec-packages/issues/9253)) ([7ed89aa](https://github.com/AztecProtocol/aztec-packages/commit/7ed89aaa9d0968af6334c1c8abf6c06a42754c52)) +* Keccak honk proving in bb.js ([#10489](https://github.com/AztecProtocol/aztec-packages/issues/10489)) ([e0d7431](https://github.com/AztecProtocol/aztec-packages/commit/e0d743121674bcfdd73f84836c17645a5bc2df92)) +* Leaf index requests to the native world state can now be performed as a batch query ([#10649](https://github.com/AztecProtocol/aztec-packages/issues/10649)) ([a437e73](https://github.com/AztecProtocol/aztec-packages/commit/a437e73558a936981f3eb3ba022b0770b75d9060)) +* Manage enqueued calls & phases in AVM witgen ([#10310](https://github.com/AztecProtocol/aztec-packages/issues/10310)) ([e7ebef8](https://github.com/AztecProtocol/aztec-packages/commit/e7ebef8d09744fdc24a79cb0bf74638b0a8f5dc8)) +* Mock IVC state from arbitrary acir IVC recursion constraints ([#10314](https://github.com/AztecProtocol/aztec-packages/issues/10314)) ([ac7c0da](https://github.com/AztecProtocol/aztec-packages/commit/ac7c0da38ff05d6f11c4d6a6244c4526ac00232e)) +* Modify HonkRecursionConstraint to handle IPA claims ([#10469](https://github.com/AztecProtocol/aztec-packages/issues/10469)) ([a204d1b](https://github.com/AztecProtocol/aztec-packages/commit/a204d1b60514d6321c2db5063375cc2bbd507fe8)) +* Move busread and lookup block construction at the top of the trace ([#10707](https://github.com/AztecProtocol/aztec-packages/issues/10707)) ([e8480cb](https://github.com/AztecProtocol/aztec-packages/commit/e8480cbf1ecdee5d7228b08d1c9608308acdd624)) +* New 17 in 20 IVC bench added to actions ([#10777](https://github.com/AztecProtocol/aztec-packages/issues/10777)) ([9fbcff6](https://github.com/AztecProtocol/aztec-packages/commit/9fbcff60a63e0eca14c4e28677aed1fc5e6f2c14)) +* Note hash management in the AVM ([#10666](https://github.com/AztecProtocol/aztec-packages/issues/10666)) ([e077980](https://github.com/AztecProtocol/aztec-packages/commit/e077980f8cce1fc7922c27d368b6dbced956aad2)) +* Origin tags implemented in biggroup ([#10002](https://github.com/AztecProtocol/aztec-packages/issues/10002)) ([c8696b1](https://github.com/AztecProtocol/aztec-packages/commit/c8696b165425ee6dd7a2398f4b90b29f24d762f4)) +* Remove auto verify mode from ClientIVC ([#10599](https://github.com/AztecProtocol/aztec-packages/issues/10599)) ([b1d8b97](https://github.com/AztecProtocol/aztec-packages/commit/b1d8b978871948fbba639476465f4de6fb471292)) +* Rename Header to BlockHeader ([#10372](https://github.com/AztecProtocol/aztec-packages/issues/10372)) ([0803964](https://github.com/AztecProtocol/aztec-packages/commit/0803964015492db81001c17252aa4b724e43797b)) +* Sayonara old hints ([#10547](https://github.com/AztecProtocol/aztec-packages/issues/10547)) ([dede16e](https://github.com/AztecProtocol/aztec-packages/commit/dede16e035115e1c6971079d12f62e3046407b36)) +* Sequential insertion in indexed trees ([#10111](https://github.com/AztecProtocol/aztec-packages/issues/10111)) ([bfd9fa6](https://github.com/AztecProtocol/aztec-packages/commit/bfd9fa68be4147acb3e3feeaf83ed3c9247761be)) +* Several Updates in SMT verification module (part 1) ([#10437](https://github.com/AztecProtocol/aztec-packages/issues/10437)) ([0c37672](https://github.com/AztecProtocol/aztec-packages/commit/0c376725a29ec18e25a7c9a89c0df8f5a1e06ff4)) +* Speed up transaction execution ([#10172](https://github.com/AztecProtocol/aztec-packages/issues/10172)) ([da265b6](https://github.com/AztecProtocol/aztec-packages/commit/da265b6b7d61a0d991fa23bd044f711513a0e86c)) +* Sumcheck with disabled rows ([#10068](https://github.com/AztecProtocol/aztec-packages/issues/10068)) ([abd2226](https://github.com/AztecProtocol/aztec-packages/commit/abd2226da3a159e7efb7cbef099e41739f665ef1)) +* Swap polys to facilitate dynamic trace overflow ([#9976](https://github.com/AztecProtocol/aztec-packages/issues/9976)) ([b7b282c](https://github.com/AztecProtocol/aztec-packages/commit/b7b282cd0fb306abbe3951a55a1a4f4d42ed7f8e)) +* Ultra rollup flows ([#10162](https://github.com/AztecProtocol/aztec-packages/issues/10162)) ([c53f4cf](https://github.com/AztecProtocol/aztec-packages/commit/c53f4cf84c60b8d81cc62d5827ec4408da88cc4e)) +* UltraRollupRecursiveFlavor ([#10088](https://github.com/AztecProtocol/aztec-packages/issues/10088)) ([4418ef2](https://github.com/AztecProtocol/aztec-packages/commit/4418ef2a5768e0f627160b86e8dc8735d4bf00e7)) +* Unified create circuit from acir ([#10440](https://github.com/AztecProtocol/aztec-packages/issues/10440)) ([a4dfe13](https://github.com/AztecProtocol/aztec-packages/commit/a4dfe13c1c0af3d527f5c9b2fcc38fe059e9bc38)) + + +### Bug Fixes + +* Avm gas and non-member ([#10709](https://github.com/AztecProtocol/aztec-packages/issues/10709)) ([dd8cc7b](https://github.com/AztecProtocol/aztec-packages/commit/dd8cc7b93119c0376873a366a8310d2ebd2641de)) +* AVM witgen track gas for nested calls and external halts ([#10731](https://github.com/AztecProtocol/aztec-packages/issues/10731)) ([b8bdb52](https://github.com/AztecProtocol/aztec-packages/commit/b8bdb529719c1f72244e904ea667462458a43317)) +* **avm:** Execution test ordering ([#10226](https://github.com/AztecProtocol/aztec-packages/issues/10226)) ([49b4a6c](https://github.com/AztecProtocol/aztec-packages/commit/49b4a6c07f39711ad2a0477e1fad11e11b8ee23c)) +* Bbup cleanup and fix ([#10067](https://github.com/AztecProtocol/aztec-packages/issues/10067)) ([0ff8177](https://github.com/AztecProtocol/aztec-packages/commit/0ff81773da58f7c28621d4e5711ce130afd3e51b)) +* Cl/ci3.1 ([#10888](https://github.com/AztecProtocol/aztec-packages/issues/10888)) ([2454a26](https://github.com/AztecProtocol/aztec-packages/commit/2454a262cce5d804420ad8e11c3e0b8f10a6e218)) +* Don't store indices of zero leaves. ([#10270](https://github.com/AztecProtocol/aztec-packages/issues/10270)) ([c22be8b](https://github.com/AztecProtocol/aztec-packages/commit/c22be8b23e6d16cf4a60509494b979c3edfdba9b)) +* Handle calls to non-existent contracts in AVM witgen ([#10862](https://github.com/AztecProtocol/aztec-packages/issues/10862)) ([8820bd5](https://github.com/AztecProtocol/aztec-packages/commit/8820bd5f3004fedd6c286e2dbf5f8b24fc767fd2)) +* Remove auto verify in cbind ivc prove ([#10627](https://github.com/AztecProtocol/aztec-packages/issues/10627)) ([d773423](https://github.com/AztecProtocol/aztec-packages/commit/d773423fb4c701d830ac2a732ab9bbc205396a63)) +* Remove table shifts ([#10814](https://github.com/AztecProtocol/aztec-packages/issues/10814)) ([469476b](https://github.com/AztecProtocol/aztec-packages/commit/469476bc73606659da58d492b2640dea4ac924c2)) +* Revert "feat: Avoid inserting an empty leaf in indexed trees on update" ([#10319](https://github.com/AztecProtocol/aztec-packages/issues/10319)) ([887c011](https://github.com/AztecProtocol/aztec-packages/commit/887c01103255ea4cbbb6cb33c8771d47123b3bff)) +* Small fixes to avm witgen ([#10749](https://github.com/AztecProtocol/aztec-packages/issues/10749)) ([96887b6](https://github.com/AztecProtocol/aztec-packages/commit/96887b60c3a6a1aaf4fa5b7623e664917e7a68bc)) +* Strip wasm debug ([#9987](https://github.com/AztecProtocol/aztec-packages/issues/9987)) ([62a6b66](https://github.com/AztecProtocol/aztec-packages/commit/62a6b662f1ef20a603177c55c199de4a79b65b5c)) +* Url in bbup install ([#10456](https://github.com/AztecProtocol/aztec-packages/issues/10456)) ([1b0dfb7](https://github.com/AztecProtocol/aztec-packages/commit/1b0dfb77612cae9fa026da1d453bdf0d89442200)) +* Use correct size for databus_id ([#10673](https://github.com/AztecProtocol/aztec-packages/issues/10673)) ([95eb658](https://github.com/AztecProtocol/aztec-packages/commit/95eb658f90687c75589b345f95a904d96e2a8e62)) +* Use e2e structure in cbind ([#10585](https://github.com/AztecProtocol/aztec-packages/issues/10585)) ([985aef1](https://github.com/AztecProtocol/aztec-packages/commit/985aef16ce612a9d3d7ff27b87b871a01911002e)) +* Witness changes in file sponge.hpp ([#10345](https://github.com/AztecProtocol/aztec-packages/issues/10345)) ([4a38edf](https://github.com/AztecProtocol/aztec-packages/commit/4a38edfc1580aa1cb5113993ff8a2e5574076226)) +* Zero index is not always 0 ([#10135](https://github.com/AztecProtocol/aztec-packages/issues/10135)) ([bbac3d9](https://github.com/AztecProtocol/aztec-packages/commit/bbac3d9db1a4cd133c4949c3c25a17a7e39d14a2)) + + +### Miscellaneous + +* **avm:** Conditionally enable avm recursion unit tests based on an env variable ([#10873](https://github.com/AztecProtocol/aztec-packages/issues/10873)) ([7a9506c](https://github.com/AztecProtocol/aztec-packages/commit/7a9506c6f400a88cbdbc9fad75d7b2bd35bea2cf)) +* **avm:** Extra column information in lookups ([#10905](https://github.com/AztecProtocol/aztec-packages/issues/10905)) ([ef247d4](https://github.com/AztecProtocol/aztec-packages/commit/ef247d4d68ce4aadb4c45b1f75d71a411e7102b6)) +* **avm:** Fake verification routine for avm recursion in public base rollup ([#10382](https://github.com/AztecProtocol/aztec-packages/issues/10382)) ([a1e5966](https://github.com/AztecProtocol/aztec-packages/commit/a1e5966ffe98351d848bfa47608a2f22c381acfb)), closes [#10243](https://github.com/AztecProtocol/aztec-packages/issues/10243) +* **avm:** Gas constants adjustment based on trace rows accounting ([#10614](https://github.com/AztecProtocol/aztec-packages/issues/10614)) ([fc729ef](https://github.com/AztecProtocol/aztec-packages/commit/fc729ef3af7ec33f48dbb9fae3820a59a4a26479)), closes [#10368](https://github.com/AztecProtocol/aztec-packages/issues/10368) +* **avm:** Handle parsing error ([#10203](https://github.com/AztecProtocol/aztec-packages/issues/10203)) ([3c623fc](https://github.com/AztecProtocol/aztec-packages/commit/3c623fc2d857d6792b557dc7d1ccb929274046bb)), closes [#9770](https://github.com/AztecProtocol/aztec-packages/issues/9770) +* **avm:** More pilcom compat changes ([#10569](https://github.com/AztecProtocol/aztec-packages/issues/10569)) ([f18d701](https://github.com/AztecProtocol/aztec-packages/commit/f18d701aa527c68a1adcc4b8acbb9c7bd239468a)) +* **avm:** Operands reordering ([#10182](https://github.com/AztecProtocol/aztec-packages/issues/10182)) ([69bdf4f](https://github.com/AztecProtocol/aztec-packages/commit/69bdf4f0341cbd95908e5e632b71a57da5df1433)), closes [#10136](https://github.com/AztecProtocol/aztec-packages/issues/10136) +* **avm:** Pilcom compatibility changes ([#10544](https://github.com/AztecProtocol/aztec-packages/issues/10544)) ([fbc8c0e](https://github.com/AztecProtocol/aztec-packages/commit/fbc8c0e864b10d2265373688457a33d61517bbb4)) +* **avm:** Radix opcode - remove immediates ([#10696](https://github.com/AztecProtocol/aztec-packages/issues/10696)) ([4ac13e6](https://github.com/AztecProtocol/aztec-packages/commit/4ac13e642c958392ce5606684c044ea014325e26)), closes [#10371](https://github.com/AztecProtocol/aztec-packages/issues/10371) +* **avm:** Remove function selector type of getenv opcode ([#10406](https://github.com/AztecProtocol/aztec-packages/issues/10406)) ([38c0c14](https://github.com/AztecProtocol/aztec-packages/commit/38c0c14fe90a1a920818f2f99a7d3204f0211091)), closes [#9396](https://github.com/AztecProtocol/aztec-packages/issues/9396) +* **avm:** Remove initialization for non-derived polynomials ([#10103](https://github.com/AztecProtocol/aztec-packages/issues/10103)) ([c6fdf4b](https://github.com/AztecProtocol/aztec-packages/commit/c6fdf4bda5c9ef32ca355cda9a5a0c7ed3d1a100)), closes [#10096](https://github.com/AztecProtocol/aztec-packages/issues/10096) +* **avm:** Zero initialization in avm public inputs and execution test fixes ([#10238](https://github.com/AztecProtocol/aztec-packages/issues/10238)) ([0c7c4c9](https://github.com/AztecProtocol/aztec-packages/commit/0c7c4c9bb0c01067abe57ccd06962d71c7279aa0)) +* Ci3 phase 1 ([#10042](https://github.com/AztecProtocol/aztec-packages/issues/10042)) ([641da4b](https://github.com/AztecProtocol/aztec-packages/commit/641da4bbd7f12d5a66e5763c18f5fa8f7c627c76)) +* CIVC VK ([#10223](https://github.com/AztecProtocol/aztec-packages/issues/10223)) ([089c34c](https://github.com/AztecProtocol/aztec-packages/commit/089c34cc3e9fb5cb493096246525c2205e646204)) +* Don't generate proofs of verifier circuits in test ([#10405](https://github.com/AztecProtocol/aztec-packages/issues/10405)) ([c00ebdd](https://github.com/AztecProtocol/aztec-packages/commit/c00ebdd60373aa579587b03eeb4b44ada0bb1155)) +* L2 gas maximum is per-TX-public-portion. AVM startup gas is now 20k. ([#10214](https://github.com/AztecProtocol/aztec-packages/issues/10214)) ([1365401](https://github.com/AztecProtocol/aztec-packages/commit/1365401cb379d7206e268dc01a33110cecae7293)) +* Lower public tx gas limit to 6M ([#10635](https://github.com/AztecProtocol/aztec-packages/issues/10635)) ([9836036](https://github.com/AztecProtocol/aztec-packages/commit/9836036053f1b5f3e57bf4e19bf0eb1a692306bd)) +* Making bbup a shell script ([#10426](https://github.com/AztecProtocol/aztec-packages/issues/10426)) ([1c29554](https://github.com/AztecProtocol/aztec-packages/commit/1c29554929268fe9f53961325ae6af3f9b799b1c)) +* **master:** Release 0.64.0 ([#10043](https://github.com/AztecProtocol/aztec-packages/issues/10043)) ([12b1daa](https://github.com/AztecProtocol/aztec-packages/commit/12b1daafa121452a1ba2d17228be335b1a45b818)) +* **master:** Release 0.65.0 ([#10181](https://github.com/AztecProtocol/aztec-packages/issues/10181)) ([903bcb0](https://github.com/AztecProtocol/aztec-packages/commit/903bcb0a42f7fd83fb7da97a13b763cf761336bd)) +* **master:** Release 0.65.1 ([#10219](https://github.com/AztecProtocol/aztec-packages/issues/10219)) ([62fc917](https://github.com/AztecProtocol/aztec-packages/commit/62fc9175019cb5f3fabca1a5f5ff9e04d708695e)) +* **master:** Release 0.65.2 ([#10258](https://github.com/AztecProtocol/aztec-packages/issues/10258)) ([10754db](https://github.com/AztecProtocol/aztec-packages/commit/10754db0e6626047d4fc59cd0d7bbb320606152a)) +* **master:** Release 0.66.0 ([#10282](https://github.com/AztecProtocol/aztec-packages/issues/10282)) ([fc61b27](https://github.com/AztecProtocol/aztec-packages/commit/fc61b27dde7c8d30712bf4910d45081caaf0bb53)) +* **master:** Release 0.67.0 ([#10472](https://github.com/AztecProtocol/aztec-packages/issues/10472)) ([19a500f](https://github.com/AztecProtocol/aztec-packages/commit/19a500ffc09ab8bc367a78599dd73a07a04b426e)) +* **master:** Release 0.67.1 ([#10684](https://github.com/AztecProtocol/aztec-packages/issues/10684)) ([c90bb16](https://github.com/AztecProtocol/aztec-packages/commit/c90bb16a5880c42752809f383f517181e6f8a53a)) +* Move decider PK allocation to methods ([#10670](https://github.com/AztecProtocol/aztec-packages/issues/10670)) ([1ab9e30](https://github.com/AztecProtocol/aztec-packages/commit/1ab9e30d339cfd7a80f333e408c367c1f8bf49f8)) +* Optimise grand product computation round based on active ranges ([#10460](https://github.com/AztecProtocol/aztec-packages/issues/10460)) ([7fa8f84](https://github.com/AztecProtocol/aztec-packages/commit/7fa8f844d9e389f8636118f1d3c3ecce707e771e)) +* Parallelise construction of perturbator coefficients at each level ([#10304](https://github.com/AztecProtocol/aztec-packages/issues/10304)) ([ba335bd](https://github.com/AztecProtocol/aztec-packages/commit/ba335bdff645398d20241ce7baab02f63b20f55c)) +* Parallelise inverse polynomial construction for lookup relations ([#10413](https://github.com/AztecProtocol/aztec-packages/issues/10413)) ([427cf59](https://github.com/AztecProtocol/aztec-packages/commit/427cf594ec9ca4b472ec5d4a249c7b49805c78e2)) +* Public inputs in unit tests with proving were incorrectly set ([#10300](https://github.com/AztecProtocol/aztec-packages/issues/10300)) ([0311bf3](https://github.com/AztecProtocol/aztec-packages/commit/0311bf333acb2def3be1373b36514b99b132623a)) +* Pull out some sync changes ([#10245](https://github.com/AztecProtocol/aztec-packages/issues/10245)) ([1bfc15e](https://github.com/AztecProtocol/aztec-packages/commit/1bfc15e08873a1f0f3743e259f418b70426b3f25)) +* Pull value merger code from sync ([#10080](https://github.com/AztecProtocol/aztec-packages/issues/10080)) ([3392629](https://github.com/AztecProtocol/aztec-packages/commit/3392629818e6d51c01ca4c75c1ad916bb4b4fdb1)) +* Redo typo PR by Dimitrolito ([#10364](https://github.com/AztecProtocol/aztec-packages/issues/10364)) ([da809c5](https://github.com/AztecProtocol/aztec-packages/commit/da809c58290f9590836f45ec59376cbf04d3c4ce)) +* Redo typo PR by leopardracer ([#10363](https://github.com/AztecProtocol/aztec-packages/issues/10363)) ([0d1b722](https://github.com/AztecProtocol/aztec-packages/commit/0d1b722ef7fdc501ca78cfca8f46009a29504c8f)) +* Remove handling of duplicates from the note hash tree ([#10016](https://github.com/AztecProtocol/aztec-packages/issues/10016)) ([ece1d45](https://github.com/AztecProtocol/aztec-packages/commit/ece1d455548bccd80a3c9660cc32149bcb129562)) +* Remove SchnorrVerify opcode ([#9897](https://github.com/AztecProtocol/aztec-packages/issues/9897)) ([93cd323](https://github.com/AztecProtocol/aztec-packages/commit/93cd323e493118ce91097934216a364855a991db)) +* Replace bbup.dev link ([#10908](https://github.com/AztecProtocol/aztec-packages/issues/10908)) ([6cdcdb3](https://github.com/AztecProtocol/aztec-packages/commit/6cdcdb32ae51b316b2bd454772026292f1979411)) + ## [0.67.1](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.67.0...barretenberg-v0.67.1) (2024-12-17) diff --git a/barretenberg/bbup/README.md b/barretenberg/bbup/README.md index 6e8ce8343d5e..ff67ec7f578a 100644 --- a/barretenberg/bbup/README.md +++ b/barretenberg/bbup/README.md @@ -9,7 +9,7 @@ It assumes you are using [Noir](https://noir-lang.org) as the frontend language. BBup is an installer for whatever version of BB you may want. Install BBup with: ```bash -curl -L bbup.dev | bash +curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/barretenberg/bbup/install | bash ``` > [!IMPORTANT] diff --git a/barretenberg/cpp/CMakeLists.txt b/barretenberg/cpp/CMakeLists.txt index 6e35eb87c159..5c14d971e479 100644 --- a/barretenberg/cpp/CMakeLists.txt +++ b/barretenberg/cpp/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.24 FATAL_ERROR) project( Barretenberg DESCRIPTION "BN254 elliptic curve library, and PLONK SNARK prover" - VERSION 0.67.1 # x-release-please-version + VERSION 0.68.0 # x-release-please-version LANGUAGES CXX C ) # Insert version into `bb` config file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/incl_main_tag_err.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/incl_main_tag_err.hpp index e99c219eb46c..e17b895d3a37 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/incl_main_tag_err.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/incl_main_tag_err.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class incl_main_tag_err_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::mem_tag_err; + static constexpr Column DST_SELECTOR = Column::main_tag_err; + static constexpr Column COUNTS = Column::incl_main_tag_err_counts; + static constexpr Column INVERSES = Column::incl_main_tag_err_inv; + static constexpr std::array SRC_COLUMNS = { Column::mem_clk }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_tag_err == 1 || in.main_tag_err == 1); @@ -35,15 +44,15 @@ class incl_main_tag_err_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.incl_main_tag_err_inv, - in.incl_main_tag_err_counts, - in.mem_tag_err, - in.main_tag_err, - in.mem_clk, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.incl_main_tag_err_inv, in.incl_main_tag_err_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/incl_mem_tag_err.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/incl_mem_tag_err.hpp index d0bb035fea69..7f5d246592e3 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/incl_mem_tag_err.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/incl_mem_tag_err.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class incl_mem_tag_err_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::main_tag_err; + static constexpr Column DST_SELECTOR = Column::mem_tag_err; + static constexpr Column COUNTS = Column::incl_mem_tag_err_counts; + static constexpr Column INVERSES = Column::incl_mem_tag_err_inv; + static constexpr std::array SRC_COLUMNS = { Column::main_clk }; + static constexpr std::array DST_COLUMNS = { Column::mem_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_tag_err == 1 || in.mem_tag_err == 1); @@ -35,15 +44,15 @@ class incl_mem_tag_err_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.incl_mem_tag_err_inv, - in.incl_mem_tag_err_counts, - in.main_tag_err, - in.mem_tag_err, - in.main_clk, - in.mem_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.incl_mem_tag_err_inv, in.incl_mem_tag_err_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_byte_lengths.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_byte_lengths.hpp index 27d465545332..c1a91dbd3ecb 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_byte_lengths.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_byte_lengths.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,16 @@ class lookup_byte_lengths_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::binary_start; + static constexpr Column DST_SELECTOR = Column::byte_lookup_sel_bin; + static constexpr Column COUNTS = Column::lookup_byte_lengths_counts; + static constexpr Column INVERSES = Column::lookup_byte_lengths_inv; + static constexpr std::array SRC_COLUMNS = { Column::binary_in_tag, + Column::binary_mem_tag_ctr }; + static constexpr std::array DST_COLUMNS = { Column::byte_lookup_table_in_tags, + Column::byte_lookup_table_byte_lengths }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.binary_start == 1 || in.byte_lookup_sel_bin == 1); @@ -35,17 +46,15 @@ class lookup_byte_lengths_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_byte_lengths_inv, - in.lookup_byte_lengths_counts, - in.binary_start, - in.byte_lookup_sel_bin, - in.binary_in_tag, - in.binary_mem_tag_ctr, - in.byte_lookup_table_in_tags, - in.byte_lookup_table_byte_lengths); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_byte_lengths_inv, in.lookup_byte_lengths_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_byte_operations.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_byte_operations.hpp index 99a66ff3c27d..bd8343ecb459 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_byte_operations.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_byte_operations.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,19 @@ class lookup_byte_operations_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::binary_sel_bin; + static constexpr Column DST_SELECTOR = Column::byte_lookup_sel_bin; + static constexpr Column COUNTS = Column::lookup_byte_operations_counts; + static constexpr Column INVERSES = Column::lookup_byte_operations_inv; + static constexpr std::array SRC_COLUMNS = { + Column::binary_op_id, Column::binary_ia_bytes, Column::binary_ib_bytes, Column::binary_ic_bytes + }; + static constexpr std::array DST_COLUMNS = { Column::byte_lookup_table_op_id, + Column::byte_lookup_table_input_a, + Column::byte_lookup_table_input_b, + Column::byte_lookup_table_output }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.binary_sel_bin == 1 || in.byte_lookup_sel_bin == 1); @@ -35,21 +49,15 @@ class lookup_byte_operations_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_byte_operations_inv, - in.lookup_byte_operations_counts, - in.binary_sel_bin, - in.byte_lookup_sel_bin, - in.binary_op_id, - in.binary_ia_bytes, - in.binary_ib_bytes, - in.binary_ic_bytes, - in.byte_lookup_table_op_id, - in.byte_lookup_table_input_a, - in.byte_lookup_table_input_b, - in.byte_lookup_table_output); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_byte_operations_inv, in.lookup_byte_operations_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_cd_value.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_cd_value.hpp index 46348b991bc3..ed274d2b1b96 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_cd_value.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_cd_value.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,15 @@ class lookup_cd_value_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::slice_sel_cd_cpy; + static constexpr Column DST_SELECTOR = Column::main_sel_calldata; + static constexpr Column COUNTS = Column::lookup_cd_value_counts; + static constexpr Column INVERSES = Column::lookup_cd_value_inv; + static constexpr std::array SRC_COLUMNS = { Column::slice_col_offset, + Column::slice_val }; + static constexpr std::array DST_COLUMNS = { Column::main_clk, Column::main_calldata }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.slice_sel_cd_cpy == 1 || in.main_sel_calldata == 1); @@ -35,17 +45,15 @@ class lookup_cd_value_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_cd_value_inv, - in.lookup_cd_value_counts, - in.slice_sel_cd_cpy, - in.main_sel_calldata, - in.slice_col_offset, - in.slice_val, - in.main_clk, - in.main_calldata); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_cd_value_inv, in.lookup_cd_value_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_da_gas_rng_chk_0.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_da_gas_rng_chk_0.hpp index 3fec11370d18..9fcb0205a25d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_da_gas_rng_chk_0.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_da_gas_rng_chk_0.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_da_gas_rng_chk_0_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::main_is_gas_accounted; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_da_gas_rng_chk_0_counts; + static constexpr Column INVERSES = Column::lookup_da_gas_rng_chk_0_inv; + static constexpr std::array SRC_COLUMNS = { Column::main_da_gas_u16_r0 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_is_gas_accounted == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_da_gas_rng_chk_0_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_da_gas_rng_chk_0_inv, - in.lookup_da_gas_rng_chk_0_counts, - in.main_is_gas_accounted, - in.main_sel_rng_16, - in.main_da_gas_u16_r0, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_da_gas_rng_chk_0_inv, in.lookup_da_gas_rng_chk_0_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_da_gas_rng_chk_1.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_da_gas_rng_chk_1.hpp index 84c02c77c373..d3d31b1af56d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_da_gas_rng_chk_1.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_da_gas_rng_chk_1.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_da_gas_rng_chk_1_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::main_is_gas_accounted; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_da_gas_rng_chk_1_counts; + static constexpr Column INVERSES = Column::lookup_da_gas_rng_chk_1_inv; + static constexpr std::array SRC_COLUMNS = { Column::main_da_gas_u16_r1 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_is_gas_accounted == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_da_gas_rng_chk_1_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_da_gas_rng_chk_1_inv, - in.lookup_da_gas_rng_chk_1_counts, - in.main_is_gas_accounted, - in.main_sel_rng_16, - in.main_da_gas_u16_r1, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_da_gas_rng_chk_1_inv, in.lookup_da_gas_rng_chk_1_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_l2_gas_rng_chk_0.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_l2_gas_rng_chk_0.hpp index 87f3515ade94..b5b1750e07e9 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_l2_gas_rng_chk_0.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_l2_gas_rng_chk_0.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_l2_gas_rng_chk_0_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::main_is_gas_accounted; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_l2_gas_rng_chk_0_counts; + static constexpr Column INVERSES = Column::lookup_l2_gas_rng_chk_0_inv; + static constexpr std::array SRC_COLUMNS = { Column::main_l2_gas_u16_r0 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_is_gas_accounted == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_l2_gas_rng_chk_0_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_l2_gas_rng_chk_0_inv, - in.lookup_l2_gas_rng_chk_0_counts, - in.main_is_gas_accounted, - in.main_sel_rng_16, - in.main_l2_gas_u16_r0, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_l2_gas_rng_chk_0_inv, in.lookup_l2_gas_rng_chk_0_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_l2_gas_rng_chk_1.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_l2_gas_rng_chk_1.hpp index e8642cadc316..fcc24c097a42 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_l2_gas_rng_chk_1.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_l2_gas_rng_chk_1.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_l2_gas_rng_chk_1_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::main_is_gas_accounted; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_l2_gas_rng_chk_1_counts; + static constexpr Column INVERSES = Column::lookup_l2_gas_rng_chk_1_inv; + static constexpr std::array SRC_COLUMNS = { Column::main_l2_gas_u16_r1 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_is_gas_accounted == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_l2_gas_rng_chk_1_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_l2_gas_rng_chk_1_inv, - in.lookup_l2_gas_rng_chk_1_counts, - in.main_is_gas_accounted, - in.main_sel_rng_16, - in.main_l2_gas_u16_r1, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_l2_gas_rng_chk_1_inv, in.lookup_l2_gas_rng_chk_1_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_0.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_0.hpp index 8c7855558304..1116ce3d58d7 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_0.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_0.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_mem_rng_chk_0_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::mem_sel_rng_chk; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_mem_rng_chk_0_counts; + static constexpr Column INVERSES = Column::lookup_mem_rng_chk_0_inv; + static constexpr std::array SRC_COLUMNS = { Column::mem_u16_r0 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_sel_rng_chk == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_mem_rng_chk_0_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_mem_rng_chk_0_inv, - in.lookup_mem_rng_chk_0_counts, - in.mem_sel_rng_chk, - in.main_sel_rng_16, - in.mem_u16_r0, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_mem_rng_chk_0_inv, in.lookup_mem_rng_chk_0_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_1.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_1.hpp index 5b9a6b8e41c4..82d50313a702 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_1.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_1.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_mem_rng_chk_1_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::mem_sel_rng_chk; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_mem_rng_chk_1_counts; + static constexpr Column INVERSES = Column::lookup_mem_rng_chk_1_inv; + static constexpr std::array SRC_COLUMNS = { Column::mem_u16_r1 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_sel_rng_chk == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_mem_rng_chk_1_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_mem_rng_chk_1_inv, - in.lookup_mem_rng_chk_1_counts, - in.mem_sel_rng_chk, - in.main_sel_rng_16, - in.mem_u16_r1, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_mem_rng_chk_1_inv, in.lookup_mem_rng_chk_1_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_2.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_2.hpp index 2213ec643a53..f32173648c6c 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_2.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_mem_rng_chk_2.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_mem_rng_chk_2_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::mem_sel_rng_chk; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_8; + static constexpr Column COUNTS = Column::lookup_mem_rng_chk_2_counts; + static constexpr Column INVERSES = Column::lookup_mem_rng_chk_2_inv; + static constexpr std::array SRC_COLUMNS = { Column::mem_u8_r0 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.mem_sel_rng_chk == 1 || in.main_sel_rng_8 == 1); @@ -35,15 +44,15 @@ class lookup_mem_rng_chk_2_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_mem_rng_chk_2_inv, - in.lookup_mem_rng_chk_2_counts, - in.mem_sel_rng_chk, - in.main_sel_rng_8, - in.mem_u8_r0, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_mem_rng_chk_2_inv, in.lookup_mem_rng_chk_2_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_opcode_gas.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_opcode_gas.hpp index 661a9d1dfe93..166c570367cc 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_opcode_gas.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_opcode_gas.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,22 @@ class lookup_opcode_gas_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::main_is_gas_accounted; + static constexpr Column DST_SELECTOR = Column::gas_sel_gas_cost; + static constexpr Column COUNTS = Column::lookup_opcode_gas_counts; + static constexpr Column INVERSES = Column::lookup_opcode_gas_inv; + static constexpr std::array SRC_COLUMNS = { Column::main_opcode_val, + Column::main_base_l2_gas_op_cost, + Column::main_base_da_gas_op_cost, + Column::main_dyn_l2_gas_op_cost, + Column::main_dyn_da_gas_op_cost }; + static constexpr std::array DST_COLUMNS = { Column::main_clk, + Column::gas_base_l2_gas_fixed_table, + Column::gas_base_da_gas_fixed_table, + Column::gas_dyn_l2_gas_fixed_table, + Column::gas_dyn_da_gas_fixed_table }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.main_is_gas_accounted == 1 || in.gas_sel_gas_cost == 1); @@ -35,23 +52,15 @@ class lookup_opcode_gas_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_opcode_gas_inv, - in.lookup_opcode_gas_counts, - in.main_is_gas_accounted, - in.gas_sel_gas_cost, - in.main_opcode_val, - in.main_base_l2_gas_op_cost, - in.main_base_da_gas_op_cost, - in.main_dyn_l2_gas_op_cost, - in.main_dyn_da_gas_op_cost, - in.main_clk, - in.gas_base_l2_gas_fixed_table, - in.gas_base_da_gas_fixed_table, - in.gas_dyn_l2_gas_fixed_table, - in.gas_dyn_da_gas_fixed_table); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_opcode_gas_inv, in.lookup_opcode_gas_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_pow_2_0.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_pow_2_0.hpp index d80fc14e3bd3..74999ea5a607 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_pow_2_0.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_pow_2_0.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,15 @@ class lookup_pow_2_0_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::alu_sel_shift_which; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_8; + static constexpr Column COUNTS = Column::lookup_pow_2_0_counts; + static constexpr Column INVERSES = Column::lookup_pow_2_0_inv; + static constexpr std::array SRC_COLUMNS = { Column::alu_ib, Column::alu_b_pow }; + static constexpr std::array DST_COLUMNS = { Column::main_clk, + Column::powers_power_of_2 }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_shift_which == 1 || in.main_sel_rng_8 == 1); @@ -35,17 +45,15 @@ class lookup_pow_2_0_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_pow_2_0_inv, - in.lookup_pow_2_0_counts, - in.alu_sel_shift_which, - in.main_sel_rng_8, - in.alu_ib, - in.alu_b_pow, - in.main_clk, - in.powers_power_of_2); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_pow_2_0_inv, in.lookup_pow_2_0_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_pow_2_1.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_pow_2_1.hpp index d79ed748b264..5859b44b537a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_pow_2_1.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_pow_2_1.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,16 @@ class lookup_pow_2_1_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::alu_sel_shift_which; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_8; + static constexpr Column COUNTS = Column::lookup_pow_2_1_counts; + static constexpr Column INVERSES = Column::lookup_pow_2_1_inv; + static constexpr std::array SRC_COLUMNS = { Column::alu_max_bits_sub_b_bits, + Column::alu_max_bits_sub_b_pow }; + static constexpr std::array DST_COLUMNS = { Column::main_clk, + Column::powers_power_of_2 }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.alu_sel_shift_which == 1 || in.main_sel_rng_8 == 1); @@ -35,17 +46,15 @@ class lookup_pow_2_1_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_pow_2_1_inv, - in.lookup_pow_2_1_counts, - in.alu_sel_shift_which, - in.main_sel_rng_8, - in.alu_max_bits_sub_b_bits, - in.alu_max_bits_sub_b_pow, - in.main_clk, - in.powers_power_of_2); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_pow_2_1_inv, in.lookup_pow_2_1_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_ret_value.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_ret_value.hpp index 1b666ddb9218..1d4d546e8af7 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_ret_value.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_ret_value.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,15 @@ class lookup_ret_value_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::slice_sel_return; + static constexpr Column DST_SELECTOR = Column::main_sel_returndata; + static constexpr Column COUNTS = Column::lookup_ret_value_counts; + static constexpr Column INVERSES = Column::lookup_ret_value_inv; + static constexpr std::array SRC_COLUMNS = { Column::slice_col_offset, + Column::slice_val }; + static constexpr std::array DST_COLUMNS = { Column::main_clk, Column::main_returndata }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.slice_sel_return == 1 || in.main_sel_returndata == 1); @@ -35,17 +45,15 @@ class lookup_ret_value_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_ret_value_inv, - in.lookup_ret_value_counts, - in.slice_sel_return, - in.main_sel_returndata, - in.slice_col_offset, - in.slice_val, - in.main_clk, - in.main_returndata); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_ret_value_inv, in.lookup_ret_value_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_0.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_0.hpp index 7e4210a15d59..cfc1c8721c99 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_0.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_0.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_rng_chk_0_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::range_check_sel_lookup_0; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_rng_chk_0_counts; + static constexpr Column INVERSES = Column::lookup_rng_chk_0_inv; + static constexpr std::array SRC_COLUMNS = { Column::range_check_u16_r0 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.range_check_sel_lookup_0 == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_rng_chk_0_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_rng_chk_0_inv, - in.lookup_rng_chk_0_counts, - in.range_check_sel_lookup_0, - in.main_sel_rng_16, - in.range_check_u16_r0, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_rng_chk_0_inv, in.lookup_rng_chk_0_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_1.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_1.hpp index 0e8e763f677f..3e968f497311 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_1.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_1.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_rng_chk_1_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::range_check_sel_lookup_1; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_rng_chk_1_counts; + static constexpr Column INVERSES = Column::lookup_rng_chk_1_inv; + static constexpr std::array SRC_COLUMNS = { Column::range_check_u16_r1 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.range_check_sel_lookup_1 == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_rng_chk_1_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_rng_chk_1_inv, - in.lookup_rng_chk_1_counts, - in.range_check_sel_lookup_1, - in.main_sel_rng_16, - in.range_check_u16_r1, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_rng_chk_1_inv, in.lookup_rng_chk_1_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_2.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_2.hpp index c0490636474b..fd1fbe25e27a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_2.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_2.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_rng_chk_2_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::range_check_sel_lookup_2; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_rng_chk_2_counts; + static constexpr Column INVERSES = Column::lookup_rng_chk_2_inv; + static constexpr std::array SRC_COLUMNS = { Column::range_check_u16_r2 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.range_check_sel_lookup_2 == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_rng_chk_2_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_rng_chk_2_inv, - in.lookup_rng_chk_2_counts, - in.range_check_sel_lookup_2, - in.main_sel_rng_16, - in.range_check_u16_r2, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_rng_chk_2_inv, in.lookup_rng_chk_2_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_3.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_3.hpp index d1b2ab9900b1..740cdd242e6f 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_3.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_3.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_rng_chk_3_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::range_check_sel_lookup_3; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_rng_chk_3_counts; + static constexpr Column INVERSES = Column::lookup_rng_chk_3_inv; + static constexpr std::array SRC_COLUMNS = { Column::range_check_u16_r3 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.range_check_sel_lookup_3 == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_rng_chk_3_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_rng_chk_3_inv, - in.lookup_rng_chk_3_counts, - in.range_check_sel_lookup_3, - in.main_sel_rng_16, - in.range_check_u16_r3, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_rng_chk_3_inv, in.lookup_rng_chk_3_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_4.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_4.hpp index 3fcdbaba5483..ce257b6ec380 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_4.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_4.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_rng_chk_4_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::range_check_sel_lookup_4; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_rng_chk_4_counts; + static constexpr Column INVERSES = Column::lookup_rng_chk_4_inv; + static constexpr std::array SRC_COLUMNS = { Column::range_check_u16_r4 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.range_check_sel_lookup_4 == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_rng_chk_4_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_rng_chk_4_inv, - in.lookup_rng_chk_4_counts, - in.range_check_sel_lookup_4, - in.main_sel_rng_16, - in.range_check_u16_r4, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_rng_chk_4_inv, in.lookup_rng_chk_4_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_5.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_5.hpp index 9ce59cca5dfc..efcba04f4340 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_5.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_5.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_rng_chk_5_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::range_check_sel_lookup_5; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_rng_chk_5_counts; + static constexpr Column INVERSES = Column::lookup_rng_chk_5_inv; + static constexpr std::array SRC_COLUMNS = { Column::range_check_u16_r5 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.range_check_sel_lookup_5 == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_rng_chk_5_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_rng_chk_5_inv, - in.lookup_rng_chk_5_counts, - in.range_check_sel_lookup_5, - in.main_sel_rng_16, - in.range_check_u16_r5, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_rng_chk_5_inv, in.lookup_rng_chk_5_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_6.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_6.hpp index 5c800f794317..5bceaaf16170 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_6.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_6.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_rng_chk_6_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::range_check_sel_lookup_6; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_rng_chk_6_counts; + static constexpr Column INVERSES = Column::lookup_rng_chk_6_inv; + static constexpr std::array SRC_COLUMNS = { Column::range_check_u16_r6 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.range_check_sel_lookup_6 == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_rng_chk_6_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_rng_chk_6_inv, - in.lookup_rng_chk_6_counts, - in.range_check_sel_lookup_6, - in.main_sel_rng_16, - in.range_check_u16_r6, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_rng_chk_6_inv, in.lookup_rng_chk_6_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_7.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_7.hpp index e93989515715..3c4425f46dab 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_7.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_7.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_rng_chk_7_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::range_check_sel_rng_chk; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_rng_chk_7_counts; + static constexpr Column INVERSES = Column::lookup_rng_chk_7_inv; + static constexpr std::array SRC_COLUMNS = { Column::range_check_u16_r7 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.range_check_sel_rng_chk == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_rng_chk_7_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_rng_chk_7_inv, - in.lookup_rng_chk_7_counts, - in.range_check_sel_rng_chk, - in.main_sel_rng_16, - in.range_check_u16_r7, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_rng_chk_7_inv, in.lookup_rng_chk_7_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_diff.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_diff.hpp index 5cd7dcceaa85..59808d1f0efe 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_diff.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_diff.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,14 @@ class lookup_rng_chk_diff_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::range_check_sel_rng_chk; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_16; + static constexpr Column COUNTS = Column::lookup_rng_chk_diff_counts; + static constexpr Column INVERSES = Column::lookup_rng_chk_diff_inv; + static constexpr std::array SRC_COLUMNS = { Column::range_check_dyn_diff }; + static constexpr std::array DST_COLUMNS = { Column::main_clk }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.range_check_sel_rng_chk == 1 || in.main_sel_rng_16 == 1); @@ -35,15 +44,15 @@ class lookup_rng_chk_diff_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_rng_chk_diff_inv, - in.lookup_rng_chk_diff_counts, - in.range_check_sel_rng_chk, - in.main_sel_rng_16, - in.range_check_dyn_diff, - in.main_clk); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_rng_chk_diff_inv, in.lookup_rng_chk_diff_counts, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_pow_2.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_pow_2.hpp index 3a3e641c91c7..cf966db21b5f 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_pow_2.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/lookup_rng_chk_pow_2.hpp @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,16 @@ class lookup_rng_chk_pow_2_lookup_settings { static constexpr size_t READ_TERM_DEGREE = 0; static constexpr size_t WRITE_TERM_DEGREE = 0; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::range_check_sel_rng_chk; + static constexpr Column DST_SELECTOR = Column::main_sel_rng_8; + static constexpr Column COUNTS = Column::lookup_rng_chk_pow_2_counts; + static constexpr Column INVERSES = Column::lookup_rng_chk_pow_2_inv; + static constexpr std::array SRC_COLUMNS = { Column::range_check_dyn_rng_chk_bits, + Column::range_check_dyn_rng_chk_pow_2 }; + static constexpr std::array DST_COLUMNS = { Column::main_clk, + Column::powers_power_of_2 }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.range_check_sel_rng_chk == 1 || in.main_sel_rng_8 == 1); @@ -35,17 +46,15 @@ class lookup_rng_chk_pow_2_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple(in.lookup_rng_chk_pow_2_inv, - in.lookup_rng_chk_pow_2_counts, - in.range_check_sel_rng_chk, - in.main_sel_rng_8, - in.range_check_dyn_rng_chk_bits, - in.range_check_dyn_rng_chk_pow_2, - in.main_clk, - in.powers_power_of_2); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple(in.lookup_rng_chk_pow_2_inv, in.lookup_rng_chk_pow_2_counts, diff --git a/barretenberg/ts/CHANGELOG.md b/barretenberg/ts/CHANGELOG.md index 1758b9d134ed..a746aa53966b 100644 --- a/barretenberg/ts/CHANGELOG.md +++ b/barretenberg/ts/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## [0.68.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg.js-v0.67.1...barretenberg.js-v0.68.0) (2024-12-20) + + +### Features + +* CIVC browser proveThenVerify ([#10431](https://github.com/AztecProtocol/aztec-packages/issues/10431)) ([8c064d4](https://github.com/AztecProtocol/aztec-packages/commit/8c064d484c686fdf00a100f65f1f740be4ef13cb)) +* Keccak honk proving in bb.js ([#10489](https://github.com/AztecProtocol/aztec-packages/issues/10489)) ([e0d7431](https://github.com/AztecProtocol/aztec-packages/commit/e0d743121674bcfdd73f84836c17645a5bc2df92)) +* PXE browser proving ([#10704](https://github.com/AztecProtocol/aztec-packages/issues/10704)) ([46da3cc](https://github.com/AztecProtocol/aztec-packages/commit/46da3cc8a9c1c407a8ad2857695eea794e334efd)) +* Speed up transaction execution ([#10172](https://github.com/AztecProtocol/aztec-packages/issues/10172)) ([da265b6](https://github.com/AztecProtocol/aztec-packages/commit/da265b6b7d61a0d991fa23bd044f711513a0e86c)) + + +### Bug Fixes + +* Add pako as a dependency in bb.js ([#10186](https://github.com/AztecProtocol/aztec-packages/issues/10186)) ([b773c14](https://github.com/AztecProtocol/aztec-packages/commit/b773c14a8fe8bf425dc755b3a156e500e9924c1e)) +* **bb.js:** Don't minify bb.js - webpack config ([#10170](https://github.com/AztecProtocol/aztec-packages/issues/10170)) ([6e7fae7](https://github.com/AztecProtocol/aztec-packages/commit/6e7fae7c78496b0b2241e2061b35ab22a3b3b186)) +* **bb.js:** Use globalThis instead of self ([#10747](https://github.com/AztecProtocol/aztec-packages/issues/10747)) ([309b5f7](https://github.com/AztecProtocol/aztec-packages/commit/309b5f74862089001e3159bdb52cbc8b60c71dc1)), closes [#10741](https://github.com/AztecProtocol/aztec-packages/issues/10741) +* Bump hard coded SRS size for wasm from 2^19 to 2^10 ([#10596](https://github.com/AztecProtocol/aztec-packages/issues/10596)) ([a37f82d](https://github.com/AztecProtocol/aztec-packages/commit/a37f82d2ed6a4512eb38f8fa576f52a06ddbdfba)) +* Casting vk to rawbuffer before wasm so it reads from the correct offset ([#10769](https://github.com/AztecProtocol/aztec-packages/issues/10769)) ([6a5bcfd](https://github.com/AztecProtocol/aztec-packages/commit/6a5bcfd2dc1a2bef6df2b93e9afa137a9b4ea315)) +* Strip wasm debug ([#9987](https://github.com/AztecProtocol/aztec-packages/issues/9987)) ([62a6b66](https://github.com/AztecProtocol/aztec-packages/commit/62a6b662f1ef20a603177c55c199de4a79b65b5c)) + + +### Miscellaneous + +* Ci3 phase 1 ([#10042](https://github.com/AztecProtocol/aztec-packages/issues/10042)) ([641da4b](https://github.com/AztecProtocol/aztec-packages/commit/641da4bbd7f12d5a66e5763c18f5fa8f7c627c76)) +* **master:** Release 0.64.0 ([#10043](https://github.com/AztecProtocol/aztec-packages/issues/10043)) ([12b1daa](https://github.com/AztecProtocol/aztec-packages/commit/12b1daafa121452a1ba2d17228be335b1a45b818)) +* **master:** Release 0.65.0 ([#10181](https://github.com/AztecProtocol/aztec-packages/issues/10181)) ([903bcb0](https://github.com/AztecProtocol/aztec-packages/commit/903bcb0a42f7fd83fb7da97a13b763cf761336bd)) +* **master:** Release 0.65.1 ([#10219](https://github.com/AztecProtocol/aztec-packages/issues/10219)) ([62fc917](https://github.com/AztecProtocol/aztec-packages/commit/62fc9175019cb5f3fabca1a5f5ff9e04d708695e)) +* **master:** Release 0.65.2 ([#10258](https://github.com/AztecProtocol/aztec-packages/issues/10258)) ([10754db](https://github.com/AztecProtocol/aztec-packages/commit/10754db0e6626047d4fc59cd0d7bbb320606152a)) +* **master:** Release 0.66.0 ([#10282](https://github.com/AztecProtocol/aztec-packages/issues/10282)) ([fc61b27](https://github.com/AztecProtocol/aztec-packages/commit/fc61b27dde7c8d30712bf4910d45081caaf0bb53)) +* **master:** Release 0.67.0 ([#10472](https://github.com/AztecProtocol/aztec-packages/issues/10472)) ([19a500f](https://github.com/AztecProtocol/aztec-packages/commit/19a500ffc09ab8bc367a78599dd73a07a04b426e)) +* **master:** Release 0.67.1 ([#10684](https://github.com/AztecProtocol/aztec-packages/issues/10684)) ([c90bb16](https://github.com/AztecProtocol/aztec-packages/commit/c90bb16a5880c42752809f383f517181e6f8a53a)) + ## [0.67.1](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg.js-v0.67.0...barretenberg.js-v0.67.1) (2024-12-17) diff --git a/barretenberg/ts/package.json b/barretenberg/ts/package.json index 0a405371618d..cb7645171c11 100644 --- a/barretenberg/ts/package.json +++ b/barretenberg/ts/package.json @@ -1,7 +1,7 @@ { "name": "@aztec/bb.js", "packageManager": "yarn@4.5.2", - "version": "0.67.1", + "version": "0.68.0", "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/barretenberg/ts", "license": "MIT", "type": "module", diff --git a/bb-pilcom/bb-pil-backend/src/file_writer.rs b/bb-pilcom/bb-pil-backend/src/file_writer.rs index 478455a372ef..37123485b2e2 100644 --- a/bb-pilcom/bb-pil-backend/src/file_writer.rs +++ b/bb-pilcom/bb-pil-backend/src/file_writer.rs @@ -9,10 +9,6 @@ pub struct BBFiles { } impl BBFiles { - pub fn default(vm_name: &str) -> Self { - Self::new(vm_name, None, None) - } - #[allow(clippy::too_many_arguments)] pub fn new(vm_name: &str, base_dir: Option<&str>, relations: Option<&str>) -> Self { let base_dir = base_dir diff --git a/bb-pilcom/bb-pil-backend/src/lookup_builder.rs b/bb-pilcom/bb-pil-backend/src/lookup_builder.rs index 028e74b26980..43888ee5cb13 100644 --- a/bb-pilcom/bb-pil-backend/src/lookup_builder.rs +++ b/bb-pilcom/bb-pil-backend/src/lookup_builder.rs @@ -138,23 +138,6 @@ fn create_lookup_settings_data(lookup: &Lookup, vm_name: &str) -> Json { "Lookup columns lhs must be the same length as rhs" ); - // 0. The polynomial containing the inverse products -> taken from the attributes - // 1. The polynomial with the counts! - // 2. lhs selector - // 3. rhs selector - // 4.. + columns per set. lhs cols - // 4 + columns per set.. . rhs cols - let mut lookup_entities: Vec = [ - lookup.inverse.clone(), - lookup.counts_poly.clone(), - lhs_selector.clone(), - rhs_selector.clone(), - ] - .to_vec(); - - lookup_entities.extend(lhs_cols); - lookup_entities.extend(rhs_cols); - // NOTE: these are hardcoded as 1 for now until more optimizations are required let read_terms = 1; let write_terms = 1; @@ -172,6 +155,10 @@ fn create_lookup_settings_data(lookup: &Lookup, vm_name: &str) -> Json { "lookup_name": lookup.name, "lhs_selector": lhs_selector, "rhs_selector": rhs_selector, + "lhs_cols": lhs_cols, + "rhs_cols": rhs_cols, + "inverses_col": lookup.inverse.clone(), + "counts_col": lookup.counts_poly, "read_terms": read_terms, "write_terms": write_terms, "lookup_tuple_size": lookup_tuple_size, @@ -180,7 +167,6 @@ fn create_lookup_settings_data(lookup: &Lookup, vm_name: &str) -> Json { "write_term_degree": write_term_degree, "read_term_types": read_term_types, "write_term_types": write_term_types, - "lookup_entities": lookup_entities, }) } diff --git a/bb-pilcom/bb-pil-backend/templates/lookup.hpp.hbs b/bb-pilcom/bb-pil-backend/templates/lookup.hpp.hbs index 3d97be8ee8d5..ecb6945b268e 100644 --- a/bb-pilcom/bb-pil-backend/templates/lookup.hpp.hbs +++ b/bb-pilcom/bb-pil-backend/templates/lookup.hpp.hbs @@ -1,6 +1,7 @@ // AUTOGENERATED FILE #pragma once +#include "../columns.hpp" #include "barretenberg/relations/generic_lookup/generic_lookup_relation.hpp" #include @@ -19,6 +20,22 @@ class {{lookup_name}}_lookup_settings { static constexpr size_t READ_TERM_DEGREE = {{read_term_degree}}; static constexpr size_t WRITE_TERM_DEGREE = {{write_term_degree}}; + // Columns using the Column enum. + static constexpr Column SRC_SELECTOR = Column::{{lhs_selector}}; + static constexpr Column DST_SELECTOR = Column::{{rhs_selector}}; + static constexpr Column COUNTS = Column::{{counts_col}}; + static constexpr Column INVERSES = Column::{{inverses_col}}; + static constexpr std::array SRC_COLUMNS = { + {{#each lhs_cols as |col|}} + Column::{{col}}{{#unless @last}},{{/unless}} + {{/each}} + }; + static constexpr std::array DST_COLUMNS = { + {{#each rhs_cols as |col|}} + Column::{{col}}{{#unless @last}},{{/unless}} + {{/each}} + }; + template static inline auto inverse_polynomial_is_computed_at_row(const AllEntities& in) { return (in.{{lhs_selector}} == 1 || in.{{rhs_selector}} == 1); @@ -35,19 +52,27 @@ class {{lookup_name}}_lookup_settings { template static inline auto get_const_entities(const AllEntities& in) { - return std::forward_as_tuple( - {{#each lookup_entities as |ent|}} - in.{{ent}}{{#unless @last}},{{/unless}} - {{/each}} - ); + return get_entities(in); } template static inline auto get_nonconst_entities(AllEntities& in) + { + return get_entities(in); + } + + template static inline auto get_entities(AllEntities&& in) { return std::forward_as_tuple( - {{#each lookup_entities as |ent|}} - in.{{ent}}{{#unless @last}},{{/unless}} - {{/each}} + in.{{inverses_col}}, + in.{{counts_col}}, + in.{{lhs_selector}}, + in.{{rhs_selector}}, + {{#each lhs_cols as |col|}} + in.{{col}}, + {{/each}} + {{#each rhs_cols as |col|}} + in.{{col}}{{#unless @last}},{{/unless}} + {{/each}} ); } }; diff --git a/bootstrap.sh b/bootstrap.sh index 80c8d4919b55..d59fa4ba5ab6 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -76,8 +76,8 @@ function check_toolchains { local node_installed_version=$(node --version | cut -d 'v' -f 2) if [[ "$(printf '%s\n' "$node_min_version" "$node_installed_version" | sort -V | head -n1)" != "$node_min_version" ]]; then encourage_dev_container - echo "Minimum Node.js version 18.19.0 not found." - echo "Installation: nvm install 18" + echo "Minimum Node.js version $node_min_version not found (got $node_installed_version)." + echo "Installation: nvm install $node_min_version" exit 1 fi # Check for required npm globals. @@ -89,6 +89,22 @@ function check_toolchains { exit 1 fi done + # Check for yarn availability + if ! command -v yarn > /dev/null; then + encourage_dev_container + echo "yarn not found." + echo "Installation: corepack enable" + exit 1 + fi + # Check for yarn version + local yarn_min_version="4.5.2" + local yarn_installed_version=$(yarn --version) + if [[ "$(printf '%s\n' "$yarn_min_version" "$yarn_installed_version" | sort -V | head -n1)" != "$yarn_min_version" ]]; then + encourage_dev_container + echo "Minimum yarn version $yarn_min_version not found (got $yarn_installed_version)." + echo "Installation: yarn set version $yarn_min_version; yarn install" + exit 1 + fi } case "$cmd" in @@ -132,7 +148,7 @@ case "$cmd" in ;; "test-boxes") github_group "test-boxes" - bootstrap_local "CI=1 SKIP_BB_CRS=1 ./bootstrap.sh fast && ./boxes/bootstrap.sh test"; + bootstrap_local_noninteractive "CI=1 SKIP_BB_CRS=1 ./bootstrap.sh fast && ./boxes/bootstrap.sh test"; exit ;; "image-aztec") diff --git a/boxes/boxes/vite/package.json b/boxes/boxes/vite/package.json index 5d127569aef3..c3301be3c0dd 100644 --- a/boxes/boxes/vite/package.json +++ b/boxes/boxes/vite/package.json @@ -41,7 +41,6 @@ "typescript-eslint": "^8.11.0", "vite": "^6.0.3", "vite-plugin-node-polyfills": "^0.22.0", - "vite-plugin-strip-block": "^1.0.1", "vite-plugin-top-level-await": "^1.4.4" } } diff --git a/boxes/boxes/vite/vite.config.ts b/boxes/boxes/vite/vite.config.ts index ef09a7d9e674..94bade805b8c 100644 --- a/boxes/boxes/vite/vite.config.ts +++ b/boxes/boxes/vite/vite.config.ts @@ -2,7 +2,6 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react-swc"; import { PolyfillOptions, nodePolyfills } from "vite-plugin-node-polyfills"; import topLevelAwait from "vite-plugin-top-level-await"; -import stripBlock from "vite-plugin-strip-block"; // Unfortunate, but needed due to https://github.com/davidmyersdev/vite-plugin-node-polyfills/issues/81 // Suspected to be because of the yarn workspace setup, but not sure @@ -31,7 +30,6 @@ export default defineConfig({ }, }, plugins: [ - stripBlock({ start: "testing-only-start", end: "testing-only-end" }), react(), nodePolyfillsFix({ include: ["buffer", "process", "path"] }), topLevelAwait(), diff --git a/boxes/yarn.lock b/boxes/yarn.lock index 6819882597ce..3e2af4835f81 100644 --- a/boxes/yarn.lock +++ b/boxes/yarn.lock @@ -12043,13 +12043,6 @@ __metadata: languageName: node linkType: hard -"vite-plugin-strip-block@npm:^1.0.1": - version: 1.0.1 - resolution: "vite-plugin-strip-block@npm:1.0.1" - checksum: 10c0/4302a035fbcaff8c5cfdffeedfd7c61d9b7198aeac1123cdadc00770db1d4828e7b780ce3a84106c786e771eb47c60289a694283c95702819f6f909c21bc3bbe - languageName: node - linkType: hard - "vite-plugin-top-level-await@npm:^1.4.4": version: 1.4.4 resolution: "vite-plugin-top-level-await@npm:1.4.4" @@ -12187,7 +12180,6 @@ __metadata: typescript-eslint: "npm:^8.11.0" vite: "npm:^6.0.3" vite-plugin-node-polyfills: "npm:^0.22.0" - vite-plugin-strip-block: "npm:^1.0.1" vite-plugin-top-level-await: "npm:^1.4.4" languageName: unknown linkType: soft diff --git a/ci3/bootstrap_local_noninteractive b/ci3/bootstrap_local_noninteractive new file mode 100755 index 000000000000..c2f6cc9ecd69 --- /dev/null +++ b/ci3/bootstrap_local_noninteractive @@ -0,0 +1,30 @@ +#!/bin/bash +# Launches our CI image locally and runs the bootstrap. +# This is used interim while we have CI runners that are not launched with bootstrap_ec2. +# It uses docker-in-docker as some test flows require it (e.g. e2e). +# We use a volume on /var/lib/docker as overlayfs trashes performance (in fact it just breaks). +# We mount in aws credentials to leverage the s3 cache. +# The host repository is mounted in read-only, and a clone is taken to ensure a clean start. +# If anything goes wrong during the run, the container will drop into a shell. + +root=$(git rev-parse --show-toplevel) +source $root/ci3/source +current_commit=$(git rev-parse HEAD) +cmd=${1:-"CI=1 ./bootstrap.sh fast"} + +docker run --rm \ + --privileged \ + -v bootstrap_ci_local_docker:/var/lib/docker \ + -v $root:/aztec-packages-host:ro \ + -v $HOME/.aws:/root/.aws \ + aztecprotocol/ci:2.0 bash -c " + /usr/local/share/docker-init.sh &> /dev/null + git config --global --add safe.directory /aztec-packages-host/.git + mkdir -p /root/aztec-packages && cd /root/aztec-packages + # Ensure we get a clean clone of the repo. + git init &>/dev/null + git remote add origin https://github.com/aztecprotocol/aztec-packages + git fetch --depth 1 origin $current_commit 2>/dev/null || (echo 'The commit was not pushed, run aborted.' && exit 1) + git checkout FETCH_HEAD &>/dev/null + $cmd +" diff --git a/docs/docs/migration_notes.md b/docs/docs/migration_notes.md index b7817ae8bd7d..2181a6c67857 100644 --- a/docs/docs/migration_notes.md +++ b/docs/docs/migration_notes.md @@ -5,6 +5,67 @@ keywords: [sandbox, aztec, notes, migration, updating, upgrading] --- Aztec is in full-speed development. Literally every version breaks compatibility with the previous ones. This page attempts to target errors and difficulties you might encounter when upgrading, and how to resolve them. +## 0.68.0 +### [archiver, node, pxe] Remove contract artifacts in node and archiver and store function names instead +Contract artifacts were only in the archiver for debugging purposes. Instead function names are now (optionally) emitted +when registering contract classes + +Function changes in the Node interface and Contract Data source interface: +```diff +- addContractArtifact(address: AztecAddress, artifact: ContractArtifact): Promise; ++ registerContractFunctionNames(address: AztecAddress, names: Record): Promise; +``` + +So now the PXE registers this when calling `registerContract()` +``` +await this.node.registerContractFunctionNames(instance.address, functionNames); +``` + +Function changes in the Archiver +```diff +- addContractArtifact(address: AztecAddress, artifact: ContractArtifact) +- getContractArtifact(address: AztecAddress) ++ registerContractFunctionNames(address: AztecAddress, names: Record): Promise +``` + +### [fees, fpc] Changes in setting up FPC as fee payer on AztecJS and method names in FPC +On AztecJS, setting up `PrivateFeePaymentMethod` and `PublicFeePaymentMethod` are now the same. The don't need to specify a sequencer address or which coin to pay in. The coins are set up in the FPC contract! + +```diff +- paymentMethod: new PrivateFeePaymentMethod(bananaCoin.address,bananaFPC.address,aliceWallet,sequencerAddress), ++ paymentMethod: new PrivateFeePaymentMethod(bananaFPC.address, aliceWallet), + +- paymentMethod: new PublicFeePaymentMethod(bananaCoin.address, bananaFPC.address, aliceWallet), ++ paymentMethod: new PublicFeePaymentMethod(bananaFPC.address, aliceWallet), +``` + +Changes in `FeePaymentMethod` class in AztecJS +```diff +- getAsset(): AztecAddress; ++ getAsset(): Promise; +``` + +Changes in the token contract: +FPC specific methods, `setup_refund()` and `complete_refund()` have minor args rename. + +Changes in FPC contract: +Rename of args in all of FPC functions as FPC now stores the accepted token address and admin and making it clearer the amounts are corresponding to the accepted token and not fee juice. +Also created a public function `pull_funds()` for admin to clawback any money in the FPC + +Expect more changes in FPC in the coming releases! + +### Name change from `contact` to `sender` in PXE API +`contact` has been deemed confusing because the name is too similar to `contract`. +For this reason we've decided to rename it: + +```diff +- await pxe.registerContact(address); ++ await pxe.registerSender(address); +- await pxe.getContacts(); ++ await pxe.getSenders(); +- await pxe.removeContact(address); ++ await pxe.removeSender(address); +``` ## 0.67.1 diff --git a/noir-projects/aztec-nr/.gitrepo b/noir-projects/aztec-nr/.gitrepo index 7a408b26c32a..e889ae14f151 100644 --- a/noir-projects/aztec-nr/.gitrepo +++ b/noir-projects/aztec-nr/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/AztecProtocol/aztec-nr branch = master - commit = 2f93e240a783a928f016479a06914624bd4e3c89 + commit = 1a03ce78d988fdaa897aed31338da8097eb6bac5 method = merge cmdver = 0.4.6 - parent = bb18f3b4079f54e8ab026e65dd9b2f21c52d848e + parent = 74ecf1e96c870668a4b6bbe047af835ec14a829e diff --git a/scripts/run_interleaved.sh b/scripts/run_interleaved.sh index 0e03e9a90309..d5db1dcf0024 100755 --- a/scripts/run_interleaved.sh +++ b/scripts/run_interleaved.sh @@ -3,13 +3,24 @@ set -eu # propagate errors inside while loop pipe set -o pipefail -# Usage: run_interleaved.sh
... +# Usage: run_interleaved.sh [-w "condition command"]
... # Runs commands in parallel, with interleaved output. See ci3/tmux_split for another approach. # Finishes when the main command exits. +# -w: Optional wait condition command that must succeed before starting next command + +# Parse options +WAIT_CMD="" +while getopts "w:" opt; do + case $opt in + w) WAIT_CMD="$OPTARG";; + \?) echo "Invalid option -$OPTARG" >&2; exit 1;; + esac +done +shift $((OPTIND-1)) # Check if at least two commands are provided (otherwise what is the point) if [ "$#" -lt 2 ]; then - echo "Usage: $0 ..." + echo "Usage: $0 [-w 'condition command'] ..." exit 1 fi @@ -51,6 +62,13 @@ function run_command() { # Run background commands without logging output i=0 for cmd in "$@"; do + if [ $i -gt 0 ] && [ -n "$WAIT_CMD" ]; then + echo "Waiting for condition before starting next command..." + until eval "$WAIT_CMD"; do + sleep 1 + done + fi + (run_command "$cmd" "${colors[$((i % ${#colors[@]}))]}" || [ $FINISHED = true ] || (echo "$cmd causing terminate" && kill 0) ) & ((i++)) || true # annoyingly considered a failure based on result done diff --git a/spartan/aztec-network/files/config/config-validator-env.sh b/spartan/aztec-network/files/config/config-validator-env.sh index b2848f8e069c..78b6b319f36a 100644 --- a/spartan/aztec-network/files/config/config-validator-env.sh +++ b/spartan/aztec-network/files/config/config-validator-env.sh @@ -3,7 +3,7 @@ set -eu # Pass a PXE url as an argument # Ask the PXE's node for l1 contract addresses -output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js get-node-info -u $1 --node-url '') +output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js get-node-info -u $1) echo "$output" diff --git a/spartan/aztec-network/files/config/deploy-l1-contracts.sh b/spartan/aztec-network/files/config/deploy-l1-contracts.sh old mode 100644 new mode 100755 index 1f4c56599f74..855372ca77cf --- a/spartan/aztec-network/files/config/deploy-l1-contracts.sh +++ b/spartan/aztec-network/files/config/deploy-l1-contracts.sh @@ -8,19 +8,31 @@ CHAIN_ID=$2 output="" MAX_RETRIES=5 RETRY_DELAY=60 -export LOG_LEVEL=debug for attempt in $(seq 1 $MAX_RETRIES); do - # if INIT_VALIDATORS is true, then we need to pass the validators flag to the deploy-l1-contracts command + # Construct base command + base_cmd="node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts" + + # Add account - use private key if set, otherwise use mnemonic + if [ -n "${L1_DEPLOYMENT_PRIVATE_KEY:-}" ]; then + base_cmd="$base_cmd --private-key $L1_DEPLOYMENT_PRIVATE_KEY" + else + base_cmd="$base_cmd --mnemonic '$MNEMONIC'" + fi + + # Add validators if INIT_VALIDATORS is true if [ "${INIT_VALIDATORS:-false}" = "true" ]; then - output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts --mnemonic "$MNEMONIC" --validators $3 --l1-chain-id $CHAIN_ID --salt $SALT) && break + output=$(eval $base_cmd --validators $3 --l1-chain-id $CHAIN_ID --salt $SALT) && break else - output=$(node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js deploy-l1-contracts --mnemonic "$MNEMONIC" --l1-chain-id $CHAIN_ID --salt $SALT) && break + output=$(eval $base_cmd --l1-chain-id $CHAIN_ID --salt $SALT) && break fi + echo "Attempt $attempt failed. Retrying in $RETRY_DELAY seconds..." sleep "$RETRY_DELAY" -done || { echo "All l1 contract deploy attempts failed."; exit 1; } - +done || { + echo "All l1 contract deploy attempts failed." + exit 1 +} echo "$output" @@ -38,7 +50,7 @@ governance_proposer_address=$(echo "$output" | grep -oP 'GovernanceProposer Addr governance_address=$(echo "$output" | grep -oP 'Governance Address: \K0x[a-fA-F0-9]{40}') # Write the addresses to a file in the shared volume -cat < /shared/contracts/contracts.env +cat </shared/contracts/contracts.env export ROLLUP_CONTRACT_ADDRESS=$rollup_address export REGISTRY_CONTRACT_ADDRESS=$registry_address export INBOX_CONTRACT_ADDRESS=$inbox_address diff --git a/spartan/aztec-network/files/config/setup-service-addresses.sh b/spartan/aztec-network/files/config/setup-service-addresses.sh index 063c84a16e5d..5b01449150a3 100644 --- a/spartan/aztec-network/files/config/setup-service-addresses.sh +++ b/spartan/aztec-network/files/config/setup-service-addresses.sh @@ -53,8 +53,8 @@ get_service_address() { } # Configure Ethereum address -if [ "${ETHEREUM_EXTERNAL_HOST}" != "" ]; then - ETHEREUM_ADDR="${ETHEREUM_EXTERNAL_HOST}" +if [ "${EXTERNAL_ETHEREUM_HOST}" != "" ]; then + ETHEREUM_ADDR="${EXTERNAL_ETHEREUM_HOST}" elif [ "${NETWORK_PUBLIC}" = "true" ]; then ETHEREUM_ADDR=$(get_service_address "ethereum" "${ETHEREUM_PORT}") else diff --git a/spartan/aztec-network/templates/boot-node.yaml b/spartan/aztec-network/templates/boot-node.yaml index f6f52b4b9b29..98a907624e63 100644 --- a/spartan/aztec-network/templates/boot-node.yaml +++ b/spartan/aztec-network/templates/boot-node.yaml @@ -44,8 +44,8 @@ spec: cat /shared/config/service-addresses echo "Awaiting ethereum node at ${ETHEREUM_HOST}" until curl -s -X POST -H 'Content-Type: application/json' \ - -d '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' \ - ${ETHEREUM_HOST} | grep -q reth; do + -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":67}' \ + ${ETHEREUM_HOST} | grep 0x; do echo "Waiting for Ethereum node ${ETHEREUM_HOST}..." sleep 5 done @@ -97,6 +97,8 @@ spec: value: "true" - name: MNEMONIC value: "{{ .Values.aztec.l1DeploymentMnemonic }}" + - name: L1_DEPLOYMENT_PRIVATE_KEY + value: "{{ .Values.ethereum.deployL1ContractsPrivateKey }}" - name: ETHEREUM_SLOT_DURATION value: "{{ .Values.ethereum.blockTime }}" - name: AZTEC_SLOT_DURATION @@ -189,6 +191,8 @@ spec: value: "{{ .Values.bootNode.sequencer.minTxsPerBlock }}" - name: VALIDATOR_PRIVATE_KEY value: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" + - name: SEQ_PUBLISHER_PRIVATE_KEY + value: "{{ .Values.bootNode.seqPublisherPrivateKey }}" - name: OTEL_RESOURCE_ATTRIBUTES value: service.name={{ .Release.Name }},service.namespace={{ .Release.Namespace }},service.version={{ .Chart.AppVersion }},environment={{ .Values.environment | default "production" }} - name: PROVER_REAL_PROOFS @@ -203,6 +207,14 @@ spec: value: "{{ .Values.aztec.epochDuration }}" - name: AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS value: "{{ .Values.aztec.epochProofClaimWindow }}" + - name: ARCHIVER_POLLING_INTERVAL_MS + value: {{ .Values.bootNode.archiverPollingInterval | quote }} + - name: ARCHIVER_VIEM_POLLING_INTERVAL_MS + value: {{ .Values.bootNode.archiverViemPollingInterval | quote }} + - name: L1_READER_VIEM_POLLING_INTERVAL_MS + value: {{ .Values.bootNode.archiverViemPollingInterval | quote }} + - name: SEQ_VIEM_POLLING_INTERVAL_MS + value: {{ .Values.bootNode.viemPollingInterval | quote }} - name: PEER_ID_PRIVATE_KEY value: "{{ .Values.bootNode.peerIdPrivateKey }}" ports: diff --git a/spartan/aztec-network/templates/prover-node.yaml b/spartan/aztec-network/templates/prover-node.yaml index 908c30902bdc..f28ea686b17d 100644 --- a/spartan/aztec-network/templates/prover-node.yaml +++ b/spartan/aztec-network/templates/prover-node.yaml @@ -34,8 +34,8 @@ spec: - | source /shared/config/service-addresses until curl -s -X POST -H 'Content-Type: application/json' \ - -d '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' \ - ${ETHEREUM_HOST} | grep -q reth; do + -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":67}' \ + ${ETHEREUM_HOST} | grep 0x; do echo "Waiting for Ethereum node ${ETHEREUM_HOST}..." sleep 5 done @@ -144,7 +144,7 @@ spec: - name: PROVER_BROKER_DATA_DIRECTORY value: "{{ .Values.proverNode.proverBroker.dataDirectory }}" - name: PROVER_PUBLISHER_PRIVATE_KEY - value: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" + value: "{{ .Values.proverNode.proverPublisherPrivateKey }}" - name: OTEL_RESOURCE_ATTRIBUTES value: service.name={{ .Release.Name }},service.namespace={{ .Release.Namespace }},service.version={{ .Chart.AppVersion }},environment={{ .Values.environment | default "production" }} - name: L1_CHAIN_ID @@ -163,6 +163,8 @@ spec: value: "{{ .Values.aztec.epochDuration }}" - name: AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS value: "{{ .Values.aztec.epochProofClaimWindow }}" + - name: PROVER_VIEM_POLLING_INTERVAL_MS + value: {{ .Values.proverNode.viemPollingInterval | quote }} ports: - containerPort: {{ .Values.proverNode.service.nodePort }} - containerPort: {{ .Values.proverNode.service.p2pTcpPort }} diff --git a/spartan/aztec-network/templates/reth.yaml b/spartan/aztec-network/templates/reth.yaml index 938d48b649ab..69bd6037e29c 100644 --- a/spartan/aztec-network/templates/reth.yaml +++ b/spartan/aztec-network/templates/reth.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.ethereum.externalHost }} apiVersion: apps/v1 kind: Deployment metadata: @@ -144,4 +145,5 @@ spec: requests: storage: {{ .Values.ethereum.storage }} {{- end }} ---- \ No newline at end of file +--- +{{ end }} \ No newline at end of file diff --git a/spartan/aztec-network/templates/validator.yaml b/spartan/aztec-network/templates/validator.yaml index b866f154ef7a..8ff7cf7735f8 100644 --- a/spartan/aztec-network/templates/validator.yaml +++ b/spartan/aztec-network/templates/validator.yaml @@ -45,8 +45,8 @@ spec: cat /shared/config/service-addresses # First check ethereum node until curl -s -X POST -H 'Content-Type: application/json' \ - -d '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' \ - $ETHEREUM_HOST | grep -q reth; do + -d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":67}' \ + $ETHEREUM_HOST | grep 0x; do echo "Waiting for Ethereum node ${ETHEREUM_HOST}..." sleep 5 done @@ -190,6 +190,16 @@ spec: value: "{{ .Values.aztec.epochDuration }}" - name: AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS value: "{{ .Values.aztec.epochProofClaimWindow }}" + - name: VALIDATOR_ATTESTATIONS_POLLING_INTERVAL_MS + value: {{ .Values.validator.attestationPollingInterval | quote }} + - name: ARCHIVER_POLLING_INTERVAL_MS + value: {{ .Values.validator.archiverPollingInterval | quote }} + - name: ARCHIVER_VIEM_POLLING_INTERVAL_MS + value: {{ .Values.validator.viemPollingInterval | quote }} + - name: L1_READER_VIEM_POLLING_INTERVAL_MS + value: {{ .Values.validator.viemPollingInterval | quote }} + - name: SEQ_VIEM_POLLING_INTERVAL_MS + value: {{ .Values.validator.viemPollingInterval | quote }} ports: - containerPort: {{ .Values.validator.service.nodePort }} - containerPort: {{ .Values.validator.service.p2pTcpPort }} diff --git a/spartan/aztec-network/values.yaml b/spartan/aztec-network/values.yaml index 8c58606c7cd9..120851580c71 100644 --- a/spartan/aztec-network/values.yaml +++ b/spartan/aztec-network/values.yaml @@ -38,6 +38,7 @@ aztec: l1Salt: "" # leave empty for random salt bootNode: + seqPublisherPrivateKey: "" peerIdPrivateKey: "" externalHost: "" replicas: 1 @@ -71,7 +72,11 @@ bootNode: outboxAddress: "" feeJuiceAddress: "" feeJuicePortalAddress: "" - stakingAssetAddress: "" + storage: "8Gi" + archiverPollingInterval: 1000 + archiverViemPollingInterval: 1000 + viemPollingInterval: 1000 + stakingAssetAddress: "" storageSize: "1Gi" dataDir: "/data" @@ -110,10 +115,15 @@ validator: requests: memory: "2Gi" cpu: "200m" + archiverPollingInterval: 1000 + archiverViemPollingInterval: 1000 + attestationPollingInterval: 1000 + viemPollingInterval: 1000 storageSize: "1Gi" dataDir: "/data" proverNode: + proverPublisherPrivateKey: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" externalHost: "" replicas: 1 p2pEnabled: true @@ -137,6 +147,10 @@ proverNode: memory: "2Gi" cpu: "200m" storage: "8Gi" + archiverPollingInterval: 1000 + archiverViemPollingInterval: 1000 + pollInterval: 1000 + viemPollingInterval: 1000 pxe: logLevel: "debug; info: aztec:simulator, json-rpc" @@ -208,6 +222,7 @@ ethereum: memory: "2Gi" cpu: "200m" storage: "80Gi" + deployL1ContractsPrivateKey: proverAgent: service: @@ -223,6 +238,7 @@ proverAgent: hardwareConcurrency: "" nodeSelector: {} resources: {} + pollInterval: 200 proverBroker: service: diff --git a/spartan/aztec-network/values/exp-2.yaml b/spartan/aztec-network/values/exp-2.yaml new file mode 100644 index 000000000000..a2601a184adc --- /dev/null +++ b/spartan/aztec-network/values/exp-2.yaml @@ -0,0 +1,32 @@ +telemetry: + enabled: true + otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 + +network: + setupL2Contracts: false + public: false + +ethereum: + externalHost: + chainId: "11155111" + +validator: + replicas: 3 + validatorKeys: + validatorAddresses: + - 0xB5221f3FA03acDEA5A68e355CcDed3f76847F375 + - 0x226E9D4c69525884b0A52C1E9E4C11054729223e + - 0xA33Fa6E2890C37C42CFC0875B86462E73885e02b + validator: + disabled: false + +bootNode: + seqPublisherPrivateKey: + validator: + disabled: true + +proverNode: + proverPublisherPrivateKey: + +bot: + txIntervalSeconds: 20 \ No newline at end of file diff --git a/spartan/aztec-network/values/sepolia-3-validators-with-metrics.yaml b/spartan/aztec-network/values/sepolia-3-validators-with-metrics.yaml new file mode 100644 index 000000000000..a2601a184adc --- /dev/null +++ b/spartan/aztec-network/values/sepolia-3-validators-with-metrics.yaml @@ -0,0 +1,32 @@ +telemetry: + enabled: true + otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 + +network: + setupL2Contracts: false + public: false + +ethereum: + externalHost: + chainId: "11155111" + +validator: + replicas: 3 + validatorKeys: + validatorAddresses: + - 0xB5221f3FA03acDEA5A68e355CcDed3f76847F375 + - 0x226E9D4c69525884b0A52C1E9E4C11054729223e + - 0xA33Fa6E2890C37C42CFC0875B86462E73885e02b + validator: + disabled: false + +bootNode: + seqPublisherPrivateKey: + validator: + disabled: true + +proverNode: + proverPublisherPrivateKey: + +bot: + txIntervalSeconds: 20 \ No newline at end of file diff --git a/spartan/terraform/deploy-release/main.tf b/spartan/terraform/deploy-release/main.tf index 84d44bae93e5..3972a6904894 100644 --- a/spartan/terraform/deploy-release/main.tf +++ b/spartan/terraform/deploy-release/main.tf @@ -47,9 +47,52 @@ resource "helm_release" "aztec-gke-cluster" { value = var.AZTEC_DOCKER_IMAGE } - set { - name = "aztec.l1DeploymentMnemonic" - value = var.L1_DEPLOYMENT_MNEMONIC + dynamic "set" { + for_each = var.L1_DEPLOYMENT_MNEMONIC != "" ? toset(["iterate"]) : toset([]) + content { + name = "aztec.l1DeploymentMnemonic" + value = var.L1_DEPLOYMENT_MNEMONIC + } + } + + dynamic "set" { + for_each = var.L1_DEPLOYMENT_PRIVATE_KEY != "" ? toset(["iterate"]) : toset([]) + content { + name = "ethereum.deployL1ContractsPrivateKey" + value = var.L1_DEPLOYMENT_PRIVATE_KEY + } + } + + dynamic "set" { + for_each = var.BOOT_NODE_SEQ_PUBLISHER_PRIVATE_KEY != "" ? toset(["iterate"]) : toset([]) + content { + name = "bootNode.seqPublisherPrivateKey" + value = var.BOOT_NODE_SEQ_PUBLISHER_PRIVATE_KEY + } + } + + dynamic "set" { + for_each = var.PROVER_PUBLISHER_PRIVATE_KEY != "" ? toset(["iterate"]) : toset([]) + content { + name = "proverNode.proverPublisherPrivateKey" + value = var.PROVER_PUBLISHER_PRIVATE_KEY + } + } + + dynamic "set_list" { + for_each = length(try(var.VALIDATOR_KEYS, [])) > 0 ? toset(["iterate"]) : toset([]) + content { + name = "validator.validatorKeys" + value = var.VALIDATOR_KEYS + } + } + + dynamic "set" { + for_each = var.ETHEREUM_EXTERNAL_HOST != "" ? toset(["iterate"]) : toset([]) + content { + name = "ethereum.externalHost" + value = var.ETHEREUM_EXTERNAL_HOST + } } set { diff --git a/spartan/terraform/deploy-release/variables.tf b/spartan/terraform/deploy-release/variables.tf index 7a5fbc364aa9..2658851316de 100644 --- a/spartan/terraform/deploy-release/variables.tf +++ b/spartan/terraform/deploy-release/variables.tf @@ -1,7 +1,7 @@ variable "GKE_CLUSTER_CONTEXT" { description = "GKE cluster context" type = string - default = "gke_testnet-440309_us-east4-a_spartan-gke" + default = "gke_testnet-440309_us-west1-a_aztec-gke" } variable "RELEASE_NAME" { @@ -23,8 +23,42 @@ variable "L1_DEPLOYMENT_MNEMONIC" { description = "Mnemonic to use for the L1 contract deployments" type = string sensitive = true + default = "" +} + +variable "L1_DEPLOYMENT_PRIVATE_KEY" { + description = "Private key to use for the L1 contract deployments" + type = string + sensitive = true + default = "" +} + +variable "VALIDATOR_KEYS" { + description = "List of private keys to use for the validators" + type = list(string) + sensitive = true + default = [] +} + +variable "BOOT_NODE_SEQ_PUBLISHER_PRIVATE_KEY" { + description = "Private key to use for the boot node" + type = string + sensitive = true + default = "" } +variable "PROVER_PUBLISHER_PRIVATE_KEY" { + description = "Private key to use for the prover" + type = string + sensitive = true + default = "" +} + +variable "ETHEREUM_EXTERNAL_HOST" { + description = "External host to use for the ethereum node" + type = string + default = "" +} variable "L1_DEPLOYMENT_SALT" { description = "Salt to use for the L1 contract deployments" type = string diff --git a/yarn-project/archiver/src/archiver/archiver.ts b/yarn-project/archiver/src/archiver/archiver.ts index ab59cca54207..049e87733226 100644 --- a/yarn-project/archiver/src/archiver/archiver.ts +++ b/yarn-project/archiver/src/archiver/archiver.ts @@ -294,6 +294,7 @@ export class Archiver implements ArchiveSource, Traceable { `to ${provenBlockNumber} due to predicted reorg at L1 block ${currentL1BlockNumber}. ` + `Updated L2 latest block is ${await this.getBlockNumber()}.`, ); + this.instrumentation.processPrune(); // TODO(palla/reorg): Do we need to set the block synched L1 block number here? // Seems like the next iteration should handle this. // await this.store.setBlockSynchedL1BlockNumber(currentL1BlockNumber); diff --git a/yarn-project/archiver/src/archiver/instrumentation.ts b/yarn-project/archiver/src/archiver/instrumentation.ts index 716f2948d0a1..f9b921df5809 100644 --- a/yarn-project/archiver/src/archiver/instrumentation.ts +++ b/yarn-project/archiver/src/archiver/instrumentation.ts @@ -23,6 +23,7 @@ export class ArchiverInstrumentation { private proofsSubmittedDelay: Histogram; private proofsSubmittedCount: UpDownCounter; private dbMetrics: LmdbMetrics; + private pruneCount: UpDownCounter; private log = createLogger('archiver:instrumentation'); @@ -68,6 +69,11 @@ export class ArchiverInstrumentation { }, lmdbStats, ); + + this.pruneCount = meter.createUpDownCounter(Metrics.ARCHIVER_PRUNE_COUNT, { + description: 'Number of prunes detected', + valueType: ValueType.INT, + }); } public static async new(telemetry: TelemetryClient, lmdbStats?: LmdbStatsCallback) { @@ -93,6 +99,10 @@ export class ArchiverInstrumentation { } } + public processPrune() { + this.pruneCount.add(1); + } + public updateLastProvenBlock(blockNumber: number) { this.blockHeight.record(blockNumber, { [Attributes.STATUS]: 'proven' }); } diff --git a/yarn-project/aztec.js/src/contract/get_gas_limits.test.ts b/yarn-project/aztec.js/src/contract/get_gas_limits.test.ts index f42e45a06551..a4f64ba896da 100644 --- a/yarn-project/aztec.js/src/contract/get_gas_limits.test.ts +++ b/yarn-project/aztec.js/src/contract/get_gas_limits.test.ts @@ -16,6 +16,7 @@ describe('getGasLimits', () => { txSimulationResult.publicOutput!.gasUsed = { totalGas: Gas.from({ daGas: 140, l2Gas: 280 }), teardownGas: Gas.from({ daGas: 10, l2Gas: 20 }), + publicGas: Gas.from({ daGas: 50, l2Gas: 200 }), }; }); diff --git a/yarn-project/aztec.js/src/contract/get_gas_limits.ts b/yarn-project/aztec.js/src/contract/get_gas_limits.ts index a6e0e7196fbd..37561490c682 100644 --- a/yarn-project/aztec.js/src/contract/get_gas_limits.ts +++ b/yarn-project/aztec.js/src/contract/get_gas_limits.ts @@ -1,11 +1,24 @@ -import { type GasUsed, type TxSimulationResult } from '@aztec/circuit-types'; +import { type TxSimulationResult } from '@aztec/circuit-types'; +import { type Gas } from '@aztec/circuits.js'; /** * Returns suggested total and teardown gas limits for a simulated tx. * Note that public gas usage is only accounted for if the publicOutput is present. * @param pad - Percentage to pad the suggested gas limits by, (as decimal, e.g., 0.10 for 10%). */ -export function getGasLimits(simulationResult: TxSimulationResult, pad = 0.1): GasUsed { +export function getGasLimits( + simulationResult: TxSimulationResult, + pad = 0.1, +): { + /** + * Total gas used across private and public + */ + totalGas: Gas; + /** + * Teardown gas used + */ + teardownGas: Gas; +} { return { totalGas: simulationResult.gasUsed.totalGas.mul(1 + pad), teardownGas: simulationResult.gasUsed.teardownGas.mul(1 + pad), diff --git a/yarn-project/aztec.js/src/wallet/base_wallet.ts b/yarn-project/aztec.js/src/wallet/base_wallet.ts index e279c66e05f4..bd1e5fd6e591 100644 --- a/yarn-project/aztec.js/src/wallet/base_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/base_wallet.ts @@ -86,14 +86,14 @@ export abstract class BaseWallet implements Wallet { getRegisteredAccount(address: AztecAddress): Promise { return this.pxe.getRegisteredAccount(address); } - registerContact(address: AztecAddress): Promise { - return this.pxe.registerContact(address); + registerSender(address: AztecAddress): Promise { + return this.pxe.registerSender(address); } - getContacts(): Promise { - return this.pxe.getContacts(); + getSenders(): Promise { + return this.pxe.getSenders(); } - async removeContact(address: AztecAddress): Promise { - await this.pxe.removeContact(address); + async removeSender(address: AztecAddress): Promise { + await this.pxe.removeSender(address); } registerContract(contract: { /** Instance */ instance: ContractInstanceWithAddress; diff --git a/yarn-project/aztec/CHANGELOG.md b/yarn-project/aztec/CHANGELOG.md index b0d385fd159a..277ba5a907e2 100644 --- a/yarn-project/aztec/CHANGELOG.md +++ b/yarn-project/aztec/CHANGELOG.md @@ -1,5 +1,51 @@ # Changelog +## [0.68.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-package-v0.67.1...aztec-package-v0.68.0) (2024-12-20) + + +### ⚠ BREAKING CHANGES + +* Remove debug and winston in favor of pino ([#10355](https://github.com/AztecProtocol/aztec-packages/issues/10355)) + +### Features + +* Agent and broker expose OTEL metrics ([#10264](https://github.com/AztecProtocol/aztec-packages/issues/10264)) ([c2c8cc6](https://github.com/AztecProtocol/aztec-packages/commit/c2c8cc6f7336cf4b2fa14d9a7f1af1a30f1b8f79)) +* **avm:** New public inputs witgen ([#10179](https://github.com/AztecProtocol/aztec-packages/issues/10179)) ([ac8f13e](https://github.com/AztecProtocol/aztec-packages/commit/ac8f13e4cd9a3f6b23d53ce5b06cc436324d5f7b)) +* Deploy faucet ([#10580](https://github.com/AztecProtocol/aztec-packages/issues/10580)) ([09e95a1](https://github.com/AztecProtocol/aztec-packages/commit/09e95a1d033deb5c31d9967d5100a6aeb8485ab5)) +* Epoch cache, do not attest if not in committee or from current proposer ([#10327](https://github.com/AztecProtocol/aztec-packages/issues/10327)) ([9ebaa65](https://github.com/AztecProtocol/aztec-packages/commit/9ebaa65ce290481e5dc00174e92137561360549a)) +* Expose P2P service API and clean up logs ([#10552](https://github.com/AztecProtocol/aztec-packages/issues/10552)) ([98cea58](https://github.com/AztecProtocol/aztec-packages/commit/98cea58dd9c7a4518daa8e625dd794a2b6f4b314)), closes [#10299](https://github.com/AztecProtocol/aztec-packages/issues/10299) +* New proving broker ([#10174](https://github.com/AztecProtocol/aztec-packages/issues/10174)) ([6fd5fc1](https://github.com/AztecProtocol/aztec-packages/commit/6fd5fc18bd973b539fb9edfb372181fbe4617f75)) +* PXE in the browser ([#10353](https://github.com/AztecProtocol/aztec-packages/issues/10353)) ([676f673](https://github.com/AztecProtocol/aztec-packages/commit/676f673dfbcb14f5351a0068aef9ad9fa4ebf879)) +* PXE sync on demand ([#10613](https://github.com/AztecProtocol/aztec-packages/issues/10613)) ([b2f1159](https://github.com/AztecProtocol/aztec-packages/commit/b2f11596e5c79be0c11ad298e734885e9657e640)) +* Staking integration ([#10403](https://github.com/AztecProtocol/aztec-packages/issues/10403)) ([ecd6c4f](https://github.com/AztecProtocol/aztec-packages/commit/ecd6c4ff914129236b23ab6f4924e4faa3e9d523)) +* Unify anvil versions ([#10143](https://github.com/AztecProtocol/aztec-packages/issues/10143)) ([adae143](https://github.com/AztecProtocol/aztec-packages/commit/adae14363c29591e01477ce131578189b82430e8)) + + +### Bug Fixes + +* Do not load pino-pretty in production bundles ([#10578](https://github.com/AztecProtocol/aztec-packages/issues/10578)) ([e515e6e](https://github.com/AztecProtocol/aztec-packages/commit/e515e6e7644180bab72eb693d83b9496919cc159)) +* Tweaking Fr and Fq fromString functionality to distinguish number-only strings ([#10529](https://github.com/AztecProtocol/aztec-packages/issues/10529)) ([736fce1](https://github.com/AztecProtocol/aztec-packages/commit/736fce1f77533925943ef363d1803b2e55f83609)) + + +### Miscellaneous + +* Bump jest default test timeout to 30s ([#10550](https://github.com/AztecProtocol/aztec-packages/issues/10550)) ([841bf48](https://github.com/AztecProtocol/aztec-packages/commit/841bf48c27767c3a4a53aacd0115582e8397910f)) +* Ci3 phase 1 ([#10042](https://github.com/AztecProtocol/aztec-packages/issues/10042)) ([641da4b](https://github.com/AztecProtocol/aztec-packages/commit/641da4bbd7f12d5a66e5763c18f5fa8f7c627c76)) +* Delete old serialization methods ([#9951](https://github.com/AztecProtocol/aztec-packages/issues/9951)) ([10d3f6f](https://github.com/AztecProtocol/aztec-packages/commit/10d3f6fe851dc73f5f12edec26b028fe526f0be6)) +* Fast epoch building test ([#10045](https://github.com/AztecProtocol/aztec-packages/issues/10045)) ([fb791a2](https://github.com/AztecProtocol/aztec-packages/commit/fb791a2ffc3f477c4526d7e14baf06dbe200144d)), closes [#9809](https://github.com/AztecProtocol/aztec-packages/issues/9809) +* Granular CLI imports to reduce start time ([#10778](https://github.com/AztecProtocol/aztec-packages/issues/10778)) ([e2fd046](https://github.com/AztecProtocol/aztec-packages/commit/e2fd046250664cd785269a718b036c0310dfcda7)) +* **master:** Release 0.64.0 ([#10043](https://github.com/AztecProtocol/aztec-packages/issues/10043)) ([12b1daa](https://github.com/AztecProtocol/aztec-packages/commit/12b1daafa121452a1ba2d17228be335b1a45b818)) +* **master:** Release 0.65.0 ([#10181](https://github.com/AztecProtocol/aztec-packages/issues/10181)) ([903bcb0](https://github.com/AztecProtocol/aztec-packages/commit/903bcb0a42f7fd83fb7da97a13b763cf761336bd)) +* **master:** Release 0.65.1 ([#10219](https://github.com/AztecProtocol/aztec-packages/issues/10219)) ([62fc917](https://github.com/AztecProtocol/aztec-packages/commit/62fc9175019cb5f3fabca1a5f5ff9e04d708695e)) +* **master:** Release 0.65.2 ([#10258](https://github.com/AztecProtocol/aztec-packages/issues/10258)) ([10754db](https://github.com/AztecProtocol/aztec-packages/commit/10754db0e6626047d4fc59cd0d7bbb320606152a)) +* **master:** Release 0.66.0 ([#10282](https://github.com/AztecProtocol/aztec-packages/issues/10282)) ([fc61b27](https://github.com/AztecProtocol/aztec-packages/commit/fc61b27dde7c8d30712bf4910d45081caaf0bb53)) +* **master:** Release 0.67.0 ([#10472](https://github.com/AztecProtocol/aztec-packages/issues/10472)) ([19a500f](https://github.com/AztecProtocol/aztec-packages/commit/19a500ffc09ab8bc367a78599dd73a07a04b426e)) +* **master:** Release 0.67.1 ([#10684](https://github.com/AztecProtocol/aztec-packages/issues/10684)) ([c90bb16](https://github.com/AztecProtocol/aztec-packages/commit/c90bb16a5880c42752809f383f517181e6f8a53a)) +* Remove debug and winston in favor of pino ([#10355](https://github.com/AztecProtocol/aztec-packages/issues/10355)) ([c246aba](https://github.com/AztecProtocol/aztec-packages/commit/c246aba5dd51391e2b8a3bd8cdc67f0115b85a7a)) +* Rename logger modules ([#10404](https://github.com/AztecProtocol/aztec-packages/issues/10404)) ([7441767](https://github.com/AztecProtocol/aztec-packages/commit/7441767d7e8e7e7d602c447ca843dee43f8dc8f8)), closes [#10125](https://github.com/AztecProtocol/aztec-packages/issues/10125) +* Split up protocol contract artifacts ([#10765](https://github.com/AztecProtocol/aztec-packages/issues/10765)) ([5a9ca18](https://github.com/AztecProtocol/aztec-packages/commit/5a9ca18ceee03ca2175605d1029153a7bf228ea9)) +* Trace and handle errors in running promises ([#10645](https://github.com/AztecProtocol/aztec-packages/issues/10645)) ([4cc0a6d](https://github.com/AztecProtocol/aztec-packages/commit/4cc0a6d832e6ee1c3fcc6876517ed3f743f59d4b)) + ## [0.67.1](https://github.com/AztecProtocol/aztec-packages/compare/aztec-package-v0.67.0...aztec-package-v0.67.1) (2024-12-17) diff --git a/yarn-project/aztec/package.json b/yarn-project/aztec/package.json index d599427685ba..619a268c4ab2 100644 --- a/yarn-project/aztec/package.json +++ b/yarn-project/aztec/package.json @@ -1,6 +1,6 @@ { "name": "@aztec/aztec", - "version": "0.67.1", + "version": "0.68.0", "type": "module", "exports": { ".": "./dest/index.js" diff --git a/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts b/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts index eabd47a48033..5bdf4f6b9cba 100644 --- a/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts +++ b/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts @@ -31,7 +31,7 @@ import { convertPrivateKernelTailToPublicInputsToWitnessMap, getPrivateKernelResetArtifactName, } from '@aztec/noir-protocol-circuits-types'; -import { WASMSimulator } from '@aztec/simulator'; +import { WASMSimulatorWithBlobs } from '@aztec/simulator'; import { type NoirCompiledCircuit } from '@aztec/types/noir'; import { encode } from '@msgpack/msgpack'; @@ -53,7 +53,7 @@ import { readFromOutputDirectory } from './client_ivc_proof_utils.js'; * TODO(#7368): this class grew 'organically' aka it could use a look at its resposibilities */ export class BBNativePrivateKernelProver implements PrivateKernelProver { - private simulator = new WASMSimulator(); + private simulator = new WASMSimulatorWithBlobs(); private verificationKeys: Map> = new Map< ClientProtocolArtifact, diff --git a/yarn-project/bb-prover/src/prover/bb_prover.ts b/yarn-project/bb-prover/src/prover/bb_prover.ts index 62391579ed88..7c5378cf677f 100644 --- a/yarn-project/bb-prover/src/prover/bb_prover.ts +++ b/yarn-project/bb-prover/src/prover/bb_prover.ts @@ -12,35 +12,37 @@ import { AGGREGATION_OBJECT_LENGTH, AVM_PROOF_LENGTH_IN_FIELDS, type AvmCircuitInputs, - type BaseOrMergeRollupPublicInputs, type BaseParityInputs, - type BlockMergeRollupInputs, - type BlockRootOrBlockMergePublicInputs, - type BlockRootRollupInputs, - type EmptyBlockRootRollupInputs, EmptyNestedCircuitInputs, EmptyNestedData, Fr, type KernelCircuitPublicInputs, - type MergeRollupInputs, NESTED_RECURSIVE_PROOF_LENGTH, type ParityPublicInputs, - type PrivateBaseRollupInputs, type PrivateKernelEmptyInputData, PrivateKernelEmptyInputs, Proof, - type PublicBaseRollupInputs, RECURSIVE_PROOF_LENGTH, RecursiveProof, type RootParityInputs, - type RootRollupInputs, - type RootRollupPublicInputs, TUBE_PROOF_LENGTH, - type TubeInputs, type VerificationKeyAsFields, type VerificationKeyData, makeRecursiveProofFromBinary, } from '@aztec/circuits.js'; +import { + type BaseOrMergeRollupPublicInputs, + type BlockMergeRollupInputs, + type BlockRootOrBlockMergePublicInputs, + type BlockRootRollupInputs, + type EmptyBlockRootRollupInputs, + type MergeRollupInputs, + type PrivateBaseRollupInputs, + type PublicBaseRollupInputs, + type RootRollupInputs, + type RootRollupPublicInputs, + type TubeInputs, +} from '@aztec/circuits.js/rollup'; import { runInDirectory } from '@aztec/foundation/fs'; import { createLogger } from '@aztec/foundation/log'; import { BufferReader } from '@aztec/foundation/serialize'; diff --git a/yarn-project/bb-prover/src/test/test_circuit_prover.ts b/yarn-project/bb-prover/src/test/test_circuit_prover.ts index 5ed9dfad7d52..e8aff2e43ccc 100644 --- a/yarn-project/bb-prover/src/test/test_circuit_prover.ts +++ b/yarn-project/bb-prover/src/test/test_circuit_prover.ts @@ -9,32 +9,34 @@ import { AVM_PROOF_LENGTH_IN_FIELDS, AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, type AvmCircuitInputs, - type BaseOrMergeRollupPublicInputs, type BaseParityInputs, - type BlockMergeRollupInputs, - type BlockRootOrBlockMergePublicInputs, - type BlockRootRollupInputs, - type EmptyBlockRootRollupInputs, EmptyNestedData, type KernelCircuitPublicInputs, - type MergeRollupInputs, NESTED_RECURSIVE_PROOF_LENGTH, type ParityPublicInputs, - type PrivateBaseRollupInputs, type PrivateKernelEmptyInputData, PrivateKernelEmptyInputs, type Proof, - type PublicBaseRollupInputs, RECURSIVE_PROOF_LENGTH, type RootParityInputs, - type RootRollupInputs, - type RootRollupPublicInputs, TUBE_PROOF_LENGTH, - type TubeInputs, VerificationKeyData, makeEmptyRecursiveProof, makeRecursiveProof, } from '@aztec/circuits.js'; +import { + type BaseOrMergeRollupPublicInputs, + type BlockMergeRollupInputs, + type BlockRootOrBlockMergePublicInputs, + type BlockRootRollupInputs, + type EmptyBlockRootRollupInputs, + type MergeRollupInputs, + type PrivateBaseRollupInputs, + type PublicBaseRollupInputs, + type RootRollupInputs, + type RootRollupPublicInputs, + type TubeInputs, +} from '@aztec/circuits.js/rollup'; import { createLogger } from '@aztec/foundation/log'; import { sleep } from '@aztec/foundation/sleep'; import { Timer } from '@aztec/foundation/timer'; @@ -63,7 +65,7 @@ import { convertSimulatedPublicBaseRollupInputsToWitnessMap, convertSimulatedPublicBaseRollupOutputsFromWitnessMap, } from '@aztec/noir-protocol-circuits-types'; -import { type SimulationProvider, WASMSimulator, emitCircuitSimulationStats } from '@aztec/simulator'; +import { type SimulationProvider, WASMSimulatorWithBlobs, emitCircuitSimulationStats } from '@aztec/simulator'; import { type TelemetryClient, trackSpan } from '@aztec/telemetry-client'; import { type WitnessMap } from '@noir-lang/types'; @@ -76,7 +78,7 @@ import { mapProtocolArtifactNameToCircuitName } from '../stats.js'; * Simulates circuits using the most efficient method and performs no proving. */ export class TestCircuitProver implements ServerCircuitProver { - private wasmSimulator = new WASMSimulator(); + private wasmSimulator = new WASMSimulatorWithBlobs(); private instrumentation: ProverInstrumentation; private logger = createLogger('bb-prover:test-prover'); diff --git a/yarn-project/circuit-types/src/interfaces/epoch-prover.ts b/yarn-project/circuit-types/src/interfaces/epoch-prover.ts index 4774741ebf16..e8faa0206476 100644 --- a/yarn-project/circuit-types/src/interfaces/epoch-prover.ts +++ b/yarn-project/circuit-types/src/interfaces/epoch-prover.ts @@ -1,4 +1,5 @@ -import { type BlockHeader, type Fr, type Proof, type RootRollupPublicInputs } from '@aztec/circuits.js'; +import { type BlockHeader, type Fr, type Proof } from '@aztec/circuits.js'; +import { type RootRollupPublicInputs } from '@aztec/circuits.js/rollup'; import { type L2Block } from '../l2_block.js'; import { type BlockBuilder } from './block-builder.js'; diff --git a/yarn-project/circuit-types/src/interfaces/proving-job-source.test.ts b/yarn-project/circuit-types/src/interfaces/proving-job-source.test.ts index e372b6bef034..f27fe8fb85e5 100644 --- a/yarn-project/circuit-types/src/interfaces/proving-job-source.test.ts +++ b/yarn-project/circuit-types/src/interfaces/proving-job-source.test.ts @@ -1,9 +1,5 @@ -import { - BaseOrMergeRollupPublicInputs, - NESTED_RECURSIVE_PROOF_LENGTH, - VerificationKeyData, - makeRecursiveProof, -} from '@aztec/circuits.js'; +import { NESTED_RECURSIVE_PROOF_LENGTH, VerificationKeyData, makeRecursiveProof } from '@aztec/circuits.js'; +import { BaseOrMergeRollupPublicInputs } from '@aztec/circuits.js/rollup'; import { type JsonRpcTestContext, createJsonRpcTestSetup } from '@aztec/foundation/json-rpc/test'; import { type ProvingJobSource, ProvingJobSourceSchema } from './proving-job-source.js'; diff --git a/yarn-project/circuit-types/src/interfaces/proving-job.ts b/yarn-project/circuit-types/src/interfaces/proving-job.ts index 8c2b44b98a05..618016bfc7e0 100644 --- a/yarn-project/circuit-types/src/interfaces/proving-job.ts +++ b/yarn-project/circuit-types/src/interfaces/proving-job.ts @@ -1,28 +1,30 @@ import { AVM_PROOF_LENGTH_IN_FIELDS, AvmCircuitInputs, - BaseOrMergeRollupPublicInputs, BaseParityInputs, - BlockMergeRollupInputs, - BlockRootOrBlockMergePublicInputs, - BlockRootRollupInputs, - EmptyBlockRootRollupInputs, KernelCircuitPublicInputs, - MergeRollupInputs, NESTED_RECURSIVE_PROOF_LENGTH, ParityPublicInputs, - PrivateBaseRollupInputs, PrivateKernelEmptyInputData, - PublicBaseRollupInputs, RECURSIVE_PROOF_LENGTH, RecursiveProof, RootParityInputs, - RootRollupInputs, - RootRollupPublicInputs, TUBE_PROOF_LENGTH, - TubeInputs, VerificationKeyData, } from '@aztec/circuits.js'; +import { + BaseOrMergeRollupPublicInputs, + BlockMergeRollupInputs, + BlockRootOrBlockMergePublicInputs, + BlockRootRollupInputs, + EmptyBlockRootRollupInputs, + MergeRollupInputs, + PrivateBaseRollupInputs, + PublicBaseRollupInputs, + RootRollupInputs, + RootRollupPublicInputs, + TubeInputs, +} from '@aztec/circuits.js/rollup'; import { type ZodFor } from '@aztec/foundation/schemas'; import { z } from 'zod'; diff --git a/yarn-project/circuit-types/src/interfaces/pxe.test.ts b/yarn-project/circuit-types/src/interfaces/pxe.test.ts index 902e5d538b53..35ca91421a21 100644 --- a/yarn-project/circuit-types/src/interfaces/pxe.test.ts +++ b/yarn-project/circuit-types/src/interfaces/pxe.test.ts @@ -118,18 +118,18 @@ describe('PXESchema', () => { expect(result).toBeInstanceOf(CompleteAddress); }); - it('registerContact', async () => { - const result = await context.client.registerContact(address); + it('registerSender', async () => { + const result = await context.client.registerSender(address); expect(result).toEqual(address); }); - it('getContacts', async () => { - const result = await context.client.getContacts(); + it('getSenders', async () => { + const result = await context.client.getSenders(); expect(result).toEqual([address]); }); - it('removeContact', async () => { - await context.client.removeContact(address); + it('removeSender', async () => { + await context.client.removeSender(address); }); it('registerContractClass', async () => { @@ -344,14 +344,14 @@ class MockPXE implements PXE { expect(address).toBeInstanceOf(AztecAddress); return Promise.resolve(CompleteAddress.random()); } - registerContact(address: AztecAddress): Promise { + registerSender(address: AztecAddress): Promise { expect(address).toBeInstanceOf(AztecAddress); return Promise.resolve(this.address); } - getContacts(): Promise { + getSenders(): Promise { return Promise.resolve([this.address]); } - removeContact(address: AztecAddress): Promise { + removeSender(address: AztecAddress): Promise { expect(address).toBeInstanceOf(AztecAddress); return Promise.resolve(); } diff --git a/yarn-project/circuit-types/src/interfaces/pxe.ts b/yarn-project/circuit-types/src/interfaces/pxe.ts index b47fb693449c..7aaa954f7df7 100644 --- a/yarn-project/circuit-types/src/interfaces/pxe.ts +++ b/yarn-project/circuit-types/src/interfaces/pxe.ts @@ -123,18 +123,18 @@ export interface PXE { * @param address - Address of the user to add to the address book * @returns The address address of the account. */ - registerContact(address: AztecAddress): Promise; + registerSender(address: AztecAddress): Promise; /** - * Retrieves the addresses stored as contacts on this PXE Service. - * @returns An array of the contacts on this PXE Service. + * Retrieves the addresses stored as senders on this PXE Service. + * @returns An array of the senders on this PXE Service. */ - getContacts(): Promise; + getSenders(): Promise; /** - * Removes a contact in the address book. + * Removes a sender in the address book. */ - removeContact(address: AztecAddress): Promise; + removeSender(address: AztecAddress): Promise; /** * Registers a contract class in the PXE without registering any associated contract instance with it. @@ -467,9 +467,9 @@ export const PXESchema: ApiSchemaFor = { .function() .args(schemas.AztecAddress) .returns(z.union([CompleteAddress.schema, z.undefined()])), - registerContact: z.function().args(schemas.AztecAddress).returns(schemas.AztecAddress), - getContacts: z.function().returns(z.array(schemas.AztecAddress)), - removeContact: z.function().args(schemas.AztecAddress).returns(z.void()), + registerSender: z.function().args(schemas.AztecAddress).returns(schemas.AztecAddress), + getSenders: z.function().returns(z.array(schemas.AztecAddress)), + removeSender: z.function().args(schemas.AztecAddress).returns(z.void()), registerContractClass: z.function().args(ContractArtifactSchema).returns(z.void()), registerContract: z .function() diff --git a/yarn-project/circuit-types/src/interfaces/server_circuit_prover.ts b/yarn-project/circuit-types/src/interfaces/server_circuit_prover.ts index aa0c60c7f2f7..e9a63893f3e0 100644 --- a/yarn-project/circuit-types/src/interfaces/server_circuit_prover.ts +++ b/yarn-project/circuit-types/src/interfaces/server_circuit_prover.ts @@ -1,26 +1,28 @@ import { type AVM_PROOF_LENGTH_IN_FIELDS, type AvmCircuitInputs, - type BaseOrMergeRollupPublicInputs, type BaseParityInputs, + type KernelCircuitPublicInputs, + type NESTED_RECURSIVE_PROOF_LENGTH, + type ParityPublicInputs, + type PrivateKernelEmptyInputData, + type RECURSIVE_PROOF_LENGTH, + type RootParityInputs, + type TUBE_PROOF_LENGTH, +} from '@aztec/circuits.js'; +import { + type BaseOrMergeRollupPublicInputs, type BlockMergeRollupInputs, type BlockRootOrBlockMergePublicInputs, type BlockRootRollupInputs, type EmptyBlockRootRollupInputs, - type KernelCircuitPublicInputs, type MergeRollupInputs, - type NESTED_RECURSIVE_PROOF_LENGTH, - type ParityPublicInputs, type PrivateBaseRollupInputs, - type PrivateKernelEmptyInputData, type PublicBaseRollupInputs, - type RECURSIVE_PROOF_LENGTH, - type RootParityInputs, type RootRollupInputs, type RootRollupPublicInputs, - type TUBE_PROOF_LENGTH, type TubeInputs, -} from '@aztec/circuits.js'; +} from '@aztec/circuits.js/rollup'; import type { Tx } from '../tx/tx.js'; import { type ProofAndVerificationKey, type PublicInputsAndRecursiveProof } from './proving-job.js'; diff --git a/yarn-project/circuit-types/src/mocks.ts b/yarn-project/circuit-types/src/mocks.ts index 4d38c4bc9868..9909b1e179ed 100644 --- a/yarn-project/circuit-types/src/mocks.ts +++ b/yarn-project/circuit-types/src/mocks.ts @@ -166,6 +166,7 @@ export const mockSimulatedTx = (seed = 1) => { { totalGas: makeGas(), teardownGas: makeGas(), + publicGas: makeGas(), }, ); return new TxSimulationResult(privateExecutionResult, tx.data, output); diff --git a/yarn-project/circuit-types/src/stats/stats.ts b/yarn-project/circuit-types/src/stats/stats.ts index 279e70899b26..545a7531e623 100644 --- a/yarn-project/circuit-types/src/stats/stats.ts +++ b/yarn-project/circuit-types/src/stats/stats.ts @@ -36,6 +36,10 @@ export type L1PublishStats = { calldataGas: number; /** Size in bytes of the calldata. */ calldataSize: number; + /** Gas cost of the blob data */ + blobDataGas: bigint; + /** Amount of blob gas used. */ + blobGasUsed: bigint; }; /** Stats logged for each L1 rollup publish tx.*/ diff --git a/yarn-project/circuit-types/src/test/factories.ts b/yarn-project/circuit-types/src/test/factories.ts index 9eb5b7ab46db..487bd5a86364 100644 --- a/yarn-project/circuit-types/src/test/factories.ts +++ b/yarn-project/circuit-types/src/test/factories.ts @@ -26,6 +26,7 @@ import { type MerkleTreeReadOperations } from '../interfaces/merkle_tree_operati import { ProvingRequestType } from '../interfaces/proving-job.js'; import { makeHeader } from '../l2_block_code_to_purge.js'; import { mockTx } from '../mocks.js'; +import { type GasUsed } from '../tx/gas_used.js'; import { makeProcessedTxFromPrivateOnlyTx, makeProcessedTxFromTxWithPublicCalls } from '../tx/processed_tx.js'; /** Makes a bloated processed tx for testing purposes. */ @@ -125,7 +126,8 @@ export function makeBloatedProcessedTx({ const gasUsed = { totalGas: Gas.empty(), teardownGas: Gas.empty(), - }; + publicGas: Gas.empty(), + } satisfies GasUsed; return makeProcessedTxFromTxWithPublicCalls( tx, diff --git a/yarn-project/circuit-types/src/tx/gas_used.ts b/yarn-project/circuit-types/src/tx/gas_used.ts index 2522b74b8635..ceb145467fc1 100644 --- a/yarn-project/circuit-types/src/tx/gas_used.ts +++ b/yarn-project/circuit-types/src/tx/gas_used.ts @@ -7,6 +7,10 @@ export interface GasUsed { * `GasSettings`, rather than actual teardown gas. */ totalGas: Gas; + + /** Total gas used during public execution, including teardown gas */ + publicGas: Gas; + /** * The actual gas used in the teardown phase. */ diff --git a/yarn-project/circuit-types/src/tx/processed_tx.ts b/yarn-project/circuit-types/src/tx/processed_tx.ts index 7006ee42e160..ddbc926647c5 100644 --- a/yarn-project/circuit-types/src/tx/processed_tx.ts +++ b/yarn-project/circuit-types/src/tx/processed_tx.ts @@ -112,6 +112,7 @@ export function makeEmptyProcessedTx( gasUsed: { totalGas: Gas.empty(), teardownGas: Gas.empty(), + publicGas: Gas.empty(), }, revertReason: undefined, isEmpty: true, @@ -148,7 +149,8 @@ export function makeProcessedTxFromPrivateOnlyTx( const gasUsed = { totalGas: tx.data.gasUsed, teardownGas: Gas.empty(), - }; + publicGas: Gas.empty(), + } satisfies GasUsed; return { hash: tx.getTxHash(), diff --git a/yarn-project/circuit-types/src/tx/public_simulation_output.ts b/yarn-project/circuit-types/src/tx/public_simulation_output.ts index 98ca5e8fc604..03b2fb9910d8 100644 --- a/yarn-project/circuit-types/src/tx/public_simulation_output.ts +++ b/yarn-project/circuit-types/src/tx/public_simulation_output.ts @@ -61,7 +61,7 @@ export class PublicSimulationOutput { constants: CombinedConstantData.schema, txEffect: TxEffect.schema, publicReturnValues: z.array(NestedProcessReturnValues.schema), - gasUsed: z.object({ totalGas: Gas.schema, teardownGas: Gas.schema }), + gasUsed: z.object({ totalGas: Gas.schema, teardownGas: Gas.schema, publicGas: Gas.schema }), }) .transform( fields => @@ -81,7 +81,7 @@ export class PublicSimulationOutput { CombinedConstantData.empty(), TxEffect.empty(), times(2, NestedProcessReturnValues.random), - { teardownGas: Gas.random(), totalGas: Gas.random() }, + { teardownGas: Gas.random(), totalGas: Gas.random(), publicGas: Gas.random() }, ); } } diff --git a/yarn-project/circuit-types/src/tx/simulated_tx.ts b/yarn-project/circuit-types/src/tx/simulated_tx.ts index df143b6e092f..5a80dd2244b2 100644 --- a/yarn-project/circuit-types/src/tx/simulated_tx.ts +++ b/yarn-project/circuit-types/src/tx/simulated_tx.ts @@ -61,6 +61,7 @@ export class TxSimulationResult extends PrivateSimulationResult { this.publicOutput?.gasUsed ?? { totalGas: this.publicInputs.gasUsed, teardownGas: Gas.empty(), + publicGas: Gas.empty(), } ); } diff --git a/yarn-project/circuits.js/package.json b/yarn-project/circuits.js/package.json index aaf5bfa4abdd..3f556edd8e32 100644 --- a/yarn-project/circuits.js/package.json +++ b/yarn-project/circuits.js/package.json @@ -19,7 +19,9 @@ "./constants": "./dest/constants.js", "./contract": "./dest/contract/index.js", "./merkle": "./dest/merkle/index.js", - "./simulation": "./dest/simulator/index.js" + "./simulation": "./dest/simulator/index.js", + "./blobs": "./dest/structs/blobs/index.js", + "./rollup": "./dest/structs/rollup/index.js" }, "typedocOptions": { "entryPoints": [ diff --git a/yarn-project/circuits.js/src/structs/blob_public_inputs.test.ts b/yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.test.ts similarity index 95% rename from yarn-project/circuits.js/src/structs/blob_public_inputs.test.ts rename to yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.test.ts index 9dc9c42d7be6..7624b088a5e4 100644 --- a/yarn-project/circuits.js/src/structs/blob_public_inputs.test.ts +++ b/yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.test.ts @@ -1,10 +1,10 @@ import { Blob } from '@aztec/foundation/blob'; import { randomInt } from '@aztec/foundation/crypto'; -import { BLOBS_PER_BLOCK, BLOB_PUBLIC_INPUTS } from '../constants.gen.js'; -import { makeBlobPublicInputs, makeBlockBlobPublicInputs } from '../tests/factories.js'; +import { BLOBS_PER_BLOCK, BLOB_PUBLIC_INPUTS } from '../../constants.gen.js'; +import { makeBlobPublicInputs, makeBlockBlobPublicInputs } from '../../tests/factories.js'; +import { Fr } from '../index.js'; import { BlobPublicInputs, BlockBlobPublicInputs } from './blob_public_inputs.js'; -import { Fr } from './index.js'; describe('BlobPublicInputs', () => { let blobPI: BlobPublicInputs; diff --git a/yarn-project/circuits.js/src/structs/blob_public_inputs.ts b/yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.ts similarity index 99% rename from yarn-project/circuits.js/src/structs/blob_public_inputs.ts rename to yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.ts index bbec9f51eafd..537bace933da 100644 --- a/yarn-project/circuits.js/src/structs/blob_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/blobs/blob_public_inputs.ts @@ -6,7 +6,7 @@ import { Fr } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; -import { BLOBS_PER_BLOCK } from '../constants.gen.js'; +import { BLOBS_PER_BLOCK } from '../../constants.gen.js'; // The prefix to the EVM blobHash, defined here: https://eips.ethereum.org/EIPS/eip-4844#specification // Also defined in yarn-project/foundation/src/blob/index.ts, which can't take in our circuits.js constants diff --git a/yarn-project/circuits.js/src/structs/blobs/index.ts b/yarn-project/circuits.js/src/structs/blobs/index.ts new file mode 100644 index 000000000000..f382b2046804 --- /dev/null +++ b/yarn-project/circuits.js/src/structs/blobs/index.ts @@ -0,0 +1,2 @@ +export * from './blob_public_inputs.js'; +export * from './sponge_blob.js'; diff --git a/yarn-project/circuits.js/src/structs/sponge_blob.test.ts b/yarn-project/circuits.js/src/structs/blobs/sponge_blob.test.ts similarity index 93% rename from yarn-project/circuits.js/src/structs/sponge_blob.test.ts rename to yarn-project/circuits.js/src/structs/blobs/sponge_blob.test.ts index 574eb15f69c5..573e0e7f7a3c 100644 --- a/yarn-project/circuits.js/src/structs/sponge_blob.test.ts +++ b/yarn-project/circuits.js/src/structs/blobs/sponge_blob.test.ts @@ -1,8 +1,8 @@ import { poseidon2Hash } from '@aztec/foundation/crypto'; import { Fr } from '@aztec/foundation/fields'; -import { SPONGE_BLOB_LENGTH } from '../constants.gen.js'; -import { makeSpongeBlob } from '../tests/factories.js'; +import { SPONGE_BLOB_LENGTH } from '../../constants.gen.js'; +import { makeSpongeBlob } from '../../tests/factories.js'; import { SpongeBlob } from './sponge_blob.js'; describe('SpongeBlob', () => { diff --git a/yarn-project/circuits.js/src/structs/sponge_blob.ts b/yarn-project/circuits.js/src/structs/blobs/sponge_blob.ts similarity index 100% rename from yarn-project/circuits.js/src/structs/sponge_blob.ts rename to yarn-project/circuits.js/src/structs/blobs/sponge_blob.ts diff --git a/yarn-project/circuits.js/src/structs/block_header.ts b/yarn-project/circuits.js/src/structs/block_header.ts index edfcabe8f784..dcb57c0b04d8 100644 --- a/yarn-project/circuits.js/src/structs/block_header.ts +++ b/yarn-project/circuits.js/src/structs/block_header.ts @@ -11,8 +11,8 @@ import { z } from 'zod'; import { BLOCK_HEADER_LENGTH, GeneratorIndex } from '../constants.gen.js'; import { ContentCommitment } from './content_commitment.js'; import { GlobalVariables } from './global_variables.js'; -import { AppendOnlyTreeSnapshot } from './rollup/append_only_tree_snapshot.js'; import { StateReference } from './state_reference.js'; +import { AppendOnlyTreeSnapshot } from './trees/append_only_tree_snapshot.js'; /** A header of an L2 block. */ export class BlockHeader { diff --git a/yarn-project/circuits.js/src/structs/index.ts b/yarn-project/circuits.js/src/structs/index.ts index 4df382c6b576..68d640ebf135 100644 --- a/yarn-project/circuits.js/src/structs/index.ts +++ b/yarn-project/circuits.js/src/structs/index.ts @@ -2,7 +2,6 @@ export * from '@aztec/foundation/eth-address'; export * from './avm/avm.js'; export * from './avm/avm_accumulated_data.js'; export * from './avm/avm_circuit_public_inputs.js'; -export * from './blob_public_inputs.js'; export * from './call_context.js'; export * from './client_ivc_proof.js'; export * from './complete_address.js'; @@ -69,28 +68,8 @@ export * from './read_request.js'; export * from './read_request_hints/index.js'; export * from './recursive_proof.js'; export * from './revert_code.js'; -export * from './rollup/append_only_tree_snapshot.js'; -export * from './rollup/avm_proof_data.js'; -export * from './rollup/base_or_merge_rollup_public_inputs.js'; -export * from './rollup/base_rollup_hints.js'; -export * from './rollup/block_merge_rollup.js'; -export * from './rollup/block_root_or_block_merge_public_inputs.js'; -export * from './rollup/constant_rollup_data.js'; -export * from './rollup/empty_block_root_rollup_inputs.js'; -export * from './rollup/block_root_rollup.js'; -export * from './rollup/merge_rollup.js'; -export * from './rollup/previous_rollup_block_data.js'; -export * from './rollup/previous_rollup_data.js'; -export * from './rollup/private_base_rollup_inputs.js'; -export * from './rollup/private_tube_data.js'; -export * from './rollup/public_base_rollup_inputs.js'; -export * from './rollup/public_tube_data.js'; -export * from './rollup/root_rollup.js'; -export * from './rollup/state_diff_hints.js'; -export * from './rollup/tube_inputs.js'; export * from './rollup_validation_requests.js'; export * from './scoped_key_validation_request_and_generator.js'; -export * from './sponge_blob.js'; export * from './shared.js'; export * from './state_reference.js'; export * from './tree_leaf_read_request.js'; diff --git a/yarn-project/circuits.js/src/structs/partial_state_reference.ts b/yarn-project/circuits.js/src/structs/partial_state_reference.ts index 7e212e712628..1db9147bedb4 100644 --- a/yarn-project/circuits.js/src/structs/partial_state_reference.ts +++ b/yarn-project/circuits.js/src/structs/partial_state_reference.ts @@ -4,7 +4,7 @@ import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/ import { z } from 'zod'; import { PARTIAL_STATE_REFERENCE_LENGTH } from '../constants.gen.js'; -import { AppendOnlyTreeSnapshot } from './rollup/append_only_tree_snapshot.js'; +import { AppendOnlyTreeSnapshot } from './trees/append_only_tree_snapshot.js'; /** * Stores snapshots of trees which are commonly needed by base or merge rollup circuits. diff --git a/yarn-project/circuits.js/src/structs/rollup/base_or_merge_rollup_public_inputs.ts b/yarn-project/circuits.js/src/structs/rollup/base_or_merge_rollup_public_inputs.ts index afd619bdf9a4..1d9611e1c676 100644 --- a/yarn-project/circuits.js/src/structs/rollup/base_or_merge_rollup_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/rollup/base_or_merge_rollup_public_inputs.ts @@ -3,9 +3,9 @@ import { bufferSchemaFor } from '@aztec/foundation/schemas'; import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; +import { SpongeBlob } from '../blobs/sponge_blob.js'; import { PartialStateReference } from '../partial_state_reference.js'; import { RollupTypes } from '../shared.js'; -import { SpongeBlob } from '../sponge_blob.js'; import { ConstantRollupData } from './constant_rollup_data.js'; /** diff --git a/yarn-project/circuits.js/src/structs/rollup/base_rollup_hints.ts b/yarn-project/circuits.js/src/structs/rollup/base_rollup_hints.ts index aedc17a3ee23..5450a3c25cfe 100644 --- a/yarn-project/circuits.js/src/structs/rollup/base_rollup_hints.ts +++ b/yarn-project/circuits.js/src/structs/rollup/base_rollup_hints.ts @@ -3,10 +3,10 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; import { ARCHIVE_HEIGHT } from '../../constants.gen.js'; +import { SpongeBlob } from '../blobs/sponge_blob.js'; import { MembershipWitness } from '../membership_witness.js'; import { PartialStateReference } from '../partial_state_reference.js'; import { PublicDataHint } from '../public_data_hint.js'; -import { SpongeBlob } from '../sponge_blob.js'; import { ConstantRollupData } from './constant_rollup_data.js'; import { PrivateBaseStateDiffHints, PublicBaseStateDiffHints } from './state_diff_hints.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/block_root_or_block_merge_public_inputs.ts b/yarn-project/circuits.js/src/structs/rollup/block_root_or_block_merge_public_inputs.ts index 6b53806f48b0..895824df0e08 100644 --- a/yarn-project/circuits.js/src/structs/rollup/block_root_or_block_merge_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/rollup/block_root_or_block_merge_public_inputs.ts @@ -6,9 +6,9 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; import { AZTEC_MAX_EPOCH_DURATION } from '../../constants.gen.js'; -import { BlockBlobPublicInputs } from '../blob_public_inputs.js'; +import { BlockBlobPublicInputs } from '../blobs/blob_public_inputs.js'; import { GlobalVariables } from '../global_variables.js'; -import { AppendOnlyTreeSnapshot } from './append_only_tree_snapshot.js'; +import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js'; /** * Output of the block root and block merge rollup circuits. diff --git a/yarn-project/circuits.js/src/structs/rollup/block_root_rollup.ts b/yarn-project/circuits.js/src/structs/rollup/block_root_rollup.ts index d12e42a54166..f85856c37ad3 100644 --- a/yarn-project/circuits.js/src/structs/rollup/block_root_rollup.ts +++ b/yarn-project/circuits.js/src/structs/rollup/block_root_rollup.ts @@ -13,7 +13,7 @@ import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, } from '../../constants.gen.js'; import { RootParityInput } from '../parity/root_parity_input.js'; -import { AppendOnlyTreeSnapshot } from './append_only_tree_snapshot.js'; +import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js'; import { PreviousRollupData } from './previous_rollup_data.js'; /** diff --git a/yarn-project/circuits.js/src/structs/rollup/constant_rollup_data.ts b/yarn-project/circuits.js/src/structs/rollup/constant_rollup_data.ts index 5065e997097e..eacfbf46ebda 100644 --- a/yarn-project/circuits.js/src/structs/rollup/constant_rollup_data.ts +++ b/yarn-project/circuits.js/src/structs/rollup/constant_rollup_data.ts @@ -3,7 +3,7 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; import { GlobalVariables } from '../global_variables.js'; -import { AppendOnlyTreeSnapshot } from './append_only_tree_snapshot.js'; +import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js'; /** * Data which is forwarded through the base rollup circuits unchanged. diff --git a/yarn-project/circuits.js/src/structs/rollup/empty_block_root_rollup_inputs.ts b/yarn-project/circuits.js/src/structs/rollup/empty_block_root_rollup_inputs.ts index f4355e835a7e..bdeba458fbd1 100644 --- a/yarn-project/circuits.js/src/structs/rollup/empty_block_root_rollup_inputs.ts +++ b/yarn-project/circuits.js/src/structs/rollup/empty_block_root_rollup_inputs.ts @@ -5,7 +5,7 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; import { GlobalVariables } from '../global_variables.js'; -import { AppendOnlyTreeSnapshot } from './append_only_tree_snapshot.js'; +import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js'; /** * Represents inputs of the empty block root rollup circuit. diff --git a/yarn-project/circuits.js/src/structs/rollup/index.ts b/yarn-project/circuits.js/src/structs/rollup/index.ts new file mode 100644 index 000000000000..8801d9fad2f3 --- /dev/null +++ b/yarn-project/circuits.js/src/structs/rollup/index.ts @@ -0,0 +1,18 @@ +export * from './avm_proof_data.js'; +export * from './base_or_merge_rollup_public_inputs.js'; +export * from './base_rollup_hints.js'; +export * from './block_merge_rollup.js'; +export * from './block_root_or_block_merge_public_inputs.js'; +export * from './constant_rollup_data.js'; +export * from './empty_block_root_rollup_inputs.js'; +export * from './block_root_rollup.js'; +export * from './merge_rollup.js'; +export * from './previous_rollup_block_data.js'; +export * from './previous_rollup_data.js'; +export * from './private_base_rollup_inputs.js'; +export * from './private_tube_data.js'; +export * from './public_base_rollup_inputs.js'; +export * from './public_tube_data.js'; +export * from './root_rollup.js'; +export * from './state_diff_hints.js'; +export * from './tube_inputs.js'; diff --git a/yarn-project/circuits.js/src/structs/rollup/root_rollup.ts b/yarn-project/circuits.js/src/structs/rollup/root_rollup.ts index 1398b68e08a8..b5eab3be568e 100644 --- a/yarn-project/circuits.js/src/structs/rollup/root_rollup.ts +++ b/yarn-project/circuits.js/src/structs/rollup/root_rollup.ts @@ -5,8 +5,8 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string'; import { type FieldsOf } from '@aztec/foundation/types'; import { AZTEC_MAX_EPOCH_DURATION } from '../../constants.gen.js'; -import { BlockBlobPublicInputs } from '../blob_public_inputs.js'; -import { AppendOnlyTreeSnapshot } from './append_only_tree_snapshot.js'; +import { BlockBlobPublicInputs } from '../blobs/blob_public_inputs.js'; +import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js'; import { FeeRecipient } from './block_root_or_block_merge_public_inputs.js'; import { PreviousRollupBlockData } from './previous_rollup_block_data.js'; diff --git a/yarn-project/circuits.js/src/structs/state_reference.ts b/yarn-project/circuits.js/src/structs/state_reference.ts index 12945a22e58a..4f550dd63b46 100644 --- a/yarn-project/circuits.js/src/structs/state_reference.ts +++ b/yarn-project/circuits.js/src/structs/state_reference.ts @@ -6,7 +6,7 @@ import { z } from 'zod'; import { STATE_REFERENCE_LENGTH } from '../constants.gen.js'; import { PartialStateReference } from './partial_state_reference.js'; -import { AppendOnlyTreeSnapshot } from './rollup/append_only_tree_snapshot.js'; +import { AppendOnlyTreeSnapshot } from './trees/append_only_tree_snapshot.js'; /** * Stores snapshots of all the trees but archive. diff --git a/yarn-project/circuits.js/src/structs/tree_snapshots.ts b/yarn-project/circuits.js/src/structs/tree_snapshots.ts index c55e24be1b5a..0a85f9f5383a 100644 --- a/yarn-project/circuits.js/src/structs/tree_snapshots.ts +++ b/yarn-project/circuits.js/src/structs/tree_snapshots.ts @@ -4,7 +4,7 @@ import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/ import { inspect } from 'util'; import { TREE_SNAPSHOTS_LENGTH } from '../constants.gen.js'; -import { AppendOnlyTreeSnapshot } from './rollup/append_only_tree_snapshot.js'; +import { AppendOnlyTreeSnapshot } from './trees/append_only_tree_snapshot.js'; /** * Stores snapshots of all the trees but archive. diff --git a/yarn-project/circuits.js/src/structs/rollup/append_only_tree_snapshot.ts b/yarn-project/circuits.js/src/structs/trees/append_only_tree_snapshot.ts similarity index 100% rename from yarn-project/circuits.js/src/structs/rollup/append_only_tree_snapshot.ts rename to yarn-project/circuits.js/src/structs/trees/append_only_tree_snapshot.ts diff --git a/yarn-project/circuits.js/src/structs/trees/index.ts b/yarn-project/circuits.js/src/structs/trees/index.ts index 4143138abab4..5d2659eec7c7 100644 --- a/yarn-project/circuits.js/src/structs/trees/index.ts +++ b/yarn-project/circuits.js/src/structs/trees/index.ts @@ -1,2 +1,3 @@ export * from './nullifier_leaf.js'; export * from './public_data_leaf.js'; +export * from './append_only_tree_snapshot.js'; diff --git a/yarn-project/circuits.js/src/tests/factories.ts b/yarn-project/circuits.js/src/tests/factories.ts index a606dfb86845..b9d2eb28a1a4 100644 --- a/yarn-project/circuits.js/src/tests/factories.ts +++ b/yarn-project/circuits.js/src/tests/factories.ts @@ -20,17 +20,14 @@ import { ARCHIVE_HEIGHT, AVM_PROOF_LENGTH_IN_FIELDS, AZTEC_MAX_EPOCH_DURATION, - AppendOnlyTreeSnapshot, AvmCircuitInputs, AvmContractInstanceHint, AvmExecutionHints, BLOBS_PER_BLOCK, - BaseOrMergeRollupPublicInputs, BaseParityInputs, CallContext, CombinedAccumulatedData, CombinedConstantData, - ConstantRollupData, ContractStorageRead, ContractStorageUpdateRequest, FIELDS_PER_BLOB, @@ -63,7 +60,6 @@ import { MAX_UNENCRYPTED_LOGS_PER_TX, MaxBlockNumber, MembershipWitness, - MergeRollupInputs, NESTED_RECURSIVE_PROOF_LENGTH, NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, @@ -81,7 +77,6 @@ import { PartialPrivateTailPublicInputsForRollup, PartialStateReference, Point, - PreviousRollupData, PrivateCallRequest, PrivateCircuitPublicInputs, PrivateKernelTailCircuitPublicInputs, @@ -99,8 +94,6 @@ import { RollupTypes, RootParityInput, RootParityInputs, - RootRollupInputs, - RootRollupPublicInputs, ScopedLogHash, StateReference, TUBE_PROOF_LENGTH, @@ -116,6 +109,8 @@ import { computePublicBytecodeCommitment, makeRecursiveProof, } from '../index.js'; +import { BlobPublicInputs, BlockBlobPublicInputs } from '../structs/blobs/blob_public_inputs.js'; +import { Poseidon2Sponge, SpongeBlob } from '../structs/blobs/sponge_blob.js'; import { BlockHeader } from '../structs/block_header.js'; import { ContentCommitment, NUM_BYTES_PER_SHA256 } from '../structs/content_commitment.js'; import { Gas } from '../structs/gas.js'; @@ -130,44 +125,44 @@ import { AvmEnqueuedCallHint, AvmNullifierReadTreeHint, AvmNullifierWriteTreeHint, - AvmProofData, AvmPublicDataReadTreeHint, AvmPublicDataWriteTreeHint, - BlobPublicInputs, - BlockBlobPublicInputs, CountedPublicCallRequest, - Poseidon2Sponge, - PrivateBaseRollupHints, - PrivateBaseRollupInputs, - PrivateBaseStateDiffHints, PrivateLog, PrivateLogData, PrivateToAvmAccumulatedData, PrivateToAvmAccumulatedDataArrayLengths, PrivateToPublicAccumulatedData, PrivateToPublicKernelCircuitPublicInputs, - PrivateTubeData, - PublicBaseRollupHints, - PublicBaseRollupInputs, - PublicBaseStateDiffHints, PublicDataWrite, - PublicTubeData, ScopedL2ToL1Message, - SpongeBlob, TreeSnapshots, TxConstantData, VkWitnessData, } from '../structs/index.js'; import { KernelCircuitPublicInputs } from '../structs/kernel/kernel_circuit_public_inputs.js'; +import { AvmProofData } from '../structs/rollup/avm_proof_data.js'; +import { BaseOrMergeRollupPublicInputs } from '../structs/rollup/base_or_merge_rollup_public_inputs.js'; +import { PrivateBaseRollupHints, PublicBaseRollupHints } from '../structs/rollup/base_rollup_hints.js'; import { BlockMergeRollupInputs } from '../structs/rollup/block_merge_rollup.js'; import { BlockRootOrBlockMergePublicInputs, FeeRecipient, } from '../structs/rollup/block_root_or_block_merge_public_inputs.js'; import { BlockRootRollupInputs } from '../structs/rollup/block_root_rollup.js'; +import { ConstantRollupData } from '../structs/rollup/constant_rollup_data.js'; import { EmptyBlockRootRollupInputs } from '../structs/rollup/empty_block_root_rollup_inputs.js'; +import { MergeRollupInputs } from '../structs/rollup/merge_rollup.js'; import { PreviousRollupBlockData } from '../structs/rollup/previous_rollup_block_data.js'; +import { PreviousRollupData } from '../structs/rollup/previous_rollup_data.js'; +import { PrivateBaseRollupInputs } from '../structs/rollup/private_base_rollup_inputs.js'; +import { PrivateTubeData } from '../structs/rollup/private_tube_data.js'; +import { PublicBaseRollupInputs } from '../structs/rollup/public_base_rollup_inputs.js'; +import { PublicTubeData } from '../structs/rollup/public_tube_data.js'; +import { RootRollupInputs, RootRollupPublicInputs } from '../structs/rollup/root_rollup.js'; +import { PrivateBaseStateDiffHints, PublicBaseStateDiffHints } from '../structs/rollup/state_diff_hints.js'; import { RollupValidationRequests } from '../structs/rollup_validation_requests.js'; +import { AppendOnlyTreeSnapshot } from '../structs/trees/append_only_tree_snapshot.js'; /** * Creates an arbitrary side effect object with the given seed. diff --git a/yarn-project/cli-wallet/src/bin/index.ts b/yarn-project/cli-wallet/src/bin/index.ts index 1147134a56ff..cda770c1ae38 100644 --- a/yarn-project/cli-wallet/src/bin/index.ts +++ b/yarn-project/cli-wallet/src/bin/index.ts @@ -86,11 +86,28 @@ async function main() { .env('AZTEC_NODE_URL') .default(`http://${LOCALHOST}:8080`), ) + .addOption( + new Option('-b, --bb-binary-path ', 'Path to the BB binary') + .env('BB_BINARY_PATH') + .default(`$HOME/.bb/bb`), + ) + .addOption( + new Option('-w, --bb-working-directory ', 'Path to the BB working directory') + .env('BB_WORKING_DIRECTORY') + .default(`$HOME/.bb-workdir`), + ) .hook('preSubcommand', async command => { const { dataDir, remotePxe, nodeUrl } = command.optsWithGlobals(); + if (!remotePxe) { debugLogger.info('Using local PXE service'); - await pxeWrapper.init(nodeUrl, join(dataDir, 'pxe')); + const subcommand = command.args[0]; + const isProfiling = command.args.includes('--profile'); + const enableProving = subcommand === 'simulate' && isProfiling; + + await pxeWrapper.init(nodeUrl, join(dataDir, 'pxe'), { + proverEnabled: enableProving, + }); } db.init(AztecLmdbStore.open(dataDir)); }); diff --git a/yarn-project/cli-wallet/src/cmds/index.ts b/yarn-project/cli-wallet/src/cmds/index.ts index 1915e080af75..14fe32668c15 100644 --- a/yarn-project/cli-wallet/src/cmds/index.ts +++ b/yarn-project/cli-wallet/src/cmds/index.ts @@ -617,27 +617,27 @@ export function injectCommands( }); program - .command('register-contact') + .command('register-sender') .description( - "Registers a contact's address in the wallet, so the note synching process will look for notes sent by them", + "Registers a sender's address in the wallet, so the note synching process will look for notes sent by them", ) - .argument('[address]', 'The address of the contact to register', address => + .argument('[address]', 'The address of the sender to register', address => aliasedAddressParser('accounts', address, db), ) .addOption(pxeOption) .addOption(createAccountOption('Alias or address of the account to simulate from', !db, db)) - .addOption(createAliasOption('Alias for the contact. Used for easy reference in subsequent commands.', !db)) + .addOption(createAliasOption('Alias for the sender. Used for easy reference in subsequent commands.', !db)) .action(async (address, options) => { - const { registerContact } = await import('./register_contact.js'); + const { registerSender } = await import('./register_sender.js'); const { from: parsedFromAddress, rpcUrl, secretKey, alias } = options; const client = pxeWrapper?.getPXE() ?? (await createCompatibleClient(rpcUrl, debugLogger)); const account = await createOrRetrieveAccount(client, parsedFromAddress, db, secretKey); const wallet = await getWalletWithScopes(account, db); - await registerContact(wallet, address, log); + await registerSender(wallet, address, log); if (db && alias) { - await db.storeContact(address, alias, log); + await db.storeSender(address, alias, log); } }); diff --git a/yarn-project/cli-wallet/src/cmds/register_contact.ts b/yarn-project/cli-wallet/src/cmds/register_contact.ts deleted file mode 100644 index 8a3c9ea9d6f6..000000000000 --- a/yarn-project/cli-wallet/src/cmds/register_contact.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { type AccountWalletWithSecretKey, type AztecAddress } from '@aztec/aztec.js'; -import { type LogFn } from '@aztec/foundation/log'; - -export async function registerContact(wallet: AccountWalletWithSecretKey, address: AztecAddress, log: LogFn) { - await wallet.registerContact(address); - log(`Contact registered: ${address}`); -} diff --git a/yarn-project/cli-wallet/src/cmds/register_sender.ts b/yarn-project/cli-wallet/src/cmds/register_sender.ts new file mode 100644 index 000000000000..0d84f637c492 --- /dev/null +++ b/yarn-project/cli-wallet/src/cmds/register_sender.ts @@ -0,0 +1,7 @@ +import { type AccountWalletWithSecretKey, type AztecAddress } from '@aztec/aztec.js'; +import { type LogFn } from '@aztec/foundation/log'; + +export async function registerSender(wallet: AccountWalletWithSecretKey, address: AztecAddress, log: LogFn) { + await wallet.registerSender(address); + log(`Sender registered: ${address}`); +} diff --git a/yarn-project/cli-wallet/src/storage/wallet_db.ts b/yarn-project/cli-wallet/src/storage/wallet_db.ts index 3bef8ed01531..1c491ae17cbb 100644 --- a/yarn-project/cli-wallet/src/storage/wallet_db.ts +++ b/yarn-project/cli-wallet/src/storage/wallet_db.ts @@ -82,9 +82,9 @@ export class WalletDB { log(`Account stored in database with alias${alias ? `es last & ${alias}` : ' last'}`); } - async storeContact(address: AztecAddress, alias: string, log: LogFn) { + async storeSender(address: AztecAddress, alias: string, log: LogFn) { await this.#aliases.set(`accounts:${alias}`, Buffer.from(address.toString())); - log(`Account stored in database with alias ${alias} as a contact`); + log(`Account stored in database with alias ${alias} as a sender`); } async storeContract(address: AztecAddress, artifactPath: string, log: LogFn, alias?: string) { diff --git a/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts b/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts index 4fcf026373ab..f0621737fb73 100644 --- a/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts +++ b/yarn-project/cli-wallet/src/utils/pxe_wrapper.ts @@ -1,5 +1,5 @@ import { type PXE, createAztecNodeClient } from '@aztec/circuit-types'; -import { createPXEService, getPXEServiceConfig } from '@aztec/pxe'; +import { type PXEServiceConfig, createPXEService, getPXEServiceConfig } from '@aztec/pxe'; /* * Wrapper class for PXE service, avoids initialization issues due to @@ -12,9 +12,9 @@ export class PXEWrapper { return PXEWrapper.pxe; } - async init(nodeUrl: string, dataDir: string) { + async init(nodeUrl: string, dataDir: string, overridePXEServiceConfig?: Partial) { const aztecNode = createAztecNodeClient(nodeUrl); - const pxeConfig = getPXEServiceConfig(); + const pxeConfig = Object.assign(getPXEServiceConfig(), overridePXEServiceConfig); pxeConfig.dataDirectory = dataDir; PXEWrapper.pxe = await createPXEService(aztecNode, pxeConfig); } diff --git a/yarn-project/end-to-end/package.json b/yarn-project/end-to-end/package.json index 4a96cb434a0d..b84ebb2f27e7 100644 --- a/yarn-project/end-to-end/package.json +++ b/yarn-project/end-to-end/package.json @@ -53,6 +53,7 @@ "@aztec/telemetry-client": "workspace:^", "@aztec/types": "workspace:^", "@aztec/world-state": "workspace:^", + "@iarna/toml": "^2.2.5", "@jest/globals": "^29.5.0", "@noble/curves": "^1.0.0", "@swc/core": "^1.4.11", diff --git a/yarn-project/end-to-end/scripts/native-network/validators.sh b/yarn-project/end-to-end/scripts/native-network/validators.sh index b3a75886368b..0fbece3cb038 100755 --- a/yarn-project/end-to-end/scripts/native-network/validators.sh +++ b/yarn-project/end-to-end/scripts/native-network/validators.sh @@ -37,6 +37,7 @@ if [ "$NUM_VALIDATORS" -eq 1 ]; then eval "${CMD[0]}" else echo "Running $NUM_VALIDATORS validators interleaved" + # Execute the run_interleaved.sh script with the commands "$(git rev-parse --show-toplevel)/scripts/run_interleaved.sh" "${CMD[@]}" fi diff --git a/yarn-project/end-to-end/scripts/network_test.sh b/yarn-project/end-to-end/scripts/network_test.sh index 4fc0dc5c46f1..99c2d4b7b0bc 100755 --- a/yarn-project/end-to-end/scripts/network_test.sh +++ b/yarn-project/end-to-end/scripts/network_test.sh @@ -15,7 +15,7 @@ set -eux SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Main positional parameter -TEST="$1" +TEST=${1:-} REPO=$(git rev-parse --show-toplevel) if [ "$(uname)" = "Linux" ] && [ "$(uname -m)" = "x86_64" ]; then @@ -39,9 +39,15 @@ if [ -z "${NAMESPACE:-}" ]; then exit 1 fi -if ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -q "aztecprotocol/aztec:$AZTEC_DOCKER_TAG" || \ - ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -q "aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG"; then - echo "Docker images not found." +# Always check for the aztec image +if ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -q "aztecprotocol/aztec:$AZTEC_DOCKER_TAG"; then + echo "Aztec Docker image not found. It needs to be built with 'earthly ./yarn-project/+export-e2e-test-images' or otherwise tagged with aztecprotocol/aztec:$AZTEC_DOCKER_TAG." + exit 1 +fi + +# Only check for end-to-end image if a test is specified +if [ -n "$TEST" ] && ! docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -q "aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG"; then + echo "End-to-end Docker image not found. It needs to be built with 'earthly ./yarn-project/+export-e2e-test-images' or otherwise tagged with aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG." exit 1 fi @@ -56,16 +62,16 @@ fi STERN_PID="" function copy_stern_to_log() { ulimit -n 4096 - stern spartan -n $NAMESPACE > $SCRIPT_DIR/network-test.log & - echo "disabled until less resource intensive solution than stern implemented" > $SCRIPT_DIR/network-test.log & + stern spartan -n $NAMESPACE >$SCRIPT_DIR/network-test.log & + echo "disabled until less resource intensive solution than stern implemented" >$SCRIPT_DIR/network-test.log & STERN_PID=$! } function show_status_until_pxe_ready() { - set +x # don't spam with our commands + set +x # don't spam with our commands sleep 15 # let helm upgrade start - for i in {1..100} ; do - if kubectl wait pod -l app==pxe --for=condition=Ready -n "$NAMESPACE" --timeout=20s >/dev/null 2>/dev/null ; then + for i in {1..100}; do + if kubectl wait pod -l app==pxe --for=condition=Ready -n "$NAMESPACE" --timeout=20s >/dev/null 2>/dev/null; then break # we are up, stop showing status fi # show startup status @@ -73,42 +79,40 @@ function show_status_until_pxe_ready() { done } -# Handle and check chaos mesh setup handle_network_shaping() { - if [ -n "${CHAOS_VALUES:-}" ]; then - echo "Checking chaos-mesh setup..." - - if ! kubectl get service chaos-daemon -n chaos-mesh &>/dev/null; then - # If chaos mesh is not installed, we check the INSTALL_CHAOS_MESH flag - # to determine if we should install it. - if [ "$INSTALL_CHAOS_MESH" ]; then - echo "Installing chaos-mesh..." - cd "$REPO/spartan/chaos-mesh" && ./install.sh - else - echo "Error: chaos-mesh namespace not found!" - echo "Please set up chaos-mesh first. You can do this by running:" - echo "cd $REPO/spartan/chaos-mesh && ./install.sh" - exit 1 - fi - fi - - echo "Deploying Aztec Chaos Scenarios..." - if ! helm upgrade --install aztec-chaos-scenarios "$REPO/spartan/aztec-chaos-scenarios/" \ - --namespace chaos-mesh \ - --values "$REPO/spartan/aztec-chaos-scenarios/values/$CHAOS_VALUES" \ - --set global.targetNamespace="$NAMESPACE" \ - --wait \ - --timeout=5m; then - echo "Error: failed to deploy Aztec Chaos Scenarios!" - return 1 - fi - - echo "Aztec Chaos Scenarios applied successfully" - return 0 + if [ -n "${CHAOS_VALUES:-}" ]; then + echo "Checking chaos-mesh setup..." + + if ! kubectl get service chaos-daemon -n chaos-mesh &>/dev/null; then + # If chaos mesh is not installed, we check the INSTALL_CHAOS_MESH flag + # to determine if we should install it. + if [ "$INSTALL_CHAOS_MESH" ]; then + echo "Installing chaos-mesh..." + cd "$REPO/spartan/chaos-mesh" && ./install.sh + else + echo "Error: chaos-mesh namespace not found!" + echo "Please set up chaos-mesh first. You can do this by running:" + echo "cd $REPO/spartan/chaos-mesh && ./install.sh" + exit 1 + fi + fi + + echo "Deploying Aztec Chaos Scenarios..." + if ! helm upgrade --install aztec-chaos-scenarios "$REPO/spartan/aztec-chaos-scenarios/" \ + --namespace chaos-mesh \ + --values "$REPO/spartan/aztec-chaos-scenarios/values/$CHAOS_VALUES" \ + --set global.targetNamespace="$NAMESPACE" \ + --wait \ + --timeout=5m; then + echo "Error: failed to deploy Aztec Chaos Scenarios!" + return 1 fi + + echo "Aztec Chaos Scenarios applied successfully" return 0 + fi + return 0 } - copy_stern_to_log show_status_until_pxe_ready & @@ -132,13 +136,13 @@ VALUES_PATH="$REPO/spartan/aztec-network/values/$VALUES_FILE" # Install the Helm chart helm upgrade --install spartan "$REPO/spartan/aztec-network/" \ - --namespace "$NAMESPACE" \ - --create-namespace \ - --values "$VALUES_PATH" \ - --set images.aztec.image="aztecprotocol/aztec:$AZTEC_DOCKER_TAG" \ - --wait \ - --wait-for-jobs=true \ - --timeout="$INSTALL_TIMEOUT" + --namespace "$NAMESPACE" \ + --create-namespace \ + --values "$VALUES_PATH" \ + --set images.aztec.image="aztecprotocol/aztec:$AZTEC_DOCKER_TAG" \ + --wait \ + --wait-for-jobs=true \ + --timeout="$INSTALL_TIMEOUT" kubectl wait pod -l app==pxe --for=condition=Ready -n "$NAMESPACE" --timeout=10m @@ -168,30 +172,33 @@ fi # Get the values from the values file VALUES=$(cat "$VALUES_PATH") -ETHEREUM_SLOT_DURATION=$(yq -r '.ethereum.blockTime' <<< "$VALUES") -AZTEC_SLOT_DURATION=$(yq -r '.aztec.slotDuration' <<< "$VALUES") -AZTEC_EPOCH_DURATION=$(yq -r '.aztec.epochDuration' <<< "$VALUES") -AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS=$(yq -r '.aztec.epochProofClaimWindow' <<< "$VALUES") - - -docker run --rm --network=host \ - -v ~/.kube:/root/.kube \ - -e K8S=local \ - -e INSTANCE_NAME="spartan" \ - -e SPARTAN_DIR="/usr/src/spartan" \ - -e NAMESPACE="$NAMESPACE" \ - -e HOST_PXE_PORT=$PXE_PORT \ - -e CONTAINER_PXE_PORT=8081 \ - -e HOST_ETHEREUM_PORT=$ANVIL_PORT \ - -e CONTAINER_ETHEREUM_PORT=8545 \ - -e HOST_METRICS_PORT=$METRICS_PORT \ - -e CONTAINER_METRICS_PORT=80 \ - -e GRAFANA_PASSWORD=$GRAFANA_PASSWORD \ - -e DEBUG=${DEBUG:-""} \ - -e LOG_JSON=1 \ - -e LOG_LEVEL=${LOG_LEVEL:-"debug; info: aztec:simulator, json-rpc"} \ - -e ETHEREUM_SLOT_DURATION=$ETHEREUM_SLOT_DURATION \ - -e AZTEC_SLOT_DURATION=$AZTEC_SLOT_DURATION \ - -e AZTEC_EPOCH_DURATION=$AZTEC_EPOCH_DURATION \ - -e AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS=$AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS \ - aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG $TEST +ETHEREUM_SLOT_DURATION=$(yq -r '.ethereum.blockTime' <<<"$VALUES") +AZTEC_SLOT_DURATION=$(yq -r '.aztec.slotDuration' <<<"$VALUES") +AZTEC_EPOCH_DURATION=$(yq -r '.aztec.epochDuration' <<<"$VALUES") +AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS=$(yq -r '.aztec.epochProofClaimWindow' <<<"$VALUES") + +# Run the test if $TEST is not empty +if [ -n "$TEST" ]; then + echo "RUNNING TEST: $TEST" + docker run --rm --network=host \ + -v ~/.kube:/root/.kube \ + -e K8S=local \ + -e INSTANCE_NAME="spartan" \ + -e SPARTAN_DIR="/usr/src/spartan" \ + -e NAMESPACE="$NAMESPACE" \ + -e HOST_PXE_PORT=$PXE_PORT \ + -e CONTAINER_PXE_PORT=8081 \ + -e HOST_ETHEREUM_PORT=$ANVIL_PORT \ + -e CONTAINER_ETHEREUM_PORT=8545 \ + -e HOST_METRICS_PORT=$METRICS_PORT \ + -e CONTAINER_METRICS_PORT=80 \ + -e GRAFANA_PASSWORD=$GRAFANA_PASSWORD \ + -e DEBUG=${DEBUG:-""} \ + -e LOG_JSON=1 \ + -e LOG_LEVEL=${LOG_LEVEL:-"debug; info: aztec:simulator, json-rpc"} \ + -e ETHEREUM_SLOT_DURATION=$ETHEREUM_SLOT_DURATION \ + -e AZTEC_SLOT_DURATION=$AZTEC_SLOT_DURATION \ + -e AZTEC_EPOCH_DURATION=$AZTEC_EPOCH_DURATION \ + -e AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS=$AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS \ + aztecprotocol/end-to-end:$AZTEC_DOCKER_TAG $TEST +fi diff --git a/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts b/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts index f03231342b9d..7b61fc01c02b 100644 --- a/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts +++ b/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts @@ -9,7 +9,6 @@ import { } from '@aztec/circuit-types'; import { makeBloatedProcessedTx } from '@aztec/circuit-types/test'; import { - BlockBlobPublicInputs, type BlockHeader, EthAddress, GENESIS_ARCHIVE_ROOT, @@ -18,6 +17,7 @@ import { MAX_NULLIFIERS_PER_TX, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, } from '@aztec/circuits.js'; +import { BlockBlobPublicInputs } from '@aztec/circuits.js/blobs'; import { fr } from '@aztec/circuits.js/testing'; import { type L1ContractAddresses, createEthereumChain } from '@aztec/ethereum'; import { EthCheatCodesWithState } from '@aztec/ethereum/test'; @@ -169,12 +169,7 @@ describe('L1Publisher integration', () => { worldStateDbMapSizeKb: 10 * 1024 * 1024, worldStateBlockHistory: 0, }; - worldStateSynchronizer = new ServerWorldStateSynchronizer( - builderDb, - blockSource, - worldStateConfig, - new NoopTelemetryClient(), - ); + worldStateSynchronizer = new ServerWorldStateSynchronizer(builderDb, blockSource, worldStateConfig); await worldStateSynchronizer.start(); publisher = new L1Publisher( diff --git a/yarn-project/end-to-end/src/composed/integration_proof_verification.test.ts b/yarn-project/end-to-end/src/composed/integration_proof_verification.test.ts index 0d1066a7a4f7..c910620d3669 100644 --- a/yarn-project/end-to-end/src/composed/integration_proof_verification.test.ts +++ b/yarn-project/end-to-end/src/composed/integration_proof_verification.test.ts @@ -1,6 +1,7 @@ import { deployL1Contract, fileURLToPath } from '@aztec/aztec.js'; import { BBCircuitVerifier } from '@aztec/bb-prover'; -import { Proof, RootRollupPublicInputs } from '@aztec/circuits.js'; +import { Proof } from '@aztec/circuits.js'; +import { RootRollupPublicInputs } from '@aztec/circuits.js/rollup'; import { compileContract, createL1Clients } from '@aztec/ethereum'; import { type Logger } from '@aztec/foundation/log'; import { IVerifierAbi } from '@aztec/l1-artifacts'; diff --git a/yarn-project/end-to-end/src/e2e_2_pxes.test.ts b/yarn-project/end-to-end/src/e2e_2_pxes.test.ts index d52f3494ecdd..c5f7b3134d9c 100644 --- a/yarn-project/end-to-end/src/e2e_2_pxes.test.ts +++ b/yarn-project/end-to-end/src/e2e_2_pxes.test.ts @@ -49,8 +49,8 @@ describe('e2e_2_pxes', () => { What is a more robust solution? */ await sleep(5000); - await walletA.registerContact(walletB.getAddress()); - await walletB.registerContact(walletA.getAddress()); + await walletA.registerSender(walletB.getAddress()); + await walletB.registerSender(walletA.getAddress()); }); afterEach(async () => { @@ -182,13 +182,13 @@ describe('e2e_2_pxes', () => { const sharedAccountAddress = sharedAccountOnA.getCompleteAddress(); const sharedWalletOnA = await sharedAccountOnA.waitSetup(); - await sharedWalletOnA.registerContact(walletA.getAddress()); + await sharedWalletOnA.registerSender(walletA.getAddress()); const sharedAccountOnB = getUnsafeSchnorrAccount(pxeB, sharedSecretKey, sharedAccountOnA.salt); await sharedAccountOnB.register(); const sharedWalletOnB = await sharedAccountOnB.getWallet(); - await sharedWalletOnB.registerContact(sharedWalletOnA.getAddress()); + await sharedWalletOnB.registerSender(sharedWalletOnA.getAddress()); // deploy the contract on PXE A const token = await deployToken(walletA, initialBalance, logger); diff --git a/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts b/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts index 280a8e5b743c..42e58a350a35 100644 --- a/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts +++ b/yarn-project/end-to-end/src/e2e_cheat_codes.test.ts @@ -52,7 +52,8 @@ describe('e2e_cheat_codes', () => { afterAll(() => teardown()); describe('L1 cheatcodes', () => { - describe('mine', () => { + // TODO(#10775): example fail https://github.com/AztecProtocol/aztec-packages/actions/runs/12418969358/job/34674141249 + describe.skip('mine', () => { it(`mine block`, async () => { const blockNumber = await cc.eth.blockNumber(); await cc.eth.mine(); diff --git a/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts b/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts index 0ac2e55f3321..8918c3eb74a0 100644 --- a/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts +++ b/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts @@ -116,7 +116,7 @@ describe('e2e_crowdfunding_and_claim', () => { // as a contact to all donor wallets, so they can receive notes await Promise.all( donorWallets.map(async wallet => { - await wallet.registerContact(operatorWallet.getAddress()); + await wallet.registerSender(operatorWallet.getAddress()); }), ); // Now we mint DNT to donors diff --git a/yarn-project/end-to-end/src/e2e_fees/private_payments.test.ts b/yarn-project/end-to-end/src/e2e_fees/private_payments.test.ts index 39420fd44b8f..c1fa2d4fbeca 100644 --- a/yarn-project/end-to-end/src/e2e_fees/private_payments.test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/private_payments.test.ts @@ -325,7 +325,8 @@ describe('e2e_fees private_payment', () => { }); // TODO(#7694): Remove this test once the lacking feature in TXE is implemented. - it('insufficient funded amount is correctly handled', async () => { + // TODO(#10775): Reenable, hit e.g. https://github.com/AztecProtocol/aztec-packages/actions/runs/12419409370/job/34675397831 + it.skip('insufficient funded amount is correctly handled', async () => { // We call arbitrary `private_get_name(...)` function just to check the correct error is triggered. await expect( bananaCoin.methods.private_get_name().prove({ diff --git a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts index 2d55474e7c89..4bfe4c45e997 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/p2p_network.ts @@ -80,6 +80,28 @@ export class P2PNetworkTest { }); } + static async create({ + testName, + numberOfNodes, + basePort, + metricsPort, + }: { + testName: string; + numberOfNodes: number; + basePort?: number; + metricsPort?: number; + }) { + const port = basePort || (await getPort()); + + const telemetry = await getEndToEndTestTelemetryClient(metricsPort); + const bootstrapNode = await createBootstrapNodeFromPrivateKey(BOOTSTRAP_NODE_PRIVATE_KEY, port, telemetry); + const bootstrapNodeEnr = bootstrapNode.getENR().encodeTxt(); + + const initialValidatorConfig = await createValidatorConfig({} as AztecNodeConfig, bootstrapNodeEnr); + + return new P2PNetworkTest(testName, bootstrapNode, port, numberOfNodes, initialValidatorConfig); + } + /** * Start a loop to sync the mock system time with the L1 block time */ @@ -108,28 +130,6 @@ export class P2PNetworkTest { dateProvider.setTime(Number(timestamp.timestamp) * 1000); } - static async create({ - testName, - numberOfNodes, - basePort, - metricsPort, - }: { - testName: string; - numberOfNodes: number; - basePort?: number; - metricsPort?: number; - }) { - const port = basePort || (await getPort()); - - const telemetry = await getEndToEndTestTelemetryClient(metricsPort); - const bootstrapNode = await createBootstrapNodeFromPrivateKey(BOOTSTRAP_NODE_PRIVATE_KEY, port, telemetry); - const bootstrapNodeEnr = bootstrapNode.getENR().encodeTxt(); - - const initialValidatorConfig = await createValidatorConfig({} as AztecNodeConfig, bootstrapNodeEnr); - - return new P2PNetworkTest(testName, bootstrapNode, port, numberOfNodes, initialValidatorConfig); - } - async applyBaseSnapshots() { await this.snapshotManager.snapshot( 'add-validators', diff --git a/yarn-project/end-to-end/src/e2e_prover/full.test.ts b/yarn-project/end-to-end/src/e2e_prover/full.test.ts index 8d9566d48ff2..010717e32831 100644 --- a/yarn-project/end-to-end/src/e2e_prover/full.test.ts +++ b/yarn-project/end-to-end/src/e2e_prover/full.test.ts @@ -1,8 +1,9 @@ import { type AztecAddress, EthAddress, retryUntil } from '@aztec/aztec.js'; -import { isGenerateTestDataEnabled } from '@aztec/foundation/testing'; -import { switchGenerateProtocolCircuitTestData } from '@aztec/foundation/testing/files'; +import { getTestData, isGenerateTestDataEnabled } from '@aztec/foundation/testing'; +import { updateProtocolCircuitSampleInputs } from '@aztec/foundation/testing/files'; import { RewardDistributorAbi, RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts'; +import TOML from '@iarna/toml'; import '@jest/globals'; import { type Chain, type GetContractReturnType, type HttpTransport, type PublicClient, getContract } from 'viem'; @@ -164,8 +165,6 @@ describe('full_prover', () => { it('generates sample Prover.toml files if generate test data is on', async () => { if (!isGenerateTestDataEnabled() || realProofs) { return; - } else { - switchGenerateProtocolCircuitTestData(); } // Create the two transactions @@ -246,7 +245,24 @@ describe('full_prover', () => { // And wait for the first pair of txs to be proven logger.info(`Awaiting proof for the previous epoch`); await Promise.all(txs.map(tx => tx.wait({ timeout: 300, interval: 10, proven: true, provenTimeout: 1500 }))); - switchGenerateProtocolCircuitTestData(); + + [ + 'private-kernel-init', + 'private-kernel-inner', + 'private-kernel-tail', + 'private-kernel-tail-to-public', + 'private-kernel-reset', + 'rollup-base-private', + 'rollup-base-public', + 'rollup-merge', + 'rollup-block-root', + 'rollup-root', + ].forEach(circuitName => { + const data = getTestData(circuitName); + if (data) { + updateProtocolCircuitSampleInputs(circuitName, TOML.stringify(data[0] as any)); + } + }); }); it('rejects txs with invalid proofs', async () => { diff --git a/yarn-project/end-to-end/src/fixtures/fixtures.ts b/yarn-project/end-to-end/src/fixtures/fixtures.ts index 79d10d0d2da8..7fec6f90d397 100644 --- a/yarn-project/end-to-end/src/fixtures/fixtures.ts +++ b/yarn-project/end-to-end/src/fixtures/fixtures.ts @@ -7,6 +7,8 @@ export const shouldCollectMetrics = () => { return undefined; }; +export const TEST_PEER_CHECK_INTERVAL_MS = 1000; + export const MNEMONIC = 'test test test test test test test test test test test junk'; export const privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex'); export const privateKey2 = Buffer.from('59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', 'hex'); diff --git a/yarn-project/end-to-end/src/fixtures/setup_p2p_test.ts b/yarn-project/end-to-end/src/fixtures/setup_p2p_test.ts index 1d31d41ab6cb..5ddcc3b6ee21 100644 --- a/yarn-project/end-to-end/src/fixtures/setup_p2p_test.ts +++ b/yarn-project/end-to-end/src/fixtures/setup_p2p_test.ts @@ -9,6 +9,7 @@ import { type PXEService } from '@aztec/pxe'; import getPort from 'get-port'; +import { TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js'; import { getPrivateKeyFromIndex } from './utils.js'; import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js'; @@ -101,6 +102,7 @@ export async function createValidatorConfig( tcpAnnounceAddress: `127.0.0.1:${port}`, udpAnnounceAddress: `127.0.0.1:${port}`, p2pEnabled: true, + peerCheckIntervalMS: TEST_PEER_CHECK_INTERVAL_MS, blockCheckIntervalMS: 1000, transactionProtocol: '', dataDirectory, diff --git a/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts b/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts index 2acb78f7d47d..d031d18c5bd5 100644 --- a/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts +++ b/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts @@ -34,7 +34,7 @@ import path, { join } from 'path'; import { type Hex, getContract } from 'viem'; import { mnemonicToAccount } from 'viem/accounts'; -import { MNEMONIC } from './fixtures.js'; +import { MNEMONIC, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js'; import { getACVMConfig } from './get_acvm_config.js'; import { getBBConfig } from './get_bb_config.js'; import { setupL1Contracts } from './setup_l1_contracts.js'; @@ -281,6 +281,7 @@ async function setupFromFresh( // Fetch the AztecNode config. // TODO: For some reason this is currently the union of a bunch of subsystems. That needs fixing. const aztecNodeConfig: AztecNodeConfig & SetupOptions = { ...getConfigEnvVars(), ...opts }; + aztecNodeConfig.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS; // Create a temp directory for all ephemeral state and cleanup afterwards const directoryToCleanup = path.join(tmpdir(), randomBytes(8).toString('hex')); diff --git a/yarn-project/end-to-end/src/fixtures/utils.ts b/yarn-project/end-to-end/src/fixtures/utils.ts index b931dfe1260c..d6698a0ca043 100644 --- a/yarn-project/end-to-end/src/fixtures/utils.ts +++ b/yarn-project/end-to-end/src/fixtures/utils.ts @@ -67,7 +67,7 @@ import { import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts'; import { foundry } from 'viem/chains'; -import { MNEMONIC } from './fixtures.js'; +import { MNEMONIC, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js'; import { getACVMConfig } from './get_acvm_config.js'; import { getBBConfig } from './get_bb_config.js'; import { isMetricsLoggingRequested, setupMetricsLogger } from './logging.js'; @@ -315,6 +315,8 @@ export async function setup( chain: Chain = foundry, ): Promise { const config = { ...getConfigEnvVars(), ...opts }; + config.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS; + const logger = getLogger(); // Create a temp directory for any services that need it and cleanup later diff --git a/yarn-project/ethereum/package.json b/yarn-project/ethereum/package.json index aa01b556c174..1a5d81a38a89 100644 --- a/yarn-project/ethereum/package.json +++ b/yarn-project/ethereum/package.json @@ -5,7 +5,8 @@ "exports": { ".": "./dest/index.js", "./test": "./dest/test/index.js", - "./contracts": "./dest/contracts/index.js" + "./contracts": "./dest/contracts/index.js", + "./l1-contract-addresses": "./dest/l1_contract_addresses.js" }, "typedocOptions": { "entryPoints": [ diff --git a/yarn-project/foundation/src/testing/files/index.ts b/yarn-project/foundation/src/testing/files/index.ts index a610bc9b473c..04ff3dbff300 100644 --- a/yarn-project/foundation/src/testing/files/index.ts +++ b/yarn-project/foundation/src/testing/files/index.ts @@ -5,16 +5,6 @@ import { createConsoleLogger } from '../../log/console.js'; import { fileURLToPath } from '../../url/index.js'; import { isGenerateTestDataEnabled } from '../test_data.js'; -let generateProtocolCircuitTestData = false; - -/** - * This is separate so Prover.tomls don't get edited everytime any test is run, - * Only full.test updates prover tomls, then switches this off. - */ -export function switchGenerateProtocolCircuitTestData() { - generateProtocolCircuitTestData = !generateProtocolCircuitTestData; -} - /** Writes the contents specified to the target file if test data generation is enabled. */ export function writeTestData(targetFileFromRepoRoot: string, contents: string | Buffer) { if (!isGenerateTestDataEnabled()) { @@ -56,9 +46,6 @@ export function updateInlineTestData(targetFileFromRepoRoot: string, itemName: s * To re-gen, run 'AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn workspace @aztec/end-to-end test full.test' */ export function updateProtocolCircuitSampleInputs(circuitName: string, value: string) { - if (!isGenerateTestDataEnabled() || !generateProtocolCircuitTestData) { - return; - } const logger = createConsoleLogger('aztec:testing:test_data'); const targetFileFromRepoRoot = `noir-projects/noir-protocol-circuits/crates/${circuitName}/Prover.toml`; const targetFile = getPathToFile(targetFileFromRepoRoot); diff --git a/yarn-project/l1-artifacts/scripts/generate-artifacts.sh b/yarn-project/l1-artifacts/scripts/generate-artifacts.sh index 896467dfd053..04bb74e264d0 100755 --- a/yarn-project/l1-artifacts/scripts/generate-artifacts.sh +++ b/yarn-project/l1-artifacts/scripts/generate-artifacts.sh @@ -71,4 +71,4 @@ for E in "${CONTRACTS[@]}"; do echo -ne "export * from './${CONTRACT_NAME}Abi.js';\nexport * from './${CONTRACT_NAME}Bytecode.js';\n" >> "$target_dir/index.ts"; done; -echo "Successfully generated TS artifacts!"; +echo "Successfully generated TS artifacts!"; \ No newline at end of file diff --git a/yarn-project/noir-protocol-circuits-types/package.json b/yarn-project/noir-protocol-circuits-types/package.json index c2d868456a8a..b5503ab9b33c 100644 --- a/yarn-project/noir-protocol-circuits-types/package.json +++ b/yarn-project/noir-protocol-circuits-types/package.json @@ -12,13 +12,15 @@ "./package.local.json" ], "scripts": { - "build": "yarn clean && yarn generate && tsc -b", + "build": "yarn clean && yarn generate && yarn generate:cleanup-artifacts && tsc -b", + "build:keep-debug-symbols": "yarn clean && yarn generate && tsc -b", "clean": "rm -rf ./dest .tsbuildinfo src/types artifacts", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", "formatting:fix:types": "NODE_OPTIONS='--max-old-space-size=8096' run -T eslint --fix ./src/types && run -T prettier -w ./src/types", "generate": "yarn generate:copy-artifacts && yarn generate:vk-hashes && yarn generate:noir-circuits && yarn generate:reset-data", "generate:copy-artifacts": "mkdir -p ./artifacts && cp -r ../../noir-projects/noir-protocol-circuits/target/* ./artifacts && node --no-warnings --loader ts-node/esm src/scripts/generate_declaration_files.ts ", + "generate:cleanup-artifacts": "node --no-warnings --loader ts-node/esm src/scripts/cleanup_artifacts.ts", "generate:vk-hashes": "node --no-warnings --loader ts-node/esm src/scripts/generate_vk_hashes.ts", "generate:noir-circuits": "node --no-warnings --loader ts-node/esm src/scripts/generate_ts_from_abi.ts && run -T prettier -w ./src/types", "generate:reset-data": "node --no-warnings --loader ts-node/esm src/scripts/generate_private_kernel_reset_data.ts && run -T prettier -w src/private_kernel_reset_data.ts", @@ -68,7 +70,6 @@ "@aztec/circuits.js": "workspace:^", "@aztec/foundation": "workspace:^", "@aztec/types": "workspace:^", - "@iarna/toml": "^2.2.5", "@noir-lang/acvm_js": "portal:../../noir/packages/acvm_js", "@noir-lang/noir_codegen": "portal:../../noir/packages/noir_codegen", "@noir-lang/noir_js": "file:../../noir/packages/noir_js", diff --git a/yarn-project/noir-protocol-circuits-types/package.local.json b/yarn-project/noir-protocol-circuits-types/package.local.json index d496e2497152..e77a0ffe2c45 100644 --- a/yarn-project/noir-protocol-circuits-types/package.local.json +++ b/yarn-project/noir-protocol-circuits-types/package.local.json @@ -1,6 +1,6 @@ { "scripts": { - "build": "yarn clean && yarn generate && tsc -b", + "build": "yarn clean && yarn generate && yarn generate:cleanup-artifacts && tsc -b", "clean": "rm -rf ./dest .tsbuildinfo src/types artifacts" }, "files": ["dest", "src", "artifacts", "!*.test.*"] diff --git a/yarn-project/noir-protocol-circuits-types/src/client.ts b/yarn-project/noir-protocol-circuits-types/src/client.ts index db2b21ae6015..597e3be73ec1 100644 --- a/yarn-project/noir-protocol-circuits-types/src/client.ts +++ b/yarn-project/noir-protocol-circuits-types/src/client.ts @@ -20,5 +20,5 @@ export { ClientCircuitArtifacts, type ClientProtocolArtifact } from './artifacts export { getPrivateKernelResetArtifactName } from './utils/private_kernel_reset.js'; export { maxPrivateKernelResetDimensions, privateKernelResetDimensionsConfig } from './private_kernel_reset_data.js'; -export { foreignCallHandler } from './utils/foreign_call_handler.js'; +export { foreignCallHandler } from './utils/client/foreign_call_handler.js'; export { ClientCircuitVks, getVKIndex, getVKTreeRoot, getVKSiblingPath } from './vks.js'; diff --git a/yarn-project/noir-protocol-circuits-types/src/conversion/client.ts b/yarn-project/noir-protocol-circuits-types/src/conversion/client.ts new file mode 100644 index 000000000000..5ac5dbc4918f --- /dev/null +++ b/yarn-project/noir-protocol-circuits-types/src/conversion/client.ts @@ -0,0 +1,856 @@ +import { + CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS, + CallContext, + CountedPublicCallRequest, + Fr, + FunctionData, + type KeyValidationHint, + KeyValidationRequest, + KeyValidationRequestAndGenerator, + LogHash, + MAX_CONTRACT_CLASS_LOGS_PER_TX, + MAX_ENQUEUED_CALLS_PER_TX, + MAX_KEY_VALIDATION_REQUESTS_PER_TX, + MAX_L2_TO_L1_MSGS_PER_TX, + MAX_NOTE_HASHES_PER_TX, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, + MAX_NULLIFIERS_PER_TX, + MAX_NULLIFIER_READ_REQUESTS_PER_TX, + MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, + MAX_PRIVATE_LOGS_PER_TX, + type NOTE_HASH_TREE_HEIGHT, + type NULLIFIER_TREE_HEIGHT, + NoteHash, + type NoteHashReadRequestHints, + Nullifier, + type NullifierLeafPreimage, + type NullifierReadRequestHints, + PartialPrivateTailPublicInputsForPublic, + PartialPrivateTailPublicInputsForRollup, + type PendingReadHint, + PrivateAccumulatedData, + type PrivateCallData, + PrivateCallRequest, + type PrivateCircuitPublicInputs, + PrivateKernelCircuitPublicInputs, + type PrivateKernelData, + type PrivateKernelResetHints, + PrivateKernelTailCircuitPublicInputs, + PrivateLogData, + PrivateToPublicAccumulatedData, + PrivateValidationRequests, + type PublicKeys, + ReadRequest, + type ReadRequestStatus, + RollupValidationRequests, + ScopedKeyValidationRequestAndGenerator, + ScopedLogHash, + ScopedNoteHash, + ScopedNullifier, + ScopedPrivateLogData, + ScopedReadRequest, + type SettledReadHint, + type TransientDataIndexHint, + TxConstantData, + type TxRequest, +} from '@aztec/circuits.js'; +import { mapTuple } from '@aztec/foundation/serialize'; + +import type { + CallContext as CallContextNoir, + Counted as CountedPublicCallRequestNoir, + FixedLengthArray, + FunctionData as FunctionDataNoir, + KernelCircuitPublicInputs as KernelCircuitPublicInputsNoir, + KeyValidationHint as KeyValidationHintNoir, + KeyValidationRequestAndGenerator as KeyValidationRequestAndGeneratorNoir, + KeyValidationRequest as KeyValidationRequestsNoir, + LogHash as LogHashNoir, + NoteHashLeafPreimage as NoteHashLeafPreimageNoir, + NoteHash as NoteHashNoir, + NoteHashReadRequestHints as NoteHashReadRequestHintsNoir, + NoteHashSettledReadHint as NoteHashSettledReadHintNoir, + Nullifier as NullifierNoir, + NullifierReadRequestHints as NullifierReadRequestHintsNoir, + NullifierSettledReadHint as NullifierSettledReadHintNoir, + PendingReadHint as PendingReadHintNoir, + PrivateAccumulatedData as PrivateAccumulatedDataNoir, + PrivateCallDataWithoutPublicInputs as PrivateCallDataWithoutPublicInputsNoir, + PrivateCallRequest as PrivateCallRequestNoir, + PrivateCircuitPublicInputs as PrivateCircuitPublicInputsNoir, + PrivateKernelCircuitPublicInputs as PrivateKernelCircuitPublicInputsNoir, + PrivateKernelDataWithoutPublicInputs as PrivateKernelDataWithoutPublicInputsNoir, + PrivateKernelResetHints as PrivateKernelResetHintsNoir, + PrivateLogData as PrivateLogDataNoir, + PrivateToPublicAccumulatedData as PrivateToPublicAccumulatedDataNoir, + PrivateToPublicKernelCircuitPublicInputs as PrivateToPublicKernelCircuitPublicInputsNoir, + PrivateValidationRequests as PrivateValidationRequestsNoir, + PublicKeys as PublicKeysNoir, + ReadRequest as ReadRequestNoir, + ReadRequestStatus as ReadRequestStatusNoir, + RollupValidationRequests as RollupValidationRequestsNoir, + ScopedKeyValidationRequestAndGenerator as ScopedKeyValidationRequestAndGeneratorNoir, + ScopedLogHash as ScopedLogHashNoir, + ScopedNoteHash as ScopedNoteHashNoir, + ScopedNullifier as ScopedNullifierNoir, + Scoped as ScopedPrivateLogDataNoir, + ScopedReadRequest as ScopedReadRequestNoir, + TransientDataIndexHint as TransientDataIndexHintNoir, + TxConstantData as TxConstantDataNoir, + TxRequest as TxRequestNoir, +} from '../types/index.js'; +import { + mapAztecAddressFromNoir, + mapAztecAddressToNoir, + mapCombinedAccumulatedDataFromNoir, + mapFieldFromNoir, + mapFieldToNoir, + mapFunctionSelectorFromNoir, + mapFunctionSelectorToNoir, + mapGasFromNoir, + mapGrumpkinScalarToNoir, + mapHeaderFromNoir, + mapHeaderToNoir, + mapL2ToL1MessageToNoir, + mapMaxBlockNumberFromNoir, + mapMaxBlockNumberToNoir, + mapMembershipWitnessToNoir, + mapNullifierLeafPreimageToNoir, + mapNumberFromNoir, + mapNumberToNoir, + mapOptionalNumberFromNoir, + mapOptionalNumberToNoir, + mapPointFromNoir, + mapPointToNoir, + mapPrivateLogFromNoir, + mapPrivateLogToNoir, + mapPublicCallRequestFromNoir, + mapPublicCallRequestToNoir, + mapScopedL2ToL1MessageFromNoir, + mapScopedL2ToL1MessageToNoir, + mapTupleFromNoir, + mapTxContextFromNoir, + mapTxContextToNoir, + mapVerificationKeyToNoir, + mapWrappedFieldToNoir, +} from './common.js'; + +/* eslint-disable camelcase */ + +/** + * Maps a function data to a noir function data. + * @param functionData - The function data. + * @returns The noir function data. + */ +export function mapFunctionDataToNoir(functionData: FunctionData): FunctionDataNoir { + return { + selector: mapFunctionSelectorToNoir(functionData.selector), + is_private: functionData.isPrivate, + }; +} + +/** + * Maps a tx request to a noir tx request. + * @param txRequest - The tx request. + * @returns The noir tx request. + */ +export function mapTxRequestToNoir(txRequest: TxRequest): TxRequestNoir { + return { + origin: mapAztecAddressToNoir(txRequest.origin), + args_hash: mapFieldToNoir(txRequest.argsHash), + tx_context: mapTxContextToNoir(txRequest.txContext), + function_data: mapFunctionDataToNoir(txRequest.functionData), + }; +} + +function mapNoteHashToNoir(noteHash: NoteHash): NoteHashNoir { + return { + value: mapFieldToNoir(noteHash.value), + counter: mapNumberToNoir(noteHash.counter), + }; +} + +function mapNoteHashFromNoir(noteHash: NoteHashNoir) { + return new NoteHash(mapFieldFromNoir(noteHash.value), mapNumberFromNoir(noteHash.counter)); +} + +function mapScopedNoteHashToNoir(noteHash: ScopedNoteHash): ScopedNoteHashNoir { + return { + note_hash: mapNoteHashToNoir(noteHash.noteHash), + contract_address: mapAztecAddressToNoir(noteHash.contractAddress), + }; +} + +function mapScopedNoteHashFromNoir(noteHash: ScopedNoteHashNoir) { + return new ScopedNoteHash( + mapNoteHashFromNoir(noteHash.note_hash), + mapAztecAddressFromNoir(noteHash.contract_address), + ); +} + +function mapNullifierToNoir(nullifier: Nullifier): NullifierNoir { + return { + value: mapFieldToNoir(nullifier.value), + counter: mapNumberToNoir(nullifier.counter), + note_hash: mapFieldToNoir(nullifier.noteHash), + }; +} + +function mapNullifierFromNoir(nullifier: NullifierNoir) { + return new Nullifier( + mapFieldFromNoir(nullifier.value), + mapNumberFromNoir(nullifier.counter), + mapFieldFromNoir(nullifier.note_hash), + ); +} + +function mapScopedNullifierToNoir(nullifier: ScopedNullifier): ScopedNullifierNoir { + return { + nullifier: mapNullifierToNoir(nullifier.nullifier), + contract_address: mapAztecAddressToNoir(nullifier.contractAddress), + }; +} + +function mapScopedNullifierFromNoir(nullifier: ScopedNullifierNoir) { + return new ScopedNullifier( + mapNullifierFromNoir(nullifier.nullifier), + mapAztecAddressFromNoir(nullifier.contract_address), + ); +} + +function mapPrivateLogDataToNoir(data: PrivateLogData): PrivateLogDataNoir { + return { + log: mapPrivateLogToNoir(data.log), + note_hash_counter: mapNumberToNoir(data.noteHashCounter), + counter: mapNumberToNoir(data.counter), + }; +} + +function mapPrivateLogDataFromNoir(data: PrivateLogDataNoir) { + return new PrivateLogData( + mapPrivateLogFromNoir(data.log), + mapNumberFromNoir(data.note_hash_counter), + mapNumberFromNoir(data.counter), + ); +} + +function mapScopedPrivateLogDataToNoir(data: ScopedPrivateLogData): ScopedPrivateLogDataNoir { + return { + inner: mapPrivateLogDataToNoir(data.inner), + contract_address: mapAztecAddressToNoir(data.contractAddress), + }; +} + +function mapScopedPrivateLogDataFromNoir(data: ScopedPrivateLogDataNoir) { + return new ScopedPrivateLogData( + mapPrivateLogDataFromNoir(data.inner), + mapAztecAddressFromNoir(data.contract_address), + ); +} + +/** + * Maps a LogHash to a noir LogHash. + * @param logHash - The LogHash. + * @returns The noir log hash. + */ +function mapLogHashToNoir(logHash: LogHash): LogHashNoir { + return { + value: mapFieldToNoir(logHash.value), + counter: mapNumberToNoir(logHash.counter), + length: mapFieldToNoir(logHash.length), + }; +} + +/** + * Maps a noir LogHash to a LogHash. + * @param logHash - The noir LogHash. + * @returns The TS log hash. + */ +function mapLogHashFromNoir(logHash: LogHashNoir): LogHash { + return new LogHash( + mapFieldFromNoir(logHash.value), + mapNumberFromNoir(logHash.counter), + mapFieldFromNoir(logHash.length), + ); +} + +/** + * Maps a ts ScopedLogHash to a noir ScopedLogHash. + * @param logHash - The ts LogHash. + * @returns The noir log hash. + */ +function mapScopedLogHashToNoir(scopedLogHash: ScopedLogHash): ScopedLogHashNoir { + return { + log_hash: mapLogHashToNoir(scopedLogHash.logHash), + contract_address: mapAztecAddressToNoir(scopedLogHash.contractAddress), + }; +} + +/** + * Maps a noir ScopedLogHash to a ts ScopedLogHash. + * @param logHash - The noir LogHash. + * @returns The TS log hash. + */ +function mapScopedLogHashFromNoir(scopedLogHash: ScopedLogHashNoir): ScopedLogHash { + return new ScopedLogHash( + mapLogHashFromNoir(scopedLogHash.log_hash), + mapAztecAddressFromNoir(scopedLogHash.contract_address), + ); +} + +/** + * Maps a noir ReadRequest to ReadRequest. + * @param readRequest - The noir ReadRequest. + * @returns The TS ReadRequest. + */ +function mapReadRequestFromNoir(readRequest: ReadRequestNoir): ReadRequest { + return new ReadRequest(mapFieldFromNoir(readRequest.value), mapNumberFromNoir(readRequest.counter)); +} + +function mapScopedReadRequestToNoir(scopedReadRequest: ScopedReadRequest): ScopedReadRequestNoir { + return { + read_request: mapReadRequestToNoir(scopedReadRequest.readRequest), + contract_address: mapAztecAddressToNoir(scopedReadRequest.contractAddress), + }; +} + +/** + * Maps a noir ReadRequest to ReadRequest. + * @param readRequest - The noir ReadRequest. + * @returns The TS ReadRequest. + */ +export function mapScopedReadRequestFromNoir(scoped: ScopedReadRequestNoir): ScopedReadRequest { + return new ScopedReadRequest( + mapReadRequestFromNoir(scoped.read_request), + mapAztecAddressFromNoir(scoped.contract_address), + ); +} + +/** + * Maps a KeyValidationRequest to a noir KeyValidationRequest. + * @param request - The KeyValidationRequest. + * @returns The noir KeyValidationRequest. + */ +export function mapKeyValidationRequestToNoir(request: KeyValidationRequest): KeyValidationRequestsNoir { + return { + pk_m: mapPointToNoir(request.pkM), + sk_app: mapFieldToNoir(request.skApp), + }; +} + +export function mapKeyValidationRequestAndGeneratorToNoir( + request: KeyValidationRequestAndGenerator, +): KeyValidationRequestAndGeneratorNoir { + return { + request: mapKeyValidationRequestToNoir(request.request), + sk_app_generator: mapFieldToNoir(request.skAppGenerator), + }; +} + +/** + * Maps a noir KeyValidationRequest to KeyValidationRequest. + * @param request - The noir KeyValidationRequest. + * @returns The TS KeyValidationRequest. + */ +function mapKeyValidationRequestFromNoir(request: KeyValidationRequestsNoir): KeyValidationRequest { + return new KeyValidationRequest(mapPointFromNoir(request.pk_m), mapFieldFromNoir(request.sk_app)); +} + +function mapKeyValidationRequestAndGeneratorFromNoir( + request: KeyValidationRequestAndGeneratorNoir, +): KeyValidationRequestAndGenerator { + return new KeyValidationRequestAndGenerator( + mapKeyValidationRequestFromNoir(request.request), + mapFieldFromNoir(request.sk_app_generator), + ); +} + +function mapScopedKeyValidationRequestAndGeneratorToNoir( + request: ScopedKeyValidationRequestAndGenerator, +): ScopedKeyValidationRequestAndGeneratorNoir { + return { + request: mapKeyValidationRequestAndGeneratorToNoir(request.request), + contract_address: mapAztecAddressToNoir(request.contractAddress), + }; +} + +function mapScopedKeyValidationRequestAndGeneratorFromNoir( + request: ScopedKeyValidationRequestAndGeneratorNoir, +): ScopedKeyValidationRequestAndGenerator { + return new ScopedKeyValidationRequestAndGenerator( + mapKeyValidationRequestAndGeneratorFromNoir(request.request), + mapAztecAddressFromNoir(request.contract_address), + ); +} + +/** + * Maps a call context to a noir call context. + * @param callContext - The call context. + * @returns The noir call context. + */ +export function mapCallContextFromNoir(callContext: CallContextNoir): CallContext { + return new CallContext( + mapAztecAddressFromNoir(callContext.msg_sender), + mapAztecAddressFromNoir(callContext.contract_address), + mapFunctionSelectorFromNoir(callContext.function_selector), + callContext.is_static_call, + ); +} + +/** + * Maps a call context to a noir call context. + * @param callContext - The call context. + * @returns The noir call context. + */ +export function mapCallContextToNoir(callContext: CallContext): CallContextNoir { + return { + msg_sender: mapAztecAddressToNoir(callContext.msgSender), + contract_address: mapAztecAddressToNoir(callContext.contractAddress), + function_selector: mapFunctionSelectorToNoir(callContext.functionSelector), + is_static_call: callContext.isStaticCall, + }; +} + +function mapPrivateCallRequestFromNoir(callRequest: PrivateCallRequestNoir) { + return new PrivateCallRequest( + mapCallContextFromNoir(callRequest.call_context), + mapFieldFromNoir(callRequest.args_hash), + mapFieldFromNoir(callRequest.returns_hash), + mapNumberFromNoir(callRequest.start_side_effect_counter), + mapNumberFromNoir(callRequest.end_side_effect_counter), + ); +} + +function mapPrivateCallRequestToNoir(callRequest: PrivateCallRequest): PrivateCallRequestNoir { + return { + call_context: mapCallContextToNoir(callRequest.callContext), + args_hash: mapFieldToNoir(callRequest.argsHash), + returns_hash: mapFieldToNoir(callRequest.returnsHash), + start_side_effect_counter: mapNumberToNoir(callRequest.startSideEffectCounter), + end_side_effect_counter: mapNumberToNoir(callRequest.endSideEffectCounter), + }; +} + +function mapCountedPublicCallRequestFromNoir(request: CountedPublicCallRequestNoir) { + return new CountedPublicCallRequest(mapPublicCallRequestFromNoir(request.inner), mapNumberFromNoir(request.counter)); +} + +function mapCountedPublicCallRequestToNoir(request: CountedPublicCallRequest): CountedPublicCallRequestNoir { + return { + inner: mapPublicCallRequestToNoir(request.inner), + counter: mapNumberToNoir(request.counter), + }; +} + +/** + * Maps a ReadRequest to a noir ReadRequest. + * @param readRequest - The read request. + * @returns The noir ReadRequest. + */ +function mapReadRequestToNoir(readRequest: ReadRequest): ReadRequestNoir { + return { + value: mapFieldToNoir(readRequest.value), + counter: mapNumberToNoir(readRequest.counter), + }; +} + +export function mapRollupValidationRequestsToNoir( + rollupValidationRequests: RollupValidationRequests, +): RollupValidationRequestsNoir { + return { + max_block_number: mapMaxBlockNumberToNoir(rollupValidationRequests.maxBlockNumber), + }; +} + +export function mapRollupValidationRequestsFromNoir( + rollupValidationRequests: RollupValidationRequestsNoir, +): RollupValidationRequests { + return new RollupValidationRequests(mapMaxBlockNumberFromNoir(rollupValidationRequests.max_block_number)); +} + +function mapPrivateValidationRequestsToNoir(requests: PrivateValidationRequests): PrivateValidationRequestsNoir { + return { + for_rollup: mapRollupValidationRequestsToNoir(requests.forRollup), + note_hash_read_requests: mapTuple(requests.noteHashReadRequests, mapScopedReadRequestToNoir), + nullifier_read_requests: mapTuple(requests.nullifierReadRequests, mapScopedReadRequestToNoir), + scoped_key_validation_requests_and_generators: mapTuple( + requests.scopedKeyValidationRequestsAndGenerators, + mapScopedKeyValidationRequestAndGeneratorToNoir, + ), + split_counter: mapOptionalNumberToNoir(requests.splitCounter), + }; +} + +function mapPrivateValidationRequestsFromNoir(requests: PrivateValidationRequestsNoir) { + return new PrivateValidationRequests( + mapRollupValidationRequestsFromNoir(requests.for_rollup), + mapTupleFromNoir( + requests.note_hash_read_requests, + MAX_NOTE_HASH_READ_REQUESTS_PER_TX, + mapScopedReadRequestFromNoir, + ), + mapTupleFromNoir( + requests.nullifier_read_requests, + MAX_NULLIFIER_READ_REQUESTS_PER_TX, + mapScopedReadRequestFromNoir, + ), + mapTupleFromNoir( + requests.scoped_key_validation_requests_and_generators, + MAX_KEY_VALIDATION_REQUESTS_PER_TX, + mapScopedKeyValidationRequestAndGeneratorFromNoir, + ), + mapOptionalNumberFromNoir(requests.split_counter), + ); +} + +export function mapPrivateAccumulatedDataFromNoir( + privateAccumulatedData: PrivateAccumulatedDataNoir, +): PrivateAccumulatedData { + return new PrivateAccumulatedData( + mapTupleFromNoir(privateAccumulatedData.note_hashes, MAX_NOTE_HASHES_PER_TX, mapScopedNoteHashFromNoir), + mapTupleFromNoir(privateAccumulatedData.nullifiers, MAX_NULLIFIERS_PER_TX, mapScopedNullifierFromNoir), + mapTupleFromNoir(privateAccumulatedData.l2_to_l1_msgs, MAX_L2_TO_L1_MSGS_PER_TX, mapScopedL2ToL1MessageFromNoir), + mapTupleFromNoir(privateAccumulatedData.private_logs, MAX_PRIVATE_LOGS_PER_TX, mapScopedPrivateLogDataFromNoir), + mapTupleFromNoir( + privateAccumulatedData.contract_class_logs_hashes, + MAX_CONTRACT_CLASS_LOGS_PER_TX, + mapScopedLogHashFromNoir, + ), + mapTupleFromNoir( + privateAccumulatedData.public_call_requests, + MAX_ENQUEUED_CALLS_PER_TX, + mapCountedPublicCallRequestFromNoir, + ), + mapTupleFromNoir( + privateAccumulatedData.private_call_stack, + MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, + mapPrivateCallRequestFromNoir, + ), + ); +} + +export function mapPrivateAccumulatedDataToNoir(data: PrivateAccumulatedData): PrivateAccumulatedDataNoir { + return { + note_hashes: mapTuple(data.noteHashes, mapScopedNoteHashToNoir), + nullifiers: mapTuple(data.nullifiers, mapScopedNullifierToNoir), + l2_to_l1_msgs: mapTuple(data.l2ToL1Msgs, mapScopedL2ToL1MessageToNoir), + private_logs: mapTuple(data.privateLogs, mapScopedPrivateLogDataToNoir), + contract_class_logs_hashes: mapTuple(data.contractClassLogsHashes, mapScopedLogHashToNoir), + public_call_requests: mapTuple(data.publicCallRequests, mapCountedPublicCallRequestToNoir), + private_call_stack: mapTuple(data.privateCallStack, mapPrivateCallRequestToNoir), + }; +} + +/** + * Maps private circuit public inputs to noir private circuit public inputs. + * @param privateCircuitPublicInputs - The private circuit public inputs. + * @returns The noir private circuit public inputs. + */ +export function mapPrivateCircuitPublicInputsToNoir( + privateCircuitPublicInputs: PrivateCircuitPublicInputs, +): PrivateCircuitPublicInputsNoir { + return { + max_block_number: mapMaxBlockNumberToNoir(privateCircuitPublicInputs.maxBlockNumber), + call_context: mapCallContextToNoir(privateCircuitPublicInputs.callContext), + args_hash: mapFieldToNoir(privateCircuitPublicInputs.argsHash), + returns_hash: mapFieldToNoir(privateCircuitPublicInputs.returnsHash), + note_hash_read_requests: mapTuple(privateCircuitPublicInputs.noteHashReadRequests, mapReadRequestToNoir), + nullifier_read_requests: mapTuple(privateCircuitPublicInputs.nullifierReadRequests, mapReadRequestToNoir), + key_validation_requests_and_generators: mapTuple( + privateCircuitPublicInputs.keyValidationRequestsAndGenerators, + mapKeyValidationRequestAndGeneratorToNoir, + ), + note_hashes: mapTuple(privateCircuitPublicInputs.noteHashes, mapNoteHashToNoir), + nullifiers: mapTuple(privateCircuitPublicInputs.nullifiers, mapNullifierToNoir), + private_call_requests: mapTuple(privateCircuitPublicInputs.privateCallRequests, mapPrivateCallRequestToNoir), + public_call_requests: mapTuple(privateCircuitPublicInputs.publicCallRequests, mapCountedPublicCallRequestToNoir), + public_teardown_call_request: mapPublicCallRequestToNoir(privateCircuitPublicInputs.publicTeardownCallRequest), + l2_to_l1_msgs: mapTuple(privateCircuitPublicInputs.l2ToL1Msgs, mapL2ToL1MessageToNoir), + private_logs: mapTuple(privateCircuitPublicInputs.privateLogs, mapPrivateLogDataToNoir), + contract_class_logs_hashes: mapTuple(privateCircuitPublicInputs.contractClassLogsHashes, mapLogHashToNoir), + start_side_effect_counter: mapFieldToNoir(privateCircuitPublicInputs.startSideEffectCounter), + end_side_effect_counter: mapFieldToNoir(privateCircuitPublicInputs.endSideEffectCounter), + historical_header: mapHeaderToNoir(privateCircuitPublicInputs.historicalHeader), + tx_context: mapTxContextToNoir(privateCircuitPublicInputs.txContext), + min_revertible_side_effect_counter: mapFieldToNoir(privateCircuitPublicInputs.minRevertibleSideEffectCounter), + is_fee_payer: privateCircuitPublicInputs.isFeePayer, + }; +} + +export function mapPublicKeysToNoir(publicKeys: PublicKeys): PublicKeysNoir { + return { + npk_m: { + inner: mapPointToNoir(publicKeys.masterNullifierPublicKey), + }, + ivpk_m: { + inner: mapPointToNoir(publicKeys.masterIncomingViewingPublicKey), + }, + ovpk_m: { + inner: mapPointToNoir(publicKeys.masterOutgoingViewingPublicKey), + }, + tpk_m: { + inner: mapPointToNoir(publicKeys.masterTaggingPublicKey), + }, + }; +} + +/** + * Maps a noir function data to a function data. + * @param functionData - The noir function data. + * @returns The function data. + */ +export function mapFunctionDataFromNoir(functionData: FunctionDataNoir): FunctionData { + return new FunctionData(mapFunctionSelectorFromNoir(functionData.selector), functionData.is_private); +} + +/** + * Maps a private call data to a noir private call data. + * @param privateCallData - The private call data. + * @returns The noir private call data. + */ +export function mapPrivateCallDataToNoir(privateCallData: PrivateCallData): PrivateCallDataWithoutPublicInputsNoir { + return { + vk: mapVerificationKeyToNoir(privateCallData.vk, CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS), + function_leaf_membership_witness: mapMembershipWitnessToNoir(privateCallData.functionLeafMembershipWitness), + contract_class_artifact_hash: mapFieldToNoir(privateCallData.contractClassArtifactHash), + contract_class_public_bytecode_commitment: mapFieldToNoir(privateCallData.contractClassPublicBytecodeCommitment), + public_keys: mapPublicKeysToNoir(privateCallData.publicKeys), + salted_initialization_hash: mapWrappedFieldToNoir(privateCallData.saltedInitializationHash), + protocol_contract_sibling_path: mapTuple(privateCallData.protocolContractSiblingPath, mapFieldToNoir), + acir_hash: mapFieldToNoir(privateCallData.acirHash), + }; +} + +function mapTxConstantDataFromNoir(data: TxConstantDataNoir) { + return new TxConstantData( + mapHeaderFromNoir(data.historical_header), + mapTxContextFromNoir(data.tx_context), + mapFieldFromNoir(data.vk_tree_root), + mapFieldFromNoir(data.protocol_contract_tree_root), + ); +} + +function mapTxConstantDataToNoir(data: TxConstantData): TxConstantDataNoir { + return { + historical_header: mapHeaderToNoir(data.historicalHeader), + tx_context: mapTxContextToNoir(data.txContext), + vk_tree_root: mapFieldToNoir(data.vkTreeRoot), + protocol_contract_tree_root: mapFieldToNoir(data.protocolContractTreeRoot), + }; +} + +export function mapPrivateKernelCircuitPublicInputsFromNoir( + inputs: PrivateKernelCircuitPublicInputsNoir, +): PrivateKernelCircuitPublicInputs { + return new PrivateKernelCircuitPublicInputs( + mapTxConstantDataFromNoir(inputs.constants), + mapFieldFromNoir(inputs.min_revertible_side_effect_counter), + mapPrivateValidationRequestsFromNoir(inputs.validation_requests), + mapPrivateAccumulatedDataFromNoir(inputs.end), + mapPublicCallRequestFromNoir(inputs.public_teardown_call_request), + mapAztecAddressFromNoir(inputs.fee_payer), + inputs.is_private_only, + ); +} + +export function mapPrivateKernelCircuitPublicInputsToNoir( + inputs: PrivateKernelCircuitPublicInputs, +): PrivateKernelCircuitPublicInputsNoir { + return { + constants: mapTxConstantDataToNoir(inputs.constants), + validation_requests: mapPrivateValidationRequestsToNoir(inputs.validationRequests), + end: mapPrivateAccumulatedDataToNoir(inputs.end), + min_revertible_side_effect_counter: mapFieldToNoir(inputs.minRevertibleSideEffectCounter), + public_teardown_call_request: mapPublicCallRequestToNoir(inputs.publicTeardownCallRequest), + fee_payer: mapAztecAddressToNoir(inputs.feePayer), + is_private_only: inputs.isPrivateOnly, + }; +} + +/** + * Maps a private kernel inner data to a noir private kernel inner data. + * @param privateKernelInnerData - The private kernel inner data. + * @returns The noir private kernel inner data. + */ +export function mapPrivateKernelDataToNoir( + privateKernelInnerData: PrivateKernelData, +): PrivateKernelDataWithoutPublicInputsNoir { + return { + vk: mapVerificationKeyToNoir(privateKernelInnerData.vk, CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS), + vk_index: mapFieldToNoir(new Fr(privateKernelInnerData.vkIndex)), + vk_path: mapTuple(privateKernelInnerData.vkPath, mapFieldToNoir), + }; +} + +export function mapPrivateKernelTailCircuitPublicInputsForRollupFromNoir( + inputs: KernelCircuitPublicInputsNoir, +): PrivateKernelTailCircuitPublicInputs { + const forRollup = new PartialPrivateTailPublicInputsForRollup(mapCombinedAccumulatedDataFromNoir(inputs.end)); + return new PrivateKernelTailCircuitPublicInputs( + mapTxConstantDataFromNoir(inputs.constants), + mapRollupValidationRequestsFromNoir(inputs.rollup_validation_requests), + mapGasFromNoir(inputs.gas_used), + mapAztecAddressFromNoir(inputs.fee_payer), + undefined, + forRollup, + ); +} + +export function mapPrivateToPublicAccumulatedDataFromNoir(data: PrivateToPublicAccumulatedDataNoir) { + return new PrivateToPublicAccumulatedData( + mapTupleFromNoir(data.note_hashes, MAX_NOTE_HASHES_PER_TX, mapFieldFromNoir), + mapTupleFromNoir(data.nullifiers, MAX_NULLIFIERS_PER_TX, mapFieldFromNoir), + mapTupleFromNoir(data.l2_to_l1_msgs, MAX_L2_TO_L1_MSGS_PER_TX, mapScopedL2ToL1MessageFromNoir), + mapTupleFromNoir(data.private_logs, MAX_PRIVATE_LOGS_PER_TX, mapPrivateLogFromNoir), + mapTupleFromNoir(data.contract_class_logs_hashes, MAX_CONTRACT_CLASS_LOGS_PER_TX, mapScopedLogHashFromNoir), + mapTupleFromNoir(data.public_call_requests, MAX_ENQUEUED_CALLS_PER_TX, mapPublicCallRequestFromNoir), + ); +} + +export function mapPrivateKernelTailCircuitPublicInputsForPublicFromNoir( + inputs: PrivateToPublicKernelCircuitPublicInputsNoir, +): PrivateKernelTailCircuitPublicInputs { + const forPublic = new PartialPrivateTailPublicInputsForPublic( + mapPrivateToPublicAccumulatedDataFromNoir(inputs.non_revertible_accumulated_data), + mapPrivateToPublicAccumulatedDataFromNoir(inputs.revertible_accumulated_data), + mapPublicCallRequestFromNoir(inputs.public_teardown_call_request), + ); + return new PrivateKernelTailCircuitPublicInputs( + mapTxConstantDataFromNoir(inputs.constants), + mapRollupValidationRequestsFromNoir(inputs.rollup_validation_requests), + mapGasFromNoir(inputs.gas_used), + mapAztecAddressFromNoir(inputs.fee_payer), + forPublic, + ); +} + +function mapTransientDataIndexHintToNoir(indexHint: TransientDataIndexHint): TransientDataIndexHintNoir { + return { + nullifier_index: mapNumberToNoir(indexHint.nullifierIndex), + note_hash_index: mapNumberToNoir(indexHint.noteHashIndex), + }; +} + +function mapReadRequestStatusToNoir(readRequestStatus: ReadRequestStatus): ReadRequestStatusNoir { + return { + state: mapNumberToNoir(readRequestStatus.state), + hint_index: mapNumberToNoir(readRequestStatus.hintIndex), + }; +} + +function mapPendingReadHintToNoir(hint: PendingReadHint): PendingReadHintNoir { + return { + read_request_index: mapNumberToNoir(hint.readRequestIndex), + pending_value_index: mapNumberToNoir(hint.pendingValueIndex), + }; +} + +function mapNoteHashLeafPreimageToNoir(noteHashLeafValue: Fr): NoteHashLeafPreimageNoir { + return { + value: mapFieldToNoir(noteHashLeafValue), + }; +} + +function mapNoteHashSettledReadHintToNoir( + hint: SettledReadHint, +): NoteHashSettledReadHintNoir { + return { + read_request_index: mapNumberToNoir(hint.readRequestIndex), + membership_witness: mapMembershipWitnessToNoir(hint.membershipWitness), + leaf_preimage: mapNoteHashLeafPreimageToNoir(hint.leafPreimage), + }; +} + +function mapNullifierSettledReadHintToNoir( + hint: SettledReadHint, +): NullifierSettledReadHintNoir { + return { + read_request_index: mapNumberToNoir(hint.readRequestIndex), + membership_witness: mapMembershipWitnessToNoir(hint.membershipWitness), + leaf_preimage: mapNullifierLeafPreimageToNoir(hint.leafPreimage), + }; +} + +function mapNoteHashReadRequestHintsToNoir( + hints: NoteHashReadRequestHints, +): NoteHashReadRequestHintsNoir { + return { + read_request_statuses: mapTuple(hints.readRequestStatuses, mapReadRequestStatusToNoir), + pending_read_hints: hints.pendingReadHints.map(mapPendingReadHintToNoir) as FixedLengthArray< + PendingReadHintNoir, + PENDING + >, + settled_read_hints: hints.settledReadHints.map(mapNoteHashSettledReadHintToNoir) as FixedLengthArray< + NoteHashSettledReadHintNoir, + SETTLED + >, + }; +} + +function mapNullifierReadRequestHintsToNoir( + hints: NullifierReadRequestHints, +): NullifierReadRequestHintsNoir { + return { + read_request_statuses: mapTuple(hints.readRequestStatuses, mapReadRequestStatusToNoir), + pending_read_hints: hints.pendingReadHints.map(mapPendingReadHintToNoir) as FixedLengthArray< + PendingReadHintNoir, + PENDING + >, + settled_read_hints: hints.settledReadHints.map(settledHint => + mapNullifierSettledReadHintToNoir( + settledHint as SettledReadHint, + ), + ) as FixedLengthArray, + }; +} + +/** + * Maps a KeyValidationHint to noir. + * @param hint - The key validation hint. + * @returns The key validation hint mapped to noir types. + */ +export function mapKeyValidationHintToNoir(hint: KeyValidationHint): KeyValidationHintNoir { + return { + sk_m: mapGrumpkinScalarToNoir(hint.skM), + request_index: mapNumberToNoir(hint.requestIndex), + }; +} + +export function mapPrivateKernelResetHintsToNoir< + NH_RR_PENDING extends number, + NH_RR_SETTLED extends number, + NLL_RR_PENDING extends number, + NLL_RR_SETTLED extends number, + KEY_VALIDATION_REQUESTS extends number, + NUM_TRANSIENT_DATA_HINTS extends number, +>( + inputs: PrivateKernelResetHints< + NH_RR_PENDING, + NH_RR_SETTLED, + NLL_RR_PENDING, + NLL_RR_SETTLED, + KEY_VALIDATION_REQUESTS, + NUM_TRANSIENT_DATA_HINTS + >, +): PrivateKernelResetHintsNoir< + NH_RR_PENDING, + NH_RR_SETTLED, + NLL_RR_PENDING, + NLL_RR_SETTLED, + KEY_VALIDATION_REQUESTS, + NUM_TRANSIENT_DATA_HINTS +> { + return { + note_hash_read_request_hints: mapNoteHashReadRequestHintsToNoir(inputs.noteHashReadRequestHints), + nullifier_read_request_hints: mapNullifierReadRequestHintsToNoir(inputs.nullifierReadRequestHints), + key_validation_hints: inputs.keyValidationHints.map(mapKeyValidationHintToNoir) as FixedLengthArray< + KeyValidationHintNoir, + KEY_VALIDATION_REQUESTS + >, + transient_data_index_hints: inputs.transientDataIndexHints.map(mapTransientDataIndexHintToNoir) as FixedLengthArray< + TransientDataIndexHintNoir, + NUM_TRANSIENT_DATA_HINTS + >, + validation_requests_split_counter: mapNumberToNoir(inputs.validationRequestsSplitCounter), + }; +} diff --git a/yarn-project/noir-protocol-circuits-types/src/conversion/common.ts b/yarn-project/noir-protocol-circuits-types/src/conversion/common.ts new file mode 100644 index 000000000000..8434af0674a2 --- /dev/null +++ b/yarn-project/noir-protocol-circuits-types/src/conversion/common.ts @@ -0,0 +1,729 @@ +import { + AppendOnlyTreeSnapshot, + AztecAddress, + BlockHeader, + CombinedAccumulatedData, + ContentCommitment, + EthAddress, + Fr, + FunctionSelector, + Gas, + GasFees, + GasSettings, + GlobalVariables, + GrumpkinScalar, + L2ToL1Message, + LogHash, + MAX_CONTRACT_CLASS_LOGS_PER_TX, + MAX_L2_TO_L1_MSGS_PER_TX, + MAX_NOTE_HASHES_PER_TX, + MAX_NULLIFIERS_PER_TX, + MAX_PRIVATE_LOGS_PER_TX, + MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, + MAX_UNENCRYPTED_LOGS_PER_TX, + MaxBlockNumber, + type MembershipWitness, + NUM_BYTES_PER_SHA256, + type NullifierLeafPreimage, + OptionalNumber, + PartialStateReference, + Point, + PrivateLog, + PublicCallRequest, + type PublicDataTreeLeafPreimage, + PublicDataWrite, + ScopedL2ToL1Message, + ScopedLogHash, + StateReference, + TxContext, + type VerificationKeyAsFields, +} from '@aztec/circuits.js'; +import { toBufferBE } from '@aztec/foundation/bigint-buffer'; +import { type Tuple, mapTuple, toTruncField } from '@aztec/foundation/serialize'; + +import type { + AppendOnlyTreeSnapshot as AppendOnlyTreeSnapshotNoir, + BlockHeader as BlockHeaderNoir, + CombinedAccumulatedData as CombinedAccumulatedDataNoir, + ContentCommitment as ContentCommitmentNoir, + Field, + FixedLengthArray, + FunctionSelector as FunctionSelectorNoir, + GasFees as GasFeesNoir, + Gas as GasNoir, + GasSettings as GasSettingsNoir, + GlobalVariables as GlobalVariablesNoir, + EmbeddedCurveScalar as GrumpkinScalarNoir, + L2ToL1Message as L2ToL1MessageNoir, + LogHash as LogHashNoir, + MaxBlockNumber as MaxBlockNumberNoir, + MembershipWitness as MembershipWitnessNoir, + AztecAddress as NoirAztecAddress, + EthAddress as NoirEthAddress, + Field as NoirField, + EmbeddedCurvePoint as NoirPoint, + NullifierLeafPreimage as NullifierLeafPreimageNoir, + Option as OptionalNumberNoir, + PartialStateReference as PartialStateReferenceNoir, + Log as PrivateLogNoir, + PublicCallRequest as PublicCallRequestNoir, + PublicDataTreeLeafPreimage as PublicDataTreeLeafPreimageNoir, + PublicDataWrite as PublicDataWriteNoir, + ScopedL2ToL1Message as ScopedL2ToL1MessageNoir, + ScopedLogHash as ScopedLogHashNoir, + StateReference as StateReferenceNoir, + TxContext as TxContextNoir, + VerificationKey as VerificationKeyNoir, +} from '../types/index.js'; + +/* eslint-disable camelcase */ + +/** + * Maps a field to a noir field. + * @param field - The field. + * @returns The noir field. + */ +export function mapFieldToNoir(field: Fr): NoirField { + return field.toString(); +} + +/** + * Maps a noir field to a fr. + * @param field - The noir field. + * @returns The fr. + */ +export function mapFieldFromNoir(field: NoirField): Fr { + return Fr.fromHexString(field); +} + +/** Maps a field to a noir wrapped field type (ie any type implemented as struct with an inner Field). */ +export function mapWrappedFieldToNoir(field: Fr): { inner: NoirField } { + return { inner: mapFieldToNoir(field) }; +} + +/** Maps a noir wrapped field type (ie any type implemented as struct with an inner Field) to a typescript field. */ +export function mapWrappedFieldFromNoir(wrappedField: { inner: NoirField }): Fr { + return mapFieldFromNoir(wrappedField.inner); +} + +/** + * Maps a number coming from noir. + * @param number - The field representing the number. + * @returns The number + */ +export function mapNumberFromNoir(number: NoirField): number { + return Number(Fr.fromHexString(number).toBigInt()); +} + +export function mapNumberToNoir(number: number): NoirField { + return new Fr(BigInt(number)).toString(); +} + +/** + * Maps a point to a noir point. + * @param point - The point. + * @returns The noir point. + */ +export function mapPointToNoir(point: Point): NoirPoint { + return { + x: mapFieldToNoir(point.x), + y: mapFieldToNoir(point.y), + is_infinite: point.isInfinite, + }; +} + +/** + * Maps a noir point to a point. + * @param point - The noir point. + * @returns The point. + */ +export function mapPointFromNoir(point: NoirPoint): Point { + return new Point(mapFieldFromNoir(point.x), mapFieldFromNoir(point.y), point.is_infinite); +} + +/** + * Maps a GrumpkinScalar to a noir GrumpkinScalar. + * @param privateKey - The GrumpkinScalar. + * @returns The noir GrumpkinScalar. + */ +export function mapGrumpkinScalarToNoir(privateKey: GrumpkinScalar): GrumpkinScalarNoir { + return { + hi: mapFieldToNoir(privateKey.hi), + lo: mapFieldToNoir(privateKey.lo), + }; +} + +/** + * Maps a noir GrumpkinScalar to a GrumpkinScalar. + * @param privateKey - The noir GrumpkinScalar. + * @returns The GrumpkinScalar. + */ +export function mapGrumpkinScalarFromNoir(privateKey: GrumpkinScalarNoir): GrumpkinScalar { + return GrumpkinScalar.fromHighLow(mapFieldFromNoir(privateKey.hi), mapFieldFromNoir(privateKey.lo)); +} + +/** + * Maps an aztec address to a noir aztec address. + * @param address - The address. + * @returns The noir aztec address. + */ +export function mapAztecAddressToNoir(address: AztecAddress): NoirAztecAddress { + return { + inner: mapFieldToNoir(address.toField()), + }; +} + +/** + * Maps a noir aztec address to an aztec address. + * @param address - The noir aztec address. + * @returns The aztec address. + */ +export function mapAztecAddressFromNoir(address: NoirAztecAddress): AztecAddress { + return AztecAddress.fromField(mapFieldFromNoir(address.inner)); +} + +/** + * Maps an eth address to a noir eth address. + * @param address - The address. + * @returns The noir eth address. + */ +export function mapEthAddressToNoir(address: EthAddress): NoirEthAddress { + return { + inner: mapFieldToNoir(address.toField()), + }; +} + +/** + * Maps a noir eth address to an eth address. + * @param address - The noir eth address. + * @returns The eth address. + */ +export function mapEthAddressFromNoir(address: NoirEthAddress): EthAddress { + return EthAddress.fromField(mapFieldFromNoir(address.inner)); +} + +export function mapGasFromNoir(gasUsed: GasNoir): Gas { + return Gas.from({ + daGas: mapNumberFromNoir(gasUsed.da_gas), + l2Gas: mapNumberFromNoir(gasUsed.l2_gas), + }); +} + +export function mapGasToNoir(gasUsed: Gas): GasNoir { + return { + da_gas: mapNumberToNoir(gasUsed.daGas), + l2_gas: mapNumberToNoir(gasUsed.l2Gas), + }; +} + +export function mapGasSettingsFromNoir(gasSettings: GasSettingsNoir): GasSettings { + return new GasSettings( + mapGasFromNoir(gasSettings.gas_limits), + mapGasFromNoir(gasSettings.teardown_gas_limits), + mapGasFeesFromNoir(gasSettings.max_fees_per_gas), + mapGasFeesFromNoir(gasSettings.max_priority_fees_per_gas), + ); +} + +export function mapGasSettingsToNoir(gasSettings: GasSettings): GasSettingsNoir { + return { + gas_limits: mapGasToNoir(gasSettings.gasLimits), + teardown_gas_limits: mapGasToNoir(gasSettings.teardownGasLimits), + max_fees_per_gas: mapGasFeesToNoir(gasSettings.maxFeesPerGas), + max_priority_fees_per_gas: mapGasFeesToNoir(gasSettings.maxPriorityFeesPerGas), + }; +} + +export function mapGasFeesToNoir(gasFees: GasFees): GasFeesNoir { + return { + fee_per_da_gas: mapFieldToNoir(gasFees.feePerDaGas), + fee_per_l2_gas: mapFieldToNoir(gasFees.feePerL2Gas), + }; +} + +export function mapGasFeesFromNoir(gasFees: GasFeesNoir): GasFees { + return new GasFees(mapFieldFromNoir(gasFees.fee_per_da_gas), mapFieldFromNoir(gasFees.fee_per_l2_gas)); +} + +export function mapPrivateLogToNoir(log: PrivateLog): PrivateLogNoir { + return { + fields: mapTuple(log.fields, mapFieldToNoir), + }; +} + +export function mapPrivateLogFromNoir(log: PrivateLogNoir) { + return new PrivateLog(mapTupleFromNoir(log.fields, log.fields.length, mapFieldFromNoir)); +} + +/** + * Maps an array from noir types to a tuple of parsed types. + * @param noirArray - The noir array. + * @param length - The length of the tuple. + * @param mapper - The mapper function applied to each element. + * @returns The tuple. + */ +export function mapTupleFromNoir( + noirArray: T[], + length: N, + mapper: (item: T) => M, +): Tuple { + if (noirArray.length != length) { + throw new Error(`Expected ${length} items, got ${noirArray.length}`); + } + return Array.from({ length }, (_, idx) => mapper(noirArray[idx])) as Tuple; +} + +/** + * Maps a AOT snapshot to noir. + * @param snapshot - The circuits.js AOT snapshot. + * @returns The noir AOT snapshot. + */ +export function mapAppendOnlyTreeSnapshotFromNoir(snapshot: AppendOnlyTreeSnapshotNoir): AppendOnlyTreeSnapshot { + return new AppendOnlyTreeSnapshot( + mapFieldFromNoir(snapshot.root), + mapNumberFromNoir(snapshot.next_available_leaf_index), + ); +} + +/** + * Maps a AOT snapshot from noir to the circuits.js type. + * @param snapshot - The noir AOT snapshot. + * @returns The circuits.js AOT snapshot. + */ +export function mapAppendOnlyTreeSnapshotToNoir(snapshot: AppendOnlyTreeSnapshot): AppendOnlyTreeSnapshotNoir { + return { + root: mapFieldToNoir(snapshot.root), + next_available_leaf_index: mapFieldToNoir(new Fr(snapshot.nextAvailableLeafIndex)), + }; +} + +/** + * Maps a content commitment to Noir + * + */ +export function mapContentCommitmentToNoir(contentCommitment: ContentCommitment): ContentCommitmentNoir { + return { + num_txs: mapFieldToNoir(contentCommitment.numTxs), + blobs_hash: mapSha256HashToNoir(contentCommitment.blobsHash), + in_hash: mapSha256HashToNoir(contentCommitment.inHash), + out_hash: mapSha256HashToNoir(contentCommitment.outHash), + }; +} + +/** + * Maps a content commitment to Noir + * + */ +export function mapContentCommitmentFromNoir(contentCommitment: ContentCommitmentNoir): ContentCommitment { + return new ContentCommitment( + mapFieldFromNoir(contentCommitment.num_txs), + mapSha256HashFromNoir(contentCommitment.blobs_hash), + mapSha256HashFromNoir(contentCommitment.in_hash), + mapSha256HashFromNoir(contentCommitment.out_hash), + ); +} + +/** + * Maps a block header to Noir + * @param header - The block header. + * @returns BlockHeader. + */ +export function mapHeaderToNoir(header: BlockHeader): BlockHeaderNoir { + return { + last_archive: mapAppendOnlyTreeSnapshotToNoir(header.lastArchive), + content_commitment: mapContentCommitmentToNoir(header.contentCommitment), + state: mapStateReferenceToNoir(header.state), + global_variables: mapGlobalVariablesToNoir(header.globalVariables), + total_fees: mapFieldToNoir(header.totalFees), + total_mana_used: mapFieldToNoir(header.totalManaUsed), + }; +} + +/** + * Maps a block header from Noir. + * @param header - The block header. + * @returns BlockHeader. + */ +export function mapHeaderFromNoir(header: BlockHeaderNoir): BlockHeader { + return new BlockHeader( + mapAppendOnlyTreeSnapshotFromNoir(header.last_archive), + mapContentCommitmentFromNoir(header.content_commitment), + mapStateReferenceFromNoir(header.state), + mapGlobalVariablesFromNoir(header.global_variables), + mapFieldFromNoir(header.total_fees), + mapFieldFromNoir(header.total_mana_used), + ); +} + +/** + * Maps a SHA256 hash from noir to the parsed type. + * @param hash - The hash as it is represented in Noir (1 fields). + * @returns The hash represented as a 31 bytes long buffer. + */ +export function mapSha256HashFromNoir(hash: Field): Buffer { + return toBufferBE(mapFieldFromNoir(hash).toBigInt(), NUM_BYTES_PER_SHA256); +} + +/** + * Maps a sha256 to the representation used in noir. + * @param hash - The hash represented as a 32 bytes long buffer. + * @returns The hash as it is represented in Noir (1 field, truncated). + */ +export function mapSha256HashToNoir(hash: Buffer): Field { + return mapFieldToNoir(toTruncField(hash)); +} + +export function mapOptionalNumberToNoir(option: OptionalNumber): OptionalNumberNoir { + return { + _is_some: option.isSome, + _value: mapNumberToNoir(option.value), + }; +} + +export function mapOptionalNumberFromNoir(option: OptionalNumberNoir) { + return new OptionalNumber(option._is_some, mapNumberFromNoir(option._value)); +} + +export function mapMaxBlockNumberToNoir(maxBlockNumber: MaxBlockNumber): MaxBlockNumberNoir { + return { + _opt: { + _is_some: maxBlockNumber.isSome, + _value: mapFieldToNoir(maxBlockNumber.value), + }, + }; +} + +export function mapMaxBlockNumberFromNoir(maxBlockNumber: MaxBlockNumberNoir): MaxBlockNumber { + return new MaxBlockNumber(maxBlockNumber._opt._is_some, mapFieldFromNoir(maxBlockNumber._opt._value)); +} + +/** + * Maps a L2 to L1 message to a noir L2 to L1 message. + * @param message - The L2 to L1 message. + * @returns The noir L2 to L1 message. + */ +export function mapL2ToL1MessageToNoir(message: L2ToL1Message): L2ToL1MessageNoir { + return { + recipient: mapEthAddressToNoir(message.recipient), + content: mapFieldToNoir(message.content), + counter: mapNumberToNoir(message.counter), + }; +} + +export function mapL2ToL1MessageFromNoir(message: L2ToL1MessageNoir) { + return new L2ToL1Message( + mapEthAddressFromNoir(message.recipient), + mapFieldFromNoir(message.content), + mapNumberFromNoir(message.counter), + ); +} + +export function mapScopedL2ToL1MessageFromNoir(message: ScopedL2ToL1MessageNoir) { + return new ScopedL2ToL1Message( + mapL2ToL1MessageFromNoir(message.message), + mapAztecAddressFromNoir(message.contract_address), + ); +} + +/** + * Maps a function selector to a noir function selector. + * @param functionSelector - The function selector. + * @returns The noir function selector. + */ +export function mapFunctionSelectorToNoir(functionSelector: FunctionSelector): FunctionSelectorNoir { + return { + inner: mapFieldToNoir(functionSelector.toField()), + }; +} + +/** + * Maps a noir function selector to a function selector. + * @param functionSelector - The noir function selector. + * @returns The function selector. + */ +export function mapFunctionSelectorFromNoir(functionSelector: FunctionSelectorNoir): FunctionSelector { + return FunctionSelector.fromField(mapFieldFromNoir(functionSelector.inner)); +} + +export function mapPublicCallRequestFromNoir(request: PublicCallRequestNoir) { + return new PublicCallRequest( + mapAztecAddressFromNoir(request.msg_sender), + mapAztecAddressFromNoir(request.contract_address), + mapFunctionSelectorFromNoir(request.function_selector), + request.is_static_call, + mapFieldFromNoir(request.args_hash), + ); +} + +export function mapPublicCallRequestToNoir(request: PublicCallRequest): PublicCallRequestNoir { + return { + msg_sender: mapAztecAddressToNoir(request.msgSender), + contract_address: mapAztecAddressToNoir(request.contractAddress), + function_selector: mapFunctionSelectorToNoir(request.functionSelector), + is_static_call: request.isStaticCall, + args_hash: mapFieldToNoir(request.argsHash), + }; +} + +export function mapScopedL2ToL1MessageToNoir(message: ScopedL2ToL1Message): ScopedL2ToL1MessageNoir { + return { + message: mapL2ToL1MessageToNoir(message.message), + contract_address: mapAztecAddressToNoir(message.contractAddress), + }; +} + +export function mapVerificationKeyToNoir( + key: VerificationKeyAsFields, + length: N, +): VerificationKeyNoir { + if (key.key.length !== length) { + throw new Error(`Expected ${length} fields, got ${key.key.length}`); + } + return { + key: key.key.map(mapFieldToNoir) as FixedLengthArray, + hash: mapFieldToNoir(key.hash), + }; +} + +/** + * Maps global variables to the noir type. + * @param globalVariables - The global variables. + * @returns The noir global variables. + */ +export function mapGlobalVariablesToNoir(globalVariables: GlobalVariables): GlobalVariablesNoir { + return { + chain_id: mapFieldToNoir(globalVariables.chainId), + version: mapFieldToNoir(globalVariables.version), + block_number: mapFieldToNoir(globalVariables.blockNumber), + slot_number: mapFieldToNoir(globalVariables.slotNumber), + timestamp: mapFieldToNoir(globalVariables.timestamp), + coinbase: mapEthAddressToNoir(globalVariables.coinbase), + fee_recipient: mapAztecAddressToNoir(globalVariables.feeRecipient), + gas_fees: mapGasFeesToNoir(globalVariables.gasFees), + }; +} + +/** + * Maps global variables from the noir type. + * @param globalVariables - The noir global variables. + * @returns The global variables. + */ +export function mapGlobalVariablesFromNoir(globalVariables: GlobalVariablesNoir): GlobalVariables { + return new GlobalVariables( + mapFieldFromNoir(globalVariables.chain_id), + mapFieldFromNoir(globalVariables.version), + mapFieldFromNoir(globalVariables.block_number), + mapFieldFromNoir(globalVariables.slot_number), + mapFieldFromNoir(globalVariables.timestamp), + mapEthAddressFromNoir(globalVariables.coinbase), + mapAztecAddressFromNoir(globalVariables.fee_recipient), + mapGasFeesFromNoir(globalVariables.gas_fees), + ); +} + +/** + * Maps state reference to Noir. + * @param stateReference - The state reference. + * @returns Noir representation of state reference. + */ +export function mapStateReferenceToNoir(stateReference: StateReference): StateReferenceNoir { + return { + l1_to_l2_message_tree: mapAppendOnlyTreeSnapshotToNoir(stateReference.l1ToL2MessageTree), + partial: mapPartialStateReferenceToNoir(stateReference.partial), + }; +} + +/** + * Maps state reference from Noir. + * @param stateReference - The state reference. + * @returns State reference + */ +export function mapStateReferenceFromNoir(stateReference: StateReferenceNoir): StateReference { + return new StateReference( + mapAppendOnlyTreeSnapshotFromNoir(stateReference.l1_to_l2_message_tree), + mapPartialStateReferenceFromNoir(stateReference.partial), + ); +} + +/** + * Maps a nullifier leaf preimage to noir + * @param nullifierLeafPreimage - The nullifier leaf preimage. + * @returns The noir nullifier leaf preimage. + */ +export function mapNullifierLeafPreimageToNoir( + nullifierLeafPreimage: NullifierLeafPreimage, +): NullifierLeafPreimageNoir { + return { + nullifier: mapFieldToNoir(nullifierLeafPreimage.nullifier), + next_nullifier: mapFieldToNoir(nullifierLeafPreimage.nextNullifier), + next_index: mapNumberToNoir(Number(nullifierLeafPreimage.nextIndex)), + }; +} + +/** + * Maps partial state reference from Noir. + * @param partialStateReference - The state reference. + * @returns Partial state reference + */ +export function mapPartialStateReferenceFromNoir( + partialStateReference: PartialStateReferenceNoir, +): PartialStateReference { + return new PartialStateReference( + mapAppendOnlyTreeSnapshotFromNoir(partialStateReference.note_hash_tree), + mapAppendOnlyTreeSnapshotFromNoir(partialStateReference.nullifier_tree), + mapAppendOnlyTreeSnapshotFromNoir(partialStateReference.public_data_tree), + ); +} + +export function mapMembershipWitnessToNoir(witness: MembershipWitness): MembershipWitnessNoir { + const siblingPath = mapTuple(witness.siblingPath, mapFieldToNoir) as FixedLengthArray; + return { + leaf_index: witness.leafIndex.toString(), + sibling_path: siblingPath, + }; +} + +/** + * Maps a leaf preimage of the public data tree to noir. + */ +export function mapPublicDataTreePreimageToNoir(preimage: PublicDataTreeLeafPreimage): PublicDataTreeLeafPreimageNoir { + return { + slot: mapFieldToNoir(preimage.slot), + value: mapFieldToNoir(preimage.value), + next_slot: mapFieldToNoir(preimage.nextSlot), + next_index: mapNumberToNoir(Number(preimage.nextIndex)), + }; +} + +/** + * Maps a partial state reference to a noir partial state reference. + * @param partialStateReference - The partial state reference. + * @returns The noir partial state reference. + */ +export function mapPartialStateReferenceToNoir( + partialStateReference: PartialStateReference, +): PartialStateReferenceNoir { + return { + note_hash_tree: mapAppendOnlyTreeSnapshotToNoir(partialStateReference.noteHashTree), + nullifier_tree: mapAppendOnlyTreeSnapshotToNoir(partialStateReference.nullifierTree), + public_data_tree: mapAppendOnlyTreeSnapshotToNoir(partialStateReference.publicDataTree), + }; +} + +/** + * Maps a LogHash to a noir LogHash. + * @param logHash - The LogHash. + * @returns The noir log hash. + */ +function mapLogHashToNoir(logHash: LogHash): LogHashNoir { + return { + value: mapFieldToNoir(logHash.value), + counter: mapNumberToNoir(logHash.counter), + length: mapFieldToNoir(logHash.length), + }; +} + +/** + * Maps a noir LogHash to a LogHash. + * @param logHash - The noir LogHash. + * @returns The TS log hash. + */ +function mapLogHashFromNoir(logHash: LogHashNoir): LogHash { + return new LogHash( + mapFieldFromNoir(logHash.value), + mapNumberFromNoir(logHash.counter), + mapFieldFromNoir(logHash.length), + ); +} + +/** + * Maps a ts ScopedLogHash to a noir ScopedLogHash. + * @param logHash - The ts LogHash. + * @returns The noir log hash. + */ +export function mapScopedLogHashToNoir(scopedLogHash: ScopedLogHash): ScopedLogHashNoir { + return { + log_hash: mapLogHashToNoir(scopedLogHash.logHash), + contract_address: mapAztecAddressToNoir(scopedLogHash.contractAddress), + }; +} + +/** + * Maps a noir ScopedLogHash to a ts ScopedLogHash. + * @param logHash - The noir LogHash. + * @returns The TS log hash. + */ +function mapScopedLogHashFromNoir(scopedLogHash: ScopedLogHashNoir): ScopedLogHash { + return new ScopedLogHash( + mapLogHashFromNoir(scopedLogHash.log_hash), + mapAztecAddressFromNoir(scopedLogHash.contract_address), + ); +} + +function mapPublicDataWriteFromNoir(write: PublicDataWriteNoir) { + return new PublicDataWrite(mapFieldFromNoir(write.leaf_slot), mapFieldFromNoir(write.value)); +} + +export function mapPublicDataWriteToNoir(write: PublicDataWrite): PublicDataWriteNoir { + return { + leaf_slot: mapFieldToNoir(write.leafSlot), + value: mapFieldToNoir(write.value), + }; +} + +/** + * Maps combined accumulated data from noir to the parsed type. + * @param combinedAccumulatedData - The noir combined accumulated data. + * @returns The parsed combined accumulated data. + */ +export function mapCombinedAccumulatedDataFromNoir(combinedAccumulatedData: CombinedAccumulatedDataNoir) { + return new CombinedAccumulatedData( + mapTupleFromNoir(combinedAccumulatedData.note_hashes, MAX_NOTE_HASHES_PER_TX, mapFieldFromNoir), + mapTupleFromNoir(combinedAccumulatedData.nullifiers, MAX_NULLIFIERS_PER_TX, mapFieldFromNoir), + mapTupleFromNoir(combinedAccumulatedData.l2_to_l1_msgs, MAX_L2_TO_L1_MSGS_PER_TX, mapScopedL2ToL1MessageFromNoir), + mapTupleFromNoir(combinedAccumulatedData.private_logs, MAX_PRIVATE_LOGS_PER_TX, mapPrivateLogFromNoir), + mapTupleFromNoir( + combinedAccumulatedData.unencrypted_logs_hashes, + MAX_UNENCRYPTED_LOGS_PER_TX, + mapScopedLogHashFromNoir, + ), + mapTupleFromNoir( + combinedAccumulatedData.contract_class_logs_hashes, + MAX_CONTRACT_CLASS_LOGS_PER_TX, + mapScopedLogHashFromNoir, + ), + mapFieldFromNoir(combinedAccumulatedData.unencrypted_log_preimages_length), + mapFieldFromNoir(combinedAccumulatedData.contract_class_log_preimages_length), + mapTupleFromNoir( + combinedAccumulatedData.public_data_writes, + MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, + mapPublicDataWriteFromNoir, + ), + ); +} + +/** + * Maps a tx context to a noir tx context. + * @param txContext - The tx context. + * @returns The noir tx context. + */ +export function mapTxContextToNoir(txContext: TxContext): TxContextNoir { + return { + chain_id: mapFieldToNoir(txContext.chainId), + version: mapFieldToNoir(txContext.version), + gas_settings: mapGasSettingsToNoir(txContext.gasSettings), + }; +} + +/** + * Maps a noir tx context to a tx context. + * @param txContext - The noir tx context. + * @returns The tx context. + */ +export function mapTxContextFromNoir(txContext: TxContextNoir): TxContext { + return new TxContext( + mapFieldFromNoir(txContext.chain_id), + mapFieldFromNoir(txContext.version), + mapGasSettingsFromNoir(txContext.gas_settings), + ); +} diff --git a/yarn-project/noir-protocol-circuits-types/src/conversion/server.ts b/yarn-project/noir-protocol-circuits-types/src/conversion/server.ts new file mode 100644 index 000000000000..e052b1cd0440 --- /dev/null +++ b/yarn-project/noir-protocol-circuits-types/src/conversion/server.ts @@ -0,0 +1,966 @@ +import { + type AVM_PROOF_LENGTH_IN_FIELDS, + AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, + AZTEC_MAX_EPOCH_DURATION, + type AvmAccumulatedData, + type AvmCircuitPublicInputs, + BLOBS_PER_BLOCK, + type BaseParityInputs, + type CombinedAccumulatedData, + CombinedConstantData, + type EmptyNestedData, + Fr, + HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS, + KernelCircuitPublicInputs, + type MembershipWitness, + type NESTED_RECURSIVE_PROOF_LENGTH, + type NULLIFIER_TREE_HEIGHT, + type PUBLIC_DATA_TREE_HEIGHT, + ParityPublicInputs, + type PrivateKernelEmptyInputs, + type PrivateToAvmAccumulatedData, + type PrivateToAvmAccumulatedDataArrayLengths, + type PrivateToPublicAccumulatedData, + type PrivateToPublicKernelCircuitPublicInputs, + type PublicDataHint, + type RECURSIVE_PROOF_LENGTH, + type RecursiveProof, + RevertCode, + RollupValidationRequests, + type RootParityInput, + type RootParityInputs, + type TUBE_PROOF_LENGTH, + type TreeSnapshots, + type TxConstantData, + type VkWitnessData, +} from '@aztec/circuits.js'; +import { BlobPublicInputs, BlockBlobPublicInputs, Poseidon2Sponge, SpongeBlob } from '@aztec/circuits.js/blobs'; +import { + type AvmProofData, + BaseOrMergeRollupPublicInputs, + type BlockMergeRollupInputs, + BlockRootOrBlockMergePublicInputs, + type BlockRootRollupInputs, + ConstantRollupData, + type EmptyBlockRootRollupInputs, + FeeRecipient, + type MergeRollupInputs, + type PreviousRollupBlockData, + type PreviousRollupData, + type PrivateBaseRollupInputs, + type PrivateBaseStateDiffHints, + type PrivateTubeData, + type PublicBaseRollupInputs, + type PublicBaseStateDiffHints, + type PublicTubeData, + type RootRollupInputs, + RootRollupPublicInputs, +} from '@aztec/circuits.js/rollup'; +import { toHex } from '@aztec/foundation/bigint-buffer'; +import { mapTuple } from '@aztec/foundation/serialize'; + +import type { + AvmAccumulatedData as AvmAccumulatedDataNoir, + AvmCircuitPublicInputs as AvmCircuitPublicInputsNoir, + AvmProofData as AvmProofDataNoir, + BaseOrMergeRollupPublicInputs as BaseOrMergeRollupPublicInputsNoir, + BaseParityInputs as BaseParityInputsNoir, + BigNum, + BlobCommitment as BlobCommitmentNoir, + BlobPublicInputs as BlobPublicInputsNoir, + BlockBlobPublicInputs as BlockBlobPublicInputsNoir, + BlockMergeRollupInputs as BlockMergeRollupInputsNoir, + BlockRootOrBlockMergePublicInputs as BlockRootOrBlockMergePublicInputsNoir, + BlockRootRollupInputs as BlockRootRollupInputsNoir, + CombinedAccumulatedData as CombinedAccumulatedDataNoir, + CombinedConstantData as CombinedConstantDataNoir, + ConstantRollupData as ConstantRollupDataNoir, + EmptyBlockRootRollupInputs as EmptyBlockRootRollupInputsNoir, + EmptyNestedCircuitPublicInputs as EmptyNestedDataNoir, + FeeRecipient as FeeRecipientNoir, + FixedLengthArray, + KernelCircuitPublicInputs as KernelCircuitPublicInputsNoir, + MergeRollupInputs as MergeRollupInputsNoir, + Field as NoirField, + ParityPublicInputs as ParityPublicInputsNoir, + RootParityInput as ParityRootParityInputNoir, + Poseidon2 as Poseidon2SpongeNoir, + PreviousRollupBlockData as PreviousRollupBlockDataNoir, + PreviousRollupData as PreviousRollupDataNoir, + PrivateBaseRollupInputs as PrivateBaseRollupInputsNoir, + PrivateBaseStateDiffHints as PrivateBaseStateDiffHintsNoir, + PrivateKernelEmptyPrivateInputs as PrivateKernelEmptyPrivateInputsNoir, + PrivateToAvmAccumulatedDataArrayLengths as PrivateToAvmAccumulatedDataArrayLengthsNoir, + PrivateToAvmAccumulatedData as PrivateToAvmAccumulatedDataNoir, + PrivateToPublicAccumulatedData as PrivateToPublicAccumulatedDataNoir, + PrivateToPublicKernelCircuitPublicInputs as PrivateToPublicKernelCircuitPublicInputsNoir, + PrivateTubeData as PrivateTubeDataNoir, + PublicBaseRollupInputs as PublicBaseRollupInputsNoir, + PublicBaseStateDiffHints as PublicBaseStateDiffHintsNoir, + PublicDataHint as PublicDataHintNoir, + PublicTubeData as PublicTubeDataNoir, + RollupValidationRequests as RollupValidationRequestsNoir, + RootParityInputs as RootParityInputsNoir, + RootRollupInputs as RootRollupInputsNoir, + RootRollupParityInput as RootRollupParityInputNoir, + RootRollupPublicInputs as RootRollupPublicInputsNoir, + SpongeBlob as SpongeBlobNoir, + TreeSnapshots as TreeSnapshotsNoir, + TxConstantData as TxConstantDataNoir, + VkData as VkDataNoir, +} from '../types/index.js'; +import { + mapAppendOnlyTreeSnapshotFromNoir, + mapAppendOnlyTreeSnapshotToNoir, + mapAztecAddressFromNoir, + mapAztecAddressToNoir, + mapCombinedAccumulatedDataFromNoir, + mapEthAddressFromNoir, + mapEthAddressToNoir, + mapFieldFromNoir, + mapFieldToNoir, + mapGasFromNoir, + mapGasSettingsToNoir, + mapGasToNoir, + mapGlobalVariablesFromNoir, + mapGlobalVariablesToNoir, + mapHeaderFromNoir, + mapHeaderToNoir, + mapMaxBlockNumberFromNoir, + mapMaxBlockNumberToNoir, + mapMembershipWitnessToNoir, + mapNullifierLeafPreimageToNoir, + mapNumberFromNoir, + mapNumberToNoir, + mapPartialStateReferenceFromNoir, + mapPartialStateReferenceToNoir, + mapPrivateLogToNoir, + mapPublicCallRequestToNoir, + mapPublicDataTreePreimageToNoir, + mapPublicDataWriteToNoir, + mapScopedL2ToL1MessageToNoir, + mapScopedLogHashToNoir, + mapTupleFromNoir, + mapTxContextFromNoir, + mapTxContextToNoir, + mapVerificationKeyToNoir, +} from './common.js'; + +/* eslint-disable camelcase */ + +/** + * Maps a BigNum coming to/from noir. + * TODO(): Is BigInt the best way to represent this? + * @param number - The BigNum representing the number. + * @returns The number + */ +export function mapBLS12BigNumFromNoir(bignum: BigNum): bigint { + // TODO(Miranda): there's gotta be a better way to convert this + const paddedLimbs = [ + `0x` + bignum.limbs[2].substring(2).padStart(4, '0'), + bignum.limbs[1].substring(2).padStart(30, '0'), + bignum.limbs[0].substring(2).padStart(30, '0'), + ]; + return BigInt(paddedLimbs[0].concat(paddedLimbs[1], paddedLimbs[2])); +} + +export function mapBLS12BigNumToNoir(number: bigint): BigNum { + const hex = toHex(number, true); + return { + limbs: ['0x' + hex.substring(36), '0x' + hex.substring(6, 36), hex.substring(0, 6)], + }; +} + +export function mapFeeRecipientToNoir(feeRecipient: FeeRecipient): FeeRecipientNoir { + return { + recipient: mapEthAddressToNoir(feeRecipient.recipient), + value: mapFieldToNoir(feeRecipient.value), + }; +} + +export function mapFeeRecipientFromNoir(feeRecipient: FeeRecipientNoir): FeeRecipient { + return new FeeRecipient(mapEthAddressFromNoir(feeRecipient.recipient), mapFieldFromNoir(feeRecipient.value)); +} + +/** + * Maps poseidon sponge to noir. + * @param sponge - The circuits.js poseidon sponge. + * @returns The noir poseidon sponge. + */ +export function mapPoseidon2SpongeToNoir(sponge: Poseidon2Sponge): Poseidon2SpongeNoir { + return { + cache: mapTuple(sponge.cache, mapFieldToNoir), + state: mapTuple(sponge.state, mapFieldToNoir), + cache_size: mapNumberToNoir(sponge.cacheSize), + squeeze_mode: sponge.squeezeMode, + }; +} + +/** + * Maps poseidon sponge from noir. + * @param sponge - The noir poseidon sponge. + * @returns The circuits.js poseidon sponge. + */ +export function mapPoseidon2SpongeFromNoir(sponge: Poseidon2SpongeNoir): Poseidon2Sponge { + return new Poseidon2Sponge( + mapTupleFromNoir(sponge.cache, 3, mapFieldFromNoir), + mapTupleFromNoir(sponge.state, 4, mapFieldFromNoir), + mapNumberFromNoir(sponge.cache_size), + sponge.squeeze_mode, + ); +} + +/** + * Maps sponge blob to noir. + * @param spongeBlob - The circuits.js sponge blob. + * @returns The noir sponge blob. + */ +export function mapSpongeBlobToNoir(spongeBlob: SpongeBlob): SpongeBlobNoir { + return { + sponge: mapPoseidon2SpongeToNoir(spongeBlob.sponge), + fields: mapNumberToNoir(spongeBlob.fields), + expected_fields: mapNumberToNoir(spongeBlob.expectedFields), + }; +} + +/** + * Maps sponge blob from noir. + * @param spongeBlob - The noir sponge blob. + * @returns The circuits.js sponge blob. + */ +export function mapSpongeBlobFromNoir(spongeBlob: SpongeBlobNoir): SpongeBlob { + return new SpongeBlob( + mapPoseidon2SpongeFromNoir(spongeBlob.sponge), + mapNumberFromNoir(spongeBlob.fields), + mapNumberFromNoir(spongeBlob.expected_fields), + ); +} + +/** + * Maps blob commitment to noir. + * @param commitment - The circuits.js commitment. + * @returns The noir commitment. + */ +export function mapBlobCommitmentToNoir(commitment: [Fr, Fr]): BlobCommitmentNoir { + return { + inner: mapTuple(commitment, mapFieldToNoir), + }; +} + +/** + * Maps blob public inputs to noir. + * @param blobPublicInputs - The circuits.js blob public inputs. + * @returns The noir blob public inputs. + */ +export function mapBlobPublicInputsToNoir(blobPublicInputs: BlobPublicInputs): BlobPublicInputsNoir { + return { + z: mapFieldToNoir(blobPublicInputs.z), + y: mapBLS12BigNumToNoir(blobPublicInputs.y), + kzg_commitment: mapBlobCommitmentToNoir(blobPublicInputs.kzgCommitment), + }; +} + +/** + * Maps blob public inputs from noir. + * @param blobPublicInputs - The noir blob public inputs. + * @returns The circuits.js blob public inputs. + */ +export function mapBlobPublicInputsFromNoir(blobPublicInputs: BlobPublicInputsNoir): BlobPublicInputs { + return new BlobPublicInputs( + mapFieldFromNoir(blobPublicInputs.z), + mapBLS12BigNumFromNoir(blobPublicInputs.y), + mapTupleFromNoir(blobPublicInputs.kzg_commitment.inner, 2, mapFieldFromNoir), + ); +} + +/** + * Maps block blob public inputs to noir. + * @param blockBlobPublicInputs - The circuits.js block blob public inputs. + * @returns The noir block blob public inputs. + */ +export function mapBlockBlobPublicInputsToNoir( + blockBlobPublicInputs: BlockBlobPublicInputs, +): BlockBlobPublicInputsNoir { + return { + inner: mapTuple(blockBlobPublicInputs.inner, mapBlobPublicInputsToNoir), + }; +} + +/** + * Maps block blob public inputs from noir. + * @param blockBlobPublicInputs - The noir block blob public inputs. + * @returns The circuits.js block blob public inputs. + */ +export function mapBlockBlobPublicInputsFromNoir( + blockBlobPublicInputs: BlockBlobPublicInputsNoir, +): BlockBlobPublicInputs { + return new BlockBlobPublicInputs( + mapTupleFromNoir(blockBlobPublicInputs.inner, BLOBS_PER_BLOCK, mapBlobPublicInputsFromNoir), + ); +} + +function mapPublicDataHintToNoir(hint: PublicDataHint): PublicDataHintNoir { + return { + leaf_slot: mapFieldToNoir(hint.leafSlot), + value: mapFieldToNoir(hint.value), + membership_witness: mapMembershipWitnessToNoir(hint.membershipWitness), + leaf_preimage: mapPublicDataTreePreimageToNoir(hint.leafPreimage), + }; +} + +/** + * Maps a constant rollup data to a noir constant rollup data. + * @param constantRollupData - The circuits.js constant rollup data. + * @returns The noir constant rollup data. + */ +export function mapConstantRollupDataToNoir(constantRollupData: ConstantRollupData): ConstantRollupDataNoir { + return { + last_archive: mapAppendOnlyTreeSnapshotToNoir(constantRollupData.lastArchive), + vk_tree_root: mapFieldToNoir(constantRollupData.vkTreeRoot), + protocol_contract_tree_root: mapFieldToNoir(constantRollupData.protocolContractTreeRoot), + global_variables: mapGlobalVariablesToNoir(constantRollupData.globalVariables), + }; +} + +/** + * Maps a constant rollup data from noir to the circuits.js type. + * @param constantRollupData - The noir constant rollup data. + * @returns The circuits.js constant rollup data. + */ +export function mapConstantRollupDataFromNoir(constantRollupData: ConstantRollupDataNoir): ConstantRollupData { + return new ConstantRollupData( + mapAppendOnlyTreeSnapshotFromNoir(constantRollupData.last_archive), + mapFieldFromNoir(constantRollupData.vk_tree_root), + mapFieldFromNoir(constantRollupData.protocol_contract_tree_root), + mapGlobalVariablesFromNoir(constantRollupData.global_variables), + ); +} + +/** + * Maps a base or merge rollup public inputs to a noir base or merge rollup public inputs. + * @param baseOrMergeRollupPublicInputs - The base or merge rollup public inputs. + * @returns The noir base or merge rollup public inputs. + */ +export function mapBaseOrMergeRollupPublicInputsToNoir( + baseOrMergeRollupPublicInputs: BaseOrMergeRollupPublicInputs, +): BaseOrMergeRollupPublicInputsNoir { + return { + rollup_type: mapFieldToNoir(new Fr(baseOrMergeRollupPublicInputs.rollupType)), + num_txs: mapFieldToNoir(new Fr(baseOrMergeRollupPublicInputs.numTxs)), + constants: mapConstantRollupDataToNoir(baseOrMergeRollupPublicInputs.constants), + start: mapPartialStateReferenceToNoir(baseOrMergeRollupPublicInputs.start), + end: mapPartialStateReferenceToNoir(baseOrMergeRollupPublicInputs.end), + start_sponge_blob: mapSpongeBlobToNoir(baseOrMergeRollupPublicInputs.startSpongeBlob), + end_sponge_blob: mapSpongeBlobToNoir(baseOrMergeRollupPublicInputs.endSpongeBlob), + out_hash: mapFieldToNoir(baseOrMergeRollupPublicInputs.outHash), + accumulated_fees: mapFieldToNoir(baseOrMergeRollupPublicInputs.accumulatedFees), + accumulated_mana_used: mapFieldToNoir(baseOrMergeRollupPublicInputs.accumulatedManaUsed), + }; +} + +/** + * Maps block root or block merge rollup public inputs to a noir block root or block merge rollup public inputs. + * @param blockRootOrBlockMergePublicInputs - The block root or block merge rollup public inputs. + * @returns The noir block root or block merge rollup public inputs. + */ +export function mapBlockRootOrBlockMergePublicInputsToNoir( + blockRootOrBlockMergePublicInputs: BlockRootOrBlockMergePublicInputs, +): BlockRootOrBlockMergePublicInputsNoir { + return { + previous_archive: mapAppendOnlyTreeSnapshotToNoir(blockRootOrBlockMergePublicInputs.previousArchive), + new_archive: mapAppendOnlyTreeSnapshotToNoir(blockRootOrBlockMergePublicInputs.newArchive), + previous_block_hash: mapFieldToNoir(blockRootOrBlockMergePublicInputs.previousBlockHash), + end_block_hash: mapFieldToNoir(blockRootOrBlockMergePublicInputs.endBlockHash), + start_global_variables: mapGlobalVariablesToNoir(blockRootOrBlockMergePublicInputs.startGlobalVariables), + end_global_variables: mapGlobalVariablesToNoir(blockRootOrBlockMergePublicInputs.endGlobalVariables), + out_hash: mapFieldToNoir(blockRootOrBlockMergePublicInputs.outHash), + fees: mapTuple(blockRootOrBlockMergePublicInputs.fees, mapFeeRecipientToNoir), + vk_tree_root: mapFieldToNoir(blockRootOrBlockMergePublicInputs.vkTreeRoot), + protocol_contract_tree_root: mapFieldToNoir(blockRootOrBlockMergePublicInputs.protocolContractTreeRoot), + prover_id: mapFieldToNoir(blockRootOrBlockMergePublicInputs.proverId), + blob_public_inputs: mapTuple(blockRootOrBlockMergePublicInputs.blobPublicInputs, mapBlockBlobPublicInputsToNoir), + }; +} + +export function mapRecursiveProofToNoir(proof: RecursiveProof) { + return { + fields: mapTuple(proof.proof, mapFieldToNoir) as FixedLengthArray, + }; +} + +export function mapRootParityInputToNoir( + rootParityInput: RootParityInput, +): ParityRootParityInputNoir { + return { + proof: mapRecursiveProofToNoir(rootParityInput.proof), + verification_key: mapVerificationKeyToNoir(rootParityInput.verificationKey, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), + vk_path: mapTuple(rootParityInput.vkPath, mapFieldToNoir), + public_inputs: mapParityPublicInputsToNoir(rootParityInput.publicInputs), + }; +} + +export function mapParityPublicInputsToNoir(parityPublicInputs: ParityPublicInputs): ParityPublicInputsNoir { + return { + sha_root: mapFieldToNoir(parityPublicInputs.shaRoot), + converted_root: mapFieldToNoir(parityPublicInputs.convertedRoot), + vk_tree_root: mapFieldToNoir(parityPublicInputs.vkTreeRoot), + }; +} + +/** + * Maps a root rollup public inputs from noir. + * @param rootRollupPublicInputs - The noir root rollup public inputs. + * @returns The circuits.js root rollup public inputs. + */ +export function mapRootRollupPublicInputsFromNoir( + rootRollupPublicInputs: RootRollupPublicInputsNoir, +): RootRollupPublicInputs { + return new RootRollupPublicInputs( + mapAppendOnlyTreeSnapshotFromNoir(rootRollupPublicInputs.previous_archive), + mapAppendOnlyTreeSnapshotFromNoir(rootRollupPublicInputs.end_archive), + mapFieldFromNoir(rootRollupPublicInputs.previous_block_hash), + mapFieldFromNoir(rootRollupPublicInputs.end_block_hash), + mapFieldFromNoir(rootRollupPublicInputs.end_timestamp), + mapFieldFromNoir(rootRollupPublicInputs.end_block_number), + mapFieldFromNoir(rootRollupPublicInputs.out_hash), + mapTupleFromNoir(rootRollupPublicInputs.fees, AZTEC_MAX_EPOCH_DURATION, mapFeeRecipientFromNoir), + mapFieldFromNoir(rootRollupPublicInputs.vk_tree_root), + mapFieldFromNoir(rootRollupPublicInputs.protocol_contract_tree_root), + mapFieldFromNoir(rootRollupPublicInputs.prover_id), + mapTupleFromNoir( + rootRollupPublicInputs.blob_public_inputs, + AZTEC_MAX_EPOCH_DURATION, + mapBlockBlobPublicInputsFromNoir, + ), + ); +} + +/** + * Maps a parity public inputs from noir. + * @param parityPublicInputs - The noir parity public inputs. + * @returns The circuits.js parity public inputs. + */ +export function mapParityPublicInputsFromNoir(parityPublicInputs: ParityPublicInputsNoir): ParityPublicInputs { + return new ParityPublicInputs( + mapFieldFromNoir(parityPublicInputs.sha_root), + mapFieldFromNoir(parityPublicInputs.converted_root), + mapFieldFromNoir(parityPublicInputs.vk_tree_root), + ); +} + +export function mapTreeSnapshotsToNoir(snapshots: TreeSnapshots): TreeSnapshotsNoir { + return { + l1_to_l2_message_tree: mapAppendOnlyTreeSnapshotToNoir(snapshots.l1ToL2MessageTree), + note_hash_tree: mapAppendOnlyTreeSnapshotToNoir(snapshots.noteHashTree), + nullifier_tree: mapAppendOnlyTreeSnapshotToNoir(snapshots.nullifierTree), + public_data_tree: mapAppendOnlyTreeSnapshotToNoir(snapshots.publicDataTree), + }; +} + +export function mapPrivateToPublicAccumulatedDataToNoir( + data: PrivateToPublicAccumulatedData, +): PrivateToPublicAccumulatedDataNoir { + return { + note_hashes: mapTuple(data.noteHashes, mapFieldToNoir), + nullifiers: mapTuple(data.nullifiers, mapFieldToNoir), + l2_to_l1_msgs: mapTuple(data.l2ToL1Msgs, mapScopedL2ToL1MessageToNoir), + private_logs: mapTuple(data.privateLogs, mapPrivateLogToNoir), + contract_class_logs_hashes: mapTuple(data.contractClassLogsHashes, mapScopedLogHashToNoir), + public_call_requests: mapTuple(data.publicCallRequests, mapPublicCallRequestToNoir), + }; +} + +export function mapCombinedAccumulatedDataToNoir( + combinedAccumulatedData: CombinedAccumulatedData, +): CombinedAccumulatedDataNoir { + return { + note_hashes: mapTuple(combinedAccumulatedData.noteHashes, mapFieldToNoir), + nullifiers: mapTuple(combinedAccumulatedData.nullifiers, mapFieldToNoir), + l2_to_l1_msgs: mapTuple(combinedAccumulatedData.l2ToL1Msgs, mapScopedL2ToL1MessageToNoir), + private_logs: mapTuple(combinedAccumulatedData.privateLogs, mapPrivateLogToNoir), + unencrypted_logs_hashes: mapTuple(combinedAccumulatedData.unencryptedLogsHashes, mapScopedLogHashToNoir), + contract_class_logs_hashes: mapTuple(combinedAccumulatedData.contractClassLogsHashes, mapScopedLogHashToNoir), + unencrypted_log_preimages_length: mapFieldToNoir(combinedAccumulatedData.unencryptedLogPreimagesLength), + contract_class_log_preimages_length: mapFieldToNoir(combinedAccumulatedData.contractClassLogPreimagesLength), + public_data_writes: mapTuple(combinedAccumulatedData.publicDataWrites, mapPublicDataWriteToNoir), + }; +} + +function mapCombinedConstantDataFromNoir(combinedConstantData: CombinedConstantDataNoir): CombinedConstantData { + return new CombinedConstantData( + mapHeaderFromNoir(combinedConstantData.historical_header), + mapTxContextFromNoir(combinedConstantData.tx_context), + mapFieldFromNoir(combinedConstantData.vk_tree_root), + mapFieldFromNoir(combinedConstantData.protocol_contract_tree_root), + mapGlobalVariablesFromNoir(combinedConstantData.global_variables), + ); +} + +function mapCombinedConstantDataToNoir(combinedConstantData: CombinedConstantData): CombinedConstantDataNoir { + return { + historical_header: mapHeaderToNoir(combinedConstantData.historicalHeader), + tx_context: mapTxContextToNoir(combinedConstantData.txContext), + vk_tree_root: mapFieldToNoir(combinedConstantData.vkTreeRoot), + protocol_contract_tree_root: mapFieldToNoir(combinedConstantData.protocolContractTreeRoot), + global_variables: mapGlobalVariablesToNoir(combinedConstantData.globalVariables), + }; +} + +function mapTxConstantDataToNoir(data: TxConstantData): TxConstantDataNoir { + return { + historical_header: mapHeaderToNoir(data.historicalHeader), + tx_context: mapTxContextToNoir(data.txContext), + vk_tree_root: mapFieldToNoir(data.vkTreeRoot), + protocol_contract_tree_root: mapFieldToNoir(data.protocolContractTreeRoot), + }; +} + +export function mapPrivateToPublicKernelCircuitPublicInputsToNoir( + inputs: PrivateToPublicKernelCircuitPublicInputs, +): PrivateToPublicKernelCircuitPublicInputsNoir { + return { + constants: mapTxConstantDataToNoir(inputs.constants), + rollup_validation_requests: mapRollupValidationRequestsToNoir(inputs.rollupValidationRequests), + non_revertible_accumulated_data: mapPrivateToPublicAccumulatedDataToNoir(inputs.nonRevertibleAccumulatedData), + revertible_accumulated_data: mapPrivateToPublicAccumulatedDataToNoir(inputs.revertibleAccumulatedData), + public_teardown_call_request: mapPublicCallRequestToNoir(inputs.publicTeardownCallRequest), + gas_used: mapGasToNoir(inputs.gasUsed), + fee_payer: mapAztecAddressToNoir(inputs.feePayer), + }; +} + +export function mapKernelCircuitPublicInputsToNoir(inputs: KernelCircuitPublicInputs): KernelCircuitPublicInputsNoir { + return { + rollup_validation_requests: mapRollupValidationRequestsToNoir(inputs.rollupValidationRequests), + constants: mapCombinedConstantDataToNoir(inputs.constants), + end: mapCombinedAccumulatedDataToNoir(inputs.end), + start_state: mapPartialStateReferenceToNoir(inputs.startState), + revert_code: mapRevertCodeToNoir(inputs.revertCode), + gas_used: mapGasToNoir(inputs.gasUsed), + fee_payer: mapAztecAddressToNoir(inputs.feePayer), + }; +} + +function mapPrivateToAvmAccumulatedDataToNoir(data: PrivateToAvmAccumulatedData): PrivateToAvmAccumulatedDataNoir { + return { + note_hashes: mapTuple(data.noteHashes, mapFieldToNoir), + nullifiers: mapTuple(data.nullifiers, mapFieldToNoir), + l2_to_l1_msgs: mapTuple(data.l2ToL1Msgs, mapScopedL2ToL1MessageToNoir), + }; +} + +function mapPrivateToAvmAccumulatedDataArrayLengthsToNoir( + data: PrivateToAvmAccumulatedDataArrayLengths, +): PrivateToAvmAccumulatedDataArrayLengthsNoir { + return { + note_hashes: mapNumberToNoir(data.noteHashes), + nullifiers: mapNumberToNoir(data.nullifiers), + l2_to_l1_msgs: mapNumberToNoir(data.l2ToL1Msgs), + }; +} + +function mapAvmAccumulatedDataToNoir(data: AvmAccumulatedData): AvmAccumulatedDataNoir { + return { + note_hashes: mapTuple(data.noteHashes, mapFieldToNoir), + nullifiers: mapTuple(data.nullifiers, mapFieldToNoir), + l2_to_l1_msgs: mapTuple(data.l2ToL1Msgs, mapScopedL2ToL1MessageToNoir), + unencrypted_logs_hashes: mapTuple(data.unencryptedLogsHashes, mapScopedLogHashToNoir), + public_data_writes: mapTuple(data.publicDataWrites, mapPublicDataWriteToNoir), + }; +} + +function mapAvmCircuitPublicInputsToNoir(inputs: AvmCircuitPublicInputs): AvmCircuitPublicInputsNoir { + return { + global_variables: mapGlobalVariablesToNoir(inputs.globalVariables), + start_tree_snapshots: mapTreeSnapshotsToNoir(inputs.startTreeSnapshots), + start_gas_used: mapGasToNoir(inputs.startGasUsed), + gas_settings: mapGasSettingsToNoir(inputs.gasSettings), + fee_payer: mapAztecAddressToNoir(inputs.feePayer), + public_setup_call_requests: mapTuple(inputs.publicSetupCallRequests, mapPublicCallRequestToNoir), + public_app_logic_call_requests: mapTuple(inputs.publicAppLogicCallRequests, mapPublicCallRequestToNoir), + public_teardown_call_request: mapPublicCallRequestToNoir(inputs.publicTeardownCallRequest), + previous_non_revertible_accumulated_data_array_lengths: mapPrivateToAvmAccumulatedDataArrayLengthsToNoir( + inputs.previousNonRevertibleAccumulatedDataArrayLengths, + ), + previous_revertible_accumulated_data_array_lengths: mapPrivateToAvmAccumulatedDataArrayLengthsToNoir( + inputs.previousRevertibleAccumulatedDataArrayLengths, + ), + previous_non_revertible_accumulated_data: mapPrivateToAvmAccumulatedDataToNoir( + inputs.previousNonRevertibleAccumulatedData, + ), + previous_revertible_accumulated_data: mapPrivateToAvmAccumulatedDataToNoir( + inputs.previousRevertibleAccumulatedData, + ), + end_tree_snapshots: mapTreeSnapshotsToNoir(inputs.endTreeSnapshots), + end_gas_used: mapGasToNoir(inputs.endGasUsed), + accumulated_data: mapAvmAccumulatedDataToNoir(inputs.accumulatedData), + transaction_fee: mapFieldToNoir(inputs.transactionFee), + reverted: inputs.reverted, + }; +} + +/** + * Maps a block root or block merge rollup public inputs from noir to the circuits.js type. + * @param blockRootOrBlockMergePublicInputs - The noir lock root or block merge rollup public inputs. + * @returns The circuits.js block root or block merge rollup public inputs. + */ +export function mapBlockRootOrBlockMergePublicInputsFromNoir( + blockRootOrBlockMergePublicInputs: BlockRootOrBlockMergePublicInputsNoir, +): BlockRootOrBlockMergePublicInputs { + return new BlockRootOrBlockMergePublicInputs( + mapAppendOnlyTreeSnapshotFromNoir(blockRootOrBlockMergePublicInputs.previous_archive), + mapAppendOnlyTreeSnapshotFromNoir(blockRootOrBlockMergePublicInputs.new_archive), + mapFieldFromNoir(blockRootOrBlockMergePublicInputs.previous_block_hash), + mapFieldFromNoir(blockRootOrBlockMergePublicInputs.end_block_hash), + mapGlobalVariablesFromNoir(blockRootOrBlockMergePublicInputs.start_global_variables), + mapGlobalVariablesFromNoir(blockRootOrBlockMergePublicInputs.end_global_variables), + mapFieldFromNoir(blockRootOrBlockMergePublicInputs.out_hash), + mapTupleFromNoir(blockRootOrBlockMergePublicInputs.fees, AZTEC_MAX_EPOCH_DURATION, mapFeeRecipientFromNoir), + mapFieldFromNoir(blockRootOrBlockMergePublicInputs.vk_tree_root), + mapFieldFromNoir(blockRootOrBlockMergePublicInputs.protocol_contract_tree_root), + mapFieldFromNoir(blockRootOrBlockMergePublicInputs.prover_id), + mapTupleFromNoir( + blockRootOrBlockMergePublicInputs.blob_public_inputs, + AZTEC_MAX_EPOCH_DURATION, + mapBlockBlobPublicInputsFromNoir, + ), + ); +} + +/** + * Maps a previous rollup data from the circuits.js type to noir. + * @param previousRollupData - The circuits.js previous rollup data. + * @returns The noir previous rollup data. + */ +export function mapPreviousRollupDataToNoir(previousRollupData: PreviousRollupData): PreviousRollupDataNoir { + return { + base_or_merge_rollup_public_inputs: mapBaseOrMergeRollupPublicInputsToNoir( + previousRollupData.baseOrMergeRollupPublicInputs, + ), + proof: mapRecursiveProofToNoir(previousRollupData.proof), + vk: mapVerificationKeyToNoir(previousRollupData.vk, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), + vk_witness: { + leaf_index: mapFieldToNoir(new Fr(previousRollupData.vkWitness.leafIndex)), + sibling_path: mapTuple(previousRollupData.vkWitness.siblingPath, mapFieldToNoir), + }, + }; +} + +/** + * Maps a previous rollup data from the circuits.js type to noir. + * @param previousRollupData - The circuits.js previous rollup data. + * @returns The noir previous rollup data. + */ +export function mapPreviousRollupBlockDataToNoir( + previousRollupData: PreviousRollupBlockData, +): PreviousRollupBlockDataNoir { + return { + block_root_or_block_merge_public_inputs: mapBlockRootOrBlockMergePublicInputsToNoir( + previousRollupData.blockRootOrBlockMergePublicInputs, + ), + proof: mapRecursiveProofToNoir(previousRollupData.proof), + vk: mapVerificationKeyToNoir(previousRollupData.vk, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), + vk_witness: { + leaf_index: mapFieldToNoir(new Fr(previousRollupData.vkWitness.leafIndex)), + sibling_path: mapTuple(previousRollupData.vkWitness.siblingPath, mapFieldToNoir), + }, + }; +} + +export function mapRootRollupParityInputToNoir( + rootParityInput: RootParityInput, +): RootRollupParityInputNoir { + return { + proof: mapRecursiveProofToNoir(rootParityInput.proof), + verification_key: mapVerificationKeyToNoir(rootParityInput.verificationKey, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), + vk_path: mapTuple(rootParityInput.vkPath, mapFieldToNoir), + public_inputs: mapParityPublicInputsToNoir(rootParityInput.publicInputs), + }; +} + +/** + * Maps the block root rollup inputs to noir. + * @param rootRollupInputs - The circuits.js block root rollup inputs. + * @returns The noir block root rollup inputs. + */ +export function mapBlockRootRollupInputsToNoir(rootRollupInputs: BlockRootRollupInputs): BlockRootRollupInputsNoir { + return { + previous_rollup_data: mapTuple(rootRollupInputs.previousRollupData, mapPreviousRollupDataToNoir), + l1_to_l2_roots: mapRootRollupParityInputToNoir(rootRollupInputs.l1ToL2Roots), + l1_to_l2_messages: mapTuple(rootRollupInputs.newL1ToL2Messages, mapFieldToNoir), + l1_to_l2_message_subtree_sibling_path: mapTuple( + rootRollupInputs.newL1ToL2MessageTreeRootSiblingPath, + mapFieldToNoir, + ), + start_l1_to_l2_message_tree_snapshot: mapAppendOnlyTreeSnapshotToNoir( + rootRollupInputs.startL1ToL2MessageTreeSnapshot, + ), + start_archive_snapshot: mapAppendOnlyTreeSnapshotToNoir(rootRollupInputs.startArchiveSnapshot), + new_archive_sibling_path: mapTuple(rootRollupInputs.newArchiveSiblingPath, mapFieldToNoir), + previous_block_hash: mapFieldToNoir(rootRollupInputs.previousBlockHash), + prover_id: mapFieldToNoir(rootRollupInputs.proverId), + // @ts-expect-error - below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)' + blobs_fields: mapTuple(rootRollupInputs.blobFields, mapFieldToNoir), + blob_commitments: mapTuple(rootRollupInputs.blobCommitments, mapBlobCommitmentToNoir), + blobs_hash: mapFieldToNoir(rootRollupInputs.blobsHash), + }; +} + +/** + * Maps the empty block root rollup inputs to noir. + * @param rootRollupInputs - The circuits.js block root rollup inputs. + * @returns The noir block root rollup inputs. + */ +export function mapEmptyBlockRootRollupInputsToNoir( + rootRollupInputs: EmptyBlockRootRollupInputs, +): EmptyBlockRootRollupInputsNoir { + return { + archive: mapAppendOnlyTreeSnapshotToNoir(rootRollupInputs.archive), + block_hash: mapFieldToNoir(rootRollupInputs.blockHash), + global_variables: mapGlobalVariablesToNoir(rootRollupInputs.globalVariables), + vk_tree_root: mapFieldToNoir(rootRollupInputs.vkTreeRoot), + protocol_contract_tree_root: mapFieldToNoir(rootRollupInputs.protocolContractTreeRoot), + prover_id: mapFieldToNoir(rootRollupInputs.proverId), + }; +} + +/** + * Maps the root rollup inputs to noir. + * @param rootRollupInputs - The circuits.js root rollup inputs. + * @returns The noir root rollup inputs. + */ +export function mapRootRollupInputsToNoir(rootRollupInputs: RootRollupInputs): RootRollupInputsNoir { + return { + previous_rollup_data: mapTuple(rootRollupInputs.previousRollupData, mapPreviousRollupBlockDataToNoir), + prover_id: mapFieldToNoir(rootRollupInputs.proverId), + }; +} + +/** + * Maps a base or merge rollup public inputs from noir to the circuits.js type. + * @param baseOrMergeRollupPublicInputs - The noir base or merge rollup public inputs. + * @returns The circuits.js base or merge rollup public inputs. + */ +export function mapBaseOrMergeRollupPublicInputsFromNoir( + baseOrMergeRollupPublicInputs: BaseOrMergeRollupPublicInputsNoir, +): BaseOrMergeRollupPublicInputs { + return new BaseOrMergeRollupPublicInputs( + mapNumberFromNoir(baseOrMergeRollupPublicInputs.rollup_type), + mapNumberFromNoir(baseOrMergeRollupPublicInputs.num_txs), + mapConstantRollupDataFromNoir(baseOrMergeRollupPublicInputs.constants), + mapPartialStateReferenceFromNoir(baseOrMergeRollupPublicInputs.start), + mapPartialStateReferenceFromNoir(baseOrMergeRollupPublicInputs.end), + mapSpongeBlobFromNoir(baseOrMergeRollupPublicInputs.start_sponge_blob), + mapSpongeBlobFromNoir(baseOrMergeRollupPublicInputs.end_sponge_blob), + mapFieldFromNoir(baseOrMergeRollupPublicInputs.out_hash), + mapFieldFromNoir(baseOrMergeRollupPublicInputs.accumulated_fees), + mapFieldFromNoir(baseOrMergeRollupPublicInputs.accumulated_mana_used), + ); +} + +/** + * Maps private base state diff hints to a noir state diff hints. + * @param hints - The state diff hints. + * @returns The noir state diff hints. + */ +export function mapPrivateBaseStateDiffHintsToNoir(hints: PrivateBaseStateDiffHints): PrivateBaseStateDiffHintsNoir { + return { + nullifier_predecessor_preimages: mapTuple(hints.nullifierPredecessorPreimages, mapNullifierLeafPreimageToNoir), + nullifier_predecessor_membership_witnesses: mapTuple( + hints.nullifierPredecessorMembershipWitnesses, + (witness: MembershipWitness) => mapMembershipWitnessToNoir(witness), + ), + sorted_nullifiers: mapTuple(hints.sortedNullifiers, mapFieldToNoir), + sorted_nullifier_indexes: mapTuple(hints.sortedNullifierIndexes, (index: number) => mapNumberToNoir(index)), + note_hash_subtree_sibling_path: mapTuple(hints.noteHashSubtreeSiblingPath, mapFieldToNoir), + nullifier_subtree_sibling_path: mapTuple(hints.nullifierSubtreeSiblingPath, mapFieldToNoir), + fee_write_low_leaf_preimage: mapPublicDataTreePreimageToNoir(hints.feeWriteLowLeafPreimage), + fee_write_low_leaf_membership_witness: mapMembershipWitnessToNoir(hints.feeWriteLowLeafMembershipWitness), + fee_write_sibling_path: mapTuple(hints.feeWriteSiblingPath, mapFieldToNoir), + }; +} + +/** + * Maps public base state diff hints to a noir state diff hints. + * @param hints - The state diff hints. + * @returns The noir state diff hints. + */ +export function mapPublicBaseStateDiffHintsToNoir(hints: PublicBaseStateDiffHints): PublicBaseStateDiffHintsNoir { + return { + nullifier_predecessor_preimages: mapTuple(hints.nullifierPredecessorPreimages, mapNullifierLeafPreimageToNoir), + nullifier_predecessor_membership_witnesses: mapTuple( + hints.nullifierPredecessorMembershipWitnesses, + (witness: MembershipWitness) => mapMembershipWitnessToNoir(witness), + ), + sorted_nullifiers: mapTuple(hints.sortedNullifiers, mapFieldToNoir), + sorted_nullifier_indexes: mapTuple(hints.sortedNullifierIndexes, (index: number) => mapNumberToNoir(index)), + note_hash_subtree_sibling_path: mapTuple(hints.noteHashSubtreeSiblingPath, mapFieldToNoir), + nullifier_subtree_sibling_path: mapTuple(hints.nullifierSubtreeSiblingPath, mapFieldToNoir), + low_public_data_writes_preimages: mapTuple(hints.lowPublicDataWritesPreimages, mapPublicDataTreePreimageToNoir), + low_public_data_writes_witnesses: mapTuple( + hints.lowPublicDataWritesMembershipWitnesses, + (witness: MembershipWitness) => mapMembershipWitnessToNoir(witness), + ), + public_data_tree_sibling_paths: mapTuple(hints.publicDataTreeSiblingPaths, path => mapTuple(path, mapFieldToNoir)), + }; +} + +/** + * Maps base parity inputs to noir. + * @param inputs - The circuits.js base parity inputs. + * @returns The noir base parity inputs. + */ +export function mapBaseParityInputsToNoir(inputs: BaseParityInputs): BaseParityInputsNoir { + return { + msgs: mapTuple(inputs.msgs, mapFieldToNoir), + vk_tree_root: mapFieldToNoir(inputs.vkTreeRoot), + }; +} + +/** + * Maps root parity inputs to noir. + * @param inputs - The circuits.js root parity inputs. + * @returns The noir root parity inputs. + */ +export function mapRootParityInputsToNoir(inputs: RootParityInputs): RootParityInputsNoir { + return { + children: mapTuple(inputs.children, mapRootParityInputToNoir), + }; +} + +function mapPrivateTubeDataToNoir(data: PrivateTubeData): PrivateTubeDataNoir { + return { + public_inputs: mapKernelCircuitPublicInputsToNoir(data.publicInputs), + proof: mapRecursiveProofToNoir(data.proof), + vk_data: mapVkWitnessDataToNoir(data.vkData, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), + }; +} + +/** + * Maps the inputs to the base rollup to noir. + * @param input - The circuits.js base rollup inputs. + * @returns The noir base rollup inputs. + */ +export function mapPrivateBaseRollupInputsToNoir(inputs: PrivateBaseRollupInputs): PrivateBaseRollupInputsNoir { + return { + tube_data: mapPrivateTubeDataToNoir(inputs.tubeData), + start: mapPartialStateReferenceToNoir(inputs.hints.start), + start_sponge_blob: mapSpongeBlobToNoir(inputs.hints.startSpongeBlob), + state_diff_hints: mapPrivateBaseStateDiffHintsToNoir(inputs.hints.stateDiffHints), + + archive_root_membership_witness: mapMembershipWitnessToNoir(inputs.hints.archiveRootMembershipWitness), + constants: mapConstantRollupDataToNoir(inputs.hints.constants), + fee_payer_fee_juice_balance_read_hint: mapPublicDataHintToNoir(inputs.hints.feePayerFeeJuiceBalanceReadHint), + }; +} + +function mapVkWitnessDataToNoir(vkData: VkWitnessData, length: N): VkDataNoir { + return { + vk: mapVerificationKeyToNoir(vkData.vk.keyAsFields, length), + vk_index: mapFieldToNoir(new Fr(vkData.vkIndex)), + vk_path: mapTuple(vkData.vkPath, mapFieldToNoir), + }; +} + +function mapPublicTubeDataToNoir(data: PublicTubeData): PublicTubeDataNoir { + return { + public_inputs: mapPrivateToPublicKernelCircuitPublicInputsToNoir(data.publicInputs), + proof: mapRecursiveProofToNoir(data.proof), + vk_data: mapVkWitnessDataToNoir(data.vkData, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), + }; +} + +function mapAvmProofDataToNoir(data: AvmProofData): AvmProofDataNoir { + return { + public_inputs: mapAvmCircuitPublicInputsToNoir(data.publicInputs), + proof: mapRecursiveProofToNoir(data.proof), + vk_data: mapVkWitnessDataToNoir(data.vkData, AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS), + }; +} + +export function mapPublicBaseRollupInputsToNoir(inputs: PublicBaseRollupInputs): PublicBaseRollupInputsNoir { + return { + tube_data: mapPublicTubeDataToNoir(inputs.tubeData), + avm_proof_data: mapAvmProofDataToNoir(inputs.avmProofData), + start: mapPartialStateReferenceToNoir(inputs.hints.start), + start_sponge_blob: mapSpongeBlobToNoir(inputs.hints.startSpongeBlob), + state_diff_hints: mapPublicBaseStateDiffHintsToNoir(inputs.hints.stateDiffHints), + + archive_root_membership_witness: mapMembershipWitnessToNoir(inputs.hints.archiveRootMembershipWitness), + constants: mapConstantRollupDataToNoir(inputs.hints.constants), + }; +} + +export function mapEmptyKernelInputsToNoir(inputs: PrivateKernelEmptyInputs): PrivateKernelEmptyPrivateInputsNoir { + return { + empty_nested: mapEmptyNestedDataToNoir(inputs.emptyNested), + historical_header: mapHeaderToNoir(inputs.header), + chain_id: mapFieldToNoir(inputs.chainId), + version: mapFieldToNoir(inputs.version), + vk_tree_root: mapFieldToNoir(inputs.vkTreeRoot), + protocol_contract_tree_root: mapFieldToNoir(inputs.protocolContractTreeRoot), + }; +} + +function mapEmptyNestedDataToNoir(inputs: EmptyNestedData): EmptyNestedDataNoir { + return { + proof: mapRecursiveProofToNoir(inputs.proof), + vk: mapVerificationKeyToNoir(inputs.vk, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), + }; +} + +/** + * Maps the merge rollup inputs to noir. + * @param mergeRollupInputs - The circuits.js merge rollup inputs. + * @returns The noir merge rollup inputs. + */ +export function mapMergeRollupInputsToNoir(mergeRollupInputs: MergeRollupInputs): MergeRollupInputsNoir { + return { + previous_rollup_data: mapTuple(mergeRollupInputs.previousRollupData, mapPreviousRollupDataToNoir), + }; +} + +/** + * Maps the block merge rollup inputs to noir. + * @param mergeRollupInputs - The circuits.js block merge rollup inputs. + * @returns The noir block merge rollup inputs. + */ +export function mapBlockMergeRollupInputsToNoir(mergeRollupInputs: BlockMergeRollupInputs): BlockMergeRollupInputsNoir { + return { + previous_rollup_data: mapTuple(mergeRollupInputs.previousRollupData, mapPreviousRollupBlockDataToNoir), + }; +} + +export function mapRollupValidationRequestsToNoir( + rollupValidationRequests: RollupValidationRequests, +): RollupValidationRequestsNoir { + return { + max_block_number: mapMaxBlockNumberToNoir(rollupValidationRequests.maxBlockNumber), + }; +} + +export function mapRollupValidationRequestsFromNoir( + rollupValidationRequests: RollupValidationRequestsNoir, +): RollupValidationRequests { + return new RollupValidationRequests(mapMaxBlockNumberFromNoir(rollupValidationRequests.max_block_number)); +} + +export function mapRevertCodeFromNoir(revertCode: NoirField): RevertCode { + return RevertCode.fromField(mapFieldFromNoir(revertCode)); +} + +export function mapRevertCodeToNoir(revertCode: RevertCode): NoirField { + return mapFieldToNoir(revertCode.toField()); +} + +export function mapKernelCircuitPublicInputsFromNoir(inputs: KernelCircuitPublicInputsNoir) { + return new KernelCircuitPublicInputs( + mapRollupValidationRequestsFromNoir(inputs.rollup_validation_requests), + mapCombinedAccumulatedDataFromNoir(inputs.end), + mapCombinedConstantDataFromNoir(inputs.constants), + mapPartialStateReferenceFromNoir(inputs.start_state), + mapRevertCodeFromNoir(inputs.revert_code), + mapGasFromNoir(inputs.gas_used), + mapAztecAddressFromNoir(inputs.fee_payer), + ); +} diff --git a/yarn-project/noir-protocol-circuits-types/src/type_conversion.test.ts b/yarn-project/noir-protocol-circuits-types/src/conversion/type_conversion.test.ts similarity index 95% rename from yarn-project/noir-protocol-circuits-types/src/type_conversion.test.ts rename to yarn-project/noir-protocol-circuits-types/src/conversion/type_conversion.test.ts index 7bb7d82cd389..02fadc4d3475 100644 --- a/yarn-project/noir-protocol-circuits-types/src/type_conversion.test.ts +++ b/yarn-project/noir-protocol-circuits-types/src/conversion/type_conversion.test.ts @@ -1,6 +1,7 @@ import { AztecAddress, EthAddress, Fr, FunctionData, FunctionSelector, Point } from '@aztec/circuits.js'; import { makeHeader } from '@aztec/circuits.js/testing'; +import { mapFunctionDataFromNoir, mapFunctionDataToNoir } from './client.js'; import { mapAztecAddressFromNoir, mapAztecAddressToNoir, @@ -8,15 +9,13 @@ import { mapEthAddressToNoir, mapFieldFromNoir, mapFieldToNoir, - mapFunctionDataFromNoir, - mapFunctionDataToNoir, mapFunctionSelectorFromNoir, mapFunctionSelectorToNoir, mapHeaderFromNoir, mapHeaderToNoir, mapPointFromNoir, mapPointToNoir, -} from './type_conversion.js'; +} from './common.js'; describe('Noir<>Circuits.js type conversion test suite', () => { describe('Round trip', () => { diff --git a/yarn-project/noir-protocol-circuits-types/src/execution/client.ts b/yarn-project/noir-protocol-circuits-types/src/execution/client.ts index cfa768c17424..35dd960f42b9 100644 --- a/yarn-project/noir-protocol-circuits-types/src/execution/client.ts +++ b/yarn-project/noir-protocol-circuits-types/src/execution/client.ts @@ -8,14 +8,13 @@ import { type PrivateKernelTailCircuitPrivateInputs, type PrivateKernelTailCircuitPublicInputs, } from '@aztec/circuits.js'; +import { pushTestData } from '@aztec/foundation/testing'; import { type CompiledCircuit, type InputMap, Noir, type WitnessMap } from '@noir-lang/noir_js'; import { type Abi, abiDecode, abiEncode } from '@noir-lang/noirc_abi'; import { ClientCircuitArtifacts, SimulatedClientCircuitArtifacts } from '../artifacts/client.js'; -import { type PrivateResetArtifact } from '../private_kernel_reset_data.js'; import { - mapFieldToNoir, mapPrivateCallDataToNoir, mapPrivateCircuitPublicInputsToNoir, mapPrivateKernelCircuitPublicInputsFromNoir, @@ -25,7 +24,9 @@ import { mapPrivateKernelTailCircuitPublicInputsForPublicFromNoir, mapPrivateKernelTailCircuitPublicInputsForRollupFromNoir, mapTxRequestToNoir, -} from '../type_conversion.js'; +} from '../conversion/client.js'; +import { mapFieldToNoir } from '../conversion/common.js'; +import { type PrivateResetArtifact } from '../private_kernel_reset_data.js'; import { type PrivateKernelInitReturnType, type PrivateKernelInnerReturnType, @@ -37,22 +38,12 @@ import { PrivateKernelTailToPublic as executePrivateKernelTailToPublicWithACVM, PrivateKernelTail as executePrivateKernelTailWithACVM, } from '../types/index.js'; +import { foreignCallHandler } from '../utils/client/foreign_call_handler.js'; import { type DecodedInputs } from '../utils/decoded_inputs.js'; -import { foreignCallHandler } from '../utils/foreign_call_handler.js'; import { getPrivateKernelResetArtifactName } from '../utils/private_kernel_reset.js'; /* eslint-disable camelcase */ -// Utility function with self-contained dynamic imports, so it can be stripped from browser bundles -// This is only ever used in testing, so it's safe to do so -/* testing-only-start */ -async function updateProtocolCircuitSampleInputs(circuitName: string, inputs: any) { - const { updateProtocolCircuitSampleInputs } = await import('@aztec/foundation/testing/files'); - const TOML = await import('@iarna/toml'); - updateProtocolCircuitSampleInputs(circuitName, TOML.stringify(inputs)); -} -/* testing-only-end */ - /** * Executes the init private kernel. * @param privateKernelInitCircuitPrivateInputs - The private inputs to the initial private kernel. @@ -72,10 +63,7 @@ export async function executeInit( ), }; - // Allow bundlers to remove this code - /* testing-only-start */ - await updateProtocolCircuitSampleInputs('private-kernel-init', inputs); - /* testing-only-end */ + pushTestData('private-kernel-init', inputs); const returnType = await executePrivateKernelInitWithACVM( inputs.tx_request, @@ -110,10 +98,7 @@ export async function executeInner( ), }; - // Allow bundlers to remove this code - /* testing-only-start */ - await updateProtocolCircuitSampleInputs('private-kernel-inner', inputs); - /* testing-only-end */ + pushTestData('private-kernel-inner', inputs); const returnType = await executePrivateKernelInnerWithACVM( inputs.previous_kernel, @@ -155,7 +140,7 @@ export async function executeReset< const artifact = SimulatedClientCircuitArtifacts[getPrivateKernelResetArtifactName(dimensions)]; const program = new Noir(artifact as CompiledCircuit); if (untrimmedPrivateKernelResetCircuitPrivateInputs) { - await updateResetCircuitSampleInputs(untrimmedPrivateKernelResetCircuitPrivateInputs); + updateResetCircuitSampleInputs(untrimmedPrivateKernelResetCircuitPrivateInputs); } const args: InputMap = { previous_kernel: mapPrivateKernelDataToNoir(privateKernelResetCircuitPrivateInputs.previousKernel), @@ -181,10 +166,7 @@ export async function executeTail( previous_kernel_public_inputs: mapPrivateKernelCircuitPublicInputsToNoir(privateInputs.previousKernel.publicInputs), }; - // Allow bundlers to remove this code - /* testing-only-start */ - await updateProtocolCircuitSampleInputs('private-kernel-tail', inputs); - /* testing-only-end */ + pushTestData('private-kernel-tail', inputs); const returnType = await executePrivateKernelTailWithACVM( inputs.previous_kernel, @@ -209,10 +191,7 @@ export async function executeTailForPublic( previous_kernel_public_inputs: mapPrivateKernelCircuitPublicInputsToNoir(privateInputs.previousKernel.publicInputs), }; - // Allow bundlers to remove this code - /* testing-only-start */ - await updateProtocolCircuitSampleInputs('private-kernel-tail-to-public', inputs); - /* testing-only-end */ + pushTestData('private-kernel-tail-to-public', inputs); const returnType = await executePrivateKernelTailToPublicWithACVM( inputs.previous_kernel, @@ -420,7 +399,7 @@ export function convertPrivateKernelTailForPublicOutputsFromWitnessMap( return mapPrivateKernelTailCircuitPublicInputsForPublicFromNoir(returnType); } -async function updateResetCircuitSampleInputs( +function updateResetCircuitSampleInputs( privateKernelResetCircuitPrivateInputs: PrivateKernelResetCircuitPrivateInputs, ) { const inputs = { @@ -431,8 +410,5 @@ async function updateResetCircuitSampleInputs( hints: mapPrivateKernelResetHintsToNoir(privateKernelResetCircuitPrivateInputs.hints), }; - // Allow bundlers to remove this code - /* testing-only-start */ - await updateProtocolCircuitSampleInputs('private-kernel-reset', inputs); - /* testing-only-end */ + pushTestData('private-kernel-reset', inputs); } diff --git a/yarn-project/noir-protocol-circuits-types/src/execution/server.ts b/yarn-project/noir-protocol-circuits-types/src/execution/server.ts index 5396265eea0c..722172b9a1e7 100644 --- a/yarn-project/noir-protocol-circuits-types/src/execution/server.ts +++ b/yarn-project/noir-protocol-circuits-types/src/execution/server.ts @@ -1,23 +1,24 @@ import { - type BaseOrMergeRollupPublicInputs, type BaseParityInputs, + type KernelCircuitPublicInputs, + type ParityPublicInputs, + type PrivateKernelEmptyInputs, + type RootParityInputs, +} from '@aztec/circuits.js'; +import { + type BaseOrMergeRollupPublicInputs, type BlockMergeRollupInputs, type BlockRootOrBlockMergePublicInputs, type BlockRootRollupInputs, type EmptyBlockRootRollupInputs, - type KernelCircuitPublicInputs, type MergeRollupInputs, - type ParityPublicInputs, type PrivateBaseRollupInputs, - type PrivateKernelEmptyInputs, type PublicBaseRollupInputs, - type RootParityInputs, type RootRollupInputs, type RootRollupPublicInputs, -} from '@aztec/circuits.js'; -import { updateProtocolCircuitSampleInputs } from '@aztec/foundation/testing/files'; +} from '@aztec/circuits.js/rollup'; +import { pushTestData } from '@aztec/foundation/testing'; -import TOML from '@iarna/toml'; import { type WitnessMap } from '@noir-lang/acvm_js'; import { abiDecode, abiEncode } from '@noir-lang/noirc_abi'; @@ -38,7 +39,7 @@ import { mapRootParityInputsToNoir, mapRootRollupInputsToNoir, mapRootRollupPublicInputsFromNoir, -} from '../type_conversion.js'; +} from '../conversion/server.js'; import { type ParityBaseReturnType, type ParityRootReturnType, @@ -89,7 +90,7 @@ export function convertPrivateBaseRollupInputsToWitnessMap(inputs: PrivateBaseRo export function convertSimulatedPrivateBaseRollupInputsToWitnessMap(inputs: PrivateBaseRollupInputs): WitnessMap { const mapped = mapPrivateBaseRollupInputsToNoir(inputs); - updateProtocolCircuitSampleInputs('rollup-base-private', TOML.stringify({ inputs: mapped })); + pushTestData('rollup-base-private', { inputs: mapped }); const initialWitnessMap = abiEncode(SimulatedServerCircuitArtifacts.PrivateBaseRollupArtifact.abi, { inputs: mapped as any, }); @@ -104,7 +105,7 @@ export function convertPublicBaseRollupInputsToWitnessMap(inputs: PublicBaseRoll export function convertSimulatedPublicBaseRollupInputsToWitnessMap(inputs: PublicBaseRollupInputs): WitnessMap { const mapped = mapPublicBaseRollupInputsToNoir(inputs); - updateProtocolCircuitSampleInputs('rollup-base-public', TOML.stringify({ inputs: mapped })); + pushTestData('rollup-base-public', { inputs: mapped }); const initialWitnessMap = abiEncode(SimulatedServerCircuitArtifacts.PublicBaseRollupArtifact.abi, { inputs: mapped as any, }); @@ -118,7 +119,7 @@ export function convertSimulatedPublicBaseRollupInputsToWitnessMap(inputs: Publi */ export function convertMergeRollupInputsToWitnessMap(inputs: MergeRollupInputs): WitnessMap { const mapped = mapMergeRollupInputsToNoir(inputs); - updateProtocolCircuitSampleInputs('rollup-merge', TOML.stringify({ inputs: mapped })); + pushTestData('rollup-merge', { inputs: mapped }); const initialWitnessMap = abiEncode(ServerCircuitArtifacts.MergeRollupArtifact.abi, { inputs: mapped as any }); return initialWitnessMap; } @@ -130,7 +131,7 @@ export function convertMergeRollupInputsToWitnessMap(inputs: MergeRollupInputs): */ export function convertBlockRootRollupInputsToWitnessMap(inputs: BlockRootRollupInputs): WitnessMap { const mapped = mapBlockRootRollupInputsToNoir(inputs); - updateProtocolCircuitSampleInputs('rollup-block-root', TOML.stringify({ inputs: mapped })); + pushTestData('rollup-block-root', { inputs: mapped }); const initialWitnessMap = abiEncode(ServerCircuitArtifacts.BlockRootRollupArtifact.abi, { inputs: mapped as any }); return initialWitnessMap; } @@ -142,7 +143,7 @@ export function convertBlockRootRollupInputsToWitnessMap(inputs: BlockRootRollup */ export function convertSimulatedBlockRootRollupInputsToWitnessMap(inputs: BlockRootRollupInputs): WitnessMap { const mapped = mapBlockRootRollupInputsToNoir(inputs); - updateProtocolCircuitSampleInputs('rollup-block-root', TOML.stringify({ inputs: mapped })); + pushTestData('rollup-block-root', { inputs: mapped }); const initialWitnessMap = abiEncode(SimulatedServerCircuitArtifacts.BlockRootRollupArtifact.abi, { inputs: mapped as any, }); @@ -169,7 +170,7 @@ export function convertEmptyBlockRootRollupInputsToWitnessMap(inputs: EmptyBlock */ export function convertBlockMergeRollupInputsToWitnessMap(inputs: BlockMergeRollupInputs): WitnessMap { const mapped = mapBlockMergeRollupInputsToNoir(inputs); - updateProtocolCircuitSampleInputs('rollup-block-merge', TOML.stringify({ inputs: mapped })); + pushTestData('rollup-block-merge', { inputs: mapped }); const initialWitnessMap = abiEncode(ServerCircuitArtifacts.BlockMergeRollupArtifact.abi, { inputs: mapped as any }); return initialWitnessMap; } @@ -181,7 +182,7 @@ export function convertBlockMergeRollupInputsToWitnessMap(inputs: BlockMergeRoll */ export function convertRootRollupInputsToWitnessMap(inputs: RootRollupInputs): WitnessMap { const mapped = mapRootRollupInputsToNoir(inputs); - updateProtocolCircuitSampleInputs('rollup-root', TOML.stringify({ inputs: mapped })); + pushTestData('rollup-root', { inputs: mapped }); const initialWitnessMap = abiEncode(ServerCircuitArtifacts.RootRollupArtifact.abi, { inputs: mapped as any }); return initialWitnessMap; } diff --git a/yarn-project/noir-protocol-circuits-types/src/index.ts b/yarn-project/noir-protocol-circuits-types/src/index.ts index 22bb7a5a0415..553be46a7def 100644 --- a/yarn-project/noir-protocol-circuits-types/src/index.ts +++ b/yarn-project/noir-protocol-circuits-types/src/index.ts @@ -3,5 +3,5 @@ export * from './execution/index.js'; export { getPrivateKernelResetArtifactName } from './utils/private_kernel_reset.js'; export { maxPrivateKernelResetDimensions, privateKernelResetDimensionsConfig } from './private_kernel_reset_data.js'; -export { foreignCallHandler } from './utils/foreign_call_handler.js'; +export { foreignCallHandler } from './utils/server/foreign_call_handler.js'; export * from './vks.js'; diff --git a/yarn-project/noir-protocol-circuits-types/src/scripts/cleanup_artifacts.ts b/yarn-project/noir-protocol-circuits-types/src/scripts/cleanup_artifacts.ts new file mode 100644 index 000000000000..1317b093ee60 --- /dev/null +++ b/yarn-project/noir-protocol-circuits-types/src/scripts/cleanup_artifacts.ts @@ -0,0 +1,19 @@ +import { fileURLToPath } from '@aztec/foundation/url'; + +import { readFile, readdir, writeFile } from 'fs/promises'; +import { join } from 'path'; + +async function cleanupArtifacts(target: string) { + const files = await readdir(target); + for (const file of files) { + if (!file.endsWith('.json')) { + continue; + } + const fileData = JSON.parse((await readFile(join(target, file), 'utf8')).toString()); + fileData.file_map = {}; + fileData.debug_symbols = {}; + await writeFile(join(target, file), JSON.stringify(fileData)); + } +} + +await cleanupArtifacts(fileURLToPath(new URL('../../artifacts', import.meta.url).href)); diff --git a/yarn-project/noir-protocol-circuits-types/src/type_conversion.ts b/yarn-project/noir-protocol-circuits-types/src/type_conversion.ts deleted file mode 100644 index e6dcafdeee51..000000000000 --- a/yarn-project/noir-protocol-circuits-types/src/type_conversion.ts +++ /dev/null @@ -1,2373 +0,0 @@ -import { - type AVM_PROOF_LENGTH_IN_FIELDS, - AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, - AZTEC_MAX_EPOCH_DURATION, - AppendOnlyTreeSnapshot, - type AvmAccumulatedData, - type AvmCircuitPublicInputs, - type AvmProofData, - AztecAddress, - BLOBS_PER_BLOCK, - BaseOrMergeRollupPublicInputs, - type BaseParityInputs, - BlobPublicInputs, - BlockBlobPublicInputs, - BlockHeader, - type BlockMergeRollupInputs, - BlockRootOrBlockMergePublicInputs, - type BlockRootRollupInputs, - CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS, - CallContext, - CombinedAccumulatedData, - CombinedConstantData, - ConstantRollupData, - ContentCommitment, - CountedPublicCallRequest, - type EmptyBlockRootRollupInputs, - type EmptyNestedData, - EthAddress, - FeeRecipient, - Fr, - FunctionData, - FunctionSelector, - Gas, - GasFees, - GasSettings, - GlobalVariables, - GrumpkinScalar, - HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS, - KernelCircuitPublicInputs, - type KeyValidationHint, - KeyValidationRequest, - KeyValidationRequestAndGenerator, - L2ToL1Message, - LogHash, - MAX_CONTRACT_CLASS_LOGS_PER_TX, - MAX_ENQUEUED_CALLS_PER_TX, - MAX_KEY_VALIDATION_REQUESTS_PER_TX, - MAX_L2_TO_L1_MSGS_PER_TX, - MAX_NOTE_HASHES_PER_TX, - MAX_NOTE_HASH_READ_REQUESTS_PER_TX, - MAX_NULLIFIERS_PER_TX, - MAX_NULLIFIER_READ_REQUESTS_PER_TX, - MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, - MAX_PRIVATE_LOGS_PER_TX, - MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - MAX_UNENCRYPTED_LOGS_PER_TX, - MaxBlockNumber, - type MembershipWitness, - type MergeRollupInputs, - type NESTED_RECURSIVE_PROOF_LENGTH, - type NOTE_HASH_TREE_HEIGHT, - type NULLIFIER_TREE_HEIGHT, - NUM_BYTES_PER_SHA256, - NoteHash, - type NoteHashReadRequestHints, - Nullifier, - type NullifierLeafPreimage, - type NullifierReadRequestHints, - OptionalNumber, - type PUBLIC_DATA_TREE_HEIGHT, - ParityPublicInputs, - PartialPrivateTailPublicInputsForPublic, - PartialPrivateTailPublicInputsForRollup, - PartialStateReference, - type PendingReadHint, - Point, - Poseidon2Sponge, - type PreviousRollupBlockData, - type PreviousRollupData, - PrivateAccumulatedData, - type PrivateBaseRollupInputs, - type PrivateBaseStateDiffHints, - type PrivateCallData, - PrivateCallRequest, - type PrivateCircuitPublicInputs, - PrivateKernelCircuitPublicInputs, - type PrivateKernelData, - type PrivateKernelEmptyInputs, - type PrivateKernelResetHints, - PrivateKernelTailCircuitPublicInputs, - PrivateLog, - PrivateLogData, - type PrivateToAvmAccumulatedData, - type PrivateToAvmAccumulatedDataArrayLengths, - PrivateToPublicAccumulatedData, - type PrivateToPublicKernelCircuitPublicInputs, - type PrivateTubeData, - PrivateValidationRequests, - type PublicBaseRollupInputs, - type PublicBaseStateDiffHints, - PublicCallRequest, - type PublicDataHint, - type PublicDataTreeLeafPreimage, - PublicDataWrite, - type PublicKeys, - type PublicTubeData, - type RECURSIVE_PROOF_LENGTH, - ReadRequest, - type ReadRequestStatus, - type RecursiveProof, - RevertCode, - RollupValidationRequests, - type RootParityInput, - type RootParityInputs, - type RootRollupInputs, - RootRollupPublicInputs, - ScopedKeyValidationRequestAndGenerator, - ScopedL2ToL1Message, - ScopedLogHash, - ScopedNoteHash, - ScopedNullifier, - ScopedPrivateLogData, - ScopedReadRequest, - type SettledReadHint, - SpongeBlob, - StateReference, - type TUBE_PROOF_LENGTH, - type TransientDataIndexHint, - type TreeSnapshots, - TxConstantData, - TxContext, - type TxRequest, - type VerificationKeyAsFields, - type VkWitnessData, -} from '@aztec/circuits.js'; -import { toBufferBE, toHex } from '@aztec/foundation/bigint-buffer'; -import { type Tuple, mapTuple, toTruncField } from '@aztec/foundation/serialize'; - -import type { - AppendOnlyTreeSnapshot as AppendOnlyTreeSnapshotNoir, - AvmAccumulatedData as AvmAccumulatedDataNoir, - AvmCircuitPublicInputs as AvmCircuitPublicInputsNoir, - AvmProofData as AvmProofDataNoir, - BaseOrMergeRollupPublicInputs as BaseOrMergeRollupPublicInputsNoir, - BaseParityInputs as BaseParityInputsNoir, - BigNum, - BlobCommitment as BlobCommitmentNoir, - BlobPublicInputs as BlobPublicInputsNoir, - BlockBlobPublicInputs as BlockBlobPublicInputsNoir, - BlockHeader as BlockHeaderNoir, - BlockMergeRollupInputs as BlockMergeRollupInputsNoir, - BlockRootOrBlockMergePublicInputs as BlockRootOrBlockMergePublicInputsNoir, - BlockRootRollupInputs as BlockRootRollupInputsNoir, - CallContext as CallContextNoir, - CombinedAccumulatedData as CombinedAccumulatedDataNoir, - CombinedConstantData as CombinedConstantDataNoir, - ConstantRollupData as ConstantRollupDataNoir, - ContentCommitment as ContentCommitmentNoir, - Counted as CountedPublicCallRequestNoir, - EmptyBlockRootRollupInputs as EmptyBlockRootRollupInputsNoir, - EmptyNestedCircuitPublicInputs as EmptyNestedDataNoir, - FeeRecipient as FeeRecipientNoir, - Field, - FixedLengthArray, - FunctionData as FunctionDataNoir, - FunctionSelector as FunctionSelectorNoir, - GasFees as GasFeesNoir, - Gas as GasNoir, - GasSettings as GasSettingsNoir, - GlobalVariables as GlobalVariablesNoir, - EmbeddedCurveScalar as GrumpkinScalarNoir, - KernelCircuitPublicInputs as KernelCircuitPublicInputsNoir, - KeyValidationHint as KeyValidationHintNoir, - KeyValidationRequestAndGenerator as KeyValidationRequestAndGeneratorNoir, - KeyValidationRequest as KeyValidationRequestsNoir, - L2ToL1Message as L2ToL1MessageNoir, - LogHash as LogHashNoir, - MaxBlockNumber as MaxBlockNumberNoir, - MembershipWitness as MembershipWitnessNoir, - MergeRollupInputs as MergeRollupInputsNoir, - AztecAddress as NoirAztecAddress, - EthAddress as NoirEthAddress, - Field as NoirField, - EmbeddedCurvePoint as NoirPoint, - NoteHashLeafPreimage as NoteHashLeafPreimageNoir, - NoteHash as NoteHashNoir, - NoteHashReadRequestHints as NoteHashReadRequestHintsNoir, - NoteHashSettledReadHint as NoteHashSettledReadHintNoir, - NullifierLeafPreimage as NullifierLeafPreimageNoir, - Nullifier as NullifierNoir, - NullifierReadRequestHints as NullifierReadRequestHintsNoir, - NullifierSettledReadHint as NullifierSettledReadHintNoir, - Option as OptionalNumberNoir, - ParityPublicInputs as ParityPublicInputsNoir, - RootParityInput as ParityRootParityInputNoir, - PartialStateReference as PartialStateReferenceNoir, - PendingReadHint as PendingReadHintNoir, - Poseidon2 as Poseidon2SpongeNoir, - PreviousRollupBlockData as PreviousRollupBlockDataNoir, - PreviousRollupData as PreviousRollupDataNoir, - PrivateAccumulatedData as PrivateAccumulatedDataNoir, - PrivateBaseRollupInputs as PrivateBaseRollupInputsNoir, - PrivateBaseStateDiffHints as PrivateBaseStateDiffHintsNoir, - PrivateCallDataWithoutPublicInputs as PrivateCallDataWithoutPublicInputsNoir, - PrivateCallRequest as PrivateCallRequestNoir, - PrivateCircuitPublicInputs as PrivateCircuitPublicInputsNoir, - PrivateKernelCircuitPublicInputs as PrivateKernelCircuitPublicInputsNoir, - PrivateKernelDataWithoutPublicInputs as PrivateKernelDataWithoutPublicInputsNoir, - PrivateKernelEmptyPrivateInputs as PrivateKernelEmptyPrivateInputsNoir, - PrivateKernelResetHints as PrivateKernelResetHintsNoir, - PrivateLogData as PrivateLogDataNoir, - Log as PrivateLogNoir, - PrivateToAvmAccumulatedDataArrayLengths as PrivateToAvmAccumulatedDataArrayLengthsNoir, - PrivateToAvmAccumulatedData as PrivateToAvmAccumulatedDataNoir, - PrivateToPublicAccumulatedData as PrivateToPublicAccumulatedDataNoir, - PrivateToPublicKernelCircuitPublicInputs as PrivateToPublicKernelCircuitPublicInputsNoir, - PrivateTubeData as PrivateTubeDataNoir, - PrivateValidationRequests as PrivateValidationRequestsNoir, - PublicBaseRollupInputs as PublicBaseRollupInputsNoir, - PublicBaseStateDiffHints as PublicBaseStateDiffHintsNoir, - PublicCallRequest as PublicCallRequestNoir, - PublicDataHint as PublicDataHintNoir, - PublicDataTreeLeafPreimage as PublicDataTreeLeafPreimageNoir, - PublicDataWrite as PublicDataWriteNoir, - PublicKeys as PublicKeysNoir, - PublicTubeData as PublicTubeDataNoir, - ReadRequest as ReadRequestNoir, - ReadRequestStatus as ReadRequestStatusNoir, - RollupValidationRequests as RollupValidationRequestsNoir, - RootParityInputs as RootParityInputsNoir, - RootRollupInputs as RootRollupInputsNoir, - RootRollupParityInput as RootRollupParityInputNoir, - RootRollupPublicInputs as RootRollupPublicInputsNoir, - ScopedKeyValidationRequestAndGenerator as ScopedKeyValidationRequestAndGeneratorNoir, - ScopedL2ToL1Message as ScopedL2ToL1MessageNoir, - ScopedLogHash as ScopedLogHashNoir, - ScopedNoteHash as ScopedNoteHashNoir, - ScopedNullifier as ScopedNullifierNoir, - Scoped as ScopedPrivateLogDataNoir, - ScopedReadRequest as ScopedReadRequestNoir, - SpongeBlob as SpongeBlobNoir, - StateReference as StateReferenceNoir, - TransientDataIndexHint as TransientDataIndexHintNoir, - TreeSnapshots as TreeSnapshotsNoir, - TxConstantData as TxConstantDataNoir, - TxContext as TxContextNoir, - TxRequest as TxRequestNoir, - VerificationKey as VerificationKeyNoir, - VkData as VkDataNoir, -} from './types/index.js'; - -/* eslint-disable camelcase */ - -/** - * Maps a field to a noir field. - * @param field - The field. - * @returns The noir field. - */ -export function mapFieldToNoir(field: Fr): NoirField { - return field.toString(); -} - -/** - * Maps a noir field to a fr. - * @param field - The noir field. - * @returns The fr. - */ -export function mapFieldFromNoir(field: NoirField): Fr { - return Fr.fromHexString(field); -} - -/** Maps a field to a noir wrapped field type (ie any type implemented as struct with an inner Field). */ -export function mapWrappedFieldToNoir(field: Fr): { inner: NoirField } { - return { inner: mapFieldToNoir(field) }; -} - -/** Maps a noir wrapped field type (ie any type implemented as struct with an inner Field) to a typescript field. */ -export function mapWrappedFieldFromNoir(wrappedField: { inner: NoirField }): Fr { - return mapFieldFromNoir(wrappedField.inner); -} - -/** - * Maps a number coming from noir. - * @param number - The field representing the number. - * @returns The number - */ -export function mapNumberFromNoir(number: NoirField): number { - return Number(Fr.fromHexString(number).toBigInt()); -} - -export function mapNumberToNoir(number: number): NoirField { - return new Fr(BigInt(number)).toString(); -} - -/** - * Maps a BigNum coming to/from noir. - * TODO(): Is BigInt the best way to represent this? - * @param number - The BigNum representing the number. - * @returns The number - */ -export function mapBLS12BigNumFromNoir(bignum: BigNum): bigint { - // TODO(Miranda): there's gotta be a better way to convert this - const paddedLimbs = [ - `0x` + bignum.limbs[2].substring(2).padStart(4, '0'), - bignum.limbs[1].substring(2).padStart(30, '0'), - bignum.limbs[0].substring(2).padStart(30, '0'), - ]; - return BigInt(paddedLimbs[0].concat(paddedLimbs[1], paddedLimbs[2])); -} - -export function mapBLS12BigNumToNoir(number: bigint): BigNum { - const hex = toHex(number, true); - return { - limbs: ['0x' + hex.substring(36), '0x' + hex.substring(6, 36), hex.substring(0, 6)], - }; -} - -/** - * Maps a point to a noir point. - * @param point - The point. - * @returns The noir point. - */ -export function mapPointToNoir(point: Point): NoirPoint { - return { - x: mapFieldToNoir(point.x), - y: mapFieldToNoir(point.y), - is_infinite: point.isInfinite, - }; -} - -/** - * Maps a noir point to a point. - * @param point - The noir point. - * @returns The point. - */ -export function mapPointFromNoir(point: NoirPoint): Point { - return new Point(mapFieldFromNoir(point.x), mapFieldFromNoir(point.y), point.is_infinite); -} - -/** - * Maps a GrumpkinScalar to a noir GrumpkinScalar. - * @param privateKey - The GrumpkinScalar. - * @returns The noir GrumpkinScalar. - */ -export function mapGrumpkinScalarToNoir(privateKey: GrumpkinScalar): GrumpkinScalarNoir { - return { - hi: mapFieldToNoir(privateKey.hi), - lo: mapFieldToNoir(privateKey.lo), - }; -} - -/** - * Maps a KeyValidationHint to noir. - * @param hint - The key validation hint. - * @returns The key validation hint mapped to noir types. - */ -export function mapKeyValidationHintToNoir(hint: KeyValidationHint): KeyValidationHintNoir { - return { - sk_m: mapGrumpkinScalarToNoir(hint.skM), - request_index: mapNumberToNoir(hint.requestIndex), - }; -} - -/** - * Maps a noir GrumpkinScalar to a GrumpkinScalar. - * @param privateKey - The noir GrumpkinScalar. - * @returns The GrumpkinScalar. - */ -export function mapGrumpkinScalarFromNoir(privateKey: GrumpkinScalarNoir): GrumpkinScalar { - return GrumpkinScalar.fromHighLow(mapFieldFromNoir(privateKey.hi), mapFieldFromNoir(privateKey.lo)); -} - -/** - * Maps an aztec address to a noir aztec address. - * @param address - The address. - * @returns The noir aztec address. - */ -export function mapAztecAddressToNoir(address: AztecAddress): NoirAztecAddress { - return { - inner: mapFieldToNoir(address.toField()), - }; -} - -/** - * Maps a noir aztec address to an aztec address. - * @param address - The noir aztec address. - * @returns The aztec address. - */ -export function mapAztecAddressFromNoir(address: NoirAztecAddress): AztecAddress { - return AztecAddress.fromField(mapFieldFromNoir(address.inner)); -} - -/** - * Maps an eth address to a noir eth address. - * @param address - The address. - * @returns The noir eth address. - */ -export function mapEthAddressToNoir(address: EthAddress): NoirEthAddress { - return { - inner: mapFieldToNoir(address.toField()), - }; -} - -/** - * Maps a noir eth address to an eth address. - * @param address - The noir eth address. - * @returns The eth address. - */ -export function mapEthAddressFromNoir(address: NoirEthAddress): EthAddress { - return EthAddress.fromField(mapFieldFromNoir(address.inner)); -} - -/** - * Maps a tx context to a noir tx context. - * @param txContext - The tx context. - * @returns The noir tx context. - */ -export function mapTxContextToNoir(txContext: TxContext): TxContextNoir { - return { - chain_id: mapFieldToNoir(txContext.chainId), - version: mapFieldToNoir(txContext.version), - gas_settings: mapGasSettingsToNoir(txContext.gasSettings), - }; -} - -/** - * Maps a noir tx context to a tx context. - * @param txContext - The noir tx context. - * @returns The tx context. - */ -export function mapTxContextFromNoir(txContext: TxContextNoir): TxContext { - return new TxContext( - mapFieldFromNoir(txContext.chain_id), - mapFieldFromNoir(txContext.version), - mapGasSettingsFromNoir(txContext.gas_settings), - ); -} - -/** - * Maps a function selector to a noir function selector. - * @param functionSelector - The function selector. - * @returns The noir function selector. - */ -export function mapFunctionSelectorToNoir(functionSelector: FunctionSelector): FunctionSelectorNoir { - return { - inner: mapFieldToNoir(functionSelector.toField()), - }; -} - -/** - * Maps a noir function selector to a function selector. - * @param functionSelector - The noir function selector. - * @returns The function selector. - */ -export function mapFunctionSelectorFromNoir(functionSelector: FunctionSelectorNoir): FunctionSelector { - return FunctionSelector.fromField(mapFieldFromNoir(functionSelector.inner)); -} - -/** - * Maps a function data to a noir function data. - * @param functionData - The function data. - * @returns The noir function data. - */ -export function mapFunctionDataToNoir(functionData: FunctionData): FunctionDataNoir { - return { - selector: mapFunctionSelectorToNoir(functionData.selector), - is_private: functionData.isPrivate, - }; -} - -/** - * Maps a noir function data to a function data. - * @param functionData - The noir function data. - * @returns The function data. - */ -export function mapFunctionDataFromNoir(functionData: FunctionDataNoir): FunctionData { - return new FunctionData(mapFunctionSelectorFromNoir(functionData.selector), functionData.is_private); -} - -/** - * Maps a tx request to a noir tx request. - * @param txRequest - The tx request. - * @returns The noir tx request. - */ -export function mapTxRequestToNoir(txRequest: TxRequest): TxRequestNoir { - return { - origin: mapAztecAddressToNoir(txRequest.origin), - args_hash: mapFieldToNoir(txRequest.argsHash), - tx_context: mapTxContextToNoir(txRequest.txContext), - function_data: mapFunctionDataToNoir(txRequest.functionData), - }; -} - -/** - * Maps a call context to a noir call context. - * @param callContext - The call context. - * @returns The noir call context. - */ -export function mapCallContextFromNoir(callContext: CallContextNoir): CallContext { - return new CallContext( - mapAztecAddressFromNoir(callContext.msg_sender), - mapAztecAddressFromNoir(callContext.contract_address), - mapFunctionSelectorFromNoir(callContext.function_selector), - callContext.is_static_call, - ); -} - -/** - * Maps a call context to a noir call context. - * @param callContext - The call context. - * @returns The noir call context. - */ -export function mapCallContextToNoir(callContext: CallContext): CallContextNoir { - return { - msg_sender: mapAztecAddressToNoir(callContext.msgSender), - contract_address: mapAztecAddressToNoir(callContext.contractAddress), - function_selector: mapFunctionSelectorToNoir(callContext.functionSelector), - is_static_call: callContext.isStaticCall, - }; -} - -export function mapGasSettingsFromNoir(gasSettings: GasSettingsNoir): GasSettings { - return new GasSettings( - mapGasFromNoir(gasSettings.gas_limits), - mapGasFromNoir(gasSettings.teardown_gas_limits), - mapGasFeesFromNoir(gasSettings.max_fees_per_gas), - mapGasFeesFromNoir(gasSettings.max_priority_fees_per_gas), - ); -} - -export function mapGasSettingsToNoir(gasSettings: GasSettings): GasSettingsNoir { - return { - gas_limits: mapGasToNoir(gasSettings.gasLimits), - teardown_gas_limits: mapGasToNoir(gasSettings.teardownGasLimits), - max_fees_per_gas: mapGasFeesToNoir(gasSettings.maxFeesPerGas), - max_priority_fees_per_gas: mapGasFeesToNoir(gasSettings.maxPriorityFeesPerGas), - }; -} - -function mapPrivateCallRequestFromNoir(callRequest: PrivateCallRequestNoir) { - return new PrivateCallRequest( - mapCallContextFromNoir(callRequest.call_context), - mapFieldFromNoir(callRequest.args_hash), - mapFieldFromNoir(callRequest.returns_hash), - mapNumberFromNoir(callRequest.start_side_effect_counter), - mapNumberFromNoir(callRequest.end_side_effect_counter), - ); -} - -function mapPrivateCallRequestToNoir(callRequest: PrivateCallRequest): PrivateCallRequestNoir { - return { - call_context: mapCallContextToNoir(callRequest.callContext), - args_hash: mapFieldToNoir(callRequest.argsHash), - returns_hash: mapFieldToNoir(callRequest.returnsHash), - start_side_effect_counter: mapNumberToNoir(callRequest.startSideEffectCounter), - end_side_effect_counter: mapNumberToNoir(callRequest.endSideEffectCounter), - }; -} - -function mapPublicCallRequestFromNoir(request: PublicCallRequestNoir) { - return new PublicCallRequest( - mapAztecAddressFromNoir(request.msg_sender), - mapAztecAddressFromNoir(request.contract_address), - mapFunctionSelectorFromNoir(request.function_selector), - request.is_static_call, - mapFieldFromNoir(request.args_hash), - ); -} - -function mapPublicCallRequestToNoir(request: PublicCallRequest): PublicCallRequestNoir { - return { - msg_sender: mapAztecAddressToNoir(request.msgSender), - contract_address: mapAztecAddressToNoir(request.contractAddress), - function_selector: mapFunctionSelectorToNoir(request.functionSelector), - is_static_call: request.isStaticCall, - args_hash: mapFieldToNoir(request.argsHash), - }; -} - -function mapCountedPublicCallRequestFromNoir(request: CountedPublicCallRequestNoir) { - return new CountedPublicCallRequest(mapPublicCallRequestFromNoir(request.inner), mapNumberFromNoir(request.counter)); -} - -function mapCountedPublicCallRequestToNoir(request: CountedPublicCallRequest): CountedPublicCallRequestNoir { - return { - inner: mapPublicCallRequestToNoir(request.inner), - counter: mapNumberToNoir(request.counter), - }; -} - -function mapNoteHashToNoir(noteHash: NoteHash): NoteHashNoir { - return { - value: mapFieldToNoir(noteHash.value), - counter: mapNumberToNoir(noteHash.counter), - }; -} - -function mapNoteHashFromNoir(noteHash: NoteHashNoir) { - return new NoteHash(mapFieldFromNoir(noteHash.value), mapNumberFromNoir(noteHash.counter)); -} - -function mapScopedNoteHashToNoir(noteHash: ScopedNoteHash): ScopedNoteHashNoir { - return { - note_hash: mapNoteHashToNoir(noteHash.noteHash), - contract_address: mapAztecAddressToNoir(noteHash.contractAddress), - }; -} - -function mapScopedNoteHashFromNoir(noteHash: ScopedNoteHashNoir) { - return new ScopedNoteHash( - mapNoteHashFromNoir(noteHash.note_hash), - mapAztecAddressFromNoir(noteHash.contract_address), - ); -} - -function mapNullifierToNoir(nullifier: Nullifier): NullifierNoir { - return { - value: mapFieldToNoir(nullifier.value), - counter: mapNumberToNoir(nullifier.counter), - note_hash: mapFieldToNoir(nullifier.noteHash), - }; -} - -function mapNullifierFromNoir(nullifier: NullifierNoir) { - return new Nullifier( - mapFieldFromNoir(nullifier.value), - mapNumberFromNoir(nullifier.counter), - mapFieldFromNoir(nullifier.note_hash), - ); -} - -function mapScopedNullifierToNoir(nullifier: ScopedNullifier): ScopedNullifierNoir { - return { - nullifier: mapNullifierToNoir(nullifier.nullifier), - contract_address: mapAztecAddressToNoir(nullifier.contractAddress), - }; -} - -function mapScopedNullifierFromNoir(nullifier: ScopedNullifierNoir) { - return new ScopedNullifier( - mapNullifierFromNoir(nullifier.nullifier), - mapAztecAddressFromNoir(nullifier.contract_address), - ); -} - -function mapPrivateLogToNoir(log: PrivateLog): PrivateLogNoir { - return { - fields: mapTuple(log.fields, mapFieldToNoir), - }; -} - -function mapPrivateLogFromNoir(log: PrivateLogNoir) { - return new PrivateLog(mapTupleFromNoir(log.fields, log.fields.length, mapFieldFromNoir)); -} - -function mapPrivateLogDataToNoir(data: PrivateLogData): PrivateLogDataNoir { - return { - log: mapPrivateLogToNoir(data.log), - note_hash_counter: mapNumberToNoir(data.noteHashCounter), - counter: mapNumberToNoir(data.counter), - }; -} - -function mapPrivateLogDataFromNoir(data: PrivateLogDataNoir) { - return new PrivateLogData( - mapPrivateLogFromNoir(data.log), - mapNumberFromNoir(data.note_hash_counter), - mapNumberFromNoir(data.counter), - ); -} - -function mapScopedPrivateLogDataToNoir(data: ScopedPrivateLogData): ScopedPrivateLogDataNoir { - return { - inner: mapPrivateLogDataToNoir(data.inner), - contract_address: mapAztecAddressToNoir(data.contractAddress), - }; -} - -function mapScopedPrivateLogDataFromNoir(data: ScopedPrivateLogDataNoir) { - return new ScopedPrivateLogData( - mapPrivateLogDataFromNoir(data.inner), - mapAztecAddressFromNoir(data.contract_address), - ); -} - -/** - * Maps a LogHash to a noir LogHash. - * @param logHash - The LogHash. - * @returns The noir log hash. - */ -function mapLogHashToNoir(logHash: LogHash): LogHashNoir { - return { - value: mapFieldToNoir(logHash.value), - counter: mapNumberToNoir(logHash.counter), - length: mapFieldToNoir(logHash.length), - }; -} - -/** - * Maps a noir LogHash to a LogHash. - * @param logHash - The noir LogHash. - * @returns The TS log hash. - */ -function mapLogHashFromNoir(logHash: LogHashNoir): LogHash { - return new LogHash( - mapFieldFromNoir(logHash.value), - mapNumberFromNoir(logHash.counter), - mapFieldFromNoir(logHash.length), - ); -} - -/** - * Maps a ts ScopedLogHash to a noir ScopedLogHash. - * @param logHash - The ts LogHash. - * @returns The noir log hash. - */ -function mapScopedLogHashToNoir(scopedLogHash: ScopedLogHash): ScopedLogHashNoir { - return { - log_hash: mapLogHashToNoir(scopedLogHash.logHash), - contract_address: mapAztecAddressToNoir(scopedLogHash.contractAddress), - }; -} - -/** - * Maps a noir ScopedLogHash to a ts ScopedLogHash. - * @param logHash - The noir LogHash. - * @returns The TS log hash. - */ -function mapScopedLogHashFromNoir(scopedLogHash: ScopedLogHashNoir): ScopedLogHash { - return new ScopedLogHash( - mapLogHashFromNoir(scopedLogHash.log_hash), - mapAztecAddressFromNoir(scopedLogHash.contract_address), - ); -} - -/** - * Maps a ReadRequest to a noir ReadRequest. - * @param readRequest - The read request. - * @returns The noir ReadRequest. - */ -function mapReadRequestToNoir(readRequest: ReadRequest): ReadRequestNoir { - return { - value: mapFieldToNoir(readRequest.value), - counter: mapNumberToNoir(readRequest.counter), - }; -} - -/** - * Maps a noir ReadRequest to ReadRequest. - * @param readRequest - The noir ReadRequest. - * @returns The TS ReadRequest. - */ -function mapReadRequestFromNoir(readRequest: ReadRequestNoir): ReadRequest { - return new ReadRequest(mapFieldFromNoir(readRequest.value), mapNumberFromNoir(readRequest.counter)); -} - -function mapScopedReadRequestToNoir(scopedReadRequest: ScopedReadRequest): ScopedReadRequestNoir { - return { - read_request: mapReadRequestToNoir(scopedReadRequest.readRequest), - contract_address: mapAztecAddressToNoir(scopedReadRequest.contractAddress), - }; -} - -/** - * Maps a noir ReadRequest to ReadRequest. - * @param readRequest - The noir ReadRequest. - * @returns The TS ReadRequest. - */ -export function mapScopedReadRequestFromNoir(scoped: ScopedReadRequestNoir): ScopedReadRequest { - return new ScopedReadRequest( - mapReadRequestFromNoir(scoped.read_request), - mapAztecAddressFromNoir(scoped.contract_address), - ); -} - -/** - * Maps a KeyValidationRequest to a noir KeyValidationRequest. - * @param request - The KeyValidationRequest. - * @returns The noir KeyValidationRequest. - */ -export function mapKeyValidationRequestToNoir(request: KeyValidationRequest): KeyValidationRequestsNoir { - return { - pk_m: mapPointToNoir(request.pkM), - sk_app: mapFieldToNoir(request.skApp), - }; -} - -export function mapKeyValidationRequestAndGeneratorToNoir( - request: KeyValidationRequestAndGenerator, -): KeyValidationRequestAndGeneratorNoir { - return { - request: mapKeyValidationRequestToNoir(request.request), - sk_app_generator: mapFieldToNoir(request.skAppGenerator), - }; -} - -/** - * Maps a noir KeyValidationRequest to KeyValidationRequest. - * @param request - The noir KeyValidationRequest. - * @returns The TS KeyValidationRequest. - */ -function mapKeyValidationRequestFromNoir(request: KeyValidationRequestsNoir): KeyValidationRequest { - return new KeyValidationRequest(mapPointFromNoir(request.pk_m), mapFieldFromNoir(request.sk_app)); -} - -function mapKeyValidationRequestAndGeneratorFromNoir( - request: KeyValidationRequestAndGeneratorNoir, -): KeyValidationRequestAndGenerator { - return new KeyValidationRequestAndGenerator( - mapKeyValidationRequestFromNoir(request.request), - mapFieldFromNoir(request.sk_app_generator), - ); -} - -function mapScopedKeyValidationRequestAndGeneratorToNoir( - request: ScopedKeyValidationRequestAndGenerator, -): ScopedKeyValidationRequestAndGeneratorNoir { - return { - request: mapKeyValidationRequestAndGeneratorToNoir(request.request), - contract_address: mapAztecAddressToNoir(request.contractAddress), - }; -} - -function mapScopedKeyValidationRequestAndGeneratorFromNoir( - request: ScopedKeyValidationRequestAndGeneratorNoir, -): ScopedKeyValidationRequestAndGenerator { - return new ScopedKeyValidationRequestAndGenerator( - mapKeyValidationRequestAndGeneratorFromNoir(request.request), - mapAztecAddressFromNoir(request.contract_address), - ); -} - -/** - * Maps a L2 to L1 message to a noir L2 to L1 message. - * @param message - The L2 to L1 message. - * @returns The noir L2 to L1 message. - */ -export function mapL2ToL1MessageToNoir(message: L2ToL1Message): L2ToL1MessageNoir { - return { - recipient: mapEthAddressToNoir(message.recipient), - content: mapFieldToNoir(message.content), - counter: mapNumberToNoir(message.counter), - }; -} - -function mapL2ToL1MessageFromNoir(message: L2ToL1MessageNoir) { - return new L2ToL1Message( - mapEthAddressFromNoir(message.recipient), - mapFieldFromNoir(message.content), - mapNumberFromNoir(message.counter), - ); -} - -function mapScopedL2ToL1MessageFromNoir(message: ScopedL2ToL1MessageNoir) { - return new ScopedL2ToL1Message( - mapL2ToL1MessageFromNoir(message.message), - mapAztecAddressFromNoir(message.contract_address), - ); -} - -function mapScopedL2ToL1MessageToNoir(message: ScopedL2ToL1Message): ScopedL2ToL1MessageNoir { - return { - message: mapL2ToL1MessageToNoir(message.message), - contract_address: mapAztecAddressToNoir(message.contractAddress), - }; -} - -/** - * Maps private circuit public inputs to noir private circuit public inputs. - * @param privateCircuitPublicInputs - The private circuit public inputs. - * @returns The noir private circuit public inputs. - */ -export function mapPrivateCircuitPublicInputsToNoir( - privateCircuitPublicInputs: PrivateCircuitPublicInputs, -): PrivateCircuitPublicInputsNoir { - return { - max_block_number: mapMaxBlockNumberToNoir(privateCircuitPublicInputs.maxBlockNumber), - call_context: mapCallContextToNoir(privateCircuitPublicInputs.callContext), - args_hash: mapFieldToNoir(privateCircuitPublicInputs.argsHash), - returns_hash: mapFieldToNoir(privateCircuitPublicInputs.returnsHash), - note_hash_read_requests: mapTuple(privateCircuitPublicInputs.noteHashReadRequests, mapReadRequestToNoir), - nullifier_read_requests: mapTuple(privateCircuitPublicInputs.nullifierReadRequests, mapReadRequestToNoir), - key_validation_requests_and_generators: mapTuple( - privateCircuitPublicInputs.keyValidationRequestsAndGenerators, - mapKeyValidationRequestAndGeneratorToNoir, - ), - note_hashes: mapTuple(privateCircuitPublicInputs.noteHashes, mapNoteHashToNoir), - nullifiers: mapTuple(privateCircuitPublicInputs.nullifiers, mapNullifierToNoir), - private_call_requests: mapTuple(privateCircuitPublicInputs.privateCallRequests, mapPrivateCallRequestToNoir), - public_call_requests: mapTuple(privateCircuitPublicInputs.publicCallRequests, mapCountedPublicCallRequestToNoir), - public_teardown_call_request: mapPublicCallRequestToNoir(privateCircuitPublicInputs.publicTeardownCallRequest), - l2_to_l1_msgs: mapTuple(privateCircuitPublicInputs.l2ToL1Msgs, mapL2ToL1MessageToNoir), - private_logs: mapTuple(privateCircuitPublicInputs.privateLogs, mapPrivateLogDataToNoir), - contract_class_logs_hashes: mapTuple(privateCircuitPublicInputs.contractClassLogsHashes, mapLogHashToNoir), - start_side_effect_counter: mapFieldToNoir(privateCircuitPublicInputs.startSideEffectCounter), - end_side_effect_counter: mapFieldToNoir(privateCircuitPublicInputs.endSideEffectCounter), - historical_header: mapHeaderToNoir(privateCircuitPublicInputs.historicalHeader), - tx_context: mapTxContextToNoir(privateCircuitPublicInputs.txContext), - min_revertible_side_effect_counter: mapFieldToNoir(privateCircuitPublicInputs.minRevertibleSideEffectCounter), - is_fee_payer: privateCircuitPublicInputs.isFeePayer, - }; -} - -/** - * Maps a private call data to a noir private call data. - * @param privateCallData - The private call data. - * @returns The noir private call data. - */ -export function mapPrivateCallDataToNoir(privateCallData: PrivateCallData): PrivateCallDataWithoutPublicInputsNoir { - return { - vk: mapVerificationKeyToNoir(privateCallData.vk, CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS), - function_leaf_membership_witness: mapMembershipWitnessToNoir(privateCallData.functionLeafMembershipWitness), - contract_class_artifact_hash: mapFieldToNoir(privateCallData.contractClassArtifactHash), - contract_class_public_bytecode_commitment: mapFieldToNoir(privateCallData.contractClassPublicBytecodeCommitment), - public_keys: mapPublicKeysToNoir(privateCallData.publicKeys), - salted_initialization_hash: mapWrappedFieldToNoir(privateCallData.saltedInitializationHash), - protocol_contract_sibling_path: mapTuple(privateCallData.protocolContractSiblingPath, mapFieldToNoir), - acir_hash: mapFieldToNoir(privateCallData.acirHash), - }; -} - -export function mapPublicKeysToNoir(publicKeys: PublicKeys): PublicKeysNoir { - return { - npk_m: { - inner: mapPointToNoir(publicKeys.masterNullifierPublicKey), - }, - ivpk_m: { - inner: mapPointToNoir(publicKeys.masterIncomingViewingPublicKey), - }, - ovpk_m: { - inner: mapPointToNoir(publicKeys.masterOutgoingViewingPublicKey), - }, - tpk_m: { - inner: mapPointToNoir(publicKeys.masterTaggingPublicKey), - }, - }; -} - -export function mapRevertCodeFromNoir(revertCode: NoirField): RevertCode { - return RevertCode.fromField(mapFieldFromNoir(revertCode)); -} - -export function mapRevertCodeToNoir(revertCode: RevertCode): NoirField { - return mapFieldToNoir(revertCode.toField()); -} - -/** - * Maps an array from noir types to a tuple of parsed types. - * @param noirArray - The noir array. - * @param length - The length of the tuple. - * @param mapper - The mapper function applied to each element. - * @returns The tuple. - */ -export function mapTupleFromNoir( - noirArray: T[], - length: N, - mapper: (item: T) => M, -): Tuple { - if (noirArray.length != length) { - throw new Error(`Expected ${length} items, got ${noirArray.length}`); - } - return Array.from({ length }, (_, idx) => mapper(noirArray[idx])) as Tuple; -} - -/** - * Maps a SHA256 hash from noir to the parsed type. - * @param hash - The hash as it is represented in Noir (1 fields). - * @returns The hash represented as a 31 bytes long buffer. - */ -export function mapSha256HashFromNoir(hash: Field): Buffer { - return toBufferBE(mapFieldFromNoir(hash).toBigInt(), NUM_BYTES_PER_SHA256); -} - -/** - * Maps a sha256 to the representation used in noir. - * @param hash - The hash represented as a 32 bytes long buffer. - * @returns The hash as it is represented in Noir (1 field, truncated). - */ -export function mapSha256HashToNoir(hash: Buffer): Field { - return mapFieldToNoir(toTruncField(hash)); -} - -function mapPublicDataWriteFromNoir(write: PublicDataWriteNoir) { - return new PublicDataWrite(mapFieldFromNoir(write.leaf_slot), mapFieldFromNoir(write.value)); -} - -function mapPublicDataWriteToNoir(write: PublicDataWrite): PublicDataWriteNoir { - return { - leaf_slot: mapFieldToNoir(write.leafSlot), - value: mapFieldToNoir(write.value), - }; -} - -function mapReadRequestStatusToNoir(readRequestStatus: ReadRequestStatus): ReadRequestStatusNoir { - return { - state: mapNumberToNoir(readRequestStatus.state), - hint_index: mapNumberToNoir(readRequestStatus.hintIndex), - }; -} - -function mapPendingReadHintToNoir(hint: PendingReadHint): PendingReadHintNoir { - return { - read_request_index: mapNumberToNoir(hint.readRequestIndex), - pending_value_index: mapNumberToNoir(hint.pendingValueIndex), - }; -} - -function mapNoteHashSettledReadHintToNoir( - hint: SettledReadHint, -): NoteHashSettledReadHintNoir { - return { - read_request_index: mapNumberToNoir(hint.readRequestIndex), - membership_witness: mapMembershipWitnessToNoir(hint.membershipWitness), - leaf_preimage: mapNoteHashLeafPreimageToNoir(hint.leafPreimage), - }; -} - -function mapNullifierSettledReadHintToNoir( - hint: SettledReadHint, -): NullifierSettledReadHintNoir { - return { - read_request_index: mapNumberToNoir(hint.readRequestIndex), - membership_witness: mapMembershipWitnessToNoir(hint.membershipWitness), - leaf_preimage: mapNullifierLeafPreimageToNoir(hint.leafPreimage), - }; -} - -function mapNoteHashReadRequestHintsToNoir( - hints: NoteHashReadRequestHints, -): NoteHashReadRequestHintsNoir { - return { - read_request_statuses: mapTuple(hints.readRequestStatuses, mapReadRequestStatusToNoir), - pending_read_hints: hints.pendingReadHints.map(mapPendingReadHintToNoir) as FixedLengthArray< - PendingReadHintNoir, - PENDING - >, - settled_read_hints: hints.settledReadHints.map(mapNoteHashSettledReadHintToNoir) as FixedLengthArray< - NoteHashSettledReadHintNoir, - SETTLED - >, - }; -} - -function mapNullifierReadRequestHintsToNoir( - hints: NullifierReadRequestHints, -): NullifierReadRequestHintsNoir { - return { - read_request_statuses: mapTuple(hints.readRequestStatuses, mapReadRequestStatusToNoir), - pending_read_hints: hints.pendingReadHints.map(mapPendingReadHintToNoir) as FixedLengthArray< - PendingReadHintNoir, - PENDING - >, - settled_read_hints: hints.settledReadHints.map(settledHint => - mapNullifierSettledReadHintToNoir( - settledHint as SettledReadHint, - ), - ) as FixedLengthArray, - }; -} - -function mapPublicDataHintToNoir(hint: PublicDataHint): PublicDataHintNoir { - return { - leaf_slot: mapFieldToNoir(hint.leafSlot), - value: mapFieldToNoir(hint.value), - membership_witness: mapMembershipWitnessToNoir(hint.membershipWitness), - leaf_preimage: mapPublicDataTreePreimageToNoir(hint.leafPreimage), - }; -} - -function mapOptionalNumberToNoir(option: OptionalNumber): OptionalNumberNoir { - return { - _is_some: option.isSome, - _value: mapNumberToNoir(option.value), - }; -} - -function mapOptionalNumberFromNoir(option: OptionalNumberNoir) { - return new OptionalNumber(option._is_some, mapNumberFromNoir(option._value)); -} - -function mapPrivateValidationRequestsToNoir(requests: PrivateValidationRequests): PrivateValidationRequestsNoir { - return { - for_rollup: mapRollupValidationRequestsToNoir(requests.forRollup), - note_hash_read_requests: mapTuple(requests.noteHashReadRequests, mapScopedReadRequestToNoir), - nullifier_read_requests: mapTuple(requests.nullifierReadRequests, mapScopedReadRequestToNoir), - scoped_key_validation_requests_and_generators: mapTuple( - requests.scopedKeyValidationRequestsAndGenerators, - mapScopedKeyValidationRequestAndGeneratorToNoir, - ), - split_counter: mapOptionalNumberToNoir(requests.splitCounter), - }; -} - -function mapPrivateValidationRequestsFromNoir(requests: PrivateValidationRequestsNoir) { - return new PrivateValidationRequests( - mapRollupValidationRequestsFromNoir(requests.for_rollup), - mapTupleFromNoir( - requests.note_hash_read_requests, - MAX_NOTE_HASH_READ_REQUESTS_PER_TX, - mapScopedReadRequestFromNoir, - ), - mapTupleFromNoir( - requests.nullifier_read_requests, - MAX_NULLIFIER_READ_REQUESTS_PER_TX, - mapScopedReadRequestFromNoir, - ), - mapTupleFromNoir( - requests.scoped_key_validation_requests_and_generators, - MAX_KEY_VALIDATION_REQUESTS_PER_TX, - mapScopedKeyValidationRequestAndGeneratorFromNoir, - ), - mapOptionalNumberFromNoir(requests.split_counter), - ); -} - -export function mapPrivateAccumulatedDataFromNoir( - privateAccumulatedData: PrivateAccumulatedDataNoir, -): PrivateAccumulatedData { - return new PrivateAccumulatedData( - mapTupleFromNoir(privateAccumulatedData.note_hashes, MAX_NOTE_HASHES_PER_TX, mapScopedNoteHashFromNoir), - mapTupleFromNoir(privateAccumulatedData.nullifiers, MAX_NULLIFIERS_PER_TX, mapScopedNullifierFromNoir), - mapTupleFromNoir(privateAccumulatedData.l2_to_l1_msgs, MAX_L2_TO_L1_MSGS_PER_TX, mapScopedL2ToL1MessageFromNoir), - mapTupleFromNoir(privateAccumulatedData.private_logs, MAX_PRIVATE_LOGS_PER_TX, mapScopedPrivateLogDataFromNoir), - mapTupleFromNoir( - privateAccumulatedData.contract_class_logs_hashes, - MAX_CONTRACT_CLASS_LOGS_PER_TX, - mapScopedLogHashFromNoir, - ), - mapTupleFromNoir( - privateAccumulatedData.public_call_requests, - MAX_ENQUEUED_CALLS_PER_TX, - mapCountedPublicCallRequestFromNoir, - ), - mapTupleFromNoir( - privateAccumulatedData.private_call_stack, - MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, - mapPrivateCallRequestFromNoir, - ), - ); -} - -export function mapPrivateAccumulatedDataToNoir(data: PrivateAccumulatedData): PrivateAccumulatedDataNoir { - return { - note_hashes: mapTuple(data.noteHashes, mapScopedNoteHashToNoir), - nullifiers: mapTuple(data.nullifiers, mapScopedNullifierToNoir), - l2_to_l1_msgs: mapTuple(data.l2ToL1Msgs, mapScopedL2ToL1MessageToNoir), - private_logs: mapTuple(data.privateLogs, mapScopedPrivateLogDataToNoir), - contract_class_logs_hashes: mapTuple(data.contractClassLogsHashes, mapScopedLogHashToNoir), - public_call_requests: mapTuple(data.publicCallRequests, mapCountedPublicCallRequestToNoir), - private_call_stack: mapTuple(data.privateCallStack, mapPrivateCallRequestToNoir), - }; -} - -export function mapGasFromNoir(gasUsed: GasNoir): Gas { - return Gas.from({ - daGas: mapNumberFromNoir(gasUsed.da_gas), - l2Gas: mapNumberFromNoir(gasUsed.l2_gas), - }); -} - -export function mapGasToNoir(gasUsed: Gas): GasNoir { - return { - da_gas: mapNumberToNoir(gasUsed.daGas), - l2_gas: mapNumberToNoir(gasUsed.l2Gas), - }; -} - -export function mapRollupValidationRequestsToNoir( - rollupValidationRequests: RollupValidationRequests, -): RollupValidationRequestsNoir { - return { - max_block_number: mapMaxBlockNumberToNoir(rollupValidationRequests.maxBlockNumber), - }; -} - -export function mapRollupValidationRequestsFromNoir( - rollupValidationRequests: RollupValidationRequestsNoir, -): RollupValidationRequests { - return new RollupValidationRequests(mapMaxBlockNumberFromNoir(rollupValidationRequests.max_block_number)); -} - -export function mapMaxBlockNumberToNoir(maxBlockNumber: MaxBlockNumber): MaxBlockNumberNoir { - return { - _opt: { - _is_some: maxBlockNumber.isSome, - _value: mapFieldToNoir(maxBlockNumber.value), - }, - }; -} - -export function mapMaxBlockNumberFromNoir(maxBlockNumber: MaxBlockNumberNoir): MaxBlockNumber { - return new MaxBlockNumber(maxBlockNumber._opt._is_some, mapFieldFromNoir(maxBlockNumber._opt._value)); -} - -function mapPrivateToPublicAccumulatedDataFromNoir(data: PrivateToPublicAccumulatedDataNoir) { - return new PrivateToPublicAccumulatedData( - mapTupleFromNoir(data.note_hashes, MAX_NOTE_HASHES_PER_TX, mapFieldFromNoir), - mapTupleFromNoir(data.nullifiers, MAX_NULLIFIERS_PER_TX, mapFieldFromNoir), - mapTupleFromNoir(data.l2_to_l1_msgs, MAX_L2_TO_L1_MSGS_PER_TX, mapScopedL2ToL1MessageFromNoir), - mapTupleFromNoir(data.private_logs, MAX_PRIVATE_LOGS_PER_TX, mapPrivateLogFromNoir), - mapTupleFromNoir(data.contract_class_logs_hashes, MAX_CONTRACT_CLASS_LOGS_PER_TX, mapScopedLogHashFromNoir), - mapTupleFromNoir(data.public_call_requests, MAX_ENQUEUED_CALLS_PER_TX, mapPublicCallRequestFromNoir), - ); -} - -function mapPrivateToPublicAccumulatedDataToNoir( - data: PrivateToPublicAccumulatedData, -): PrivateToPublicAccumulatedDataNoir { - return { - note_hashes: mapTuple(data.noteHashes, mapFieldToNoir), - nullifiers: mapTuple(data.nullifiers, mapFieldToNoir), - l2_to_l1_msgs: mapTuple(data.l2ToL1Msgs, mapScopedL2ToL1MessageToNoir), - private_logs: mapTuple(data.privateLogs, mapPrivateLogToNoir), - contract_class_logs_hashes: mapTuple(data.contractClassLogsHashes, mapScopedLogHashToNoir), - public_call_requests: mapTuple(data.publicCallRequests, mapPublicCallRequestToNoir), - }; -} - -function mapPrivateToAvmAccumulatedDataToNoir(data: PrivateToAvmAccumulatedData): PrivateToAvmAccumulatedDataNoir { - return { - note_hashes: mapTuple(data.noteHashes, mapFieldToNoir), - nullifiers: mapTuple(data.nullifiers, mapFieldToNoir), - l2_to_l1_msgs: mapTuple(data.l2ToL1Msgs, mapScopedL2ToL1MessageToNoir), - }; -} - -function mapPrivateToAvmAccumulatedDataArrayLengthsToNoir( - data: PrivateToAvmAccumulatedDataArrayLengths, -): PrivateToAvmAccumulatedDataArrayLengthsNoir { - return { - note_hashes: mapNumberToNoir(data.noteHashes), - nullifiers: mapNumberToNoir(data.nullifiers), - l2_to_l1_msgs: mapNumberToNoir(data.l2ToL1Msgs), - }; -} - -function mapAvmAccumulatedDataToNoir(data: AvmAccumulatedData): AvmAccumulatedDataNoir { - return { - note_hashes: mapTuple(data.noteHashes, mapFieldToNoir), - nullifiers: mapTuple(data.nullifiers, mapFieldToNoir), - l2_to_l1_msgs: mapTuple(data.l2ToL1Msgs, mapScopedL2ToL1MessageToNoir), - unencrypted_logs_hashes: mapTuple(data.unencryptedLogsHashes, mapScopedLogHashToNoir), - public_data_writes: mapTuple(data.publicDataWrites, mapPublicDataWriteToNoir), - }; -} - -/** - * Maps combined accumulated data from noir to the parsed type. - * @param combinedAccumulatedData - The noir combined accumulated data. - * @returns The parsed combined accumulated data. - */ -export function mapCombinedAccumulatedDataFromNoir(combinedAccumulatedData: CombinedAccumulatedDataNoir) { - return new CombinedAccumulatedData( - mapTupleFromNoir(combinedAccumulatedData.note_hashes, MAX_NOTE_HASHES_PER_TX, mapFieldFromNoir), - mapTupleFromNoir(combinedAccumulatedData.nullifiers, MAX_NULLIFIERS_PER_TX, mapFieldFromNoir), - mapTupleFromNoir(combinedAccumulatedData.l2_to_l1_msgs, MAX_L2_TO_L1_MSGS_PER_TX, mapScopedL2ToL1MessageFromNoir), - mapTupleFromNoir(combinedAccumulatedData.private_logs, MAX_PRIVATE_LOGS_PER_TX, mapPrivateLogFromNoir), - mapTupleFromNoir( - combinedAccumulatedData.unencrypted_logs_hashes, - MAX_UNENCRYPTED_LOGS_PER_TX, - mapScopedLogHashFromNoir, - ), - mapTupleFromNoir( - combinedAccumulatedData.contract_class_logs_hashes, - MAX_CONTRACT_CLASS_LOGS_PER_TX, - mapScopedLogHashFromNoir, - ), - mapFieldFromNoir(combinedAccumulatedData.unencrypted_log_preimages_length), - mapFieldFromNoir(combinedAccumulatedData.contract_class_log_preimages_length), - mapTupleFromNoir( - combinedAccumulatedData.public_data_writes, - MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - mapPublicDataWriteFromNoir, - ), - ); -} - -export function mapCombinedAccumulatedDataToNoir( - combinedAccumulatedData: CombinedAccumulatedData, -): CombinedAccumulatedDataNoir { - return { - note_hashes: mapTuple(combinedAccumulatedData.noteHashes, mapFieldToNoir), - nullifiers: mapTuple(combinedAccumulatedData.nullifiers, mapFieldToNoir), - l2_to_l1_msgs: mapTuple(combinedAccumulatedData.l2ToL1Msgs, mapScopedL2ToL1MessageToNoir), - private_logs: mapTuple(combinedAccumulatedData.privateLogs, mapPrivateLogToNoir), - unencrypted_logs_hashes: mapTuple(combinedAccumulatedData.unencryptedLogsHashes, mapScopedLogHashToNoir), - contract_class_logs_hashes: mapTuple(combinedAccumulatedData.contractClassLogsHashes, mapScopedLogHashToNoir), - unencrypted_log_preimages_length: mapFieldToNoir(combinedAccumulatedData.unencryptedLogPreimagesLength), - contract_class_log_preimages_length: mapFieldToNoir(combinedAccumulatedData.contractClassLogPreimagesLength), - public_data_writes: mapTuple(combinedAccumulatedData.publicDataWrites, mapPublicDataWriteToNoir), - }; -} - -function mapTxConstantDataFromNoir(data: TxConstantDataNoir) { - return new TxConstantData( - mapHeaderFromNoir(data.historical_header), - mapTxContextFromNoir(data.tx_context), - mapFieldFromNoir(data.vk_tree_root), - mapFieldFromNoir(data.protocol_contract_tree_root), - ); -} - -function mapTxConstantDataToNoir(data: TxConstantData): TxConstantDataNoir { - return { - historical_header: mapHeaderToNoir(data.historicalHeader), - tx_context: mapTxContextToNoir(data.txContext), - vk_tree_root: mapFieldToNoir(data.vkTreeRoot), - protocol_contract_tree_root: mapFieldToNoir(data.protocolContractTreeRoot), - }; -} - -function mapCombinedConstantDataFromNoir(combinedConstantData: CombinedConstantDataNoir): CombinedConstantData { - return new CombinedConstantData( - mapHeaderFromNoir(combinedConstantData.historical_header), - mapTxContextFromNoir(combinedConstantData.tx_context), - mapFieldFromNoir(combinedConstantData.vk_tree_root), - mapFieldFromNoir(combinedConstantData.protocol_contract_tree_root), - mapGlobalVariablesFromNoir(combinedConstantData.global_variables), - ); -} - -function mapCombinedConstantDataToNoir(combinedConstantData: CombinedConstantData): CombinedConstantDataNoir { - return { - historical_header: mapHeaderToNoir(combinedConstantData.historicalHeader), - tx_context: mapTxContextToNoir(combinedConstantData.txContext), - vk_tree_root: mapFieldToNoir(combinedConstantData.vkTreeRoot), - protocol_contract_tree_root: mapFieldToNoir(combinedConstantData.protocolContractTreeRoot), - global_variables: mapGlobalVariablesToNoir(combinedConstantData.globalVariables), - }; -} - -export function mapPrivateToPublicKernelCircuitPublicInputsToNoir( - inputs: PrivateToPublicKernelCircuitPublicInputs, -): PrivateToPublicKernelCircuitPublicInputsNoir { - return { - constants: mapTxConstantDataToNoir(inputs.constants), - rollup_validation_requests: mapRollupValidationRequestsToNoir(inputs.rollupValidationRequests), - non_revertible_accumulated_data: mapPrivateToPublicAccumulatedDataToNoir(inputs.nonRevertibleAccumulatedData), - revertible_accumulated_data: mapPrivateToPublicAccumulatedDataToNoir(inputs.revertibleAccumulatedData), - public_teardown_call_request: mapPublicCallRequestToNoir(inputs.publicTeardownCallRequest), - gas_used: mapGasToNoir(inputs.gasUsed), - fee_payer: mapAztecAddressToNoir(inputs.feePayer), - }; -} - -export function mapKernelCircuitPublicInputsFromNoir(inputs: KernelCircuitPublicInputsNoir) { - return new KernelCircuitPublicInputs( - mapRollupValidationRequestsFromNoir(inputs.rollup_validation_requests), - mapCombinedAccumulatedDataFromNoir(inputs.end), - mapCombinedConstantDataFromNoir(inputs.constants), - mapPartialStateReferenceFromNoir(inputs.start_state), - mapRevertCodeFromNoir(inputs.revert_code), - mapGasFromNoir(inputs.gas_used), - mapAztecAddressFromNoir(inputs.fee_payer), - ); -} - -export function mapKernelCircuitPublicInputsToNoir(inputs: KernelCircuitPublicInputs): KernelCircuitPublicInputsNoir { - return { - rollup_validation_requests: mapRollupValidationRequestsToNoir(inputs.rollupValidationRequests), - constants: mapCombinedConstantDataToNoir(inputs.constants), - end: mapCombinedAccumulatedDataToNoir(inputs.end), - start_state: mapPartialStateReferenceToNoir(inputs.startState), - revert_code: mapRevertCodeToNoir(inputs.revertCode), - gas_used: mapGasToNoir(inputs.gasUsed), - fee_payer: mapAztecAddressToNoir(inputs.feePayer), - }; -} - -export function mapVerificationKeyToNoir( - key: VerificationKeyAsFields, - length: N, -): VerificationKeyNoir { - if (key.key.length !== length) { - throw new Error(`Expected ${length} fields, got ${key.key.length}`); - } - return { - key: key.key.map(mapFieldToNoir) as FixedLengthArray, - hash: mapFieldToNoir(key.hash), - }; -} - -function mapVkWitnessDataToNoir(vkData: VkWitnessData, length: N): VkDataNoir { - return { - vk: mapVerificationKeyToNoir(vkData.vk.keyAsFields, length), - vk_index: mapFieldToNoir(new Fr(vkData.vkIndex)), - vk_path: mapTuple(vkData.vkPath, mapFieldToNoir), - }; -} - -export function mapPrivateKernelCircuitPublicInputsFromNoir( - inputs: PrivateKernelCircuitPublicInputsNoir, -): PrivateKernelCircuitPublicInputs { - return new PrivateKernelCircuitPublicInputs( - mapTxConstantDataFromNoir(inputs.constants), - mapFieldFromNoir(inputs.min_revertible_side_effect_counter), - mapPrivateValidationRequestsFromNoir(inputs.validation_requests), - mapPrivateAccumulatedDataFromNoir(inputs.end), - mapPublicCallRequestFromNoir(inputs.public_teardown_call_request), - mapAztecAddressFromNoir(inputs.fee_payer), - inputs.is_private_only, - ); -} - -export function mapPrivateKernelCircuitPublicInputsToNoir( - inputs: PrivateKernelCircuitPublicInputs, -): PrivateKernelCircuitPublicInputsNoir { - return { - constants: mapTxConstantDataToNoir(inputs.constants), - validation_requests: mapPrivateValidationRequestsToNoir(inputs.validationRequests), - end: mapPrivateAccumulatedDataToNoir(inputs.end), - min_revertible_side_effect_counter: mapFieldToNoir(inputs.minRevertibleSideEffectCounter), - public_teardown_call_request: mapPublicCallRequestToNoir(inputs.publicTeardownCallRequest), - fee_payer: mapAztecAddressToNoir(inputs.feePayer), - is_private_only: inputs.isPrivateOnly, - }; -} - -/** - * Maps a private kernel inner data to a noir private kernel inner data. - * @param privateKernelInnerData - The private kernel inner data. - * @returns The noir private kernel inner data. - */ -export function mapPrivateKernelDataToNoir( - privateKernelInnerData: PrivateKernelData, -): PrivateKernelDataWithoutPublicInputsNoir { - return { - vk: mapVerificationKeyToNoir(privateKernelInnerData.vk, CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS), - vk_index: mapFieldToNoir(new Fr(privateKernelInnerData.vkIndex)), - vk_path: mapTuple(privateKernelInnerData.vkPath, mapFieldToNoir), - }; -} - -export function mapPrivateKernelTailCircuitPublicInputsForRollupFromNoir( - inputs: KernelCircuitPublicInputsNoir, -): PrivateKernelTailCircuitPublicInputs { - const forRollup = new PartialPrivateTailPublicInputsForRollup(mapCombinedAccumulatedDataFromNoir(inputs.end)); - return new PrivateKernelTailCircuitPublicInputs( - mapTxConstantDataFromNoir(inputs.constants), - mapRollupValidationRequestsFromNoir(inputs.rollup_validation_requests), - mapGasFromNoir(inputs.gas_used), - mapAztecAddressFromNoir(inputs.fee_payer), - undefined, - forRollup, - ); -} - -export function mapPrivateKernelTailCircuitPublicInputsForPublicFromNoir( - inputs: PrivateToPublicKernelCircuitPublicInputsNoir, -): PrivateKernelTailCircuitPublicInputs { - const forPublic = new PartialPrivateTailPublicInputsForPublic( - mapPrivateToPublicAccumulatedDataFromNoir(inputs.non_revertible_accumulated_data), - mapPrivateToPublicAccumulatedDataFromNoir(inputs.revertible_accumulated_data), - mapPublicCallRequestFromNoir(inputs.public_teardown_call_request), - ); - return new PrivateKernelTailCircuitPublicInputs( - mapTxConstantDataFromNoir(inputs.constants), - mapRollupValidationRequestsFromNoir(inputs.rollup_validation_requests), - mapGasFromNoir(inputs.gas_used), - mapAztecAddressFromNoir(inputs.fee_payer), - forPublic, - ); -} - -function mapTransientDataIndexHintToNoir(indexHint: TransientDataIndexHint): TransientDataIndexHintNoir { - return { - nullifier_index: mapNumberToNoir(indexHint.nullifierIndex), - note_hash_index: mapNumberToNoir(indexHint.noteHashIndex), - }; -} - -export function mapPrivateKernelResetHintsToNoir< - NH_RR_PENDING extends number, - NH_RR_SETTLED extends number, - NLL_RR_PENDING extends number, - NLL_RR_SETTLED extends number, - KEY_VALIDATION_REQUESTS extends number, - NUM_TRANSIENT_DATA_HINTS extends number, ->( - inputs: PrivateKernelResetHints< - NH_RR_PENDING, - NH_RR_SETTLED, - NLL_RR_PENDING, - NLL_RR_SETTLED, - KEY_VALIDATION_REQUESTS, - NUM_TRANSIENT_DATA_HINTS - >, -): PrivateKernelResetHintsNoir< - NH_RR_PENDING, - NH_RR_SETTLED, - NLL_RR_PENDING, - NLL_RR_SETTLED, - KEY_VALIDATION_REQUESTS, - NUM_TRANSIENT_DATA_HINTS -> { - return { - note_hash_read_request_hints: mapNoteHashReadRequestHintsToNoir(inputs.noteHashReadRequestHints), - nullifier_read_request_hints: mapNullifierReadRequestHintsToNoir(inputs.nullifierReadRequestHints), - key_validation_hints: inputs.keyValidationHints.map(mapKeyValidationHintToNoir) as FixedLengthArray< - KeyValidationHintNoir, - KEY_VALIDATION_REQUESTS - >, - transient_data_index_hints: inputs.transientDataIndexHints.map(mapTransientDataIndexHintToNoir) as FixedLengthArray< - TransientDataIndexHintNoir, - NUM_TRANSIENT_DATA_HINTS - >, - validation_requests_split_counter: mapNumberToNoir(inputs.validationRequestsSplitCounter), - }; -} - -/** - * Maps global variables to the noir type. - * @param globalVariables - The global variables. - * @returns The noir global variables. - */ -export function mapGlobalVariablesToNoir(globalVariables: GlobalVariables): GlobalVariablesNoir { - return { - chain_id: mapFieldToNoir(globalVariables.chainId), - version: mapFieldToNoir(globalVariables.version), - block_number: mapFieldToNoir(globalVariables.blockNumber), - slot_number: mapFieldToNoir(globalVariables.slotNumber), - timestamp: mapFieldToNoir(globalVariables.timestamp), - coinbase: mapEthAddressToNoir(globalVariables.coinbase), - fee_recipient: mapAztecAddressToNoir(globalVariables.feeRecipient), - gas_fees: mapGasFeesToNoir(globalVariables.gasFees), - }; -} - -/** - * Maps global variables from the noir type. - * @param globalVariables - The noir global variables. - * @returns The global variables. - */ -export function mapGlobalVariablesFromNoir(globalVariables: GlobalVariablesNoir): GlobalVariables { - return new GlobalVariables( - mapFieldFromNoir(globalVariables.chain_id), - mapFieldFromNoir(globalVariables.version), - mapFieldFromNoir(globalVariables.block_number), - mapFieldFromNoir(globalVariables.slot_number), - mapFieldFromNoir(globalVariables.timestamp), - mapEthAddressFromNoir(globalVariables.coinbase), - mapAztecAddressFromNoir(globalVariables.fee_recipient), - mapGasFeesFromNoir(globalVariables.gas_fees), - ); -} - -export function mapGasFeesToNoir(gasFees: GasFees): GasFeesNoir { - return { - fee_per_da_gas: mapFieldToNoir(gasFees.feePerDaGas), - fee_per_l2_gas: mapFieldToNoir(gasFees.feePerL2Gas), - }; -} - -export function mapGasFeesFromNoir(gasFees: GasFeesNoir): GasFees { - return new GasFees(mapFieldFromNoir(gasFees.fee_per_da_gas), mapFieldFromNoir(gasFees.fee_per_l2_gas)); -} - -export function mapFeeRecipientToNoir(feeRecipient: FeeRecipient): FeeRecipientNoir { - return { - recipient: mapEthAddressToNoir(feeRecipient.recipient), - value: mapFieldToNoir(feeRecipient.value), - }; -} - -export function mapFeeRecipientFromNoir(feeRecipient: FeeRecipientNoir): FeeRecipient { - return new FeeRecipient(mapEthAddressFromNoir(feeRecipient.recipient), mapFieldFromNoir(feeRecipient.value)); -} - -/** - * Maps poseidon sponge to noir. - * @param sponge - The circuits.js poseidon sponge. - * @returns The noir poseidon sponge. - */ -export function mapPoseidon2SpongeToNoir(sponge: Poseidon2Sponge): Poseidon2SpongeNoir { - return { - cache: mapTuple(sponge.cache, mapFieldToNoir), - state: mapTuple(sponge.state, mapFieldToNoir), - cache_size: mapNumberToNoir(sponge.cacheSize), - squeeze_mode: sponge.squeezeMode, - }; -} - -/** - * Maps poseidon sponge from noir. - * @param sponge - The noir poseidon sponge. - * @returns The circuits.js poseidon sponge. - */ -export function mapPoseidon2SpongeFromNoir(sponge: Poseidon2SpongeNoir): Poseidon2Sponge { - return new Poseidon2Sponge( - mapTupleFromNoir(sponge.cache, 3, mapFieldFromNoir), - mapTupleFromNoir(sponge.state, 4, mapFieldFromNoir), - mapNumberFromNoir(sponge.cache_size), - sponge.squeeze_mode, - ); -} - -/** - * Maps sponge blob to noir. - * @param spongeBlob - The circuits.js sponge blob. - * @returns The noir sponge blob. - */ -export function mapSpongeBlobToNoir(spongeBlob: SpongeBlob): SpongeBlobNoir { - return { - sponge: mapPoseidon2SpongeToNoir(spongeBlob.sponge), - fields: mapNumberToNoir(spongeBlob.fields), - expected_fields: mapNumberToNoir(spongeBlob.expectedFields), - }; -} - -/** - * Maps sponge blob from noir. - * @param spongeBlob - The noir sponge blob. - * @returns The circuits.js sponge blob. - */ -export function mapSpongeBlobFromNoir(spongeBlob: SpongeBlobNoir): SpongeBlob { - return new SpongeBlob( - mapPoseidon2SpongeFromNoir(spongeBlob.sponge), - mapNumberFromNoir(spongeBlob.fields), - mapNumberFromNoir(spongeBlob.expected_fields), - ); -} - -/** - * Maps blob commitment to noir. - * @param commitment - The circuits.js commitment. - * @returns The noir commitment. - */ -export function mapBlobCommitmentToNoir(commitment: [Fr, Fr]): BlobCommitmentNoir { - return { - inner: mapTuple(commitment, mapFieldToNoir), - }; -} - -/** - * Maps blob public inputs to noir. - * @param blobPublicInputs - The circuits.js blob public inputs. - * @returns The noir blob public inputs. - */ -export function mapBlobPublicInputsToNoir(blobPublicInputs: BlobPublicInputs): BlobPublicInputsNoir { - return { - z: mapFieldToNoir(blobPublicInputs.z), - y: mapBLS12BigNumToNoir(blobPublicInputs.y), - kzg_commitment: mapBlobCommitmentToNoir(blobPublicInputs.kzgCommitment), - }; -} - -/** - * Maps blob public inputs from noir. - * @param blobPublicInputs - The noir blob public inputs. - * @returns The circuits.js blob public inputs. - */ -export function mapBlobPublicInputsFromNoir(blobPublicInputs: BlobPublicInputsNoir): BlobPublicInputs { - return new BlobPublicInputs( - mapFieldFromNoir(blobPublicInputs.z), - mapBLS12BigNumFromNoir(blobPublicInputs.y), - mapTupleFromNoir(blobPublicInputs.kzg_commitment.inner, 2, mapFieldFromNoir), - ); -} - -/** - * Maps block blob public inputs to noir. - * @param blockBlobPublicInputs - The circuits.js block blob public inputs. - * @returns The noir block blob public inputs. - */ -export function mapBlockBlobPublicInputsToNoir( - blockBlobPublicInputs: BlockBlobPublicInputs, -): BlockBlobPublicInputsNoir { - return { - inner: mapTuple(blockBlobPublicInputs.inner, mapBlobPublicInputsToNoir), - }; -} - -/** - * Maps block blob public inputs from noir. - * @param blockBlobPublicInputs - The noir block blob public inputs. - * @returns The circuits.js block blob public inputs. - */ -export function mapBlockBlobPublicInputsFromNoir( - blockBlobPublicInputs: BlockBlobPublicInputsNoir, -): BlockBlobPublicInputs { - return new BlockBlobPublicInputs( - mapTupleFromNoir(blockBlobPublicInputs.inner, BLOBS_PER_BLOCK, mapBlobPublicInputsFromNoir), - ); -} - -/** - * Maps a constant rollup data to a noir constant rollup data. - * @param constantRollupData - The circuits.js constant rollup data. - * @returns The noir constant rollup data. - */ -export function mapConstantRollupDataToNoir(constantRollupData: ConstantRollupData): ConstantRollupDataNoir { - return { - last_archive: mapAppendOnlyTreeSnapshotToNoir(constantRollupData.lastArchive), - vk_tree_root: mapFieldToNoir(constantRollupData.vkTreeRoot), - protocol_contract_tree_root: mapFieldToNoir(constantRollupData.protocolContractTreeRoot), - global_variables: mapGlobalVariablesToNoir(constantRollupData.globalVariables), - }; -} - -/** - * Maps a constant rollup data from noir to the circuits.js type. - * @param constantRollupData - The noir constant rollup data. - * @returns The circuits.js constant rollup data. - */ -export function mapConstantRollupDataFromNoir(constantRollupData: ConstantRollupDataNoir): ConstantRollupData { - return new ConstantRollupData( - mapAppendOnlyTreeSnapshotFromNoir(constantRollupData.last_archive), - mapFieldFromNoir(constantRollupData.vk_tree_root), - mapFieldFromNoir(constantRollupData.protocol_contract_tree_root), - mapGlobalVariablesFromNoir(constantRollupData.global_variables), - ); -} - -/** - * Maps a base or merge rollup public inputs to a noir base or merge rollup public inputs. - * @param baseOrMergeRollupPublicInputs - The base or merge rollup public inputs. - * @returns The noir base or merge rollup public inputs. - */ -export function mapBaseOrMergeRollupPublicInputsToNoir( - baseOrMergeRollupPublicInputs: BaseOrMergeRollupPublicInputs, -): BaseOrMergeRollupPublicInputsNoir { - return { - rollup_type: mapFieldToNoir(new Fr(baseOrMergeRollupPublicInputs.rollupType)), - num_txs: mapFieldToNoir(new Fr(baseOrMergeRollupPublicInputs.numTxs)), - constants: mapConstantRollupDataToNoir(baseOrMergeRollupPublicInputs.constants), - start: mapPartialStateReferenceToNoir(baseOrMergeRollupPublicInputs.start), - end: mapPartialStateReferenceToNoir(baseOrMergeRollupPublicInputs.end), - start_sponge_blob: mapSpongeBlobToNoir(baseOrMergeRollupPublicInputs.startSpongeBlob), - end_sponge_blob: mapSpongeBlobToNoir(baseOrMergeRollupPublicInputs.endSpongeBlob), - out_hash: mapFieldToNoir(baseOrMergeRollupPublicInputs.outHash), - accumulated_fees: mapFieldToNoir(baseOrMergeRollupPublicInputs.accumulatedFees), - accumulated_mana_used: mapFieldToNoir(baseOrMergeRollupPublicInputs.accumulatedManaUsed), - }; -} - -/** - * Maps block root or block merge rollup public inputs to a noir block root or block merge rollup public inputs. - * @param blockRootOrBlockMergePublicInputs - The block root or block merge rollup public inputs. - * @returns The noir block root or block merge rollup public inputs. - */ -export function mapBlockRootOrBlockMergePublicInputsToNoir( - blockRootOrBlockMergePublicInputs: BlockRootOrBlockMergePublicInputs, -): BlockRootOrBlockMergePublicInputsNoir { - return { - previous_archive: mapAppendOnlyTreeSnapshotToNoir(blockRootOrBlockMergePublicInputs.previousArchive), - new_archive: mapAppendOnlyTreeSnapshotToNoir(blockRootOrBlockMergePublicInputs.newArchive), - previous_block_hash: mapFieldToNoir(blockRootOrBlockMergePublicInputs.previousBlockHash), - end_block_hash: mapFieldToNoir(blockRootOrBlockMergePublicInputs.endBlockHash), - start_global_variables: mapGlobalVariablesToNoir(blockRootOrBlockMergePublicInputs.startGlobalVariables), - end_global_variables: mapGlobalVariablesToNoir(blockRootOrBlockMergePublicInputs.endGlobalVariables), - out_hash: mapFieldToNoir(blockRootOrBlockMergePublicInputs.outHash), - fees: mapTuple(blockRootOrBlockMergePublicInputs.fees, mapFeeRecipientToNoir), - vk_tree_root: mapFieldToNoir(blockRootOrBlockMergePublicInputs.vkTreeRoot), - protocol_contract_tree_root: mapFieldToNoir(blockRootOrBlockMergePublicInputs.protocolContractTreeRoot), - prover_id: mapFieldToNoir(blockRootOrBlockMergePublicInputs.proverId), - blob_public_inputs: mapTuple(blockRootOrBlockMergePublicInputs.blobPublicInputs, mapBlockBlobPublicInputsToNoir), - }; -} - -function mapAvmCircuitPublicInputsToNoir(inputs: AvmCircuitPublicInputs): AvmCircuitPublicInputsNoir { - return { - global_variables: mapGlobalVariablesToNoir(inputs.globalVariables), - start_tree_snapshots: mapTreeSnapshotsToNoir(inputs.startTreeSnapshots), - start_gas_used: mapGasToNoir(inputs.startGasUsed), - gas_settings: mapGasSettingsToNoir(inputs.gasSettings), - fee_payer: mapAztecAddressToNoir(inputs.feePayer), - public_setup_call_requests: mapTuple(inputs.publicSetupCallRequests, mapPublicCallRequestToNoir), - public_app_logic_call_requests: mapTuple(inputs.publicAppLogicCallRequests, mapPublicCallRequestToNoir), - public_teardown_call_request: mapPublicCallRequestToNoir(inputs.publicTeardownCallRequest), - previous_non_revertible_accumulated_data_array_lengths: mapPrivateToAvmAccumulatedDataArrayLengthsToNoir( - inputs.previousNonRevertibleAccumulatedDataArrayLengths, - ), - previous_revertible_accumulated_data_array_lengths: mapPrivateToAvmAccumulatedDataArrayLengthsToNoir( - inputs.previousRevertibleAccumulatedDataArrayLengths, - ), - previous_non_revertible_accumulated_data: mapPrivateToAvmAccumulatedDataToNoir( - inputs.previousNonRevertibleAccumulatedData, - ), - previous_revertible_accumulated_data: mapPrivateToAvmAccumulatedDataToNoir( - inputs.previousRevertibleAccumulatedData, - ), - end_tree_snapshots: mapTreeSnapshotsToNoir(inputs.endTreeSnapshots), - end_gas_used: mapGasToNoir(inputs.endGasUsed), - accumulated_data: mapAvmAccumulatedDataToNoir(inputs.accumulatedData), - transaction_fee: mapFieldToNoir(inputs.transactionFee), - reverted: inputs.reverted, - }; -} - -/** - * Maps a base or merge rollup public inputs from noir to the circuits.js type. - * @param baseOrMergeRollupPublicInputs - The noir base or merge rollup public inputs. - * @returns The circuits.js base or merge rollup public inputs. - */ -export function mapBaseOrMergeRollupPublicInputsFromNoir( - baseOrMergeRollupPublicInputs: BaseOrMergeRollupPublicInputsNoir, -): BaseOrMergeRollupPublicInputs { - return new BaseOrMergeRollupPublicInputs( - mapNumberFromNoir(baseOrMergeRollupPublicInputs.rollup_type), - mapNumberFromNoir(baseOrMergeRollupPublicInputs.num_txs), - mapConstantRollupDataFromNoir(baseOrMergeRollupPublicInputs.constants), - mapPartialStateReferenceFromNoir(baseOrMergeRollupPublicInputs.start), - mapPartialStateReferenceFromNoir(baseOrMergeRollupPublicInputs.end), - mapSpongeBlobFromNoir(baseOrMergeRollupPublicInputs.start_sponge_blob), - mapSpongeBlobFromNoir(baseOrMergeRollupPublicInputs.end_sponge_blob), - mapFieldFromNoir(baseOrMergeRollupPublicInputs.out_hash), - mapFieldFromNoir(baseOrMergeRollupPublicInputs.accumulated_fees), - mapFieldFromNoir(baseOrMergeRollupPublicInputs.accumulated_mana_used), - ); -} - -/** - * Maps a block root or block merge rollup public inputs from noir to the circuits.js type. - * @param blockRootOrBlockMergePublicInputs - The noir lock root or block merge rollup public inputs. - * @returns The circuits.js block root or block merge rollup public inputs. - */ -export function mapBlockRootOrBlockMergePublicInputsFromNoir( - blockRootOrBlockMergePublicInputs: BlockRootOrBlockMergePublicInputsNoir, -): BlockRootOrBlockMergePublicInputs { - return new BlockRootOrBlockMergePublicInputs( - mapAppendOnlyTreeSnapshotFromNoir(blockRootOrBlockMergePublicInputs.previous_archive), - mapAppendOnlyTreeSnapshotFromNoir(blockRootOrBlockMergePublicInputs.new_archive), - mapFieldFromNoir(blockRootOrBlockMergePublicInputs.previous_block_hash), - mapFieldFromNoir(blockRootOrBlockMergePublicInputs.end_block_hash), - mapGlobalVariablesFromNoir(blockRootOrBlockMergePublicInputs.start_global_variables), - mapGlobalVariablesFromNoir(blockRootOrBlockMergePublicInputs.end_global_variables), - mapFieldFromNoir(blockRootOrBlockMergePublicInputs.out_hash), - mapTupleFromNoir(blockRootOrBlockMergePublicInputs.fees, AZTEC_MAX_EPOCH_DURATION, mapFeeRecipientFromNoir), - mapFieldFromNoir(blockRootOrBlockMergePublicInputs.vk_tree_root), - mapFieldFromNoir(blockRootOrBlockMergePublicInputs.protocol_contract_tree_root), - mapFieldFromNoir(blockRootOrBlockMergePublicInputs.prover_id), - mapTupleFromNoir( - blockRootOrBlockMergePublicInputs.blob_public_inputs, - AZTEC_MAX_EPOCH_DURATION, - mapBlockBlobPublicInputsFromNoir, - ), - ); -} - -/** - * Maps a previous rollup data from the circuits.js type to noir. - * @param previousRollupData - The circuits.js previous rollup data. - * @returns The noir previous rollup data. - */ -export function mapPreviousRollupDataToNoir(previousRollupData: PreviousRollupData): PreviousRollupDataNoir { - return { - base_or_merge_rollup_public_inputs: mapBaseOrMergeRollupPublicInputsToNoir( - previousRollupData.baseOrMergeRollupPublicInputs, - ), - proof: mapRecursiveProofToNoir(previousRollupData.proof), - vk: mapVerificationKeyToNoir(previousRollupData.vk, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), - vk_witness: { - leaf_index: mapFieldToNoir(new Fr(previousRollupData.vkWitness.leafIndex)), - sibling_path: mapTuple(previousRollupData.vkWitness.siblingPath, mapFieldToNoir), - }, - }; -} - -/** - * Maps a previous rollup data from the circuits.js type to noir. - * @param previousRollupData - The circuits.js previous rollup data. - * @returns The noir previous rollup data. - */ -export function mapPreviousRollupBlockDataToNoir( - previousRollupData: PreviousRollupBlockData, -): PreviousRollupBlockDataNoir { - return { - block_root_or_block_merge_public_inputs: mapBlockRootOrBlockMergePublicInputsToNoir( - previousRollupData.blockRootOrBlockMergePublicInputs, - ), - proof: mapRecursiveProofToNoir(previousRollupData.proof), - vk: mapVerificationKeyToNoir(previousRollupData.vk, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), - vk_witness: { - leaf_index: mapFieldToNoir(new Fr(previousRollupData.vkWitness.leafIndex)), - sibling_path: mapTuple(previousRollupData.vkWitness.siblingPath, mapFieldToNoir), - }, - }; -} - -/** - * Maps a AOT snapshot to noir. - * @param snapshot - The circuits.js AOT snapshot. - * @returns The noir AOT snapshot. - */ -export function mapAppendOnlyTreeSnapshotFromNoir(snapshot: AppendOnlyTreeSnapshotNoir): AppendOnlyTreeSnapshot { - return new AppendOnlyTreeSnapshot( - mapFieldFromNoir(snapshot.root), - mapNumberFromNoir(snapshot.next_available_leaf_index), - ); -} - -/** - * Maps a AOT snapshot from noir to the circuits.js type. - * @param snapshot - The noir AOT snapshot. - * @returns The circuits.js AOT snapshot. - */ -export function mapAppendOnlyTreeSnapshotToNoir(snapshot: AppendOnlyTreeSnapshot): AppendOnlyTreeSnapshotNoir { - return { - root: mapFieldToNoir(snapshot.root), - next_available_leaf_index: mapFieldToNoir(new Fr(snapshot.nextAvailableLeafIndex)), - }; -} - -export function mapRootRollupParityInputToNoir( - rootParityInput: RootParityInput, -): RootRollupParityInputNoir { - return { - proof: mapRecursiveProofToNoir(rootParityInput.proof), - verification_key: mapVerificationKeyToNoir(rootParityInput.verificationKey, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), - vk_path: mapTuple(rootParityInput.vkPath, mapFieldToNoir), - public_inputs: mapParityPublicInputsToNoir(rootParityInput.publicInputs), - }; -} - -/** - * Maps the block root rollup inputs to noir. - * @param rootRollupInputs - The circuits.js block root rollup inputs. - * @returns The noir block root rollup inputs. - */ -export function mapBlockRootRollupInputsToNoir(rootRollupInputs: BlockRootRollupInputs): BlockRootRollupInputsNoir { - return { - previous_rollup_data: mapTuple(rootRollupInputs.previousRollupData, mapPreviousRollupDataToNoir), - l1_to_l2_roots: mapRootRollupParityInputToNoir(rootRollupInputs.l1ToL2Roots), - l1_to_l2_messages: mapTuple(rootRollupInputs.newL1ToL2Messages, mapFieldToNoir), - l1_to_l2_message_subtree_sibling_path: mapTuple( - rootRollupInputs.newL1ToL2MessageTreeRootSiblingPath, - mapFieldToNoir, - ), - start_l1_to_l2_message_tree_snapshot: mapAppendOnlyTreeSnapshotToNoir( - rootRollupInputs.startL1ToL2MessageTreeSnapshot, - ), - start_archive_snapshot: mapAppendOnlyTreeSnapshotToNoir(rootRollupInputs.startArchiveSnapshot), - new_archive_sibling_path: mapTuple(rootRollupInputs.newArchiveSiblingPath, mapFieldToNoir), - previous_block_hash: mapFieldToNoir(rootRollupInputs.previousBlockHash), - prover_id: mapFieldToNoir(rootRollupInputs.proverId), - // @ts-expect-error - below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)' - blobs_fields: mapTuple(rootRollupInputs.blobFields, mapFieldToNoir), - blob_commitments: mapTuple(rootRollupInputs.blobCommitments, mapBlobCommitmentToNoir), - blobs_hash: mapFieldToNoir(rootRollupInputs.blobsHash), - }; -} - -/** - * Maps the empty block root rollup inputs to noir. - * @param rootRollupInputs - The circuits.js block root rollup inputs. - * @returns The noir block root rollup inputs. - */ -export function mapEmptyBlockRootRollupInputsToNoir( - rootRollupInputs: EmptyBlockRootRollupInputs, -): EmptyBlockRootRollupInputsNoir { - return { - archive: mapAppendOnlyTreeSnapshotToNoir(rootRollupInputs.archive), - block_hash: mapFieldToNoir(rootRollupInputs.blockHash), - global_variables: mapGlobalVariablesToNoir(rootRollupInputs.globalVariables), - vk_tree_root: mapFieldToNoir(rootRollupInputs.vkTreeRoot), - protocol_contract_tree_root: mapFieldToNoir(rootRollupInputs.protocolContractTreeRoot), - prover_id: mapFieldToNoir(rootRollupInputs.proverId), - }; -} - -/** - * Maps the root rollup inputs to noir. - * @param rootRollupInputs - The circuits.js root rollup inputs. - * @returns The noir root rollup inputs. - */ -export function mapRootRollupInputsToNoir(rootRollupInputs: RootRollupInputs): RootRollupInputsNoir { - return { - previous_rollup_data: mapTuple(rootRollupInputs.previousRollupData, mapPreviousRollupBlockDataToNoir), - prover_id: mapFieldToNoir(rootRollupInputs.proverId), - }; -} - -export function mapRecursiveProofToNoir(proof: RecursiveProof) { - return { - fields: mapTuple(proof.proof, mapFieldToNoir) as FixedLengthArray, - }; -} - -export function mapRootParityInputToNoir( - rootParityInput: RootParityInput, -): ParityRootParityInputNoir { - return { - proof: mapRecursiveProofToNoir(rootParityInput.proof), - verification_key: mapVerificationKeyToNoir(rootParityInput.verificationKey, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), - vk_path: mapTuple(rootParityInput.vkPath, mapFieldToNoir), - public_inputs: mapParityPublicInputsToNoir(rootParityInput.publicInputs), - }; -} - -export function mapParityPublicInputsToNoir(parityPublicInputs: ParityPublicInputs): ParityPublicInputsNoir { - return { - sha_root: mapFieldToNoir(parityPublicInputs.shaRoot), - converted_root: mapFieldToNoir(parityPublicInputs.convertedRoot), - vk_tree_root: mapFieldToNoir(parityPublicInputs.vkTreeRoot), - }; -} - -/** - * Maps a root rollup public inputs from noir. - * @param rootRollupPublicInputs - The noir root rollup public inputs. - * @returns The circuits.js root rollup public inputs. - */ -export function mapRootRollupPublicInputsFromNoir( - rootRollupPublicInputs: RootRollupPublicInputsNoir, -): RootRollupPublicInputs { - return new RootRollupPublicInputs( - mapAppendOnlyTreeSnapshotFromNoir(rootRollupPublicInputs.previous_archive), - mapAppendOnlyTreeSnapshotFromNoir(rootRollupPublicInputs.end_archive), - mapFieldFromNoir(rootRollupPublicInputs.previous_block_hash), - mapFieldFromNoir(rootRollupPublicInputs.end_block_hash), - mapFieldFromNoir(rootRollupPublicInputs.end_timestamp), - mapFieldFromNoir(rootRollupPublicInputs.end_block_number), - mapFieldFromNoir(rootRollupPublicInputs.out_hash), - mapTupleFromNoir(rootRollupPublicInputs.fees, AZTEC_MAX_EPOCH_DURATION, mapFeeRecipientFromNoir), - mapFieldFromNoir(rootRollupPublicInputs.vk_tree_root), - mapFieldFromNoir(rootRollupPublicInputs.protocol_contract_tree_root), - mapFieldFromNoir(rootRollupPublicInputs.prover_id), - mapTupleFromNoir( - rootRollupPublicInputs.blob_public_inputs, - AZTEC_MAX_EPOCH_DURATION, - mapBlockBlobPublicInputsFromNoir, - ), - ); -} - -/** - * Maps a parity public inputs from noir. - * @param parityPublicInputs - The noir parity public inputs. - * @returns The circuits.js parity public inputs. - */ -export function mapParityPublicInputsFromNoir(parityPublicInputs: ParityPublicInputsNoir): ParityPublicInputs { - return new ParityPublicInputs( - mapFieldFromNoir(parityPublicInputs.sha_root), - mapFieldFromNoir(parityPublicInputs.converted_root), - mapFieldFromNoir(parityPublicInputs.vk_tree_root), - ); -} - -/** - * Maps a block header to Noir - * @param header - The block header. - * @returns BlockHeader. - */ -export function mapHeaderToNoir(header: BlockHeader): BlockHeaderNoir { - return { - last_archive: mapAppendOnlyTreeSnapshotToNoir(header.lastArchive), - content_commitment: mapContentCommitmentToNoir(header.contentCommitment), - state: mapStateReferenceToNoir(header.state), - global_variables: mapGlobalVariablesToNoir(header.globalVariables), - total_fees: mapFieldToNoir(header.totalFees), - total_mana_used: mapFieldToNoir(header.totalManaUsed), - }; -} - -/** - * Maps a block header from Noir. - * @param header - The block header. - * @returns BlockHeader. - */ -export function mapHeaderFromNoir(header: BlockHeaderNoir): BlockHeader { - return new BlockHeader( - mapAppendOnlyTreeSnapshotFromNoir(header.last_archive), - mapContentCommitmentFromNoir(header.content_commitment), - mapStateReferenceFromNoir(header.state), - mapGlobalVariablesFromNoir(header.global_variables), - mapFieldFromNoir(header.total_fees), - mapFieldFromNoir(header.total_mana_used), - ); -} - -/** - * Maps a content commitment to Noir - * - */ -export function mapContentCommitmentToNoir(contentCommitment: ContentCommitment): ContentCommitmentNoir { - return { - num_txs: mapFieldToNoir(contentCommitment.numTxs), - blobs_hash: mapSha256HashToNoir(contentCommitment.blobsHash), - in_hash: mapSha256HashToNoir(contentCommitment.inHash), - out_hash: mapSha256HashToNoir(contentCommitment.outHash), - }; -} - -/** - * Maps a content commitment to Noir - * - */ -export function mapContentCommitmentFromNoir(contentCommitment: ContentCommitmentNoir): ContentCommitment { - return new ContentCommitment( - mapFieldFromNoir(contentCommitment.num_txs), - mapSha256HashFromNoir(contentCommitment.blobs_hash), - mapSha256HashFromNoir(contentCommitment.in_hash), - mapSha256HashFromNoir(contentCommitment.out_hash), - ); -} - -/** - * Maps state reference to Noir. - * @param stateReference - The state reference. - * @returns Noir representation of state reference. - */ -export function mapStateReferenceToNoir(stateReference: StateReference): StateReferenceNoir { - return { - l1_to_l2_message_tree: mapAppendOnlyTreeSnapshotToNoir(stateReference.l1ToL2MessageTree), - partial: mapPartialStateReferenceToNoir(stateReference.partial), - }; -} - -/** - * Maps state reference from Noir. - * @param stateReference - The state reference. - * @returns State reference - */ -export function mapStateReferenceFromNoir(stateReference: StateReferenceNoir): StateReference { - return new StateReference( - mapAppendOnlyTreeSnapshotFromNoir(stateReference.l1_to_l2_message_tree), - mapPartialStateReferenceFromNoir(stateReference.partial), - ); -} - -/** - * Maps partial state reference from Noir. - * @param partialStateReference - The state reference. - * @returns Partial state reference - */ -export function mapPartialStateReferenceFromNoir( - partialStateReference: PartialStateReferenceNoir, -): PartialStateReference { - return new PartialStateReference( - mapAppendOnlyTreeSnapshotFromNoir(partialStateReference.note_hash_tree), - mapAppendOnlyTreeSnapshotFromNoir(partialStateReference.nullifier_tree), - mapAppendOnlyTreeSnapshotFromNoir(partialStateReference.public_data_tree), - ); -} - -function mapTreeSnapshotsToNoir(snapshots: TreeSnapshots): TreeSnapshotsNoir { - return { - l1_to_l2_message_tree: mapAppendOnlyTreeSnapshotToNoir(snapshots.l1ToL2MessageTree), - note_hash_tree: mapAppendOnlyTreeSnapshotToNoir(snapshots.noteHashTree), - nullifier_tree: mapAppendOnlyTreeSnapshotToNoir(snapshots.nullifierTree), - public_data_tree: mapAppendOnlyTreeSnapshotToNoir(snapshots.publicDataTree), - }; -} - -// function mapTreeSnapshotsFromNoir(snapshots: TreeSnapshotsNoir) { -// return new TreeSnapshots( -// mapAppendOnlyTreeSnapshotFromNoir(snapshots.l1_to_l2_message_tree), -// mapAppendOnlyTreeSnapshotFromNoir(snapshots.note_hash_tree), -// mapAppendOnlyTreeSnapshotFromNoir(snapshots.nullifier_tree), -// mapAppendOnlyTreeSnapshotFromNoir(snapshots.public_data_tree), -// ); -// } - -/** - * Maps the merge rollup inputs to noir. - * @param mergeRollupInputs - The circuits.js merge rollup inputs. - * @returns The noir merge rollup inputs. - */ -export function mapMergeRollupInputsToNoir(mergeRollupInputs: MergeRollupInputs): MergeRollupInputsNoir { - return { - previous_rollup_data: mapTuple(mergeRollupInputs.previousRollupData, mapPreviousRollupDataToNoir), - }; -} - -/** - * Maps the block merge rollup inputs to noir. - * @param mergeRollupInputs - The circuits.js block merge rollup inputs. - * @returns The noir block merge rollup inputs. - */ -export function mapBlockMergeRollupInputsToNoir(mergeRollupInputs: BlockMergeRollupInputs): BlockMergeRollupInputsNoir { - return { - previous_rollup_data: mapTuple(mergeRollupInputs.previousRollupData, mapPreviousRollupBlockDataToNoir), - }; -} - -function mapNoteHashLeafPreimageToNoir(noteHashLeafValue: Fr): NoteHashLeafPreimageNoir { - return { - value: mapFieldToNoir(noteHashLeafValue), - }; -} - -/** - * Maps a nullifier leaf preimage to noir - * @param nullifierLeafPreimage - The nullifier leaf preimage. - * @returns The noir nullifier leaf preimage. - */ -export function mapNullifierLeafPreimageToNoir( - nullifierLeafPreimage: NullifierLeafPreimage, -): NullifierLeafPreimageNoir { - return { - nullifier: mapFieldToNoir(nullifierLeafPreimage.nullifier), - next_nullifier: mapFieldToNoir(nullifierLeafPreimage.nextNullifier), - next_index: mapNumberToNoir(Number(nullifierLeafPreimage.nextIndex)), - }; -} - -function mapMembershipWitnessToNoir(witness: MembershipWitness): MembershipWitnessNoir { - const siblingPath = mapTuple(witness.siblingPath, mapFieldToNoir) as FixedLengthArray; - return { - leaf_index: witness.leafIndex.toString(), - sibling_path: siblingPath, - }; -} - -/** - * Maps a leaf preimage of the public data tree to noir. - */ -export function mapPublicDataTreePreimageToNoir(preimage: PublicDataTreeLeafPreimage): PublicDataTreeLeafPreimageNoir { - return { - slot: mapFieldToNoir(preimage.slot), - value: mapFieldToNoir(preimage.value), - next_slot: mapFieldToNoir(preimage.nextSlot), - next_index: mapNumberToNoir(Number(preimage.nextIndex)), - }; -} - -/** - * Maps a partial state reference to a noir partial state reference. - * @param partialStateReference - The partial state reference. - * @returns The noir partial state reference. - */ -export function mapPartialStateReferenceToNoir( - partialStateReference: PartialStateReference, -): PartialStateReferenceNoir { - return { - note_hash_tree: mapAppendOnlyTreeSnapshotToNoir(partialStateReference.noteHashTree), - nullifier_tree: mapAppendOnlyTreeSnapshotToNoir(partialStateReference.nullifierTree), - public_data_tree: mapAppendOnlyTreeSnapshotToNoir(partialStateReference.publicDataTree), - }; -} - -/** - * Maps private base state diff hints to a noir state diff hints. - * @param hints - The state diff hints. - * @returns The noir state diff hints. - */ -export function mapPrivateBaseStateDiffHintsToNoir(hints: PrivateBaseStateDiffHints): PrivateBaseStateDiffHintsNoir { - return { - nullifier_predecessor_preimages: mapTuple(hints.nullifierPredecessorPreimages, mapNullifierLeafPreimageToNoir), - nullifier_predecessor_membership_witnesses: mapTuple( - hints.nullifierPredecessorMembershipWitnesses, - (witness: MembershipWitness) => mapMembershipWitnessToNoir(witness), - ), - sorted_nullifiers: mapTuple(hints.sortedNullifiers, mapFieldToNoir), - sorted_nullifier_indexes: mapTuple(hints.sortedNullifierIndexes, (index: number) => mapNumberToNoir(index)), - note_hash_subtree_sibling_path: mapTuple(hints.noteHashSubtreeSiblingPath, mapFieldToNoir), - nullifier_subtree_sibling_path: mapTuple(hints.nullifierSubtreeSiblingPath, mapFieldToNoir), - fee_write_low_leaf_preimage: mapPublicDataTreePreimageToNoir(hints.feeWriteLowLeafPreimage), - fee_write_low_leaf_membership_witness: mapMembershipWitnessToNoir(hints.feeWriteLowLeafMembershipWitness), - fee_write_sibling_path: mapTuple(hints.feeWriteSiblingPath, mapFieldToNoir), - }; -} - -/** - * Maps public base state diff hints to a noir state diff hints. - * @param hints - The state diff hints. - * @returns The noir state diff hints. - */ -export function mapPublicBaseStateDiffHintsToNoir(hints: PublicBaseStateDiffHints): PublicBaseStateDiffHintsNoir { - return { - nullifier_predecessor_preimages: mapTuple(hints.nullifierPredecessorPreimages, mapNullifierLeafPreimageToNoir), - nullifier_predecessor_membership_witnesses: mapTuple( - hints.nullifierPredecessorMembershipWitnesses, - (witness: MembershipWitness) => mapMembershipWitnessToNoir(witness), - ), - sorted_nullifiers: mapTuple(hints.sortedNullifiers, mapFieldToNoir), - sorted_nullifier_indexes: mapTuple(hints.sortedNullifierIndexes, (index: number) => mapNumberToNoir(index)), - note_hash_subtree_sibling_path: mapTuple(hints.noteHashSubtreeSiblingPath, mapFieldToNoir), - nullifier_subtree_sibling_path: mapTuple(hints.nullifierSubtreeSiblingPath, mapFieldToNoir), - low_public_data_writes_preimages: mapTuple(hints.lowPublicDataWritesPreimages, mapPublicDataTreePreimageToNoir), - low_public_data_writes_witnesses: mapTuple( - hints.lowPublicDataWritesMembershipWitnesses, - (witness: MembershipWitness) => mapMembershipWitnessToNoir(witness), - ), - public_data_tree_sibling_paths: mapTuple(hints.publicDataTreeSiblingPaths, path => mapTuple(path, mapFieldToNoir)), - }; -} - -/** - * Maps base parity inputs to noir. - * @param inputs - The circuits.js base parity inputs. - * @returns The noir base parity inputs. - */ -export function mapBaseParityInputsToNoir(inputs: BaseParityInputs): BaseParityInputsNoir { - return { - msgs: mapTuple(inputs.msgs, mapFieldToNoir), - vk_tree_root: mapFieldToNoir(inputs.vkTreeRoot), - }; -} - -/** - * Maps root parity inputs to noir. - * @param inputs - The circuits.js root parity inputs. - * @returns The noir root parity inputs. - */ -export function mapRootParityInputsToNoir(inputs: RootParityInputs): RootParityInputsNoir { - return { - children: mapTuple(inputs.children, mapRootParityInputToNoir), - }; -} - -function mapPrivateTubeDataToNoir(data: PrivateTubeData): PrivateTubeDataNoir { - return { - public_inputs: mapKernelCircuitPublicInputsToNoir(data.publicInputs), - proof: mapRecursiveProofToNoir(data.proof), - vk_data: mapVkWitnessDataToNoir(data.vkData, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), - }; -} - -/** - * Maps the inputs to the base rollup to noir. - * @param input - The circuits.js base rollup inputs. - * @returns The noir base rollup inputs. - */ -export function mapPrivateBaseRollupInputsToNoir(inputs: PrivateBaseRollupInputs): PrivateBaseRollupInputsNoir { - return { - tube_data: mapPrivateTubeDataToNoir(inputs.tubeData), - start: mapPartialStateReferenceToNoir(inputs.hints.start), - start_sponge_blob: mapSpongeBlobToNoir(inputs.hints.startSpongeBlob), - state_diff_hints: mapPrivateBaseStateDiffHintsToNoir(inputs.hints.stateDiffHints), - - archive_root_membership_witness: mapMembershipWitnessToNoir(inputs.hints.archiveRootMembershipWitness), - constants: mapConstantRollupDataToNoir(inputs.hints.constants), - fee_payer_fee_juice_balance_read_hint: mapPublicDataHintToNoir(inputs.hints.feePayerFeeJuiceBalanceReadHint), - }; -} - -function mapPublicTubeDataToNoir(data: PublicTubeData): PublicTubeDataNoir { - return { - public_inputs: mapPrivateToPublicKernelCircuitPublicInputsToNoir(data.publicInputs), - proof: mapRecursiveProofToNoir(data.proof), - vk_data: mapVkWitnessDataToNoir(data.vkData, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), - }; -} - -function mapAvmProofDataToNoir(data: AvmProofData): AvmProofDataNoir { - return { - public_inputs: mapAvmCircuitPublicInputsToNoir(data.publicInputs), - proof: mapRecursiveProofToNoir(data.proof), - vk_data: mapVkWitnessDataToNoir(data.vkData, AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS), - }; -} - -export function mapPublicBaseRollupInputsToNoir(inputs: PublicBaseRollupInputs): PublicBaseRollupInputsNoir { - return { - tube_data: mapPublicTubeDataToNoir(inputs.tubeData), - avm_proof_data: mapAvmProofDataToNoir(inputs.avmProofData), - start: mapPartialStateReferenceToNoir(inputs.hints.start), - start_sponge_blob: mapSpongeBlobToNoir(inputs.hints.startSpongeBlob), - state_diff_hints: mapPublicBaseStateDiffHintsToNoir(inputs.hints.stateDiffHints), - - archive_root_membership_witness: mapMembershipWitnessToNoir(inputs.hints.archiveRootMembershipWitness), - constants: mapConstantRollupDataToNoir(inputs.hints.constants), - }; -} - -export function mapEmptyKernelInputsToNoir(inputs: PrivateKernelEmptyInputs): PrivateKernelEmptyPrivateInputsNoir { - return { - empty_nested: mapEmptyNestedDataToNoir(inputs.emptyNested), - historical_header: mapHeaderToNoir(inputs.header), - chain_id: mapFieldToNoir(inputs.chainId), - version: mapFieldToNoir(inputs.version), - vk_tree_root: mapFieldToNoir(inputs.vkTreeRoot), - protocol_contract_tree_root: mapFieldToNoir(inputs.protocolContractTreeRoot), - }; -} - -function mapEmptyNestedDataToNoir(inputs: EmptyNestedData): EmptyNestedDataNoir { - return { - proof: mapRecursiveProofToNoir(inputs.proof), - vk: mapVerificationKeyToNoir(inputs.vk, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS), - }; -} diff --git a/yarn-project/noir-protocol-circuits-types/src/utils/client/foreign_call_handler.ts b/yarn-project/noir-protocol-circuits-types/src/utils/client/foreign_call_handler.ts new file mode 100644 index 000000000000..e01c95a83f9e --- /dev/null +++ b/yarn-project/noir-protocol-circuits-types/src/utils/client/foreign_call_handler.ts @@ -0,0 +1,26 @@ +import { Fr } from '@aztec/circuits.js'; +import { applyStringFormatting, createLogger } from '@aztec/foundation/log'; + +import { type ForeignCallInput, type ForeignCallOutput } from '@noir-lang/acvm_js'; +import { strict as assert } from 'assert'; + +function fromACVMField(field: string): Fr { + return Fr.fromBuffer(Buffer.from(field.slice(2), 'hex')); +} + +export function foreignCallHandler(name: string, args: ForeignCallInput[]): Promise { + // ForeignCallInput is actually a string[], so the args are string[][]. + const log = createLogger('noir-protocol-circuits:oracle'); + + if (name === 'debugLog') { + assert(args.length === 3, 'expected 3 arguments for debugLog: msg, fields_length, fields'); + const [msgRaw, _ignoredFieldsSize, fields] = args; + const msg: string = msgRaw.map(acvmField => String.fromCharCode(fromACVMField(acvmField).toNumber())).join(''); + const fieldsFr: Fr[] = fields.map((field: string) => fromACVMField(field)); + log.verbose('debug_log ' + applyStringFormatting(msg, fieldsFr)); + } else { + throw Error(`unexpected oracle during execution: ${name}`); + } + + return Promise.resolve([]); +} diff --git a/yarn-project/noir-protocol-circuits-types/src/utils/foreign_call_handler.ts b/yarn-project/noir-protocol-circuits-types/src/utils/server/foreign_call_handler.ts similarity index 96% rename from yarn-project/noir-protocol-circuits-types/src/utils/foreign_call_handler.ts rename to yarn-project/noir-protocol-circuits-types/src/utils/server/foreign_call_handler.ts index 5cf86ef55ebf..d95dec07a138 100644 --- a/yarn-project/noir-protocol-circuits-types/src/utils/foreign_call_handler.ts +++ b/yarn-project/noir-protocol-circuits-types/src/utils/server/foreign_call_handler.ts @@ -1,4 +1,5 @@ -import { BlockBlobPublicInputs, Fr, SpongeBlob } from '@aztec/circuits.js'; +import { Fr } from '@aztec/circuits.js'; +import { BlockBlobPublicInputs, SpongeBlob } from '@aztec/circuits.js/blobs'; import { Blob } from '@aztec/foundation/blob'; import { applyStringFormatting, createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/p2p/src/config.ts b/yarn-project/p2p/src/config.ts index 0e30bc2efe3a..5f5ea19258a7 100644 --- a/yarn-project/p2p/src/config.ts +++ b/yarn-project/p2p/src/config.ts @@ -170,7 +170,7 @@ export const p2pConfigMappings: ConfigMappingsType = { peerCheckIntervalMS: { env: 'P2P_PEER_CHECK_INTERVAL_MS', description: 'The frequency in which to check for new peers.', - ...numberConfigHelper(1_000), + ...numberConfigHelper(30_000), }, l2QueueSize: { env: 'P2P_L2_QUEUE_SIZE', diff --git a/yarn-project/p2p/src/services/peer-scoring/peer_scoring.ts b/yarn-project/p2p/src/services/peer-scoring/peer_scoring.ts index 7b56fe89a8da..34233435b865 100644 --- a/yarn-project/p2p/src/services/peer-scoring/peer_scoring.ts +++ b/yarn-project/p2p/src/services/peer-scoring/peer_scoring.ts @@ -30,11 +30,11 @@ export class PeerScoring { const orderedValues = config.peerPenaltyValues?.sort((a, b) => a - b); this.peerPenalties = { [PeerErrorSeverity.HighToleranceError]: - orderedValues?.[0] ?? DefaultPeerPenalties[PeerErrorSeverity.LowToleranceError], + orderedValues?.[0] ?? DefaultPeerPenalties[PeerErrorSeverity.HighToleranceError], [PeerErrorSeverity.MidToleranceError]: orderedValues?.[1] ?? DefaultPeerPenalties[PeerErrorSeverity.MidToleranceError], [PeerErrorSeverity.LowToleranceError]: - orderedValues?.[2] ?? DefaultPeerPenalties[PeerErrorSeverity.HighToleranceError], + orderedValues?.[2] ?? DefaultPeerPenalties[PeerErrorSeverity.LowToleranceError], }; } diff --git a/yarn-project/p2p/src/services/peer_manager.ts b/yarn-project/p2p/src/services/peer_manager.ts index d6133bfe9e42..59052dfb9adb 100644 --- a/yarn-project/p2p/src/services/peer_manager.ts +++ b/yarn-project/p2p/src/services/peer_manager.ts @@ -327,6 +327,7 @@ export class PeerManager extends WithTracer { this.logger.trace(`Failed to dial peer ${id} (attempt ${peer.dialAttempts})`, { error: inspect(error) }); this.cachedPeers.set(id, peer); } else { + formatLibp2pDialError(error as Error); this.logger.debug(`Failed to dial peer ${id} (dropping)`, { error: inspect(error) }); this.cachedPeers.delete(id); // Add to timed out peers @@ -376,3 +377,46 @@ export class PeerManager extends WithTracer { this.peerDiscoveryService.off(PeerEvent.DISCOVERED, this.handleDiscoveredPeer); } } + +/** + * copied from github.com/ChainSafe/lodestar + * libp2p errors with extremely noisy errors here, which are deeply nested taking 30-50 lines. + * Some known errors: + * ``` + * Error: The operation was aborted + * Error: stream ended before 1 bytes became available + * Error: Error occurred during XX handshake: Error occurred while verifying signed payload: Peer ID doesn't match libp2p public key + * ``` + * + * Also the error's message is not properly formatted, where the error message is indented and includes the full stack + * ``` + * { + * emessage: '\n' + + * ' Error: stream ended before 1 bytes became available\n' + + * ' at /home/lion/Code/eth2.0/lodestar/node_modules/it-reader/index.js:37:9\n' + + * ' at runMicrotasks ()\n' + + * ' at decoder (/home/lion/Code/eth2.0/lodestar/node_modules/it-length-prefixed/src/decode.js:113:22)\n' + + * ' at first (/home/lion/Code/eth2.0/lodestar/node_modules/it-first/index.js:11:20)\n' + + * ' at Object.exports.read (/home/lion/Code/eth2.0/lodestar/node_modules/multistream-select/src/multistream.js:31:15)\n' + + * ' at module.exports (/home/lion/Code/eth2.0/lodestar/node_modules/multistream-select/src/select.js:21:19)\n' + + * ' at Upgrader._encryptOutbound (/home/lion/Code/eth2.0/lodestar/node_modules/libp2p/src/upgrader.js:397:36)\n' + + * ' at Upgrader.upgradeOutbound (/home/lion/Code/eth2.0/lodestar/node_modules/libp2p/src/upgrader.js:176:11)\n' + + * ' at ClassIsWrapper.dial (/home/lion/Code/eth2.0/lodestar/node_modules/libp2p-tcp/src/index.js:49:18)' + * } + * ``` + * + * Tracking issue https://github.com/libp2p/js-libp2p/issues/996 + */ +function formatLibp2pDialError(e: Error): void { + const errorMessage = e.message.trim(); + const newlineIndex = errorMessage.indexOf('\n'); + e.message = newlineIndex !== -1 ? errorMessage.slice(0, newlineIndex) : errorMessage; + + if ( + e.message.includes('The operation was aborted') || + e.message.includes('stream ended before 1 bytes became available') || + e.message.includes('The operation was aborted') + ) { + e.stack = undefined; + } +} diff --git a/yarn-project/protocol-contracts/package.json b/yarn-project/protocol-contracts/package.json index 6292c2878be6..05001587256e 100644 --- a/yarn-project/protocol-contracts/package.json +++ b/yarn-project/protocol-contracts/package.json @@ -19,8 +19,10 @@ "tsconfig": "./tsconfig.json" }, "scripts": { - "build": "yarn clean && yarn generate && tsc -b", + "build": "yarn clean && yarn generate && yarn generate:cleanup-artifacts && tsc -b", + "build:keep-debug-symbols": "yarn clean && yarn generate && tsc -b", "generate": "yarn generate:data", + "generate:cleanup-artifacts": "node --no-warnings --loader ts-node/esm src/scripts/cleanup_artifacts.ts", "generate:data": "node --no-warnings --loader ts-node/esm src/scripts/generate_data.ts && run -T prettier -w src/protocol_contract_data.ts", "build:dev": "tsc -b --watch", "build:ts": "tsc -b", diff --git a/yarn-project/protocol-contracts/package.local.json b/yarn-project/protocol-contracts/package.local.json index 5d1ffe82a097..14231e1aa440 100644 --- a/yarn-project/protocol-contracts/package.local.json +++ b/yarn-project/protocol-contracts/package.local.json @@ -1,6 +1,6 @@ { "scripts": { - "build": "yarn clean && yarn generate && tsc -b", + "build": "yarn clean && yarn generate && yarn generate:cleanup-artifacts && tsc -b", "build:dev": "tsc -b --watch", "build:ts": "tsc -b", "clean": "rm -rf ./dest .tsbuildinfo ./artifacts" diff --git a/yarn-project/protocol-contracts/src/scripts/cleanup_artifacts.ts b/yarn-project/protocol-contracts/src/scripts/cleanup_artifacts.ts new file mode 100644 index 000000000000..1317b093ee60 --- /dev/null +++ b/yarn-project/protocol-contracts/src/scripts/cleanup_artifacts.ts @@ -0,0 +1,19 @@ +import { fileURLToPath } from '@aztec/foundation/url'; + +import { readFile, readdir, writeFile } from 'fs/promises'; +import { join } from 'path'; + +async function cleanupArtifacts(target: string) { + const files = await readdir(target); + for (const file of files) { + if (!file.endsWith('.json')) { + continue; + } + const fileData = JSON.parse((await readFile(join(target, file), 'utf8')).toString()); + fileData.file_map = {}; + fileData.debug_symbols = {}; + await writeFile(join(target, file), JSON.stringify(fileData)); + } +} + +await cleanupArtifacts(fileURLToPath(new URL('../../artifacts', import.meta.url).href)); diff --git a/yarn-project/prover-client/src/block_builder/light.test.ts b/yarn-project/prover-client/src/block_builder/light.test.ts index c40b340da4ed..26a5cfee69bc 100644 --- a/yarn-project/prover-client/src/block_builder/light.test.ts +++ b/yarn-project/prover-client/src/block_builder/light.test.ts @@ -11,34 +11,36 @@ import { makeBloatedProcessedTx } from '@aztec/circuit-types/test'; import { type AppendOnlyTreeSnapshot, BLOBS_PER_BLOCK, - type BaseOrMergeRollupPublicInputs, BaseParityInputs, - BlockRootRollupInputs, FIELDS_PER_BLOB, Fr, type GlobalVariables, L1_TO_L2_MSG_SUBTREE_HEIGHT, L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, MembershipWitness, - MergeRollupInputs, NESTED_RECURSIVE_PROOF_LENGTH, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, NUM_BASE_PARITY_PER_ROOT_PARITY, type ParityPublicInputs, - PreviousRollupData, - type PrivateBaseRollupHints, - PrivateBaseRollupInputs, - PrivateTubeData, type RecursiveProof, RootParityInput, RootParityInputs, - SpongeBlob, TUBE_VK_INDEX, VK_TREE_HEIGHT, type VerificationKeyAsFields, VkWitnessData, makeEmptyRecursiveProof, } from '@aztec/circuits.js'; +import { SpongeBlob } from '@aztec/circuits.js/blobs'; +import { + type BaseOrMergeRollupPublicInputs, + BlockRootRollupInputs, + MergeRollupInputs, + PreviousRollupData, + type PrivateBaseRollupHints, + PrivateBaseRollupInputs, + PrivateTubeData, +} from '@aztec/circuits.js/rollup'; import { makeGlobalVariables } from '@aztec/circuits.js/testing'; import { Blob } from '@aztec/foundation/blob'; import { padArrayEnd, times } from '@aztec/foundation/collection'; diff --git a/yarn-project/prover-client/src/block_builder/light.ts b/yarn-project/prover-client/src/block_builder/light.ts index 9a95b6ef1ca6..e56986b839a7 100644 --- a/yarn-project/prover-client/src/block_builder/light.ts +++ b/yarn-project/prover-client/src/block_builder/light.ts @@ -7,7 +7,8 @@ import { makeEmptyProcessedTx, toNumBlobFields, } from '@aztec/circuit-types'; -import { Fr, type GlobalVariables, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, SpongeBlob } from '@aztec/circuits.js'; +import { Fr, type GlobalVariables, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/circuits.js'; +import { SpongeBlob } from '@aztec/circuits.js/blobs'; import { padArrayEnd } from '@aztec/foundation/collection'; import { createLogger } from '@aztec/foundation/log'; import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types'; diff --git a/yarn-project/prover-client/src/mocks/fixtures.ts b/yarn-project/prover-client/src/mocks/fixtures.ts index 1aa223c57bb5..a59340bd7d23 100644 --- a/yarn-project/prover-client/src/mocks/fixtures.ts +++ b/yarn-project/prover-client/src/mocks/fixtures.ts @@ -13,7 +13,7 @@ import { padArrayEnd } from '@aztec/foundation/collection'; import { randomBytes } from '@aztec/foundation/crypto'; import { type Logger } from '@aztec/foundation/log'; import { fileURLToPath } from '@aztec/foundation/url'; -import { NativeACVMSimulator, type SimulationProvider, WASMSimulator } from '@aztec/simulator'; +import { NativeACVMSimulator, type SimulationProvider, WASMSimulatorWithBlobs } from '@aztec/simulator'; import { promises as fs } from 'fs'; import path from 'path'; @@ -83,7 +83,7 @@ export async function getSimulationProvider( } } logger?.info('Using WASM ACVM simulation'); - return new WASMSimulator(); + return new WASMSimulatorWithBlobs(); } // Updates the expectedDb trees based on the new note hashes, contracts, and nullifiers from these txs diff --git a/yarn-project/prover-client/src/mocks/test_context.ts b/yarn-project/prover-client/src/mocks/test_context.ts index 803b8d8300e7..cfb64f83be5c 100644 --- a/yarn-project/prover-client/src/mocks/test_context.ts +++ b/yarn-project/prover-client/src/mocks/test_context.ts @@ -24,7 +24,7 @@ import { PublicProcessor, PublicTxSimulator, type SimulationProvider, - WASMSimulator, + WASMSimulatorWithBlobs, type WorldStateDB, } from '@aztec/simulator'; import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; @@ -69,7 +69,7 @@ export class TestContext { logger: Logger, proverCount = 4, createProver: (bbConfig: BBProverConfig) => Promise = _ => - Promise.resolve(new TestCircuitProver(new NoopTelemetryClient(), new WASMSimulator())), + Promise.resolve(new TestCircuitProver(new NoopTelemetryClient(), new WASMSimulatorWithBlobs())), blockNumber = 1, ) { const directoriesToCleanup: string[] = []; diff --git a/yarn-project/prover-client/src/orchestrator/block-building-helpers.ts b/yarn-project/prover-client/src/orchestrator/block-building-helpers.ts index c0271c4a56be..c8a0cc9f34f4 100644 --- a/yarn-project/prover-client/src/orchestrator/block-building-helpers.ts +++ b/yarn-project/prover-client/src/orchestrator/block-building-helpers.ts @@ -9,11 +9,7 @@ import { import { ARCHIVE_HEIGHT, AppendOnlyTreeSnapshot, - type BaseOrMergeRollupPublicInputs, BlockHeader, - BlockMergeRollupInputs, - type BlockRootOrBlockMergePublicInputs, - ConstantRollupData, ContentCommitment, Fr, type GlobalVariables, @@ -21,7 +17,6 @@ import { MAX_NULLIFIERS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MembershipWitness, - MergeRollupInputs, MerkleTreeCalculator, type NESTED_RECURSIVE_PROOF_LENGTH, NOTE_HASH_SUBTREE_HEIGHT, @@ -34,22 +29,29 @@ import { PUBLIC_DATA_TREE_HEIGHT, type ParityPublicInputs, PartialStateReference, - PreviousRollupBlockData, - PreviousRollupData, - PrivateBaseRollupHints, - PrivateBaseStateDiffHints, - PublicBaseRollupHints, - PublicBaseStateDiffHints, PublicDataHint, PublicDataTreeLeaf, PublicDataTreeLeafPreimage, type RecursiveProof, - RootRollupInputs, - type SpongeBlob, StateReference, VK_TREE_HEIGHT, type VerificationKeyAsFields, } from '@aztec/circuits.js'; +import { type SpongeBlob } from '@aztec/circuits.js/blobs'; +import { + type BaseOrMergeRollupPublicInputs, + BlockMergeRollupInputs, + type BlockRootOrBlockMergePublicInputs, + ConstantRollupData, + MergeRollupInputs, + PreviousRollupBlockData, + PreviousRollupData, + PrivateBaseRollupHints, + PrivateBaseStateDiffHints, + PublicBaseRollupHints, + PublicBaseStateDiffHints, + RootRollupInputs, +} from '@aztec/circuits.js/rollup'; import { makeTuple } from '@aztec/foundation/array'; import { Blob } from '@aztec/foundation/blob'; import { padArrayEnd } from '@aztec/foundation/collection'; diff --git a/yarn-project/prover-client/src/orchestrator/block-proving-state.ts b/yarn-project/prover-client/src/orchestrator/block-proving-state.ts index 0c22fe718f55..6bc5efecacbb 100644 --- a/yarn-project/prover-client/src/orchestrator/block-proving-state.ts +++ b/yarn-project/prover-client/src/orchestrator/block-proving-state.ts @@ -2,8 +2,6 @@ import { type L2Block, type MerkleTreeId } from '@aztec/circuit-types'; import { type ARCHIVE_HEIGHT, type AppendOnlyTreeSnapshot, - type BaseOrMergeRollupPublicInputs, - type BlockRootOrBlockMergePublicInputs, type Fr, type GlobalVariables, type L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, @@ -14,9 +12,10 @@ import { type RECURSIVE_PROOF_LENGTH, type RecursiveProof, type RootParityInput, - SpongeBlob, type VerificationKeyAsFields, } from '@aztec/circuits.js'; +import { SpongeBlob } from '@aztec/circuits.js/blobs'; +import { type BaseOrMergeRollupPublicInputs, type BlockRootOrBlockMergePublicInputs } from '@aztec/circuits.js/rollup'; import { type Tuple } from '@aztec/foundation/serialize'; import { type EpochProvingState } from './epoch-proving-state.js'; diff --git a/yarn-project/prover-client/src/orchestrator/epoch-proving-state.ts b/yarn-project/prover-client/src/orchestrator/epoch-proving-state.ts index b4005052c53e..3ea4db2228c3 100644 --- a/yarn-project/prover-client/src/orchestrator/epoch-proving-state.ts +++ b/yarn-project/prover-client/src/orchestrator/epoch-proving-state.ts @@ -2,7 +2,6 @@ import { type MerkleTreeId } from '@aztec/circuit-types'; import { type ARCHIVE_HEIGHT, type AppendOnlyTreeSnapshot, - type BlockRootOrBlockMergePublicInputs, Fr, type GlobalVariables, type L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, @@ -10,9 +9,9 @@ import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, type Proof, type RecursiveProof, - type RootRollupPublicInputs, type VerificationKeyAsFields, } from '@aztec/circuits.js'; +import { type BlockRootOrBlockMergePublicInputs, type RootRollupPublicInputs } from '@aztec/circuits.js/rollup'; import { padArrayEnd } from '@aztec/foundation/collection'; import { type Tuple } from '@aztec/foundation/serialize'; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator.ts b/yarn-project/prover-client/src/orchestrator/orchestrator.ts index 30a4312f97e2..4095deeaac1c 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator.ts @@ -18,14 +18,8 @@ import { AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, type AppendOnlyTreeSnapshot, BLOBS_PER_BLOCK, - type BaseOrMergeRollupPublicInputs, BaseParityInputs, - type BaseRollupHints, - BlobPublicInputs, type BlockHeader, - type BlockRootOrBlockMergePublicInputs, - BlockRootRollupInputs, - EmptyBlockRootRollupInputs, FIELDS_PER_BLOB, Fr, type GlobalVariables, @@ -43,6 +37,14 @@ import { VerificationKeyData, makeEmptyRecursiveProof, } from '@aztec/circuits.js'; +import { BlobPublicInputs } from '@aztec/circuits.js/blobs'; +import { + type BaseOrMergeRollupPublicInputs, + type BaseRollupHints, + type BlockRootOrBlockMergePublicInputs, + BlockRootRollupInputs, + EmptyBlockRootRollupInputs, +} from '@aztec/circuits.js/rollup'; import { makeTuple } from '@aztec/foundation/array'; import { Blob } from '@aztec/foundation/blob'; import { maxBy, padArrayEnd } from '@aztec/foundation/collection'; diff --git a/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts b/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts index bf758abd286c..c5c88dd8ed00 100644 --- a/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts +++ b/yarn-project/prover-client/src/orchestrator/orchestrator_failures.test.ts @@ -2,7 +2,7 @@ import { TestCircuitProver } from '@aztec/bb-prover'; import { type ServerCircuitProver } from '@aztec/circuit-types'; import { timesAsync } from '@aztec/foundation/collection'; import { createLogger } from '@aztec/foundation/log'; -import { WASMSimulator } from '@aztec/simulator'; +import { WASMSimulatorWithBlobs } from '@aztec/simulator'; import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; import { jest } from '@jest/globals'; @@ -28,7 +28,7 @@ describe('prover/orchestrator/failures', () => { let mockProver: ServerCircuitProver; beforeEach(() => { - mockProver = new TestCircuitProver(new NoopTelemetryClient(), new WASMSimulator()); + mockProver = new TestCircuitProver(new NoopTelemetryClient(), new WASMSimulatorWithBlobs()); orchestrator = new ProvingOrchestrator(context.worldState, mockProver, new NoopTelemetryClient()); }); diff --git a/yarn-project/prover-client/src/orchestrator/tx-proving-state.ts b/yarn-project/prover-client/src/orchestrator/tx-proving-state.ts index 311b4aa75a0a..9bdd2eeda4d2 100644 --- a/yarn-project/prover-client/src/orchestrator/tx-proving-state.ts +++ b/yarn-project/prover-client/src/orchestrator/tx-proving-state.ts @@ -3,6 +3,11 @@ import { type AVM_PROOF_LENGTH_IN_FIELDS, AVM_VK_INDEX, type AppendOnlyTreeSnapshot, + type TUBE_PROOF_LENGTH, + TUBE_VK_INDEX, + VkWitnessData, +} from '@aztec/circuits.js'; +import { AvmProofData, type BaseRollupHints, PrivateBaseRollupHints, @@ -11,11 +16,8 @@ import { PublicBaseRollupHints, PublicBaseRollupInputs, PublicTubeData, - type TUBE_PROOF_LENGTH, - TUBE_VK_INDEX, TubeInputs, - VkWitnessData, -} from '@aztec/circuits.js'; +} from '@aztec/circuits.js/rollup'; import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types'; /** diff --git a/yarn-project/prover-client/src/prover-agent/agent-queue-rpc-integration.test.ts b/yarn-project/prover-client/src/prover-agent/agent-queue-rpc-integration.test.ts index fe22d7234957..d6dda59fa3d3 100644 --- a/yarn-project/prover-client/src/prover-agent/agent-queue-rpc-integration.test.ts +++ b/yarn-project/prover-client/src/prover-agent/agent-queue-rpc-integration.test.ts @@ -1,5 +1,6 @@ import { ProvingJobSourceSchema, type ServerCircuitProver } from '@aztec/circuit-types'; -import { ClientIvcProof, Fr, PrivateKernelEmptyInputData, TubeInputs } from '@aztec/circuits.js'; +import { ClientIvcProof, Fr, PrivateKernelEmptyInputData } from '@aztec/circuits.js'; +import { TubeInputs } from '@aztec/circuits.js/rollup'; import { makeAvmCircuitInputs, makeBaseParityInputs, diff --git a/yarn-project/prover-client/src/prover-agent/memory-proving-queue.ts b/yarn-project/prover-client/src/prover-agent/memory-proving-queue.ts index 19657111997e..863a702d1d32 100644 --- a/yarn-project/prover-client/src/prover-agent/memory-proving-queue.ts +++ b/yarn-project/prover-client/src/prover-agent/memory-proving-queue.ts @@ -11,25 +11,27 @@ import { import type { AVM_PROOF_LENGTH_IN_FIELDS, AvmCircuitInputs, - BaseOrMergeRollupPublicInputs, BaseParityInputs, - BlockMergeRollupInputs, - BlockRootOrBlockMergePublicInputs, - BlockRootRollupInputs, - EmptyBlockRootRollupInputs, KernelCircuitPublicInputs, - MergeRollupInputs, NESTED_RECURSIVE_PROOF_LENGTH, ParityPublicInputs, - PrivateBaseRollupInputs, PrivateKernelEmptyInputData, - PublicBaseRollupInputs, RECURSIVE_PROOF_LENGTH, RootParityInputs, - RootRollupInputs, - RootRollupPublicInputs, - TubeInputs, } from '@aztec/circuits.js'; +import { + type BaseOrMergeRollupPublicInputs, + type BlockMergeRollupInputs, + type BlockRootOrBlockMergePublicInputs, + type BlockRootRollupInputs, + type EmptyBlockRootRollupInputs, + type MergeRollupInputs, + type PrivateBaseRollupInputs, + type PublicBaseRollupInputs, + type RootRollupInputs, + type RootRollupPublicInputs, + type TubeInputs, +} from '@aztec/circuits.js/rollup'; import { randomBytes } from '@aztec/foundation/crypto'; import { AbortError, TimeoutError } from '@aztec/foundation/error'; import { createLogger } from '@aztec/foundation/log'; diff --git a/yarn-project/prover-client/src/proving_broker/broker_prover_facade.ts b/yarn-project/prover-client/src/proving_broker/broker_prover_facade.ts index dc20621706dc..6dc3db0a9336 100644 --- a/yarn-project/prover-client/src/proving_broker/broker_prover_facade.ts +++ b/yarn-project/prover-client/src/proving_broker/broker_prover_facade.ts @@ -11,26 +11,28 @@ import { import { type AVM_PROOF_LENGTH_IN_FIELDS, type AvmCircuitInputs, - type BaseOrMergeRollupPublicInputs, type BaseParityInputs, + type KernelCircuitPublicInputs, + type NESTED_RECURSIVE_PROOF_LENGTH, + type ParityPublicInputs, + type PrivateKernelEmptyInputData, + type RECURSIVE_PROOF_LENGTH, + type RootParityInputs, + type TUBE_PROOF_LENGTH, +} from '@aztec/circuits.js'; +import { + type BaseOrMergeRollupPublicInputs, type BlockMergeRollupInputs, type BlockRootOrBlockMergePublicInputs, type BlockRootRollupInputs, type EmptyBlockRootRollupInputs, - type KernelCircuitPublicInputs, type MergeRollupInputs, - type NESTED_RECURSIVE_PROOF_LENGTH, - type ParityPublicInputs, type PrivateBaseRollupInputs, - type PrivateKernelEmptyInputData, type PublicBaseRollupInputs, - type RECURSIVE_PROOF_LENGTH, - type RootParityInputs, type RootRollupInputs, type RootRollupPublicInputs, - type TUBE_PROOF_LENGTH, type TubeInputs, -} from '@aztec/circuits.js'; +} from '@aztec/circuits.js/rollup'; import { sha256 } from '@aztec/foundation/crypto'; import { createLogger } from '@aztec/foundation/log'; import { retryUntil } from '@aztec/foundation/retry'; diff --git a/yarn-project/prover-client/src/test/bb_prover_base_rollup.test.ts b/yarn-project/prover-client/src/test/bb_prover_base_rollup.test.ts index 61b99669c8ff..dc43748fcddd 100644 --- a/yarn-project/prover-client/src/test/bb_prover_base_rollup.test.ts +++ b/yarn-project/prover-client/src/test/bb_prover_base_rollup.test.ts @@ -1,14 +1,8 @@ import { BBNativeRollupProver, type BBProverConfig } from '@aztec/bb-prover'; import { makeEmptyProcessedTx } from '@aztec/circuit-types'; -import { - PRIVATE_KERNEL_EMPTY_INDEX, - type PrivateBaseRollupHints, - PrivateBaseRollupInputs, - PrivateKernelEmptyInputData, - PrivateTubeData, - SpongeBlob, - VkWitnessData, -} from '@aztec/circuits.js'; +import { PRIVATE_KERNEL_EMPTY_INDEX, PrivateKernelEmptyInputData, VkWitnessData } from '@aztec/circuits.js'; +import { SpongeBlob } from '@aztec/circuits.js/blobs'; +import { type PrivateBaseRollupHints, PrivateBaseRollupInputs, PrivateTubeData } from '@aztec/circuits.js/rollup'; import { createLogger } from '@aztec/foundation/log'; import { getVKSiblingPath, getVKTreeRoot } from '@aztec/noir-protocol-circuits-types'; import { protocolContractTreeRoot } from '@aztec/protocol-contracts'; diff --git a/yarn-project/prover-client/src/test/mock_prover.ts b/yarn-project/prover-client/src/test/mock_prover.ts index baf581d8f8ee..f67b31478305 100644 --- a/yarn-project/prover-client/src/test/mock_prover.ts +++ b/yarn-project/prover-client/src/test/mock_prover.ts @@ -14,27 +14,29 @@ import { AVM_PROOF_LENGTH_IN_FIELDS, AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS, type AvmCircuitInputs, - type BaseOrMergeRollupPublicInputs, type BaseParityInputs, - type BlockMergeRollupInputs, - type BlockRootOrBlockMergePublicInputs, - type BlockRootRollupInputs, - type EmptyBlockRootRollupInputs, type KernelCircuitPublicInputs, - type MergeRollupInputs, NESTED_RECURSIVE_PROOF_LENGTH, - type PrivateBaseRollupInputs, type PrivateKernelEmptyInputData, - type PublicBaseRollupInputs, RECURSIVE_PROOF_LENGTH, type RootParityInputs, - type RootRollupInputs, - type RootRollupPublicInputs, TUBE_PROOF_LENGTH, VerificationKeyData, makeEmptyRecursiveProof, makeRecursiveProof, } from '@aztec/circuits.js'; +import { + type BaseOrMergeRollupPublicInputs, + type BlockMergeRollupInputs, + type BlockRootOrBlockMergePublicInputs, + type BlockRootRollupInputs, + type EmptyBlockRootRollupInputs, + type MergeRollupInputs, + type PrivateBaseRollupInputs, + type PublicBaseRollupInputs, + type RootRollupInputs, + type RootRollupPublicInputs, +} from '@aztec/circuits.js/rollup'; import { makeBaseOrMergeRollupPublicInputs, makeBlockRootOrBlockMergeRollupPublicInputs, diff --git a/yarn-project/prover-node/src/job/epoch-proving-job.ts b/yarn-project/prover-node/src/job/epoch-proving-job.ts index e1999365c460..06e5d26fa82b 100644 --- a/yarn-project/prover-node/src/job/epoch-proving-job.ts +++ b/yarn-project/prover-node/src/job/epoch-proving-job.ts @@ -71,12 +71,13 @@ export class EpochProvingJob implements Traceable { }) public async run() { const epochNumber = Number(this.epochNumber); - const epochSize = this.blocks.length; + const epochSizeBlocks = this.blocks.length; + const epochSizeTxs = this.blocks.reduce((total, current) => total + current.body.numberOfTxsIncludingPadded, 0); const [fromBlock, toBlock] = [this.blocks[0].number, this.blocks.at(-1)!.number]; this.log.info(`Starting epoch ${epochNumber} proving job with blocks ${fromBlock} to ${toBlock}`, { fromBlock, toBlock, - epochSize, + epochSizeBlocks, epochNumber, uuid: this.uuid, }); @@ -87,7 +88,7 @@ export class EpochProvingJob implements Traceable { this.runPromise = promise; try { - this.prover.startNewEpoch(epochNumber, fromBlock, epochSize); + this.prover.startNewEpoch(epochNumber, fromBlock, epochSizeBlocks); await asyncPool(this.config.parallelBlockLimit, this.blocks, async block => { const globalVariables = block.header.globalVariables; @@ -136,7 +137,7 @@ export class EpochProvingJob implements Traceable { this.log.info(`Submitted proof for epoch`, { epochNumber, uuid: this.uuid }); this.state = 'completed'; - this.metrics.recordProvingJob(timer); + this.metrics.recordProvingJob(timer, epochSizeBlocks, epochSizeTxs); } catch (err) { this.log.error(`Error running epoch ${epochNumber} prover job`, err, { uuid: this.uuid, epochNumber }); this.state = 'failed'; diff --git a/yarn-project/prover-node/src/metrics.ts b/yarn-project/prover-node/src/metrics.ts index f37e12ef2995..98a6cf36608d 100644 --- a/yarn-project/prover-node/src/metrics.ts +++ b/yarn-project/prover-node/src/metrics.ts @@ -3,6 +3,8 @@ import { type Histogram, Metrics, type TelemetryClient, ValueType } from '@aztec export class ProverNodeMetrics { provingJobDuration: Histogram; + provingJobBlocks: Histogram; + provingJobTransactions: Histogram; constructor(public readonly client: TelemetryClient, name = 'ProverNode') { const meter = client.getMeter(name); @@ -11,10 +13,20 @@ export class ProverNodeMetrics { unit: 'ms', valueType: ValueType.INT, }); + this.provingJobBlocks = meter.createHistogram(Metrics.PROVER_NODE_JOB_BLOCKS, { + description: 'Number of blocks in a proven epoch', + valueType: ValueType.INT, + }); + this.provingJobTransactions = meter.createHistogram(Metrics.PROVER_NODE_JOB_TRANSACTIONS, { + description: 'Number of transactions in a proven epoch', + valueType: ValueType.INT, + }); } - public recordProvingJob(timerOrMs: Timer | number) { + public recordProvingJob(timerOrMs: Timer | number, numBlocks: number, numTxs: number) { const ms = Math.ceil(typeof timerOrMs === 'number' ? timerOrMs : timerOrMs.ms()); this.provingJobDuration.record(ms); + this.provingJobBlocks.record(Math.floor(numBlocks)); + this.provingJobTransactions.record(Math.floor(numTxs)); } } diff --git a/yarn-project/pxe/src/database/kv_pxe_database.ts b/yarn-project/pxe/src/database/kv_pxe_database.ts index 7ff1f19062b9..ebf1c07991cd 100644 --- a/yarn-project/pxe/src/database/kv_pxe_database.ts +++ b/yarn-project/pxe/src/database/kv_pxe_database.ts @@ -538,7 +538,7 @@ export class KVPxeDatabase implements PxeDatabase { return (await toArray(this.#completeAddresses.valuesAsync())).map(v => CompleteAddress.fromBuffer(v)); } - async addContactAddress(address: AztecAddress): Promise { + async addSenderAddress(address: AztecAddress): Promise { if (await this.#addressBook.hasAsync(address.toString())) { return false; } @@ -548,11 +548,11 @@ export class KVPxeDatabase implements PxeDatabase { return true; } - async getContactAddresses(): Promise { + async getSenderAddresses(): Promise { return (await toArray(this.#addressBook.entriesAsync())).map(AztecAddress.fromString); } - async removeContactAddress(address: AztecAddress): Promise { + async removeSenderAddress(address: AztecAddress): Promise { if (!this.#addressBook.hasAsync(address.toString())) { return false; } diff --git a/yarn-project/pxe/src/database/pxe_database.ts b/yarn-project/pxe/src/database/pxe_database.ts index 4f2fd1557f29..6926b2c02afe 100644 --- a/yarn-project/pxe/src/database/pxe_database.ts +++ b/yarn-project/pxe/src/database/pxe_database.ts @@ -119,24 +119,24 @@ export interface PxeDatabase extends ContractArtifactDatabase, ContractInstanceD setHeader(header: BlockHeader): Promise; /** - * Adds contact address to the database. + * Adds sender address to the database. * @param address - The address to add to the address book. * @returns A promise resolving to true if the address was added, false if it already exists. */ - addContactAddress(address: AztecAddress): Promise; + addSenderAddress(address: AztecAddress): Promise; /** - * Retrieves the list of contact addresses in the address book. + * Retrieves the list of sender addresses in the address book. * @returns An array of Aztec addresses. */ - getContactAddresses(): Promise; + getSenderAddresses(): Promise; /** - * Removes a contact address from the database. + * Removes a sender address from the database. * @param address - The address to remove from the address book. * @returns A promise resolving to true if the address was removed, false if it does not exist. */ - removeContactAddress(address: AztecAddress): Promise; + removeSenderAddress(address: AztecAddress): Promise; /** * Adds complete address to the database. diff --git a/yarn-project/pxe/src/pxe_service/error_enriching.ts b/yarn-project/pxe/src/pxe_service/error_enriching.ts index 2c18f72b1e2b..f8ff96632061 100644 --- a/yarn-project/pxe/src/pxe_service/error_enriching.ts +++ b/yarn-project/pxe/src/pxe_service/error_enriching.ts @@ -1,5 +1,8 @@ import { type SimulationError, isNoirCallStackUnresolved } from '@aztec/circuit-types'; -import { AztecAddress, Fr, FunctionSelector, PUBLIC_DISPATCH_SELECTOR } from '@aztec/circuits.js'; +import { PUBLIC_DISPATCH_SELECTOR } from '@aztec/circuits.js/constants'; +import { FunctionSelector } from '@aztec/foundation/abi'; +import { AztecAddress } from '@aztec/foundation/aztec-address'; +import { Fr } from '@aztec/foundation/fields'; import { type Logger } from '@aztec/foundation/log'; import { resolveAssertionMessageFromRevertData, resolveOpcodeLocations } from '@aztec/simulator/errors'; diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index 3a0e982c10db..9db9bb12a598 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -31,22 +31,23 @@ import { UniqueNote, getNonNullifiedL1ToL2MessageWitness, } from '@aztec/circuit-types'; +import type { + CompleteAddress, + ContractClassWithId, + ContractInstanceWithAddress, + GasFees, + L1_TO_L2_MSG_TREE_HEIGHT, + NodeInfo, + PartialAddress, + PrivateKernelTailCircuitPublicInputs, +} from '@aztec/circuits.js'; import { - type AztecAddress, - type CompleteAddress, - type ContractClassWithId, - type ContractInstanceWithAddress, - type GasFees, - type L1_TO_L2_MSG_TREE_HEIGHT, - type NodeInfo, - type PartialAddress, - type PrivateKernelTailCircuitPublicInputs, - computeAddressSecret, computeContractAddressFromInstance, computeContractClassId, getContractClassFromArtifact, -} from '@aztec/circuits.js'; +} from '@aztec/circuits.js/contract'; import { computeNoteHashNonce, siloNullifier } from '@aztec/circuits.js/hash'; +import { computeAddressSecret } from '@aztec/circuits.js/keys'; import { type AbiDecoded, type ContractArtifact, @@ -55,6 +56,7 @@ import { FunctionType, encodeArguments, } from '@aztec/foundation/abi'; +import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr, type Point } from '@aztec/foundation/fields'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { Timer } from '@aztec/foundation/timer'; @@ -164,37 +166,37 @@ export class PXEService implements PXE { return accountCompleteAddress; } - public async registerContact(address: AztecAddress): Promise { + public async registerSender(address: AztecAddress): Promise { const accounts = await this.keyStore.getAccounts(); if (accounts.includes(address)) { - this.log.info(`Account:\n "${address.toString()}"\n already registered.`); + this.log.info(`Sender:\n "${address.toString()}"\n already registered.`); return address; } - const wasAdded = await this.db.addContactAddress(address); + const wasAdded = await this.db.addSenderAddress(address); if (wasAdded) { - this.log.info(`Added contact:\n ${address.toString()}`); + this.log.info(`Added sender:\n ${address.toString()}`); } else { - this.log.info(`Contact:\n "${address.toString()}"\n already registered.`); + this.log.info(`Sender:\n "${address.toString()}"\n already registered.`); } return address; } - public getContacts(): Promise { - const contacts = this.db.getContactAddresses(); + public getSenders(): Promise { + const senders = this.db.getSenderAddresses(); - return Promise.resolve(contacts); + return Promise.resolve(senders); } - public async removeContact(address: AztecAddress): Promise { - const wasRemoved = await this.db.removeContactAddress(address); + public async removeSender(address: AztecAddress): Promise { + const wasRemoved = await this.db.removeSenderAddress(address); if (wasRemoved) { - this.log.info(`Removed contact:\n ${address.toString()}`); + this.log.info(`Removed sender:\n ${address.toString()}`); } else { - this.log.info(`Contact:\n "${address.toString()}"\n not in address book.`); + this.log.info(`Sender:\n "${address.toString()}"\n not in address book.`); } return Promise.resolve(); diff --git a/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts b/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts index d0dc0103bbfe..5f333ecb0c4f 100644 --- a/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts +++ b/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts @@ -1,6 +1,6 @@ import { type AztecNode, type PXE, TxEffect, mockTx, randomInBlock } from '@aztec/circuit-types'; import { INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js/constants'; -import { type L1ContractAddresses } from '@aztec/ethereum'; +import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses'; import { EthAddress } from '@aztec/foundation/eth-address'; import { KeyStore } from '@aztec/key-store'; import { openTmpStore } from '@aztec/kv-store/lmdb'; diff --git a/yarn-project/pxe/src/simulator_oracle/index.ts b/yarn-project/pxe/src/simulator_oracle/index.ts index bb3885695a4c..f19f840a3439 100644 --- a/yarn-project/pxe/src/simulator_oracle/index.ts +++ b/yarn-project/pxe/src/simulator_oracle/index.ts @@ -253,8 +253,8 @@ export class SimulatorOracle implements DBOracle { * finally the index specified tag. We will then query the node with this tag for each address in the address book. * @returns The full list of the users contact addresses. */ - public getContacts(): Promise { - return this.db.getContactAddresses(); + public getSenders(): Promise { + return this.db.getSenderAddresses(); } /** @@ -321,18 +321,19 @@ export class SimulatorOracle implements DBOracle { * @param recipient - The address receiving the notes * @returns A list of indexed tagging secrets */ - async #getIndexedTaggingSecretsForContacts( + async #getIndexedTaggingSecretsForSenders( contractAddress: AztecAddress, recipient: AztecAddress, ): Promise { const recipientCompleteAddress = await this.getCompleteAddress(recipient); const recipientIvsk = await this.keyStore.getMasterIncomingViewingSecretKey(recipient); - // We implicitly add all PXE accounts as contacts, this helps us decrypt tags on notes that we send to ourselves (recipient = us, sender = us) - const contacts = [...(await this.db.getContactAddresses()), ...(await this.keyStore.getAccounts())].filter( + // We implicitly add all PXE accounts as senders, this helps us decrypt tags on notes that we send to ourselves + // (recipient = us, sender = us) + const senders = [...(await this.db.getSenderAddresses()), ...(await this.keyStore.getAccounts())].filter( (address, index, self) => index === self.findIndex(otherAddress => otherAddress.equals(address)), ); - const appTaggingSecrets = contacts.map(contact => { + const appTaggingSecrets = senders.map(contact => { const sharedSecret = computeTaggingSecretPoint(recipientCompleteAddress, recipientIvsk, contact); return poseidon2Hash([sharedSecret.x, sharedSecret.y, contractAddress]); }); @@ -434,7 +435,7 @@ export class SimulatorOracle implements DBOracle { const logsForRecipient: TxScopedL2Log[] = []; // Get all the secrets for the recipient and sender pairs (#9365) - const secrets = await this.#getIndexedTaggingSecretsForContacts(contractAddress, recipient); + const secrets = await this.#getIndexedTaggingSecretsForSenders(contractAddress, recipient); // We fetch logs for a window of indexes in a range: // . diff --git a/yarn-project/pxe/src/simulator_oracle/simulator_oracle.test.ts b/yarn-project/pxe/src/simulator_oracle/simulator_oracle.test.ts index 0db352f96a6f..e70072687536 100644 --- a/yarn-project/pxe/src/simulator_oracle/simulator_oracle.test.ts +++ b/yarn-project/pxe/src/simulator_oracle/simulator_oracle.test.ts @@ -226,7 +226,7 @@ describe('Simulator oracle', () => { return { completeAddress, ivsk: keys.masterIncomingViewingSecretKey, secretKey: new Fr(index) }; }); for (const sender of senders) { - await database.addContactAddress(sender.completeAddress.address); + await database.addSenderAddress(sender.completeAddress.address); } aztecNode.getLogsByTags.mockReset(); }); diff --git a/yarn-project/sequencer-client/src/publisher/l1-publisher-metrics.ts b/yarn-project/sequencer-client/src/publisher/l1-publisher-metrics.ts index f23ac261169b..787b570e0785 100644 --- a/yarn-project/sequencer-client/src/publisher/l1-publisher-metrics.ts +++ b/yarn-project/sequencer-client/src/publisher/l1-publisher-metrics.ts @@ -20,6 +20,8 @@ export class L1PublisherMetrics { private txGas: Histogram; private txCalldataSize: Histogram; private txCalldataGas: Histogram; + private txBlobDataGasUsed: Histogram; + private txBlobDataGasCost: Histogram; constructor(client: TelemetryClient, name = 'L1Publisher') { const meter = client.getMeter(name); @@ -57,6 +59,18 @@ export class L1PublisherMetrics { unit: 'gas', valueType: ValueType.INT, }); + + this.txBlobDataGasUsed = meter.createHistogram(Metrics.L1_PUBLISHER_TX_BLOBDATA_GAS_USED, { + description: 'The amount of blob gas used in transactions', + unit: 'gas', + valueType: ValueType.INT, + }); + + this.txBlobDataGasCost = meter.createHistogram(Metrics.L1_PUBLISHER_TX_BLOBDATA_GAS_COST, { + description: 'The gas cost of blobs in transactions', + unit: 'gwei', + valueType: ValueType.INT, + }); } recordFailedTx(txType: L1TxType) { @@ -98,6 +112,9 @@ export class L1PublisherMetrics { this.txCalldataGas.record(stats.calldataGas, attributes); this.txCalldataSize.record(stats.calldataSize, attributes); + this.txBlobDataGasCost.record(Number(stats.blobDataGas), attributes); + this.txBlobDataGasUsed.record(Number(stats.blobGasUsed), attributes); + try { this.gasPrice.record(parseInt(formatEther(stats.gasPrice, 'gwei'), 10)); } catch (e) { diff --git a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts index a89969ede840..3642f039874c 100644 --- a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts +++ b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts @@ -13,10 +13,9 @@ import { AZTEC_MAX_EPOCH_DURATION, type BlockHeader, EthAddress, - type FeeRecipient, type Proof, - type RootRollupPublicInputs, } from '@aztec/circuits.js'; +import { type FeeRecipient, type RootRollupPublicInputs } from '@aztec/circuits.js/rollup'; import { type EthereumChain, type L1ContractsConfig, @@ -580,6 +579,8 @@ export class L1Publisher { const stats: L1PublishBlockStats = { gasPrice: receipt.effectiveGasPrice, gasUsed: receipt.gasUsed, + blobGasUsed: receipt.blobGasUsed ?? 0n, + blobDataGas: receipt.blobGasPrice ?? 0n, transactionHash: receipt.transactionHash, ...pick(tx!, 'calldataGas', 'calldataSize', 'sender'), ...block.getStats(), @@ -642,6 +643,8 @@ export class L1Publisher { gasPrice: receipt.effectiveGasPrice, gasUsed: receipt.gasUsed, transactionHash: receipt.transactionHash, + blobDataGas: 0n, + blobGasUsed: 0n, ...pick(tx!, 'calldataGas', 'calldataSize', 'sender'), }; this.log.verbose(`Submitted claim epoch proof right to L1 rollup contract`, { @@ -758,6 +761,8 @@ export class L1Publisher { const stats: L1PublishProofStats = { ...pick(receipt, 'gasPrice', 'gasUsed', 'transactionHash'), ...pick(tx!, 'calldataGas', 'calldataSize', 'sender'), + blobDataGas: 0n, + blobGasUsed: 0n, eventName: 'proof-published-to-l1', }; this.log.info(`Published epoch proof to L1 rollup contract`, { ...stats, ...ctx }); diff --git a/yarn-project/sequencer-client/src/sequencer/metrics.ts b/yarn-project/sequencer-client/src/sequencer/metrics.ts index 55cd5b1b145a..806d35534cca 100644 --- a/yarn-project/sequencer-client/src/sequencer/metrics.ts +++ b/yarn-project/sequencer-client/src/sequencer/metrics.ts @@ -19,6 +19,7 @@ export class SequencerMetrics { private stateTransitionBufferDuration: Histogram; private currentBlockNumber: Gauge; private currentBlockSize: Gauge; + private blockBuilderInsertions: Histogram; private timeToCollectAttestations: Gauge; @@ -49,14 +50,23 @@ export class SequencerMetrics { this.currentBlockNumber = meter.createGauge(Metrics.SEQUENCER_CURRENT_BLOCK_NUMBER, { description: 'Current block number', + valueType: ValueType.INT, }); this.currentBlockSize = meter.createGauge(Metrics.SEQUENCER_CURRENT_BLOCK_SIZE, { - description: 'Current block number', + description: 'Current block size', + valueType: ValueType.INT, }); this.timeToCollectAttestations = meter.createGauge(Metrics.SEQUENCER_TIME_TO_COLLECT_ATTESTATIONS, { description: 'The time spent collecting attestations from committee members', + valueType: ValueType.INT, + }); + + this.blockBuilderInsertions = meter.createHistogram(Metrics.SEQUENCER_BLOCK_BUILD_INSERTION_TIME, { + description: 'Timer for tree insertions performed by the block builder', + unit: 'us', + valueType: ValueType.INT, }); this.setCurrentBlock(0, 0); @@ -75,6 +85,10 @@ export class SequencerMetrics { this.timeToCollectAttestations.record(time); } + recordBlockBuilderTreeInsertions(timeUs: number) { + this.blockBuilderInsertions.record(Math.ceil(timeUs)); + } + recordCancelledBlock() { this.blockCounter.add(1, { [Attributes.STATUS]: 'cancelled', diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.ts index bc5457666cb1..e373b26efa17 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.ts @@ -519,7 +519,12 @@ export class Sequencer { this.log.verbose(`Dropping failed txs ${Tx.getHashes(failedTxData).join(', ')}`); await this.p2pClient.deleteTxs(Tx.getHashes(failedTxData)); } + + const start = process.hrtime.bigint(); await blockBuilder.addTxs(processedTxs); + const end = process.hrtime.bigint(); + const duration = Number(end - start) / 1_000; + this.metrics.recordBlockBuilderTreeInsertions(duration); await interrupt?.(processedTxs); diff --git a/yarn-project/simulator/src/providers/acvm_wasm.ts b/yarn-project/simulator/src/providers/acvm_wasm.ts index bed021be5be4..244e6e168a0a 100644 --- a/yarn-project/simulator/src/providers/acvm_wasm.ts +++ b/yarn-project/simulator/src/providers/acvm_wasm.ts @@ -17,7 +17,7 @@ export class WASMSimulator implements SimulationProvider { const _witnessMap = await executeCircuit( decodedBytecode, input, - foreignCallHandler, // handle calls to debug_log and evaluate_blobs mock + foreignCallHandler, // handle calls to debug_log ); return _witnessMap; diff --git a/yarn-project/simulator/src/providers/acvm_wasm_with_blobs.ts b/yarn-project/simulator/src/providers/acvm_wasm_with_blobs.ts new file mode 100644 index 000000000000..78d2f8992a2c --- /dev/null +++ b/yarn-project/simulator/src/providers/acvm_wasm_with_blobs.ts @@ -0,0 +1,25 @@ +import { foreignCallHandler } from '@aztec/noir-protocol-circuits-types'; +import { type NoirCompiledCircuit } from '@aztec/types/noir'; + +import { executeCircuit } from '@noir-lang/acvm_js'; +import { type WitnessMap } from '@noir-lang/types'; + +import { type SimulationProvider } from './simulation_provider.js'; + +export class WASMSimulatorWithBlobs implements SimulationProvider { + async simulateCircuit(input: WitnessMap, compiledCircuit: NoirCompiledCircuit): Promise { + // Execute the circuit on those initial witness values + // + // Decode the bytecode from base64 since the acvm does not know about base64 encoding + const decodedBytecode = Buffer.from(compiledCircuit.bytecode, 'base64'); + // + // Execute the circuit + const _witnessMap = await executeCircuit( + decodedBytecode, + input, + foreignCallHandler, // handle calls to debug_log and evaluate_blobs mock + ); + + return _witnessMap; + } +} diff --git a/yarn-project/simulator/src/providers/index.ts b/yarn-project/simulator/src/providers/index.ts index 634f163865d3..b4a832329bff 100644 --- a/yarn-project/simulator/src/providers/index.ts +++ b/yarn-project/simulator/src/providers/index.ts @@ -1,3 +1,4 @@ export * from './acvm_native.js'; +export * from './acvm_wasm_with_blobs.js'; export * from './simulation_provider.js'; export * from './factory.js'; diff --git a/yarn-project/simulator/src/public/executor_metrics.ts b/yarn-project/simulator/src/public/executor_metrics.ts index 621a3c094981..7fe14a34e34a 100644 --- a/yarn-project/simulator/src/public/executor_metrics.ts +++ b/yarn-project/simulator/src/public/executor_metrics.ts @@ -13,6 +13,7 @@ export class ExecutorMetrics { private fnCount: UpDownCounter; private fnDuration: Histogram; private manaPerSecond: Histogram; + private privateEffectsInsertions: Histogram; constructor(client: TelemetryClient, name = 'PublicExecutor') { this.tracer = client.getTracer(name); @@ -33,6 +34,12 @@ export class ExecutorMetrics { unit: 'mana/s', valueType: ValueType.INT, }); + + this.privateEffectsInsertions = meter.createHistogram(Metrics.PUBLIC_EXECUTION_PRIVATE_EFFECTS_INSERTION, { + description: 'Private effects insertion time', + unit: 'us', + valueType: ValueType.INT, + }); } recordFunctionSimulation(durationMs: number, manaUsed: number, fnName: string) { @@ -55,4 +62,10 @@ export class ExecutorMetrics { [Attributes.OK]: false, }); } + + recordPrivateEffectsInsertion(durationUs: number, type: 'revertible' | 'non-revertible') { + this.privateEffectsInsertions.record(Math.ceil(durationUs), { + [Attributes.REVERTIBILITY]: type, + }); + } } diff --git a/yarn-project/simulator/src/public/public_processor.test.ts b/yarn-project/simulator/src/public/public_processor.test.ts index 51a816e46cf4..e9570c3368f5 100644 --- a/yarn-project/simulator/src/public/public_processor.test.ts +++ b/yarn-project/simulator/src/public/public_processor.test.ts @@ -63,6 +63,7 @@ describe('public_processor', () => { gasUsed: { totalGas: Gas.empty(), teardownGas: Gas.empty(), + publicGas: Gas.empty(), }, revertCode: RevertCode.OK, processedPhases: [], diff --git a/yarn-project/simulator/src/public/public_processor.ts b/yarn-project/simulator/src/public/public_processor.ts index e0f3f328ba33..aeea00c00b6d 100644 --- a/yarn-project/simulator/src/public/public_processor.ts +++ b/yarn-project/simulator/src/public/public_processor.ts @@ -15,6 +15,7 @@ import { type BlockHeader, type ContractDataSource, Fr, + Gas, type GlobalVariables, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, @@ -113,6 +114,8 @@ export class PublicProcessor implements Traceable { const result: ProcessedTx[] = []; const failed: FailedTx[] = []; let returns: NestedProcessReturnValues[] = []; + let totalGas = new Gas(0, 0); + const timer = new Timer(); for (const tx of txs) { // only process up to the limit of the block @@ -123,6 +126,7 @@ export class PublicProcessor implements Traceable { const [processedTx, returnValues] = await this.processTx(tx, txValidator); result.push(processedTx); returns = returns.concat(returnValues); + totalGas = totalGas.add(processedTx.gasUsed.publicGas); } catch (err: any) { const errorMessage = err instanceof Error ? err.message : 'Unknown error'; this.log.warn(`Failed to process tx ${tx.getTxHash()}: ${errorMessage} ${err?.stack}`); @@ -135,6 +139,10 @@ export class PublicProcessor implements Traceable { } } + const duration = timer.s(); + const rate = duration > 0 ? totalGas.l2Gas / duration : 0; + this.metrics.recordAllTxs(totalGas, rate); + return [result, failed, returns]; } @@ -187,6 +195,7 @@ export class PublicProcessor implements Traceable { // b) always had a txHandler with the same db passed to it as this.db, which updated the db in buildBaseRollupHints in this loop // To see how this ^ happens, move back to one shared db in test_context and run orchestrator_multi_public_functions.test.ts // The below is taken from buildBaseRollupHints: + const treeInsertionStart = process.hrtime.bigint(); await this.db.appendLeaves( MerkleTreeId.NOTE_HASH_TREE, padArrayEnd(processedTx.txEffect.noteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX), @@ -211,6 +220,8 @@ export class PublicProcessor implements Traceable { MerkleTreeId.PUBLIC_DATA_TREE, processedTx.txEffect.publicDataWrites.map(x => x.toBuffer()), ); + const treeInsertionEnd = process.hrtime.bigint(); + this.metrics.recordTreeInsertions(Number(treeInsertionEnd - treeInsertionStart) / 1_000); return [processedTx, returnValues ?? []]; } @@ -302,7 +313,7 @@ export class PublicProcessor implements Traceable { const phaseCount = processedPhases.length; const durationMs = timer.ms(); - this.metrics.recordTx(phaseCount, durationMs); + this.metrics.recordTx(phaseCount, durationMs, gasUsed.publicGas); const processedTx = makeProcessedTxFromTxWithPublicCalls(tx, avmProvingRequest, gasUsed, revertCode, revertReason); diff --git a/yarn-project/simulator/src/public/public_processor_metrics.ts b/yarn-project/simulator/src/public/public_processor_metrics.ts index 84d9b52cbded..2f07408a1aa1 100644 --- a/yarn-project/simulator/src/public/public_processor_metrics.ts +++ b/yarn-project/simulator/src/public/public_processor_metrics.ts @@ -1,7 +1,9 @@ import { type TxExecutionPhase } from '@aztec/circuit-types'; +import { type Gas } from '@aztec/circuits.js'; import { type ContractClassRegisteredEvent } from '@aztec/protocol-contracts/class-registerer'; import { Attributes, + type Gauge, type Histogram, Metrics, type TelemetryClient, @@ -21,6 +23,12 @@ export class PublicProcessorMetrics { private phaseCount: UpDownCounter; private bytecodeDeployed: Histogram; + private totalGas: Gauge; + private totalGasHistogram: Histogram; + private gasRate: Histogram; + private txGas: Histogram; + + private treeInsertionDuration: Histogram; constructor(client: TelemetryClient, name = 'PublicProcessor') { this.tracer = client.getTracer(name); @@ -54,6 +62,32 @@ export class PublicProcessorMetrics { description: 'Size of deployed bytecode', unit: 'By', }); + + this.totalGas = meter.createGauge(Metrics.PUBLIC_PROCESSOR_TOTAL_GAS, { + description: 'Total gas used in block', + unit: 'gas', + }); + + this.totalGasHistogram = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TOTAL_GAS_HISTOGRAM, { + description: 'Total gas used in block as histogram', + unit: 'gas/block', + }); + + this.txGas = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TX_GAS, { + description: 'Gas used in transaction', + unit: 'gas/tx', + }); + + this.gasRate = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_GAS_RATE, { + description: 'L2 gas per second for complete block', + unit: 'gas/s', + }); + + this.treeInsertionDuration = meter.createHistogram(Metrics.PUBLIC_PROCESSOR_TREE_INSERTION, { + description: 'How long it takes for tree insertion', + unit: 'us', + valueType: ValueType.INT, + }); } recordPhaseDuration(phaseName: TxExecutionPhase, durationMs: number) { @@ -61,12 +95,36 @@ export class PublicProcessorMetrics { this.phaseDuration.record(Math.ceil(durationMs), { [Attributes.TX_PHASE_NAME]: phaseName }); } - recordTx(phaseCount: number, durationMs: number) { + recordTx(phaseCount: number, durationMs: number, gasUsed: Gas) { this.txPhaseCount.add(phaseCount); this.txDuration.record(Math.ceil(durationMs)); this.txCount.add(1, { [Attributes.OK]: true, }); + this.txGas.record(gasUsed.daGas, { + [Attributes.GAS_DIMENSION]: 'DA', + }); + this.txGas.record(gasUsed.l2Gas, { + [Attributes.GAS_DIMENSION]: 'L2', + }); + } + + recordAllTxs(totalGas: Gas, gasRate: number) { + this.totalGas.record(totalGas.daGas, { + [Attributes.GAS_DIMENSION]: 'DA', + }); + this.totalGas.record(totalGas.l2Gas, { + [Attributes.GAS_DIMENSION]: 'L2', + }); + this.gasRate.record(gasRate, { + [Attributes.GAS_DIMENSION]: 'L2', + }); + this.totalGasHistogram.record(totalGas.daGas, { + [Attributes.GAS_DIMENSION]: 'DA', + }); + this.totalGasHistogram.record(totalGas.l2Gas, { + [Attributes.GAS_DIMENSION]: 'L2', + }); } recordFailedTx() { @@ -89,4 +147,8 @@ export class PublicProcessorMetrics { this.bytecodeDeployed.record(totalBytecode); } } + + recordTreeInsertions(durationUs: number) { + this.treeInsertionDuration.record(Math.ceil(durationUs)); + } } diff --git a/yarn-project/simulator/src/public/public_tx_context.ts b/yarn-project/simulator/src/public/public_tx_context.ts index ec7aaa93316e..62dab19d16ec 100644 --- a/yarn-project/simulator/src/public/public_tx_context.ts +++ b/yarn-project/simulator/src/public/public_tx_context.ts @@ -282,6 +282,15 @@ export class PublicTxContext { return this.getTotalGasUsed().sub(teardownGasLimits).add(this.teardownGasUsed); } + /** + * Compute the public gas used using the actual gas used during teardown instead + * of the teardown gas limit. + */ + getActualPublicGasUsed(): Gas { + assert(this.halted, 'Can only compute actual gas used after tx execution ends'); + return this.gasUsedByPublic.add(this.teardownGasUsed); + } + /** * Get the transaction fee as is available to the specified phase. * Only teardown should have access to the actual transaction fee. diff --git a/yarn-project/simulator/src/public/public_tx_simulator.test.ts b/yarn-project/simulator/src/public/public_tx_simulator.test.ts index fdc11c42ae61..3029c1b1ee28 100644 --- a/yarn-project/simulator/src/public/public_tx_simulator.test.ts +++ b/yarn-project/simulator/src/public/public_tx_simulator.test.ts @@ -295,6 +295,7 @@ describe('public_tx_simulator', () => { expect(txResult.gasUsed).toEqual({ totalGas: expectedTotalGas, teardownGas: Gas.empty(), + publicGas: expectedPublicGasUsed, }); const availableGasForFirstSetup = gasLimits.sub(privateGasUsed); @@ -330,6 +331,7 @@ describe('public_tx_simulator', () => { expect(txResult.gasUsed).toEqual({ totalGas: expectedTotalGas, teardownGas: Gas.empty(), + publicGas: expectedPublicGasUsed, }); const availableGasForFirstAppLogic = gasLimits.sub(privateGasUsed); @@ -365,6 +367,7 @@ describe('public_tx_simulator', () => { expect(txResult.gasUsed).toEqual({ totalGas: expectedTotalGas, teardownGas: expectedTeardownGasUsed, + publicGas: expectedTeardownGasUsed, }); expectAvailableGasForCalls([teardownGasLimits]); @@ -404,6 +407,7 @@ describe('public_tx_simulator', () => { expect(txResult.gasUsed).toEqual({ totalGas: expectedTotalGas, teardownGas: expectedTeardownGasUsed, + publicGas: expectedPublicGasUsed.add(expectedTeardownGasUsed), }); // Check that each enqueued call is allocated the correct amount of gas. @@ -553,6 +557,7 @@ describe('public_tx_simulator', () => { expect(txResult.gasUsed).toEqual({ totalGas: expectedTotalGas, teardownGas: expectedTeardownGasUsed, + publicGas: expectedTotalGas.sub(privateGasUsed), }); const availableGasForSetup = gasLimits.sub(teardownGasLimits).sub(privateGasUsed); @@ -634,6 +639,7 @@ describe('public_tx_simulator', () => { expect(txResult.gasUsed).toEqual({ totalGas: expectedTotalGas, teardownGas: expectedTeardownGasUsed, + publicGas: expectedTotalGas.sub(privateGasUsed), }); const availableGasForSetup = gasLimits.sub(teardownGasLimits).sub(privateGasUsed); @@ -717,6 +723,7 @@ describe('public_tx_simulator', () => { expect(txResult.gasUsed).toEqual({ totalGas: expectedTotalGas, teardownGas: expectedTeardownGasUsed, + publicGas: expectedTotalGas.sub(privateGasUsed), }); const availableGasForSetup = gasLimits.sub(teardownGasLimits).sub(privateGasUsed); @@ -804,6 +811,7 @@ describe('public_tx_simulator', () => { expect(txResult.gasUsed).toEqual({ totalGas: expectedTotalGas, teardownGas: expectedTeardownGasUsed, + publicGas: expectedPublicGasUsed.add(expectedTeardownGasUsed), }); const output = txResult.avmProvingRequest!.inputs.output; diff --git a/yarn-project/simulator/src/public/public_tx_simulator.ts b/yarn-project/simulator/src/public/public_tx_simulator.ts index dc8c3198df4f..b4c91484e275 100644 --- a/yarn-project/simulator/src/public/public_tx_simulator.ts +++ b/yarn-project/simulator/src/public/public_tx_simulator.ts @@ -91,14 +91,20 @@ export class PublicTxSimulator { // FIXME: we shouldn't need to directly modify worldStateDb here! await this.worldStateDB.addNewContracts(tx); + const nonRevertStart = process.hrtime.bigint(); await this.insertNonRevertiblesFromPrivate(context); + const nonRevertEnd = process.hrtime.bigint(); + this.metrics.recordPrivateEffectsInsertion(Number(nonRevertEnd - nonRevertStart) / 1_000, 'non-revertible'); const processedPhases: ProcessedPhase[] = []; if (context.hasPhase(TxExecutionPhase.SETUP)) { const setupResult: ProcessedPhase = await this.simulateSetupPhase(context); processedPhases.push(setupResult); } + const revertStart = process.hrtime.bigint(); await this.insertRevertiblesFromPrivate(context); + const revertEnd = process.hrtime.bigint(); + this.metrics.recordPrivateEffectsInsertion(Number(revertEnd - revertStart) / 1_000, 'revertible'); if (context.hasPhase(TxExecutionPhase.APP_LOGIC)) { const appLogicResult: ProcessedPhase = await this.simulateAppLogicPhase(context); processedPhases.push(appLogicResult); @@ -135,7 +141,11 @@ export class PublicTxSimulator { return { avmProvingRequest, - gasUsed: { totalGas: context.getActualGasUsed(), teardownGas: context.teardownGasUsed }, + gasUsed: { + totalGas: context.getActualGasUsed(), + teardownGas: context.teardownGasUsed, + publicGas: context.getActualPublicGasUsed(), + }, revertCode, revertReason: context.revertReason, processedPhases: processedPhases, @@ -345,7 +355,7 @@ export class PublicTxSimulator { const avmCallResult = await simulator.execute(); const result = avmCallResult.finalize(); - this.log.debug( + this.log.verbose( result.reverted ? `Simulation of enqueued public call ${fnName} reverted with reason ${result.revertReason}.` : `Simulation of enqueued public call ${fnName} completed successfully.`, diff --git a/yarn-project/telemetry-client/src/attributes.ts b/yarn-project/telemetry-client/src/attributes.ts index 364b96d8b24e..6fa7d7c32677 100644 --- a/yarn-project/telemetry-client/src/attributes.ts +++ b/yarn-project/telemetry-client/src/attributes.ts @@ -99,3 +99,9 @@ export const WS_DB_DATA_TYPE = 'aztec.world_state.db_type'; /** Identifier for component database (e.g. archiver, tx pool) */ export const DB_DATA_TYPE = 'aztec.db_type'; + +export const REVERTIBILITY = 'aztec.revertibility'; + +export const GAS_DIMENSION = 'aztec.gas_dimension'; + +export const WORLD_STATE_REQUEST_TYPE = 'aztec.world_state_request'; diff --git a/yarn-project/telemetry-client/src/metrics.ts b/yarn-project/telemetry-client/src/metrics.ts index 84fe768da50c..5e2d33befe8d 100644 --- a/yarn-project/telemetry-client/src/metrics.ts +++ b/yarn-project/telemetry-client/src/metrics.ts @@ -41,6 +41,7 @@ export const ARCHIVER_BLOCK_HEIGHT = 'aztec.archiver.block_height'; export const ARCHIVER_BLOCK_SIZE = 'aztec.archiver.block_size'; export const ARCHIVER_ROLLUP_PROOF_DELAY = 'aztec.archiver.rollup_proof_delay'; export const ARCHIVER_ROLLUP_PROOF_COUNT = 'aztec.archiver.rollup_proof_count'; +export const ARCHIVER_PRUNE_COUNT = 'aztec.archiver.prune_count'; export const NODE_RECEIVE_TX_DURATION = 'aztec.node.receive_tx.duration'; export const NODE_RECEIVE_TX_COUNT = 'aztec.node.receive_tx.count'; @@ -52,6 +53,7 @@ export const SEQUENCER_CURRENT_STATE = 'aztec.sequencer.current.state'; export const SEQUENCER_CURRENT_BLOCK_NUMBER = 'aztec.sequencer.current.block_number'; export const SEQUENCER_CURRENT_BLOCK_SIZE = 'aztec.sequencer.current.block_size'; export const SEQUENCER_TIME_TO_COLLECT_ATTESTATIONS = 'aztec.sequencer.time_to_collect_attestations'; +export const SEQUENCER_BLOCK_BUILD_INSERTION_TIME = 'aztec.sequencer.block_builder_tree_insertion_duration'; export const L1_PUBLISHER_GAS_PRICE = 'aztec.l1_publisher.gas_price'; export const L1_PUBLISHER_TX_COUNT = 'aztec.l1_publisher.tx_count'; @@ -59,18 +61,26 @@ export const L1_PUBLISHER_TX_DURATION = 'aztec.l1_publisher.tx_duration'; export const L1_PUBLISHER_TX_GAS = 'aztec.l1_publisher.tx_gas'; export const L1_PUBLISHER_TX_CALLDATA_SIZE = 'aztec.l1_publisher.tx_calldata_size'; export const L1_PUBLISHER_TX_CALLDATA_GAS = 'aztec.l1_publisher.tx_calldata_gas'; +export const L1_PUBLISHER_TX_BLOBDATA_GAS_USED = 'aztec.l1_publisher.tx_blobdata_gas_used'; +export const L1_PUBLISHER_TX_BLOBDATA_GAS_COST = 'aztec.l1_publisher.tx_blobdata_gas_cost'; export const PUBLIC_PROCESSOR_TX_DURATION = 'aztec.public_processor.tx_duration'; export const PUBLIC_PROCESSOR_TX_COUNT = 'aztec.public_processor.tx_count'; export const PUBLIC_PROCESSOR_TX_PHASE_COUNT = 'aztec.public_processor.tx_phase_count'; +export const PUBLIC_PROCESSOR_TX_GAS = 'aztec.public_processor.tx_gas'; export const PUBLIC_PROCESSOR_PHASE_DURATION = 'aztec.public_processor.phase_duration'; export const PUBLIC_PROCESSOR_PHASE_COUNT = 'aztec.public_processor.phase_count'; export const PUBLIC_PROCESSOR_DEPLOY_BYTECODE_SIZE = 'aztec.public_processor.deploy_bytecode_size'; +export const PUBLIC_PROCESSOR_TOTAL_GAS = 'aztec.public_processor.total_gas'; +export const PUBLIC_PROCESSOR_TOTAL_GAS_HISTOGRAM = 'aztec.public_processor.total_gas_histogram'; +export const PUBLIC_PROCESSOR_GAS_RATE = 'aztec.public_processor.gas_rate'; +export const PUBLIC_PROCESSOR_TREE_INSERTION = 'aztec.public_processor.tree_insertion'; export const PUBLIC_EXECUTOR_SIMULATION_COUNT = 'aztec.public_executor.simulation_count'; export const PUBLIC_EXECUTOR_SIMULATION_DURATION = 'aztec.public_executor.simulation_duration'; export const PUBLIC_EXECUTOR_SIMULATION_MANA_PER_SECOND = 'aztec.public_executor.simulation_mana_per_second'; export const PUBLIC_EXECUTION_SIMULATION_BYTECODE_SIZE = 'aztec.public_executor.simulation_bytecode_size'; +export const PUBLIC_EXECUTION_PRIVATE_EFFECTS_INSERTION = 'aztec.public_executor.private_effects_insertion'; export const PROVING_ORCHESTRATOR_BASE_ROLLUP_INPUTS_DURATION = 'aztec.proving_orchestrator.base_rollup.inputs_duration'; @@ -91,6 +101,8 @@ export const PROVING_QUEUE_DB_USED_SIZE = 'aztec.proving_queue.db.used_size'; export const PROVING_AGENT_IDLE = 'aztec.proving_queue.agent.idle'; export const PROVER_NODE_JOB_DURATION = 'aztec.prover_node.job_duration'; +export const PROVER_NODE_JOB_BLOCKS = 'aztec.prover_node.job_blocks'; +export const PROVER_NODE_JOB_TRANSACTIONS = 'aztec.prover_node.job_transactions'; export const WORLD_STATE_FORK_DURATION = 'aztec.world_state.fork.duration'; export const WORLD_STATE_SYNC_DURATION = 'aztec.world_state.sync.duration'; @@ -103,6 +115,7 @@ export const WORLD_STATE_FINALISED_HEIGHT = 'aztec.world_state.finalised_height' export const WORLD_STATE_OLDEST_BLOCK = 'aztec.world_state.oldest_block'; export const WORLD_STATE_DB_USED_SIZE = 'aztec.world_state.db_used_size'; export const WORLD_STATE_DB_NUM_ITEMS = 'aztec.world_state.db_num_items'; +export const WORLD_STATE_REQUEST_TIME = 'aztec.world_state.request_time'; export const PROOF_VERIFIER_COUNT = 'aztec.proof_verifier.count'; diff --git a/yarn-project/telemetry-client/src/otel.ts b/yarn-project/telemetry-client/src/otel.ts index 14d28f9fe6fe..e8b6d767b489 100644 --- a/yarn-project/telemetry-client/src/otel.ts +++ b/yarn-project/telemetry-client/src/otel.ts @@ -168,6 +168,21 @@ export class OpenTelemetryClient implements TelemetryClient { true, ), }), + new View({ + instrumentType: InstrumentType.HISTOGRAM, + instrumentUnit: 'us', + aggregation: new ExplicitBucketHistogramAggregation( + [ + ...linearBuckets(5, 100, 20), // 20 buckets between 5 and 100us + ...linearBuckets(100, 1_000, 20).slice(1), // another 20 buckets between 100us and 1ms. slice(1) to remove duplicate 100 + ...linearBuckets(1_000, 10_000, 90).slice(1), // 90 buckets between 1ms and 10ms + ...linearBuckets(10_000, 100_000, 20).slice(1), // 20 buckets between 10ms and 100ms + ...linearBuckets(100_000, 1_000_000, 20).slice(1), // 20 buckets between 100ms and 1s + ...linearBuckets(1_000_000, 60_000_000, 20).slice(1), // 20 buckets between 1s and 1m + ], + true, + ), + }), new View({ instrumentType: InstrumentType.HISTOGRAM, instrumentUnit: 'By', @@ -183,6 +198,38 @@ export class OpenTelemetryClient implements TelemetryClient { true, ), }), + new View({ + instrumentType: InstrumentType.HISTOGRAM, + instrumentUnit: 'gas/s', + aggregation: new ExplicitBucketHistogramAggregation( + [...linearBuckets(100_000, 10_000_000, 100), ...linearBuckets(10_000_000, 100_000_000, 100).slice(1)], + true, + ), + }), + new View({ + instrumentType: InstrumentType.HISTOGRAM, + instrumentUnit: 'mana/s', + aggregation: new ExplicitBucketHistogramAggregation( + [...linearBuckets(100_000, 10_000_000, 100), ...linearBuckets(10_000_000, 100_000_000, 100).slice(1)], + true, + ), + }), + new View({ + instrumentType: InstrumentType.HISTOGRAM, + instrumentUnit: 'gas/block', + aggregation: new ExplicitBucketHistogramAggregation( + [...linearBuckets(100_000, 10_000_000, 100), ...linearBuckets(10_000_000, 50_000_000, 50).slice(1)], + true, + ), + }), + new View({ + instrumentType: InstrumentType.HISTOGRAM, + instrumentUnit: 'gas/tx', + aggregation: new ExplicitBucketHistogramAggregation( + [...linearBuckets(50_000, 1_000_000, 20), ...linearBuckets(1_000_000, 10_000_000, 100).slice(1)], + true, + ), + }), ], }); diff --git a/yarn-project/world-state/src/synchronizer/instrumentation.ts b/yarn-project/world-state/src/instrumentation/instrumentation.ts similarity index 75% rename from yarn-project/world-state/src/synchronizer/instrumentation.ts rename to yarn-project/world-state/src/instrumentation/instrumentation.ts index a57ae79fe86d..fa7c7c7d57fb 100644 --- a/yarn-project/world-state/src/synchronizer/instrumentation.ts +++ b/yarn-project/world-state/src/instrumentation/instrumentation.ts @@ -1,8 +1,21 @@ import { MerkleTreeId } from '@aztec/circuit-types'; import { createLogger } from '@aztec/foundation/log'; -import { Attributes, type Gauge, type TelemetryClient, ValueType } from '@aztec/telemetry-client'; - -import { type DBStats, type TreeDBStats, type TreeMeta, type WorldStateStatusFull } from '../native/message.js'; +import { + Attributes, + type Gauge, + type Histogram, + Metrics, + type TelemetryClient, + ValueType, +} from '@aztec/telemetry-client'; + +import { + type DBStats, + type TreeDBStats, + type TreeMeta, + WorldStateMessageType, + type WorldStateStatusFull, +} from '../native/message.js'; type DBTypeString = 'leaf_preimage' | 'leaf_indices' | 'nodes' | 'blocks' | 'block_indices'; @@ -14,43 +27,50 @@ export class WorldStateInstrumentation { private oldestBlock: Gauge; private dbNumItems: Gauge; private dbUsedSize: Gauge; + private requestHistogram: Histogram; constructor(public readonly telemetry: TelemetryClient, private log = createLogger('world-state:instrumentation')) { const meter = telemetry.getMeter('World State'); - this.dbMapSize = meter.createGauge(`aztec.world_state.db_map_size`, { + this.dbMapSize = meter.createGauge(Metrics.WORLD_STATE_DB_MAP_SIZE, { description: `The current configured map size for each merkle tree`, valueType: ValueType.INT, }); - this.treeSize = meter.createGauge(`aztec.world_state.tree_size`, { + this.treeSize = meter.createGauge(Metrics.WORLD_STATE_TREE_SIZE, { description: `The current number of leaves in each merkle tree`, valueType: ValueType.INT, }); - this.unfinalisedHeight = meter.createGauge(`aztec.world_state.unfinalised_height`, { + this.unfinalisedHeight = meter.createGauge(Metrics.WORLD_STATE_UNFINALISED_HEIGHT, { description: `The unfinalised block height of each merkle tree`, valueType: ValueType.INT, }); - this.finalisedHeight = meter.createGauge(`aztec.world_state.finalised_height`, { + this.finalisedHeight = meter.createGauge(Metrics.WORLD_STATE_FINALISED_HEIGHT, { description: `The finalised block height of each merkle tree`, valueType: ValueType.INT, }); - this.oldestBlock = meter.createGauge(`aztec.world_state.oldest_block`, { + this.oldestBlock = meter.createGauge(Metrics.WORLD_STATE_OLDEST_BLOCK, { description: `The oldest historical block of each merkle tree`, valueType: ValueType.INT, }); - this.dbUsedSize = meter.createGauge(`aztec.world_state.db_used_size`, { + this.dbUsedSize = meter.createGauge(Metrics.WORLD_STATE_DB_USED_SIZE, { description: `The current used database size for each db of each merkle tree`, valueType: ValueType.INT, }); - this.dbNumItems = meter.createGauge(`aztec.world_state.db_num_items`, { + this.dbNumItems = meter.createGauge(Metrics.WORLD_STATE_DB_NUM_ITEMS, { description: `The current number of items in each database of each merkle tree`, valueType: ValueType.INT, }); + + this.requestHistogram = meter.createHistogram(Metrics.WORLD_STATE_REQUEST_TIME, { + description: 'The round trip time of world state requests', + unit: 'us', + valueType: ValueType.INT, + }); } private updateTreeStats(treeDbStats: TreeDBStats, treeMeta: TreeMeta, tree: MerkleTreeId) { @@ -119,4 +139,10 @@ export class WorldStateInstrumentation { MerkleTreeId.PUBLIC_DATA_TREE, ); } + + public recordRoundTrip(timeUs: number, request: WorldStateMessageType) { + this.requestHistogram.record(Math.ceil(timeUs), { + [Attributes.WORLD_STATE_REQUEST_TYPE]: WorldStateMessageType[request], + }); + } } diff --git a/yarn-project/world-state/src/native/native_world_state.ts b/yarn-project/world-state/src/native/native_world_state.ts index 332a22008bea..84e25ea60245 100644 --- a/yarn-project/world-state/src/native/native_world_state.ts +++ b/yarn-project/world-state/src/native/native_world_state.ts @@ -21,12 +21,14 @@ import { } from '@aztec/circuits.js'; import { padArrayEnd } from '@aztec/foundation/collection'; import { createLogger } from '@aztec/foundation/log'; +import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; import assert from 'assert/strict'; import { mkdir, mkdtemp, rm } from 'fs/promises'; import { tmpdir } from 'os'; import { join } from 'path'; +import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js'; import { type MerkleTreeAdminDatabase as MerkleTreeDatabase } from '../world-state-db/merkle_tree_db.js'; import { MerkleTreesFacade, MerkleTreesForkFacade, serializeLeaf } from './merkle_trees_facade.js'; import { @@ -58,6 +60,7 @@ export class NativeWorldStateService implements MerkleTreeDatabase { protected constructor( protected readonly instance: NativeWorldState, + protected readonly worldStateInstrumentation: WorldStateInstrumentation, protected readonly log = createLogger('world-state:database'), private readonly cleanup = () => Promise.resolve(), ) {} @@ -66,6 +69,7 @@ export class NativeWorldStateService implements MerkleTreeDatabase { rollupAddress: EthAddress, dataDir: string, dbMapSizeKb: number, + instrumentation = new WorldStateInstrumentation(new NoopTelemetryClient()), log = createLogger('world-state:database'), cleanup = () => Promise.resolve(), ): Promise { @@ -89,8 +93,8 @@ export class NativeWorldStateService implements MerkleTreeDatabase { await mkdir(worldStateDirectory, { recursive: true }); await newWorldStateVersion.writeVersionFile(versionFile); - const instance = new NativeWorldState(worldStateDirectory, dbMapSizeKb); - const worldState = new this(instance, log, cleanup); + const instance = new NativeWorldState(worldStateDirectory, dbMapSizeKb, instrumentation); + const worldState = new this(instance, instrumentation, log, cleanup); try { await worldState.init(); } catch (e) { @@ -101,7 +105,11 @@ export class NativeWorldStateService implements MerkleTreeDatabase { return worldState; } - static async tmp(rollupAddress = EthAddress.ZERO, cleanupTmpDir = true): Promise { + static async tmp( + rollupAddress = EthAddress.ZERO, + cleanupTmpDir = true, + instrumentation = new WorldStateInstrumentation(new NoopTelemetryClient()), + ): Promise { const log = createLogger('world-state:database'); const dataDir = await mkdtemp(join(tmpdir(), 'aztec-world-state-')); const dbMapSizeKb = 10 * 1024 * 1024; @@ -117,7 +125,7 @@ export class NativeWorldStateService implements MerkleTreeDatabase { } }; - return this.new(rollupAddress, dataDir, dbMapSizeKb, log, cleanup); + return this.new(rollupAddress, dataDir, dbMapSizeKb, instrumentation, log, cleanup); } protected async init() { diff --git a/yarn-project/world-state/src/native/native_world_state_instance.ts b/yarn-project/world-state/src/native/native_world_state_instance.ts index 590a1ac916be..25cee92f60d1 100644 --- a/yarn-project/world-state/src/native/native_world_state_instance.ts +++ b/yarn-project/world-state/src/native/native_world_state_instance.ts @@ -12,7 +12,6 @@ import { } from '@aztec/circuits.js'; import { createLogger } from '@aztec/foundation/log'; import { SerialQueue } from '@aztec/foundation/queue'; -import { Timer } from '@aztec/foundation/timer'; import assert from 'assert'; import bindings from 'bindings'; @@ -20,6 +19,7 @@ import { Decoder, Encoder, addExtension } from 'msgpackr'; import { cpus } from 'os'; import { isAnyArrayBuffer } from 'util/types'; +import { type WorldStateInstrumentation } from '../instrumentation/instrumentation.js'; import { MessageHeader, TypedMessage, @@ -82,7 +82,12 @@ export class NativeWorldState implements NativeWorldStateInstance { private queue = new SerialQueue(); /** Creates a new native WorldState instance */ - constructor(dataDir: string, dbMapSizeKb: number, private log = createLogger('world-state:database')) { + constructor( + dataDir: string, + dbMapSizeKb: number, + private instrumentation: WorldStateInstrumentation, + private log = createLogger('world-state:database'), + ) { const threads = Math.min(cpus().length, MAX_WORLD_STATE_THREADS); log.info( `Creating world state data store at directory ${dataDir} with map size ${dbMapSizeKb} KB and ${threads} threads.`, @@ -200,11 +205,12 @@ export class NativeWorldState implements NativeWorldStateInstance { this.log.trace(`Calling messageId=${messageId} ${WorldStateMessageType[messageType]}`); } - const timer = new Timer(); + const start = process.hrtime.bigint(); const request = new TypedMessage(messageType, new MessageHeader({ messageId }), body); const encodedRequest = this.encoder.encode(request); - const encodingDuration = timer.ms(); + const encodingEnd = process.hrtime.bigint(); + const encodingDuration = Number(encodingEnd - start) / 1_000_000; let encodedResponse: any; try { @@ -214,7 +220,9 @@ export class NativeWorldState implements NativeWorldStateInstance { throw error; } - const callDuration = timer.ms() - encodingDuration; + const callEnd = process.hrtime.bigint(); + + const callDuration = Number(callEnd - encodingEnd) / 1_000_000; const buf = Buffer.isBuffer(encodedResponse) ? encodedResponse @@ -238,8 +246,9 @@ export class NativeWorldState implements NativeWorldStateInstance { } const response = TypedMessage.fromMessagePack(decodedResponse); - const decodingDuration = timer.ms() - callDuration; - const totalDuration = timer.ms(); + const decodingEnd = process.hrtime.bigint(); + const decodingDuration = Number(decodingEnd - callEnd) / 1_000_000; + const totalDuration = Number(decodingEnd - start) / 1_000_000; this.log.trace(`Call messageId=${messageId} ${WorldStateMessageType[messageType]} took (ms)`, { totalDuration, encodingDuration, @@ -257,6 +266,9 @@ export class NativeWorldState implements NativeWorldStateInstance { throw new Error('Invalid response message type: ' + response.msgType + ' != ' + messageType); } + const callDurationUs = Number(callEnd - encodingEnd) / 1000; + this.instrumentation.recordRoundTrip(callDurationUs, messageType); + return response.value; } } diff --git a/yarn-project/world-state/src/synchronizer/factory.ts b/yarn-project/world-state/src/synchronizer/factory.ts index f694d0d40724..690fcd03ce2d 100644 --- a/yarn-project/world-state/src/synchronizer/factory.ts +++ b/yarn-project/world-state/src/synchronizer/factory.ts @@ -1,12 +1,9 @@ import { type L1ToL2MessageSource, type L2BlockSource } from '@aztec/circuit-types'; -import { createLogger } from '@aztec/foundation/log'; import { type DataStoreConfig } from '@aztec/kv-store/config'; -import { createStore } from '@aztec/kv-store/lmdb'; import { type TelemetryClient } from '@aztec/telemetry-client'; -import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; +import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js'; import { NativeWorldStateService } from '../native/native_world_state.js'; -import { MerkleTrees } from '../world-state-db/merkle_trees.js'; import { type WorldStateConfig } from './config.js'; import { ServerWorldStateSynchronizer } from './server_world_state_synchronizer.js'; @@ -15,13 +12,14 @@ export async function createWorldStateSynchronizer( l2BlockSource: L2BlockSource & L1ToL2MessageSource, client: TelemetryClient, ) { - const merkleTrees = await createWorldState(config, client); - return new ServerWorldStateSynchronizer(merkleTrees, l2BlockSource, config, client); + const instrumentation = new WorldStateInstrumentation(client); + const merkleTrees = await createWorldState(config, instrumentation); + return new ServerWorldStateSynchronizer(merkleTrees, l2BlockSource, config, instrumentation); } export async function createWorldState( config: WorldStateConfig & DataStoreConfig, - client: TelemetryClient = new NoopTelemetryClient(), + instrumentation: WorldStateInstrumentation, ) { const newConfig = { dataDirectory: config.worldStateDataDirectory ?? config.dataDirectory, @@ -33,13 +31,12 @@ export async function createWorldState( } // If a data directory is provided in config, then create a persistent store. - const merkleTrees = ['true', '1'].includes(process.env.USE_LEGACY_WORLD_STATE ?? '') - ? await MerkleTrees.new(await createStore('world-state', newConfig, createLogger('world-state:lmdb')), client) - : newConfig.dataDirectory + const merkleTrees = newConfig.dataDirectory ? await NativeWorldStateService.new( config.l1Contracts.rollupAddress, newConfig.dataDirectory, newConfig.dataStoreMapSizeKB, + instrumentation, ) : await NativeWorldStateService.tmp( config.l1Contracts.rollupAddress, diff --git a/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.test.ts b/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.test.ts index af06954bc9aa..c58ddf9ab05a 100644 --- a/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.test.ts +++ b/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.test.ts @@ -12,7 +12,6 @@ import { times } from '@aztec/foundation/collection'; import { randomInt } from '@aztec/foundation/crypto'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { SHA256Trunc } from '@aztec/merkle-tree'; -import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; import { jest } from '@jest/globals'; import { type MockProxy, mock } from 'jest-mock-extended'; @@ -213,7 +212,7 @@ class TestWorldStateSynchronizer extends ServerWorldStateSynchronizer { worldStateConfig: WorldStateConfig, private mockBlockStream: L2BlockStream, ) { - super(merkleTrees, blockAndMessagesSource, worldStateConfig, new NoopTelemetryClient()); + super(merkleTrees, blockAndMessagesSource, worldStateConfig); } protected override createBlockStream(): L2BlockStream { diff --git a/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.ts b/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.ts index c43ce6e8bde2..b0d590c3b2a7 100644 --- a/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.ts +++ b/yarn-project/world-state/src/synchronizer/server_world_state_synchronizer.ts @@ -23,12 +23,13 @@ import { createLogger } from '@aztec/foundation/log'; import { promiseWithResolvers } from '@aztec/foundation/promise'; import { elapsed } from '@aztec/foundation/timer'; import { SHA256Trunc } from '@aztec/merkle-tree'; -import { type TelemetryClient, TraceableL2BlockStream } from '@aztec/telemetry-client'; +import { TraceableL2BlockStream } from '@aztec/telemetry-client'; +import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; +import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js'; import { type WorldStateStatusFull } from '../native/message.js'; import { type MerkleTreeAdminDatabase } from '../world-state-db/merkle_tree_db.js'; import { type WorldStateConfig } from './config.js'; -import { WorldStateInstrumentation } from './instrumentation.js'; /** * Synchronizes the world state with the L2 blocks from a L2BlockSource via a block stream. @@ -47,16 +48,14 @@ export class ServerWorldStateSynchronizer private syncPromise = promiseWithResolvers(); protected blockStream: L2BlockStream | undefined; - private instrumentation: WorldStateInstrumentation; constructor( private readonly merkleTreeDb: MerkleTreeAdminDatabase, private readonly l2BlockSource: L2BlockSource & L1ToL2MessageSource, private readonly config: WorldStateConfig, - telemetry: TelemetryClient, + private instrumentation = new WorldStateInstrumentation(new NoopTelemetryClient()), private readonly log = createLogger('world_state'), ) { - this.instrumentation = new WorldStateInstrumentation(telemetry); this.merkleTreeCommitted = this.merkleTreeDb.getCommitted(); this.historyToKeep = config.worldStateBlockHistory < 1 ? undefined : config.worldStateBlockHistory; this.log.info( diff --git a/yarn-project/world-state/src/test/integration.test.ts b/yarn-project/world-state/src/test/integration.test.ts index 49bc37d0e3e1..daa105e78516 100644 --- a/yarn-project/world-state/src/test/integration.test.ts +++ b/yarn-project/world-state/src/test/integration.test.ts @@ -8,6 +8,7 @@ import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; import { jest } from '@jest/globals'; +import { WorldStateInstrumentation } from '../instrumentation/instrumentation.js'; import { NativeWorldStateService } from '../native/native_world_state.js'; import { type WorldStateConfig } from '../synchronizer/config.js'; import { createWorldState } from '../synchronizer/factory.js'; @@ -52,8 +53,16 @@ describe('world-state integration', () => { archiver = new MockPrefilledArchiver(blocks, messages); - db = (await createWorldState(config)) as NativeWorldStateService; - synchronizer = new TestWorldStateSynchronizer(db, archiver, config, new NoopTelemetryClient()); + db = (await createWorldState( + config, + new WorldStateInstrumentation(new NoopTelemetryClient()), + )) as NativeWorldStateService; + synchronizer = new TestWorldStateSynchronizer( + db, + archiver, + config, + new WorldStateInstrumentation(new NoopTelemetryClient()), + ); log.info(`Created synchronizer`); }, 30_000); @@ -146,7 +155,12 @@ describe('world-state integration', () => { await expectSynchedToBlock(5); await synchronizer.stopBlockStream(); - synchronizer = new TestWorldStateSynchronizer(db, archiver, config, new NoopTelemetryClient()); + synchronizer = new TestWorldStateSynchronizer( + db, + archiver, + config, + new WorldStateInstrumentation(new NoopTelemetryClient()), + ); archiver.createBlocks(3); await synchronizer.start(); @@ -167,7 +181,7 @@ describe('world-state integration', () => { db, archiver, { ...config, worldStateProvenBlocksOnly: true }, - new NoopTelemetryClient(), + new WorldStateInstrumentation(new NoopTelemetryClient()), ); archiver.createBlocks(5); @@ -206,7 +220,7 @@ describe('world-state integration', () => { db, archiver, { ...config, worldStateBlockCheckIntervalMS: 1000 }, - new NoopTelemetryClient(), + new WorldStateInstrumentation(new NoopTelemetryClient()), ); }); diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index 9f7fdbb12f1b..c77d7c1fe864 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -553,6 +553,7 @@ __metadata: "@aztec/telemetry-client": "workspace:^" "@aztec/types": "workspace:^" "@aztec/world-state": "workspace:^" + "@iarna/toml": "npm:^2.2.5" "@jest/globals": "npm:^29.5.0" "@noble/curves": "npm:^1.0.0" "@swc/core": "npm:^1.4.11" @@ -881,7 +882,6 @@ __metadata: "@aztec/kv-store": "workspace:^" "@aztec/merkle-tree": "workspace:^" "@aztec/types": "workspace:^" - "@iarna/toml": "npm:^2.2.5" "@jest/globals": "npm:^29.5.0" "@noir-lang/acvm_js": "portal:../../noir/packages/acvm_js" "@noir-lang/noir_codegen": "portal:../../noir/packages/noir_codegen"