diff --git a/.github/RELEASE_FAILED.md b/.github/RELEASE_FAILED.md index 32399d0bd52..ff039aa28eb 100644 --- a/.github/RELEASE_FAILED.md +++ b/.github/RELEASE_FAILED.md @@ -1,6 +1,6 @@ --- title: "Nightly release failed" -assignees: fcarreiro, ludamad +assignees: fcarreiro, ludamad, spypsy --- The most recent nightly release failed. This means that no `bb` artifacts were published (which are required by Noir). diff --git a/.github/ensure-builder/action.yml b/.github/ensure-builder/action.yml index 6ff89d78471..32925ace844 100644 --- a/.github/ensure-builder/action.yml +++ b/.github/ensure-builder/action.yml @@ -70,7 +70,7 @@ runs: ec2_subnet_id: subnet-4cfabd25 ec2_security_group_id: sg-0ccd4e5df0dcca0c9 ec2_key_name: "build-instance" - ec2_instance_tags: '[{"Key": "Keep-Alive", "Value": "true"},{"Key": "Builder", "Value": "true"}]' + ec2_instance_tags: '[{"Key": "Builder", "Value": "true"}]' # This disambiguates from 'tester' - name: Set BUILDER_SPOT_IP and BUILDER_SPOT_KEY shell: bash @@ -100,4 +100,4 @@ runs: - name: Report Exit Code shell: bash if: steps.test.outputs.exit_code != '155' || inputs.spot_strategy == 'None' - run: exit ${{ steps.test.outputs.exit_code }} \ No newline at end of file + run: exit ${{ steps.test.outputs.exit_code }} diff --git a/.github/ensure-tester/action.yml b/.github/ensure-tester/action.yml index fcc896ff596..67a0d68c862 100644 --- a/.github/ensure-tester/action.yml +++ b/.github/ensure-tester/action.yml @@ -78,7 +78,6 @@ runs: ec2_subnet_id: subnet-4cfabd25 ec2_security_group_id: sg-0ccd4e5df0dcca0c9 ec2_key_name: "build-instance" - ec2_instance_tags: '[{"Key": "Keep-Alive", "Value": "true"}]' - name: Ensure Tester Cleanup uses: gacts/run-and-post-run@v1 @@ -107,4 +106,4 @@ runs: - name: Report Exit Code shell: bash if: steps.test.outputs.exit_code != '155' || inputs.spot_strategy == 'None' - run: exit ${{ steps.test.outputs.exit_code }} \ No newline at end of file + run: exit ${{ steps.test.outputs.exit_code }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bf188fd326..2afd63f633d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,6 +95,7 @@ jobs: - 'noir/noir-repo/**' bb: - 'barretenberg/cpp/**' + - 'barretenberg/acir_tests/**' noir-projects: - 'noir-projects/**' yarn-project: @@ -513,7 +514,7 @@ jobs: - uses: actions/checkout@v4 with: { ref: "${{ github.event.pull_request.head.sha }}" } - uses: ./.github/ci-setup-action - - name: Build Bench Binaries + - name: Build Boxes uses: ./.github/ensure-builder timeout-minutes: 40 with: @@ -543,21 +544,21 @@ jobs: export CI=1 USE_CACHE=1 scripts/earthly-ci +prover-client-with-cache - rough-rhino-installer: - needs: [bootstrap, configure] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: { ref: "${{ github.event.pull_request.head.sha }}" } - - uses: ./.github/ci-setup-action - - name: Rough Rhino Installer Helper Script - uses: ./.github/ensure-builder - timeout-minutes: 40 - with: - username: ${{ needs.configure.outputs.username }} - runner_type: builder-x86 - run: | - scripts/earthly-ci ./spartan/releases/rough-rhino/+test-all + # testnet-installer: + # needs: [bootstrap, configure] + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # with: { ref: "${{ github.event.pull_request.head.sha }}" } + # - uses: ./.github/ci-setup-action + # - name: Testnet Installer Helper Script + # uses: ./.github/ensure-builder + # timeout-minutes: 40 + # with: + # username: ${{ needs.configure.outputs.username }} + # runner_type: builder-x86 + # run: | + # scripts/earthly-ci ./spartan/releases/testnet/+test-all protocol-circuits-gates-report: needs: [ci-rest, configure] @@ -656,7 +657,7 @@ jobs: - kind-network-smoke - kind-network-test - boxes-test - - rough-rhino-installer + # - testnet-installer if: always() outputs: failure: ${{ steps.set_failed_jobs.outputs.failure }} diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index 756ba9fde4e..73e70ae5e1a 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -22,6 +22,10 @@ on: description: Whether to respect the Terraform lock required: false default: "true" + sepolia_deployment: + description: Whether to deploy to Sepolia + required: false + default: "false" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -47,6 +51,7 @@ jobs: deployment_salt: ${{ github.event.inputs.deployment_salt }} respect_tf_lock: ${{ github.event.inputs.respect_tf_lock }} run_terraform_destroy: "true" + sepolia_deployment: ${{ github.event.inputs.sepolia_deployment }} secrets: GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} diff --git a/.github/workflows/network-deploy.yml b/.github/workflows/network-deploy.yml index 5a7e655da50..77f92c07841 100644 --- a/.github/workflows/network-deploy.yml +++ b/.github/workflows/network-deploy.yml @@ -43,8 +43,8 @@ on: sepolia_deployment: description: "Whether to deploy on Sepolia network (default: false)" required: false - type: boolean - default: false + type: string + default: "false" secrets: GCP_SA_KEY: required: true @@ -84,8 +84,8 @@ on: sepolia_deployment: description: "Whether to deploy on Sepolia network (default: false)" required: false - type: boolean - default: false + type: string + default: "false" jobs: network_deployment: @@ -164,7 +164,7 @@ jobs: # Destroy fails if the resources are already destroyed, so we continue on error continue-on-error: true run: | - if ${{ inputs.sepolia_deployment }}; then + if ${{ inputs.sepolia_deployment == 'true' }}; then terraform destroy -auto-approve \ -var="RELEASE_NAME=${{ env.NAMESPACE }}" \ -var="VALUES_FILE=${{ env.VALUES_FILE }}" \ @@ -189,7 +189,7 @@ jobs: - name: Terraform Plan working-directory: ./spartan/terraform/deploy-release run: | - if ${{ inputs.sepolia_deployment }}; then + if ${{ inputs.sepolia_deployment == 'true' }}; then terraform plan \ -var="RELEASE_NAME=${{ env.NAMESPACE }}" \ -var="VALUES_FILE=${{ env.VALUES_FILE }}" \ diff --git a/.github/workflows/publish-aztec-packages.yml b/.github/workflows/publish-aztec-packages.yml index fa3f8a053e3..0f1549677aa 100644 --- a/.github/workflows/publish-aztec-packages.yml +++ b/.github/workflows/publish-aztec-packages.yml @@ -316,16 +316,6 @@ jobs: --VERSION=${{ steps.version_step.outputs.VERSION }} \ --DRY_RUN=${{ (github.event.inputs.publish == 'false') && '1' || '0' }} - - name: Publish spartan NPM package - run: | - earthly-ci \ - --no-output \ - --secret NPM_TOKEN=${{ env.NPM_TOKEN }} \ - ./spartan/releases/rough-rhino+publish-npm \ - --DIST_TAG=${{ steps.version_step.outputs.DIST_TAG }} \ - --VERSION=${{ steps.version_step.outputs.VERSION }} \ - --DRY_RUN=${{ (github.event.inputs.publish == 'false') && '1' || '0' }} - publish-aztec-up: needs: [configure, publish-manifests] runs-on: ubuntu-latest diff --git a/.noir-sync-commit b/.noir-sync-commit index ab7c61a3bd7..ba95bd5998e 100644 --- a/.noir-sync-commit +++ b/.noir-sync-commit @@ -1 +1 @@ -913be5b013323449963d31ab00f521f572cfcd67 +ebc4d2cf2b91658a10393733407f33d50a0faaf1 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index bc60251a774..2bf333f137e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,7 +1,7 @@ { - ".": "0.68.2", + ".": "0.69.0", "yarn-project/cli": "0.35.1", - "yarn-project/aztec": "0.68.2", - "barretenberg": "0.68.2", - "barretenberg/ts": "0.68.2" + "yarn-project/aztec": "0.69.0", + "barretenberg": "0.69.0", + "barretenberg/ts": "0.69.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index d30ffde113c..34f403ba568 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,74 @@ # Changelog +## [0.69.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.68.2...aztec-packages-v0.69.0) (2025-01-03) + + +### ⚠ BREAKING CHANGES + +* Switch to using `jsonrpsee` for foreign calls; refactor `run_test`; foreign call layering (https://github.com/noir-lang/noir/pull/6849) + +### Features + +* **docs:** Algolia -> typesense ([#9698](https://github.com/AztecProtocol/aztec-packages/issues/9698)) ([e082063](https://github.com/AztecProtocol/aztec-packages/commit/e0820636bce47d9e8ec3f8c20358d9d4cae0041e)) +* Encapsulated UltraHonk Vanilla IVC ([#10900](https://github.com/AztecProtocol/aztec-packages/issues/10900)) ([fd5f611](https://github.com/AztecProtocol/aztec-packages/commit/fd5f611aca60c9c906a6440fdb5683794a183d53)) +* **LSP:** Suggest trait methods from where clauses (https://github.com/noir-lang/noir/pull/6915) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) +* **ssa:** Hoist add and mul binary ops using known induction variables (https://github.com/noir-lang/noir/pull/6910) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) +* Switch to using `jsonrpsee` for foreign calls; refactor `run_test`; foreign call layering (https://github.com/noir-lang/noir/pull/6849) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) +* Use full IPA recursive verifier in root rollup ([#10962](https://github.com/AztecProtocol/aztec-packages/issues/10962)) ([37095ce](https://github.com/AztecProtocol/aztec-packages/commit/37095ceba560ad66516467387d186b5afd19a6e0)) +* Warn on trait method visibility (https://github.com/noir-lang/noir/pull/6923) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) + + +### Bug Fixes + +* Bigint builtins are foreigns (https://github.com/noir-lang/noir/pull/6892) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) +* **ci:** Acir bench ([#11021](https://github.com/AztecProtocol/aztec-packages/issues/11021)) ([9eaa109](https://github.com/AztecProtocol/aztec-packages/commit/9eaa10983b26616876099896accb0e3093ae8d20)) +* Consistent file_id across installation paths (https://github.com/noir-lang/noir/pull/6912) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) +* Remove unnecessary cast in bit-shift (https://github.com/noir-lang/noir/pull/6890) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) +* Revert "feat(docs): algolia -> typesense" also fix boxes-test ([#11016](https://github.com/AztecProtocol/aztec-packages/issues/11016)) ([a1a4d76](https://github.com/AztecProtocol/aztec-packages/commit/a1a4d760b950ab563fd51b0c73dc0e06dcfe7fed)) +* Small fixes for sepolia deployments ([#10915](https://github.com/AztecProtocol/aztec-packages/issues/10915)) ([37d69bf](https://github.com/AztecProtocol/aztec-packages/commit/37d69bf5601b8f2c7e54f5b69b0376c4eddf10c1)) +* Update prompted foundry install command ([#10995](https://github.com/AztecProtocol/aztec-packages/issues/10995)) ([cd59f2e](https://github.com/AztecProtocol/aztec-packages/commit/cd59f2ef651b38da642009aa2a00c3fe710aa8e6)) +* Use explicit read transactions ([#10911](https://github.com/AztecProtocol/aztec-packages/issues/10911)) ([2a8e01c](https://github.com/AztecProtocol/aztec-packages/commit/2a8e01cc9f9ca77e75991bd584d6752e120c9db6)) + + +### Miscellaneous + +* Add `Instruction::Noop` (https://github.com/noir-lang/noir/pull/6899) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) +* Add `rollup_root` and `rollup_block_merge` to tracked protocol circuits (https://github.com/noir-lang/noir/pull/6903) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) +* Add if/loop tip (separate from no-predicate [#5657](https://github.com/AztecProtocol/aztec-packages/issues/5657)) (https://github.com/noir-lang/noir/pull/6806) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) +* Add rollup circuits to memory reports (https://github.com/noir-lang/noir/pull/6897) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) +* Add spypsy to nightly canary ([#10961](https://github.com/AztecProtocol/aztec-packages/issues/10961)) ([4dca8f5](https://github.com/AztecProtocol/aztec-packages/commit/4dca8f53b36206bcc34e9e502f7cd3674fb8e9c4)) +* Add version number when starting sandbox ([#10935](https://github.com/AztecProtocol/aztec-packages/issues/10935)) ([c8dcd8f](https://github.com/AztecProtocol/aztec-packages/commit/c8dcd8f3e50e6447e1e7a09d768b3aff5f17044b)) +* Bump rc1 tps ([#11012](https://github.com/AztecProtocol/aztec-packages/issues/11012)) ([52176f7](https://github.com/AztecProtocol/aztec-packages/commit/52176f7386f100c894dac40abd3c3ffcf4f6b3b1)) +* **ci:** Memory reports for execution (https://github.com/noir-lang/noir/pull/6907) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) +* Cl/ci3.2 ([#10919](https://github.com/AztecProtocol/aztec-packages/issues/10919)) ([49dacc3](https://github.com/AztecProtocol/aztec-packages/commit/49dacc3378a339f8cc36971b630c52952249f60c)) +* Clean up translator circuit builder function definitions ([#10944](https://github.com/AztecProtocol/aztec-packages/issues/10944)) ([f6fef05](https://github.com/AztecProtocol/aztec-packages/commit/f6fef05119af7714d60f00c52455e52bdfa98288)) +* Disable broken honk test ([#11010](https://github.com/AztecProtocol/aztec-packages/issues/11010)) ([8ad239a](https://github.com/AztecProtocol/aztec-packages/commit/8ad239a7cddcde8df610e9c0287681fc12cca306)) +* Disable tt test ([#10999](https://github.com/AztecProtocol/aztec-packages/issues/10999)) ([d9d64c3](https://github.com/AztecProtocol/aztec-packages/commit/d9d64c39a09774110ef6419831c8e5ca0e322ed1)) +* Document format strings (https://github.com/noir-lang/noir/pull/6920) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) +* Fix flake in e2e-block-build ([#11002](https://github.com/AztecProtocol/aztec-packages/issues/11002)) ([2a2932e](https://github.com/AztecProtocol/aztec-packages/commit/2a2932e1b59462560f0be728469a7977fbb41c6f)) +* Fix mac build ([#10963](https://github.com/AztecProtocol/aztec-packages/issues/10963)) ([158afc4](https://github.com/AztecProtocol/aztec-packages/commit/158afc4cd34a9fc9cb41bcb083b5197eae1ce442)) +* Fix warning (https://github.com/noir-lang/noir/pull/6927) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) +* Fix warnings in avm transpiler ([#11001](https://github.com/AztecProtocol/aztec-packages/issues/11001)) ([07c5b7f](https://github.com/AztecProtocol/aztec-packages/commit/07c5b7fb336a6df88c23693118bb8e6fa07423dd)) +* Move implementation of print foreign call into `nargo` (https://github.com/noir-lang/noir/pull/6865) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) +* Prover.tomls fix ([#11011](https://github.com/AztecProtocol/aztec-packages/issues/11011)) ([565a67b](https://github.com/AztecProtocol/aztec-packages/commit/565a67b94ca88e1a632c616ea3f7079dd081c627)) +* Redo typo PR by Anon-im ([#11009](https://github.com/AztecProtocol/aztec-packages/issues/11009)) ([2044c58](https://github.com/AztecProtocol/aztec-packages/commit/2044c58387b5687658f190cf1b4a078a036eabc0)) +* Redo typo PR by Hack666r ([#10992](https://github.com/AztecProtocol/aztec-packages/issues/10992)) ([018f11e](https://github.com/AztecProtocol/aztec-packages/commit/018f11e39266423376b3a56afbc8aaf54b4de31d)) +* Redo typo PR by MonkeyKing44 ([#10996](https://github.com/AztecProtocol/aztec-packages/issues/10996)) ([faca458](https://github.com/AztecProtocol/aztec-packages/commit/faca458adda3139e92dcb2709f2c087c85842dd8)) +* Redo typo PR by panditdhamdhere ([#11026](https://github.com/AztecProtocol/aztec-packages/issues/11026)) ([8a6de5b](https://github.com/AztecProtocol/aztec-packages/commit/8a6de5b7bece0b7b18d3b1909d1d51d6bd2765b7)) +* Redo typo PR by petryshkaCODE ([#10993](https://github.com/AztecProtocol/aztec-packages/issues/10993)) ([0c6a4be](https://github.com/AztecProtocol/aztec-packages/commit/0c6a4bee82c62a522f69756f0d233ec637cd1a7a)) +* Redo typo PR by VitalikBerashvili ([#10994](https://github.com/AztecProtocol/aztec-packages/issues/10994)) ([da36da4](https://github.com/AztecProtocol/aztec-packages/commit/da36da48560d3610b2d9abf1a56c47d1b28cf9a1)) +* Redo typo PR by whitetechna ([#10997](https://github.com/AztecProtocol/aztec-packages/issues/10997)) ([89a2bd7](https://github.com/AztecProtocol/aztec-packages/commit/89a2bd7fa403ed0ba5472144b7c13d3ab7ab930b)) +* Release Noir(1.0.0-beta.1) (https://github.com/noir-lang/noir/pull/6622) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) +* Remove unused dependency (https://github.com/noir-lang/noir/pull/6922) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) +* Replace relative paths to noir-protocol-circuits ([6b34449](https://github.com/AztecProtocol/aztec-packages/commit/6b344493a8e0c2e4d9ac67f037f9202dfe38c83c)) +* Replace relative paths to noir-protocol-circuits ([11f8a42](https://github.com/AztecProtocol/aztec-packages/commit/11f8a42c1503386c2323c5305c1058853ac05711)) +* Use ssa parser in flattening pass tests (https://github.com/noir-lang/noir/pull/6868) ([dc12c2b](https://github.com/AztecProtocol/aztec-packages/commit/dc12c2b678e0c450c05cbd4748296e17ae73860b)) + + +### Documentation + +* Remove links to (outdated) protocol specs ([#10831](https://github.com/AztecProtocol/aztec-packages/issues/10831)) ([4874d95](https://github.com/AztecProtocol/aztec-packages/commit/4874d95a7fd7103178820724a637479bea39fe0a)) + ## [0.68.2](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.68.1...aztec-packages-v0.68.2) (2024-12-24) diff --git a/avm-transpiler/Cargo.lock b/avm-transpiler/Cargo.lock index 6e6331abfd2..11767391c57 100644 --- a/avm-transpiler/Cargo.lock +++ b/avm-transpiler/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "acir" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir_field", "base64 0.21.7", @@ -20,7 +20,7 @@ dependencies = [ [[package]] name = "acir_field" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "ark-bn254", "ark-ff", @@ -32,7 +32,7 @@ dependencies = [ [[package]] name = "acvm" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir", "acvm_blackbox_solver", @@ -46,7 +46,7 @@ dependencies = [ [[package]] name = "acvm_blackbox_solver" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir", "blake2", @@ -371,7 +371,7 @@ dependencies = [ [[package]] name = "brillig" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir_field", "serde", @@ -379,7 +379,7 @@ dependencies = [ [[package]] name = "brillig_vm" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir", "acvm_blackbox_solver", @@ -676,7 +676,7 @@ dependencies = [ [[package]] name = "fm" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "codespan-reporting", "iter-extended", @@ -837,7 +837,7 @@ checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "iter-extended" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" [[package]] name = "itertools" @@ -942,7 +942,7 @@ dependencies = [ [[package]] name = "noirc_errors" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "base64 0.21.7", @@ -959,7 +959,7 @@ dependencies = [ [[package]] name = "noirc_printable_type" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "iter-extended", diff --git a/avm-transpiler/src/transpile.rs b/avm-transpiler/src/transpile.rs index d8b9c9509c9..dda2a75c657 100644 --- a/avm-transpiler/src/transpile.rs +++ b/avm-transpiler/src/transpile.rs @@ -399,8 +399,8 @@ pub fn brillig_to_avm(brillig_bytecode: &[BrilligOpcode]) -> (Vec< fn handle_foreign_call( avm_instrs: &mut Vec, function: &str, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { match function { "avmOpcodeCall" => handle_external_call(avm_instrs, destinations, inputs, AvmOpcode::CALL), @@ -452,8 +452,8 @@ fn handle_foreign_call( // ) -> bool {} fn handle_external_call( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], opcode: AvmOpcode, ) { if destinations.len() != 1 || inputs.len() != 4 { @@ -496,10 +496,10 @@ fn handle_external_call( opcode, indirect: Some( AddressingModeBuilder::default() - .indirect_operand(&gas_offset_ptr) + .indirect_operand(gas_offset_ptr) .direct_operand(address_offset) - .indirect_operand(&args_offset_ptr) - .direct_operand(&args_size_offset) + .indirect_operand(args_offset_ptr) + .direct_operand(args_size_offset) .direct_operand(success_offset) .build(), ), @@ -528,10 +528,10 @@ fn handle_cast( /// Adds the new instruction to the avm instructions list. fn handle_note_hash_exists( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { - let (note_hash_offset_operand, leaf_index_offset_operand) = match &inputs[..] { + let (note_hash_offset_operand, leaf_index_offset_operand) = match inputs { [ ValueOrArray::MemoryAddress(nh_offset), ValueOrArray::MemoryAddress(li_offset) @@ -540,7 +540,7 @@ fn handle_note_hash_exists( "Transpiler expects ForeignCall::NOTEHASHEXISTS to have 2 inputs of type MemoryAddress, got {:?}", inputs ), }; - let exists_offset_operand = match &destinations[..] { + let exists_offset_operand = match destinations { [ValueOrArray::MemoryAddress(offset)] => offset, _ => panic!( "Transpiler expects ForeignCall::NOTEHASHEXISTS to have 1 output of type MemoryAddress, got {:?}", destinations @@ -566,8 +566,8 @@ fn handle_note_hash_exists( fn handle_emit_unencrypted_log( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { if !destinations.is_empty() || inputs.len() != 2 { panic!( @@ -606,8 +606,8 @@ fn handle_emit_unencrypted_log( fn handle_emit_note_hash_or_nullifier( is_nullifier: bool, // false for note hash, true for nullifier avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { let function_name = if is_nullifier { "EMITNULLIFIER" } else { "EMITNOTEHASH" }; @@ -639,8 +639,8 @@ fn handle_emit_note_hash_or_nullifier( /// Adds the new instruction to the avm instructions list. fn handle_nullifier_exists( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { if destinations.len() != 1 || inputs.len() != 2 { panic!("Transpiler expects ForeignCall::CHECKNULLIFIEREXISTS to have 1 destinations and 2 inputs, got {} and {}", destinations.len(), inputs.len()); @@ -680,8 +680,8 @@ fn handle_nullifier_exists( /// Adds the new instruction to the avm instructions list. fn handle_l1_to_l2_msg_exists( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { if destinations.len() != 1 || inputs.len() != 2 { panic!( @@ -731,8 +731,8 @@ fn handle_l1_to_l2_msg_exists( /// Adds the new instruction to the avm instructions list. fn handle_send_l2_to_l1_msg( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { if !destinations.is_empty() || inputs.len() != 2 { panic!( @@ -780,9 +780,10 @@ fn handle_send_l2_to_l1_msg( fn handle_getter_instruction( avm_instrs: &mut Vec, function: &str, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { + #[allow(clippy::upper_case_acronyms)] enum EnvironmentVariable { ADDRESS, SENDER, @@ -1161,8 +1162,8 @@ fn handle_black_box_function(avm_instrs: &mut Vec, operation: &B fn handle_debug_log( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { if !destinations.is_empty() || inputs.len() != 3 { panic!( @@ -1209,8 +1210,8 @@ fn handle_debug_log( // unconstrained fn calldata_copy_opcode(cdoffset: Field) -> [Field; N] {} fn handle_calldata_copy( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { assert!(inputs.len() == 2); assert!(destinations.len() == 1); @@ -1252,10 +1253,10 @@ fn handle_calldata_copy( // unconstrained fn returndata_size_opcode() -> u32 {} fn handle_returndata_size( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { - assert!(inputs.len() == 0); + assert!(inputs.is_empty()); assert!(destinations.len() == 1); let dest_offset = match destinations[0] { @@ -1275,8 +1276,8 @@ fn handle_returndata_size( // unconstrained fn returndata_copy_opcode(rdoffset: u32, copy_size: u32) -> [Field] {} fn handle_returndata_copy( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { assert!(inputs.len() == 2); assert!(destinations.len() == 2); @@ -1333,11 +1334,11 @@ fn handle_returndata_copy( // unconstrained fn return_opcode(returndata: [Field; N]) {} fn handle_return( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { assert!(inputs.len() == 2); - assert!(destinations.len() == 0); + assert!(destinations.is_empty()); // First arg is the size, which is ignored because it's redundant. let (return_data_offset, return_data_size) = match inputs[1] { @@ -1352,11 +1353,11 @@ fn handle_return( // unconstrained fn revert_opcode(revertdata: [Field]) {} fn handle_revert( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { assert!(inputs.len() == 2); - assert!(destinations.len() == 0); + assert!(destinations.is_empty()); // First arg is the size, which is ignored because it's redundant. let (revert_data_offset, revert_data_size_offset) = match inputs[1] { @@ -1371,8 +1372,8 @@ fn handle_revert( /// The current implementation writes an array of values into storage ( contiguous slots in memory ) fn handle_storage_write( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { assert!(inputs.len() == 2); assert!(destinations.is_empty()); @@ -1409,10 +1410,10 @@ fn handle_storage_write( fn handle_get_contract_instance( avm_instrs: &mut Vec, function: &str, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { - #[allow(non_camel_case_types)] + #[allow(non_camel_case_types, clippy::upper_case_acronyms)] enum ContractInstanceMember { DEPLOYER, CLASS_ID, @@ -1470,8 +1471,8 @@ fn handle_get_contract_instance( /// The current implementation reads an array of values from storage ( contiguous slots in memory ) fn handle_storage_read( avm_instrs: &mut Vec, - destinations: &Vec, - inputs: &Vec, + destinations: &[ValueOrArray], + inputs: &[ValueOrArray], ) { assert!(inputs.len() == 1); // output assert!(destinations.len() == 1); // return value diff --git a/barretenberg/.gitrepo b/barretenberg/.gitrepo index a39983acd92..6a44a1aa0c7 100644 --- a/barretenberg/.gitrepo +++ b/barretenberg/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/AztecProtocol/barretenberg branch = master - commit = b0e1247cdb47c388d1610f99dacea86449cfe291 - parent = c0821bd9f224c84d4e0079fd783812e1e766b92c + commit = e50b5c03a005fc294414b3b9c103bb17e42598fa + parent = 9eaa10983b26616876099896accb0e3093ae8d20 method = merge cmdver = 0.4.6 diff --git a/barretenberg/CHANGELOG.md b/barretenberg/CHANGELOG.md index 683e61b3d29..935ec694eab 100644 --- a/barretenberg/CHANGELOG.md +++ b/barretenberg/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## [0.69.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.68.2...barretenberg-v0.69.0) (2025-01-03) + + +### Features + +* Encapsulated UltraHonk Vanilla IVC ([#10900](https://github.com/AztecProtocol/aztec-packages/issues/10900)) ([fd5f611](https://github.com/AztecProtocol/aztec-packages/commit/fd5f611aca60c9c906a6440fdb5683794a183d53)) +* Use full IPA recursive verifier in root rollup ([#10962](https://github.com/AztecProtocol/aztec-packages/issues/10962)) ([37095ce](https://github.com/AztecProtocol/aztec-packages/commit/37095ceba560ad66516467387d186b5afd19a6e0)) + + +### Bug Fixes + +* Bigint builtins are foreigns (https://github.com/noir-lang/noir/pull/6892) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) +* **ci:** Acir bench ([#11021](https://github.com/AztecProtocol/aztec-packages/issues/11021)) ([9eaa109](https://github.com/AztecProtocol/aztec-packages/commit/9eaa10983b26616876099896accb0e3093ae8d20)) +* Consistent file_id across installation paths (https://github.com/noir-lang/noir/pull/6912) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) +* Remove unnecessary cast in bit-shift (https://github.com/noir-lang/noir/pull/6890) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) + + +### Miscellaneous + +* Add `Instruction::Noop` (https://github.com/noir-lang/noir/pull/6899) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) +* Add `rollup_root` and `rollup_block_merge` to tracked protocol circuits (https://github.com/noir-lang/noir/pull/6903) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) +* Cl/ci3.2 ([#10919](https://github.com/AztecProtocol/aztec-packages/issues/10919)) ([49dacc3](https://github.com/AztecProtocol/aztec-packages/commit/49dacc3378a339f8cc36971b630c52952249f60c)) +* Clean up translator circuit builder function definitions ([#10944](https://github.com/AztecProtocol/aztec-packages/issues/10944)) ([f6fef05](https://github.com/AztecProtocol/aztec-packages/commit/f6fef05119af7714d60f00c52455e52bdfa98288)) +* Disable broken honk test ([#11010](https://github.com/AztecProtocol/aztec-packages/issues/11010)) ([8ad239a](https://github.com/AztecProtocol/aztec-packages/commit/8ad239a7cddcde8df610e9c0287681fc12cca306)) +* Fix mac build ([#10963](https://github.com/AztecProtocol/aztec-packages/issues/10963)) ([158afc4](https://github.com/AztecProtocol/aztec-packages/commit/158afc4cd34a9fc9cb41bcb083b5197eae1ce442)) +* Redo typo PR by Anon-im ([#11009](https://github.com/AztecProtocol/aztec-packages/issues/11009)) ([2044c58](https://github.com/AztecProtocol/aztec-packages/commit/2044c58387b5687658f190cf1b4a078a036eabc0)) +* Redo typo PR by Hack666r ([#10992](https://github.com/AztecProtocol/aztec-packages/issues/10992)) ([018f11e](https://github.com/AztecProtocol/aztec-packages/commit/018f11e39266423376b3a56afbc8aaf54b4de31d)) +* Redo typo PR by MonkeyKing44 ([#10996](https://github.com/AztecProtocol/aztec-packages/issues/10996)) ([faca458](https://github.com/AztecProtocol/aztec-packages/commit/faca458adda3139e92dcb2709f2c087c85842dd8)) +* Redo typo PR by petryshkaCODE ([#10993](https://github.com/AztecProtocol/aztec-packages/issues/10993)) ([0c6a4be](https://github.com/AztecProtocol/aztec-packages/commit/0c6a4bee82c62a522f69756f0d233ec637cd1a7a)) +* Redo typo PR by VitalikBerashvili ([#10994](https://github.com/AztecProtocol/aztec-packages/issues/10994)) ([da36da4](https://github.com/AztecProtocol/aztec-packages/commit/da36da48560d3610b2d9abf1a56c47d1b28cf9a1)) +* Release Noir(1.0.0-beta.1) (https://github.com/noir-lang/noir/pull/6622) ([2d3805a](https://github.com/AztecProtocol/aztec-packages/commit/2d3805a3b682b27bf6275c547b4b3d68d214eebe)) + ## [0.68.2](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.68.1...barretenberg-v0.68.2) (2024-12-24) diff --git a/barretenberg/acir_tests/.rebuild_patterns b/barretenberg/acir_tests/.rebuild_patterns new file mode 100644 index 00000000000..0a2c4767ab6 --- /dev/null +++ b/barretenberg/acir_tests/.rebuild_patterns @@ -0,0 +1 @@ +^barretenberg/acir_tests/ \ No newline at end of file diff --git a/barretenberg/acir_tests/Earthfile b/barretenberg/acir_tests/Earthfile index 37858e05097..eff9239ae55 100644 --- a/barretenberg/acir_tests/Earthfile +++ b/barretenberg/acir_tests/Earthfile @@ -8,6 +8,7 @@ test: benches-bb: FROM ../../+bootstrap-noir-bb WORKDIR /usr/src/barretenberg/acir_tests + RUN ./bootstrap.sh prepare-benches bench: # This target is used for debugging the benchmarking target. diff --git a/barretenberg/acir_tests/bootstrap.sh b/barretenberg/acir_tests/bootstrap.sh index b5504e5d825..1b1a7771d9b 100755 --- a/barretenberg/acir_tests/bootstrap.sh +++ b/barretenberg/acir_tests/bootstrap.sh @@ -4,20 +4,31 @@ source $(git rev-parse --show-toplevel)/ci3/source_bootstrap cmd=${1:-} export CRS_PATH=$HOME/.bb-crs -function build { +function prepare_tests { set -eu - if [ ! -d acir_tests ]; then - cp -R ../../noir/noir-repo/test_programs/execution_success acir_tests - # Running these requires extra gluecode so they're skipped. - rm -rf acir_tests/{diamond_deps_0,workspace,workspace_default_member} - # TODO(https://github.com/AztecProtocol/barretenberg/issues/1108): problem regardless the proof system used - rm -rf acir_tests/regression_5045 - fi + + github_group "acir_tests copy tests" + + rm -rf acir_tests + cp -R ../../noir/noir-repo/test_programs/execution_success acir_tests + # Running these requires extra gluecode so they're skipped. + rm -rf acir_tests/{diamond_deps_0,workspace,workspace_default_member} + # TODO(https://github.com/AztecProtocol/barretenberg/issues/1108): problem regardless the proof system used + rm -rf acir_tests/regression_5045 # COMPILE=2 only compiles the test. - github_group "acir_tests compiling" - parallel --joblog joblog.txt --line-buffered 'COMPILE=2 ./run_test.sh $(basename {})' ::: ./acir_tests/* + denoise "parallel --joblog joblog.txt --line-buffered 'COMPILE=2 ./run_test.sh \$(basename {})' ::: ./acir_tests/*" + github_endgroup +} + +function build_tests { + set -eu + + github_group "acir_tests build" + + prepare_tests + # TODO: This actually breaks things, but shouldn't. We want to do it here and not maintain manually. # Regenerate verify_honk_proof recursive input. @@ -25,139 +36,143 @@ function build { # (cd ./acir_tests/assert_statement && \ # $bb write_recursion_inputs_honk -b ./target/program.json -o ../verify_honk_proof --recursive) - github_group "acir_tests updating yarn" # Update yarn.lock so it can be committed. # Be lenient about bb.js hash changing, even if we try to minimize the occurrences. - (cd browser-test-app && yarn add --dev @aztec/bb.js@../../ts && yarn) - (cd headless-test && yarn) - (cd sol-test && yarn) + denoise "cd browser-test-app && yarn add --dev @aztec/bb.js@../../ts && yarn" + denoise "cd headless-test && yarn" + denoise "cd sol-test && yarn" # The md5sum of everything is the same after each yarn call. # Yet seemingly yarn's content hash will churn unless we reset timestamps find {headless-test,browser-test-app} -exec touch -t 197001010000 {} + 2>/dev/null || true - github_endgroup - github_group "acir_tests building browser-test-app" - (cd browser-test-app && yarn build) + denoise "cd browser-test-app && yarn build" + github_endgroup } function hash { - cache_content_hash ../../noir/.rebuild_patterns ../../noir/.rebuild_patterns_tests ../../barretenberg/cpp/.rebuild_patterns ../../barretenberg/ts/.rebuild_patterns + cache_content_hash \ + ../../noir/.rebuild_patterns \ + ../../noir/.rebuild_patterns_tests \ + ../../barretenberg/cpp/.rebuild_patterns \ + ../../barretenberg/ts/.rebuild_patterns \ + ../../barretenberg/acir_tests/.rebuild_patterns } + function test { set -eu - github_group "acir_tests testing" + local hash=$(hash) - if ! test_should_run barretenberg-acir-tests-$hash; then - github_endgroup - return - fi + test_should_run barretenberg-acir-tests-$hash || return 0 + + github_group "acir_tests testing" # TODO: These are some magic numbers that fit our dev/ci environments. They ultimately need to work on lower hardware. export HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-8} # local jobs=$(($(nproc) / HARDWARE_CONCURRENCY)) local jobs=64 - # Create temporary file descriptor 3, and redirects anything written to it, to parallels stdin. - exec 3> >(parallel -j$jobs --tag --line-buffered --joblog joblog.txt) - local pid=$! - trap "kill -SIGTERM $pid 2>/dev/null || true" EXIT + test_cmds | (cd $root; parallel -j$jobs --tag --line-buffered --joblog joblog.txt) - # Run function for syntactic simplicity. - run() { - echo "$*" >&3 - } + cache_upload_flag barretenberg-acir-tests-$hash + github_endgroup +} +# Prints to stdout, one per line, the command to execute each individual test. +# Paths are all relative to the repository root. +function test_cmds { local plonk_tests=$(find ./acir_tests -maxdepth 1 -mindepth 1 -type d | \ grep -vE 'verify_honk_proof|double_verify_honk_proof|verify_rollup_honk_proof') local honk_tests=$(find ./acir_tests -maxdepth 1 -mindepth 1 -type d | \ grep -vE 'single_verify_proof|double_verify_proof|double_verify_nested_proof|verify_rollup_honk_proof') + local run_test=$(realpath --relative-to=$root ./run_test.sh) + local run_test_browser=$(realpath --relative-to=$root ./run_test_browser.sh) + local bbjs_bin="../ts/dest/node/main.js" + # barretenberg-acir-tests-sol: - run FLOW=sol ./run_test.sh assert_statement - run FLOW=sol ./run_test.sh double_verify_proof - run FLOW=sol ./run_test.sh double_verify_nested_proof - run FLOW=sol_honk ./run_test.sh assert_statement - run FLOW=sol_honk ./run_test.sh 1_mul - run FLOW=sol_honk ./run_test.sh slices - run FLOW=sol_honk ./run_test.sh verify_honk_proof + echo FLOW=sol $run_test assert_statement + echo FLOW=sol $run_test double_verify_proof + echo FLOW=sol $run_test double_verify_nested_proof + echo FLOW=sol_honk $run_test assert_statement + echo FLOW=sol_honk $run_test 1_mul + echo FLOW=sol_honk $run_test slices + echo FLOW=sol_honk $run_test verify_honk_proof # barretenberg-acir-tests-bb.js: # Browser tests. - run BROWSER=chrome THREAD_MODEL=mt PORT=8080 ./run_test_browser.sh verify_honk_proof - run BROWSER=chrome THREAD_MODEL=st PORT=8081 ./run_test_browser.sh 1_mul - run BROWSER=webkit THREAD_MODEL=mt PORT=8082 ./run_test_browser.sh verify_honk_proof - run BROWSER=webkit THREAD_MODEL=st PORT=8083 ./run_test_browser.sh 1_mul - # Run ecdsa_secp256r1_3x through bb.js on node to check 256k support. - run BIN=../ts/dest/node/main.js FLOW=prove_then_verify ./run_test.sh ecdsa_secp256r1_3x - # Run the prove then verify flow for UltraHonk. This makes sure we have the same circuit for different witness inputs. - run BIN=../ts/dest/node/main.js SYS=ultra_honk FLOW=prove_then_verify ./run_test.sh 6_array - # Run a single arbitrary test not involving recursion through bb.js for MegaHonk - run BIN=../ts/dest/node/main.js SYS=mega_honk FLOW=prove_and_verify ./run_test.sh 6_array - # Run 1_mul through bb.js build, all_cmds flow, to test all cli args. - run BIN=../ts/dest/node/main.js FLOW=all_cmds ./run_test.sh 1_mul + echo BROWSER=chrome THREAD_MODEL=mt PORT=8080 $run_test_browser verify_honk_proof + echo BROWSER=chrome THREAD_MODEL=st PORT=8081 $run_test_browser 1_mul + echo BROWSER=webkit THREAD_MODEL=mt PORT=8082 $run_test_browser verify_honk_proof + echo BROWSER=webkit THREAD_MODEL=st PORT=8083 $run_test_browser 1_mul + # echo ecdsa_secp256r1_3x through bb.js on node to check 256k support. + echo BIN=$bbjs_bin FLOW=prove_then_verify $run_test ecdsa_secp256r1_3x + # echo the prove then verify flow for UltraHonk. This makes sure we have the same circuit for different witness inputs. + echo BIN=$bbjs_bin SYS=ultra_honk FLOW=prove_then_verify $run_test 6_array + # echo a single arbitrary test not involving recursion through bb.js for MegaHonk + echo BIN=$bbjs_bin SYS=mega_honk FLOW=prove_and_verify $run_test 6_array + # echo 1_mul through bb.js build, all_cmds flow, to test all cli args. + echo BIN=$bbjs_bin FLOW=all_cmds $run_test 1_mul # barretenberg-acir-tests-bb: # Fold and verify an ACIR program stack using ClientIvc, recursively verify as part of the Tube circuit and produce and verify a Honk proof - run FLOW=prove_then_verify_tube ./run_test.sh 6_array - # Run 1_mul through native bb build, all_cmds flow, to test all cli args. - run FLOW=all_cmds ./run_test.sh 1_mul + echo FLOW=prove_then_verify_tube $run_test 6_array + # echo 1_mul through native bb build, all_cmds flow, to test all cli args. + echo FLOW=all_cmds $run_test 1_mul # barretenberg-acir-tests-bb-ultra-plonk: # Exclude honk tests. for t in $plonk_tests; do - run FLOW=prove_then_verify ./run_test.sh $(basename $t) + echo FLOW=prove_then_verify $run_test $(basename $t) done - run FLOW=prove_then_verify RECURSIVE=true ./run_test.sh assert_statement - run FLOW=prove_then_verify RECURSIVE=true ./run_test.sh double_verify_proof + echo FLOW=prove_then_verify RECURSIVE=true $run_test assert_statement + echo FLOW=prove_then_verify RECURSIVE=true $run_test double_verify_proof # barretenberg-acir-tests-bb-ultra-honk: # Exclude plonk tests. for t in $honk_tests; do - run SYS=ultra_honk FLOW=prove_then_verify ./run_test.sh $(basename $t) + echo SYS=ultra_honk FLOW=prove_then_verify $run_test $(basename $t) done - run SYS=ultra_honk FLOW=prove_then_verify RECURSIVE=true ./run_test.sh assert_statement - run SYS=ultra_honk FLOW=prove_then_verify RECURSIVE=true ./run_test.sh double_verify_honk_proof - run SYS=ultra_honk FLOW=prove_and_verify_program ./run_test.sh merkle_insert - run SYS=ultra_rollup_honk FLOW=prove_and_verify ./run_test.sh verify_rollup_honk_proof - + echo SYS=ultra_honk FLOW=prove_then_verify RECURSIVE=true $run_test assert_statement + echo SYS=ultra_honk FLOW=prove_then_verify RECURSIVE=true $run_test double_verify_honk_proof + echo SYS=ultra_honk FLOW=prove_and_verify_program $run_test merkle_insert + echo SYS=ultra_rollup_honk FLOW=prove_then_verify $run_test verify_rollup_honk_proof # barretenberg-acir-tests-bb-client-ivc: - run FLOW=prove_then_verify_client_ivc ./run_test.sh 6_array - run FLOW=prove_then_verify_client_ivc ./run_test.sh databus - run FLOW=prove_then_verify_client_ivc ./run_test.sh databus_two_calldata - - # Close parallels input file descriptor and wait for completion. - exec 3>&- - wait $pid - - cache_upload_flag barretenberg-acir-tests-$hash - github_endgroup + echo FLOW=prove_then_verify_client_ivc $run_test 6_array + echo FLOW=prove_then_verify_client_ivc $run_test databus + echo FLOW=prove_then_verify_client_ivc $run_test databus_two_calldata } -export -f build test +export -f build_tests test case "$cmd" in "clean") git clean -fdx (cd ../../noir/noir-repo/test_programs/execution_success && git clean -fdx) ;; - ""|"fast") + ""|"fast"|"full") ;; - "full") - denoise build + "build-tests") + build_tests ;; "ci") - denoise build - denoise test + build_tests + test ;; "hash") hash ;; "test") - denoise test + test + ;; + "prepare-benches") + prepare_tests + ;; + "test-cmds") + test_cmds ;; *) echo "Unknown command: $cmd" exit 1 -esac \ No newline at end of file +esac diff --git a/barretenberg/acir_tests/browser-test-app/yarn.lock b/barretenberg/acir_tests/browser-test-app/yarn.lock index 37157884379..4ffc4c0bdf5 100644 --- a/barretenberg/acir_tests/browser-test-app/yarn.lock +++ b/barretenberg/acir_tests/browser-test-app/yarn.lock @@ -7,7 +7,7 @@ __metadata: "@aztec/bb.js@file:../../ts::locator=browser-test-app%40workspace%3A.": version: 0.67.1 - resolution: "@aztec/bb.js@file:../../ts#../../ts::hash=29e47a&locator=browser-test-app%40workspace%3A." + resolution: "@aztec/bb.js@file:../../ts#../../ts::hash=cd38cd&locator=browser-test-app%40workspace%3A." dependencies: comlink: "npm:^4.4.1" commander: "npm:^12.1.0" @@ -17,7 +17,7 @@ __metadata: tslib: "npm:^2.4.0" bin: bb.js: ./dest/node/main.js - checksum: 10c0/c01128ff74f29b6bbc5c46362792525ef5612c5fc8787341551bcf457ba9816a971e24a74292ab230c47b0b9efe8d7e0d1cabd44247e1b6e718727d0b6372400 + checksum: 10c0/c6c1476f5f5d5cc1ea7022043e00870ee0743fd73a532c171586ab74bac53f3888c648bd4057de5a602e4a556cbb5d91454f57e0875ab002ccc87e7f83f12e43 languageName: node linkType: hard diff --git a/barretenberg/acir_tests/run_test_browser.sh b/barretenberg/acir_tests/run_test_browser.sh index 1b565ea54a2..bec27a2ec43 100755 --- a/barretenberg/acir_tests/run_test_browser.sh +++ b/barretenberg/acir_tests/run_test_browser.sh @@ -6,6 +6,8 @@ cleanup() { } trap cleanup EXIT +cd $(dirname $0) + # Skipping firefox because this headless firefox is so slow. export BROWSER=${BROWSER:-chrome,webkit} diff --git a/barretenberg/cpp/CMakeLists.txt b/barretenberg/cpp/CMakeLists.txt index 0eb5e214bf0..0956c08a44b 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.68.2 # x-release-please-version + VERSION 0.69.0 # x-release-please-version LANGUAGES CXX C ) # Insert version into `bb` config file diff --git a/barretenberg/cpp/bootstrap.sh b/barretenberg/cpp/bootstrap.sh index aad3427e64a..931abd31945 100755 --- a/barretenberg/cpp/bootstrap.sh +++ b/barretenberg/cpp/bootstrap.sh @@ -3,22 +3,8 @@ source $(git rev-parse --show-toplevel)/ci3/source_bootstrap cmd=${1:-} -# Determine system. -if [[ "$OSTYPE" == "darwin"* ]]; then - os=macos -elif [[ "$OSTYPE" == "linux-gnu" ]]; then - os=linux -elif [[ "$OSTYPE" == "linux-musl" ]]; then - os=linux -else - echo "Unknown OS: $OSTYPE" - exit 1 -fi - -# Pick native toolchain. preset=clang16-assert pic_preset="clang16-pic" - hash=$(cache_content_hash .rebuild_patterns) function build_native { @@ -68,36 +54,26 @@ function build { github_group "bb cpp build" export preset pic_preset hash export -f build_native build_wasm build_wasm_threads - parallel --line-buffered -v --tag --memfree 8g denoise {} ::: build_native build_wasm build_wasm_threads + parallel --line-buffered -v --tag denoise {} ::: build_native build_wasm build_wasm_threads github_endgroup } -function test { - if test_should_run barretenberg-test-$hash; then - github_group "bb test" - - echo "Check formatting..." - ./format.sh check - - echo "Building tests..." - denoise cmake --preset $preset -Bbuild "&&" cmake --build build - - # Download ignition transcripts. - # TODO: Use the flattened crs. These old transcripts are a pain. - echo "Downloading srs..." - denoise "cd ./srs_db && ./download_ignition.sh 3 && ./download_grumpkin.sh" - if [ ! -d ./srs_db/grumpkin ]; then - # The Grumpkin SRS is generated manually at the moment, only up to a large enough size for tests - # If tests require more points, the parameter can be increased here. Note: IPA requires - # dyadic_circuit_size + 1 points so in general this number will be a power of two plus 1 - cd ./build && cmake --build . --parallel --target grumpkin_srs_gen && ./bin/grumpkin_srs_gen 32769 - fi +function build_tests { + github_group "bb build tests" + denoise ./format.sh check + denoise cmake --preset $preset -Bbuild "&&" cmake --build build + # Download ignition transcripts. Only needed for tests. + # The actual bb binary uses the flat crs downloaded in barratenberg/bootstrap.sh to ~/.bb-crs. + # TODO: Use the flattened crs. These old transcripts are a pain. + denoise "cd ./srs_db && ./download_ignition.sh 3 && ./download_grumpkin.sh" +} - echo "Testing..." - (cd build && GTEST_COLOR=1 denoise ctest -j32 --output-on-failure) - cache_upload_flag barretenberg-test-$hash - github_endgroup - fi +function test { + test_should_run barretenberg-test-$hash || return 0 + github_group "bb test" + (cd build && GTEST_COLOR=1 denoise ctest -j32 --output-on-failure) + cache_upload_flag barretenberg-test-$hash + github_endgroup } case "$cmd" in @@ -105,22 +81,40 @@ case "$cmd" in git clean -fdx ;; ""|"fast") + # Build bb and wasms. Can be incremental. build ;; "full") + # Deletes all build dirs and build bb and wasms from scratch. rm -rf build* build ;; + "build-tests") + # Build the entire native repo, including all tests and benchmarks. + build_tests + ;; "test") + # Run the tests. Assumes they've been (re)built with a call to build_tests. test ;; "ci") build + build_tests test ;; "hash") echo $hash ;; + "test-cmds") + # Print every individual test command. Can be fed into gnu parallel. + cd build + for bin in ./bin/*_tests; do + bin_name=$(basename $bin) + $bin --gtest_list_tests | \ + awk -vbin=$bin_name '/^[a-zA-Z]/ {suite=$1} /^[ ]/ {print "barretenberg/cpp/scripts/run_test.sh " bin " " suite$1}' | \ + sed 's/\.$//' | grep -v 'DISABLED_' + done + ;; *) echo "Unknown command: $cmd" exit 1 diff --git a/barretenberg/cpp/pil/avm/mem.pil b/barretenberg/cpp/pil/avm/mem.pil index 11be391afc4..0ac4a43aacd 100644 --- a/barretenberg/cpp/pil/avm/mem.pil +++ b/barretenberg/cpp/pil/avm/mem.pil @@ -92,7 +92,7 @@ namespace mem(256); + sel_op_slice; // Maximum one memory operation enabled per row - sel_mem * (sel_mem - 1) = 0; // TODO: might be infered by the main trace + sel_mem * (sel_mem - 1) = 0; // TODO: might be inferred by the main trace // Enforce the memory entries to be contiguous, i.e., as soon as // sel_mem is disabled all subsequent rows have sel_mem disabled. diff --git a/barretenberg/cpp/scripts/run_test.sh b/barretenberg/cpp/scripts/run_test.sh new file mode 100755 index 00000000000..ca424e36aab --- /dev/null +++ b/barretenberg/cpp/scripts/run_test.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# This runs an individual test. +# It's the script used by ./bootstrap.sh test-cmds. +# It means we can return a concise, easy to read, easy to run command for reproducing a test run. +set -eu + +cd $(dirname $0)/../build + +export GTEST_COLOR=1 +export HARDWARE_CONCURRENCY=8 +# export IGNITION_CRS_PATH="./barretenberg/cpp/srs_db/ignition" +# export GRUMPKIN_CRS_PATH="./barretenberg/cpp/srs_db/grumpkin" + +./bin/$1 --gtest_filter=$2 \ No newline at end of file diff --git a/barretenberg/cpp/src/CMakeLists.txt b/barretenberg/cpp/src/CMakeLists.txt index 93f4bb4eb45..1a9590e4d67 100644 --- a/barretenberg/cpp/src/CMakeLists.txt +++ b/barretenberg/cpp/src/CMakeLists.txt @@ -61,10 +61,10 @@ if (ENABLE_PIC AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_subdirectory(barretenberg/world_state_napi) endif() -add_subdirectory(barretenberg/client_ivc) add_subdirectory(barretenberg/bb) add_subdirectory(barretenberg/boomerang_value_detection) add_subdirectory(barretenberg/circuit_checker) +add_subdirectory(barretenberg/client_ivc) add_subdirectory(barretenberg/commitment_schemes) add_subdirectory(barretenberg/commitment_schemes_recursion) add_subdirectory(barretenberg/common) @@ -87,6 +87,7 @@ add_subdirectory(barretenberg/relations) add_subdirectory(barretenberg/serialize) add_subdirectory(barretenberg/solidity_helpers) add_subdirectory(barretenberg/srs) +add_subdirectory(barretenberg/ultra_vanilla_client_ivc) add_subdirectory(barretenberg/stdlib) add_subdirectory(barretenberg/stdlib_circuit_builders) add_subdirectory(barretenberg/sumcheck) @@ -139,6 +140,7 @@ set(BARRETENBERG_TARGET_OBJECTS $ $ $ + $ $ $ $ diff --git a/barretenberg/cpp/src/barretenberg/bb/main.cpp b/barretenberg/cpp/src/barretenberg/bb/main.cpp index 8661657438d..e4b65f266ec 100644 --- a/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -898,7 +898,7 @@ template bool verify_honk(const std::string& proof_path, // TODO(https://github.com/AztecProtocol/barretenberg/issues/1168): Add formula to flavor const size_t HONK_PROOF_LENGTH = 469; const size_t num_public_inputs = - static_cast(proof[1]) - PAIRING_POINT_ACCUMULATOR_SIZE - IPA_CLAIM_SIZE; + static_cast(uint64_t(proof[1])) - PAIRING_POINT_ACCUMULATOR_SIZE - IPA_CLAIM_SIZE; // The extra calculation is for the IPA proof length. debug("proof size: ", proof.size()); debug("num public inputs: ", num_public_inputs); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/basics_bench/basics.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/basics_bench/basics.bench.cpp index 586199aea53..66001f55568 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/basics_bench/basics.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/basics_bench/basics.bench.cpp @@ -433,7 +433,7 @@ void uint_extended_multiplication(State& state) */ static void DoPippengerSetup(const benchmark::State&) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** diff --git a/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/client_ivc.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/client_ivc.bench.cpp index 2acbb568272..d5bd296ebac 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/client_ivc.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/client_ivc.bench.cpp @@ -23,8 +23,8 @@ class ClientIVCBench : public benchmark::Fixture { void SetUp([[maybe_unused]] const ::benchmark::State& state) override { - bb::srs::init_crs_factory("../srs_db/ignition"); - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } }; diff --git a/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/eccvm.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/eccvm.bench.cpp index af7ca5ea43d..10bf6c077e6 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/eccvm.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/eccvm.bench.cpp @@ -44,7 +44,7 @@ Builder generate_trace(size_t target_num_gates) void eccvm_generate_prover(State& state) noexcept { - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); size_t target_num_gates = 1 << static_cast(state.range(0)); for (auto _ : state) { @@ -55,7 +55,7 @@ void eccvm_generate_prover(State& state) noexcept void eccvm_prove(State& state) noexcept { - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); size_t target_num_gates = 1 << static_cast(state.range(0)); Builder builder = generate_trace(target_num_gates); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ipa_bench/ipa.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ipa_bench/ipa.bench.cpp index 304a0a8a1ef..5f44aba231d 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ipa_bench/ipa.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ipa_bench/ipa.bench.cpp @@ -20,7 +20,7 @@ std::vector> prover_transcripts(MAX_POLYNOMIAL std::vector> opening_claims(MAX_POLYNOMIAL_DEGREE_LOG2 - MIN_POLYNOMIAL_DEGREE_LOG2 + 1); static void DoSetup(const benchmark::State&) { - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); ck = std::make_shared>(1 << MAX_POLYNOMIAL_DEGREE_LOG2); vk = std::make_shared>(1 << MAX_POLYNOMIAL_DEGREE_LOG2, srs::get_grumpkin_crs_factory()); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/pippenger_bench/main.cpp b/barretenberg/cpp/src/barretenberg/benchmark/pippenger_bench/main.cpp index 6cacf26a5de..33f16b63f56 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/pippenger_bench/main.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/pippenger_bench/main.cpp @@ -65,7 +65,7 @@ const auto init = []() { // constexpr double add_to_mixed_add_complexity = 1.36; auto reference_string = - std::make_shared>(NUM_POINTS, "../srs_db/ignition"); + std::make_shared>(NUM_POINTS, bb::srs::get_ignition_crs_path()); int pippenger() { @@ -104,7 +104,7 @@ int coset_fft_regular() int main() { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); std::cout << "initializing" << std::endl; init(); std::cout << "executing normal fft" << std::endl; diff --git a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp index 5f286ce838c..f32e797cb27 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp @@ -53,7 +53,7 @@ void fold_k(State& state) noexcept using ProtogalaxyProver = ProtogalaxyProver_>; using Builder = typename Flavor::CircuitBuilder; - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto log2_num_gates = static_cast(state.range(0)); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp index 3fa5518ab1d..7af8f71cc7a 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp @@ -18,7 +18,7 @@ void _bench_round(::benchmark::State& state, void (*F)(ProtogalaxyProver_; using ProtogalaxyProver = ProtogalaxyProver_; - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto log2_num_gates = static_cast(state.range(0)); const auto construct_key = [&]() { diff --git a/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/simulator.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/simulator.bench.cpp index 5e51abb2b8c..1f29432f29f 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/simulator.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/simulator.bench.cpp @@ -24,7 +24,7 @@ template class SimulatorFixture : public benchmark::F void SetUp([[maybe_unused]] const ::benchmark::State& state) override { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** diff --git a/barretenberg/cpp/src/barretenberg/benchmark/stdlib_hash/pedersen.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/stdlib_hash/pedersen.bench.cpp index 0ce805fe424..a2e29f0f366 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/stdlib_hash/pedersen.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/stdlib_hash/pedersen.bench.cpp @@ -8,7 +8,7 @@ #include -#define BARRETENBERG_SRS_PATH "../srs_db/ignition" +#define BARRETENBERG_SRS_PATH bb::srs::get_ignition_crs_path() using namespace benchmark; using namespace bb; diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp index 8a56e671424..7bbcb5cf284 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp @@ -76,7 +76,7 @@ void construct_proof_with_specified_num_iterations( void (*test_circuit_function)(typename Prover::Flavor::CircuitBuilder&, size_t), size_t num_iterations) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); for (auto _ : state) { // Construct circuit and prover; don't include this part in measurement diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk_rounds.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk_rounds.bench.cpp index 3454e4af3da..621dfba72f9 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk_rounds.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk_rounds.bench.cpp @@ -63,7 +63,7 @@ BB_PROFILE static void test_round_inner(State& state, MegaProver& prover, size_t BB_PROFILE static void test_round(State& state, size_t index) noexcept { auto log2_num_gates = static_cast(state.range(0)); - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); // TODO(https://github.com/AztecProtocol/barretenberg/issues/761) benchmark both sparse and dense circuits auto prover = bb::mock_circuits::get_prover( diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk_rounds.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk_rounds.bench.cpp index 19c82f368e4..9264e9d1aea 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk_rounds.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk_rounds.bench.cpp @@ -49,7 +49,7 @@ BB_PROFILE static void test_round_inner(State& state, plonk::UltraProver& prover } BB_PROFILE static void test_round(State& state, size_t index) noexcept { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); for (auto _ : state) { state.PauseTiming(); // TODO: https://github.com/AztecProtocol/barretenberg/issues/761 benchmark both sparse and dense circuits diff --git a/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp index 2967a8bf7a6..ea74f5108ca 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp @@ -36,7 +36,7 @@ struct BasicPlonkKeyAndTranscript { BasicPlonkKeyAndTranscript get_plonk_key_and_transcript() { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto inner_composer = plonk::UltraComposer(); auto builder = typename plonk::UltraComposer::CircuitBuilder(); bb::mock_circuits::generate_basic_arithmetic_circuit(builder, 16); diff --git a/barretenberg/cpp/src/barretenberg/boomerang_value_detection/graph.cpp b/barretenberg/cpp/src/barretenberg/boomerang_value_detection/graph.cpp index 1fe02660f08..03c31e53137 100644 --- a/barretenberg/cpp/src/barretenberg/boomerang_value_detection/graph.cpp +++ b/barretenberg/cpp/src/barretenberg/boomerang_value_detection/graph.cpp @@ -289,7 +289,7 @@ bool Graph_::check_is_not_constant_variable(bb::UltraCircuitBuilder& ultra_c } /** - * @brief this method adds connection between 2 variables, if they are in one gate, they are not constrant variables, + * @brief this method adds connection between 2 variables, if they are in one gate, they are not constraint variables, * and they have different indexes * @tparam FF * @param ultra_circuit_builder @@ -821,4 +821,4 @@ template void Graph_::print_variables_edge_counts() } } -template class Graph_; \ No newline at end of file +template class Graph_; diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp index df64300f75b..ce1514969b3 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp @@ -93,8 +93,9 @@ void ClientIVC::perform_recursive_verification_and_databus_consistency_checks( } } - // Set the return data commitment to be propagated on the public inputs of the present kernel and peform consistency - // checks between the calldata commitments and the return data commitments contained within the public inputs + // Set the return data commitment to be propagated on the public inputs of the present kernel and perform + // consistency checks between the calldata commitments and the return data commitments contained within the public + // inputs bus_depot.set_return_data_to_be_propagated_and_perform_consistency_checks( decider_vk->witness_commitments.return_data, decider_vk->witness_commitments.calldata, diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hpp index eb28477637b..441efc43bfd 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hpp @@ -165,7 +165,7 @@ class ClientIVC { * @param circuit The incoming statement * @param precomputed_vk The verification key of the incoming statement OR a mocked key whose metadata needs to be * set using the proving key produced from `circuit` in order to pass some assertions in the Oink prover. - * @param mock_vk A boolean to say whether the precomputed vk shoudl have its metadata set. + * @param mock_vk A boolean to say whether the precomputed vk should have its metadata set. */ void accumulate(ClientCircuit& circuit, const bool _one_circuit = false, @@ -194,4 +194,4 @@ class ClientIVC { std::make_shared(goblin.get_translator_proving_key()) }; } }; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp index befb8d82a02..6d617ec2737 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp @@ -13,8 +13,8 @@ class ClientIVCTests : public ::testing::Test { protected: static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } using Flavor = ClientIVC::Flavor; @@ -346,8 +346,8 @@ TEST_F(ClientIVCTests, StructuredPrecomputedVKs) */ TEST(ClientIVCBenchValidation, Full6) { - bb::srs::init_crs_factory("../srs_db/ignition"); - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); ClientIVC ivc{ { CLIENT_IVC_BENCH_STRUCTURE } }; size_t total_num_circuits{ 12 }; @@ -365,8 +365,8 @@ TEST(ClientIVCBenchValidation, Full6) TEST(ClientIVCBenchValidation, Full6MockedVKs) { const auto run_test = []() { - bb::srs::init_crs_factory("../srs_db/ignition"); - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); ClientIVC ivc{ { CLIENT_IVC_BENCH_STRUCTURE } }; size_t total_num_circuits{ 12 }; diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc_integration.test.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc_integration.test.cpp index 2a32853c469..2fa80fd913c 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc_integration.test.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc_integration.test.cpp @@ -17,8 +17,8 @@ class ClientIVCIntegrationTests : public ::testing::Test { protected: static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } using Flavor = ClientIVC::Flavor; diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/mock_kernel_pinning.test.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/mock_kernel_pinning.test.cpp index 61cb907c0e1..5765a9902dd 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/mock_kernel_pinning.test.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/mock_kernel_pinning.test.cpp @@ -18,7 +18,7 @@ class MockKernelTest : public ::testing::Test { using MockCircuitProducer = PrivateFunctionExecutionMockCircuitProducer; protected: - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(MockKernelTest, PinFoldingKernelSizes) diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/commit.bench.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/commit.bench.cpp index e6724850291..7ea550a48ec 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/commit.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/commit.bench.cpp @@ -9,7 +9,7 @@ namespace bb { template std::shared_ptr> create_commitment_key(const size_t num_points) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); std::string srs_path; return std::make_shared>(num_points); } diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp index dca262c5edc..1d107e82296 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.hpp @@ -55,6 +55,7 @@ template class CommitmentKey { scalar_multiplication::pippenger_runtime_state pippenger_runtime_state; std::shared_ptr> crs_factory; std::shared_ptr> srs; + size_t dyadic_size; CommitmentKey() = delete; @@ -69,6 +70,7 @@ template class CommitmentKey { : pippenger_runtime_state(get_num_needed_srs_points(num_points)) , crs_factory(srs::get_crs_factory()) , srs(crs_factory->get_prover_crs(get_num_needed_srs_points(num_points))) + , dyadic_size(get_num_needed_srs_points(num_points)) {} // Note: This constructor is to be used only by Plonk; For Honk the srs lives in the CommitmentKey diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.test.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.test.hpp index f991e1aa164..adafef90c7c 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.test.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.test.hpp @@ -18,13 +18,13 @@ template inline std::shared_ptr CreateCommitmentKey(); template <> inline std::shared_ptr> CreateCommitmentKey>() { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); return std::make_shared>(COMMITMENT_TEST_NUM_BN254_POINTS); } // For IPA template <> inline std::shared_ptr> CreateCommitmentKey>() { - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); return std::make_shared>(COMMITMENT_TEST_NUM_GRUMPKIN_POINTS); } @@ -48,7 +48,7 @@ inline std::shared_ptr> CreateVerifierCom VerifierCommitmentKey>() { auto crs_factory = std::make_shared>( - "../srs_db/grumpkin", COMMITMENT_TEST_NUM_GRUMPKIN_POINTS); + bb::srs::get_grumpkin_crs_path(), COMMITMENT_TEST_NUM_GRUMPKIN_POINTS); return std::make_shared>(COMMITMENT_TEST_NUM_GRUMPKIN_POINTS, crs_factory); } template inline std::shared_ptr CreateVerifierCommitmentKey() diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.fuzzer.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.fuzzer.cpp index 7006c3003a1..5c2dbfc1218 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.fuzzer.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.fuzzer.cpp @@ -43,10 +43,10 @@ using namespace bb; */ extern "C" void LLVMFuzzerInitialize(int*, char***) { - srs::init_grumpkin_crs_factory("../srs_db/ignition"); + srs::init_grumpkin_crs_factory(bb::srs::get_ignition_crs_path()); ck = std::make_shared>(COMMITMENT_TEST_NUM_POINTS); - auto crs_factory = std::make_shared>("../srs_db/grumpkin", - COMMITMENT_TEST_NUM_POINTS); + auto crs_factory = std::make_shared>( + bb::srs::get_grumpkin_crs_path(), COMMITMENT_TEST_NUM_POINTS); vk = std::make_shared>(COMMITMENT_TEST_NUM_POINTS, crs_factory); } diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/sparse_commitment.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/sparse_commitment.test.cpp index 4ec17f8807a..59b94aa5d2c 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/sparse_commitment.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/sparse_commitment.test.cpp @@ -77,7 +77,7 @@ template <> std::shared_ptr> CommitmentKeyTest::create_commitment_key< CommitmentKey>(const size_t num_points) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); return std::make_shared>(num_points); } @@ -86,7 +86,7 @@ template <> std::shared_ptr> CommitmentKeyTest::create_commitment_key< CommitmentKey>(const size_t num_points) { - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); return std::make_shared>(num_points); } diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/ipa_recursive.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/ipa_recursive.test.cpp index 9479dff856a..ca7f2875625 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/ipa_recursive.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/ipa_recursive.test.cpp @@ -91,7 +91,7 @@ class IPARecursiveTests : public CommitmentTest { void test_fixed_ipa_recursive_verifier() { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); Builder builder_1(build_ipa_recursive_verifier_circuit(1 << 10)); Builder builder_2(build_ipa_recursive_verifier_circuit(1 << 11)); diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp index 97051dc2b08..3716d39da34 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp @@ -41,7 +41,7 @@ TEST(ShpleminiRecursionTest, ProveAndVerifySingle) using Polynomial = bb::Polynomial; using Transcript = bb::BaseTranscript>; - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto run_shplemini = [](size_t log_circuit_size) { size_t N = 1 << log_circuit_size; constexpr size_t NUM_UNSHIFTED = 2; diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp index fb70282a51f..4ec991706c9 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp @@ -43,7 +43,7 @@ TEST(ZeroMorphRecursionTest, ProveAndVerifySingle) constexpr size_t NUM_UNSHIFTED = 2; constexpr size_t NUM_SHIFTED = 1; - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); std::vector u_challenge(LOG_N); for (size_t idx = 0; idx < LOG_N; ++idx) { u_challenge[idx] = NativeFr::random_element(&engine); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.cpp index fbbd3f0a58a..077ffd9de8c 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.cpp @@ -3,14 +3,17 @@ #include "barretenberg/common/throw_or_abort.hpp" #include "barretenberg/dsl/acir_format/ivc_recursion_constraint.hpp" #include "barretenberg/flavor/flavor.hpp" +#include "barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.hpp" #include "barretenberg/stdlib/plonk_recursion/aggregation_state/aggregation_state.hpp" #include "barretenberg/stdlib/primitives/curves/grumpkin.hpp" #include "barretenberg/stdlib/primitives/field/field_conversion.hpp" #include "barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp" +#include "barretenberg/transcript/transcript.hpp" #include "proof_surgeon.hpp" #include #include +#include namespace acir_format { @@ -270,9 +273,8 @@ void build_constraints(Builder& builder, AcirProgram& program, const ProgramMeta // final recursion output. builder.add_pairing_point_accumulator(current_aggregation_object); } - // TODO(https://github.com/AztecProtocol/barretenberg/issues/1183): This assertion should be true, except for - // the root rollup as of now since the root rollup will not output a ipa proof. - // ASSERT((metadata.honk_recursion == 2) == (output.ipa_proof.size() > 0)); + // If we are proving with UltraRollupFlavor, the IPA proof should have nonzero size. + ASSERT((metadata.honk_recursion == 2) == (output.ipa_proof.size() > 0)); if (metadata.honk_recursion == 2) { builder.add_ipa_claim(output.ipa_claim.get_witness_indices()); builder.ipa_proof = output.ipa_proof; @@ -379,13 +381,17 @@ HonkRecursionConstraintsOutput process_honk_recursion_constraints( size_t idx = 0; std::vector>> nested_ipa_claims; std::vector> nested_ipa_proofs; + bool is_root_rollup = false; for (auto& constraint : constraint_system.honk_recursion_constraints) { if (constraint.proof_type == HONK) { auto [next_aggregation_object, _ipa_claim, _ipa_proof] = create_honk_recursion_constraints>( builder, constraint, current_aggregation_object, has_valid_witness_assignments); current_aggregation_object = next_aggregation_object; - } else if (constraint.proof_type == ROLLUP_HONK || constraint.proof_type == ROLLUP_ROOT_HONK) { + } else if (constraint.proof_type == ROLLUP_HONK || constraint.proof_type == ROOT_ROLLUP_HONK) { + if (constraint.proof_type == ROOT_ROLLUP_HONK) { + is_root_rollup = true; + } auto [next_aggregation_object, ipa_claim, ipa_proof] = create_honk_recursion_constraints>( builder, constraint, current_aggregation_object, has_valid_witness_assignments); @@ -400,6 +406,7 @@ HonkRecursionConstraintsOutput process_honk_recursion_constraints( gate_counter.track_diff(constraint_system.gates_per_opcode, constraint_system.original_opcode_indices.honk_recursion_constraints.at(idx++)); } + ASSERT(!(is_root_rollup && nested_ipa_claims.size() != 2) && "Root rollup must accumulate two IPA proofs."); // Accumulate the claims if (nested_ipa_claims.size() == 2) { auto commitment_key = std::make_shared>(1 << CONST_ECCVM_LOG_N); @@ -409,8 +416,21 @@ HonkRecursionConstraintsOutput process_honk_recursion_constraints( auto ipa_transcript_2 = std::make_shared(nested_ipa_proofs[1]); auto [ipa_claim, ipa_proof] = IPA>::accumulate( commitment_key, ipa_transcript_1, nested_ipa_claims[0], ipa_transcript_2, nested_ipa_claims[1]); - output.ipa_claim = ipa_claim; - output.ipa_proof = ipa_proof; + // If this is the root rollup, do full IPA verification + if (is_root_rollup) { + auto verifier_commitment_key = std::make_shared>>( + &builder, + 1 << CONST_ECCVM_LOG_N, + std::make_shared>(1 << CONST_ECCVM_LOG_N)); + // do full IPA verification + auto accumulated_ipa_transcript = + std::make_shared(convert_native_proof_to_stdlib(&builder, ipa_proof)); + IPA>::full_verify_recursive( + verifier_commitment_key, ipa_claim, accumulated_ipa_transcript); + } else { + output.ipa_claim = ipa_claim; + output.ipa_proof = ipa_proof; + } } else if (nested_ipa_claims.size() == 1) { output.ipa_claim = nested_ipa_claims[0]; // This conversion looks suspicious but there's no need to make this an output of the circuit since its a proof diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.test.cpp index c2f9d7d997e..a3864aac069 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.test.cpp @@ -20,7 +20,7 @@ using Composer = plonk::UltraComposer; class AcirFormatTests : public ::testing::Test { protected: - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(AcirFormatTests, TestASingleConstraintNoPubInputs) { diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp index 49ec32e7418..bcdc514b139 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp @@ -126,7 +126,7 @@ class AcirIntegrationTest : public ::testing::Test { } protected: - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; class AcirIntegrationSingleTest : public AcirIntegrationTest, public testing::WithParamInterface {}; @@ -135,8 +135,8 @@ class AcirIntegrationFoldingTest : public AcirIntegrationTest, public testing::W protected: static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } }; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp index f22bf954b85..3307a21184c 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp @@ -635,7 +635,7 @@ void handle_blackbox_func_call(Program::Opcode::BlackBoxFuncCall const& arg, // be the only means for setting the proof type. use of honk_recursion flag in this context can go // away once all noir programs (e.g. protocol circuits) are updated to use the new pattern. if (proof_type_in != HONK && proof_type_in != AVM && proof_type_in != ROLLUP_HONK && - proof_type_in != ROLLUP_ROOT_HONK) { + proof_type_in != ROOT_ROLLUP_HONK) { if (honk_recursion == 1) { proof_type_in = HONK; } else if (honk_recursion == 2) { @@ -659,7 +659,7 @@ void handle_blackbox_func_call(Program::Opcode::BlackBoxFuncCall const& arg, break; case HONK: case ROLLUP_HONK: - case ROLLUP_ROOT_HONK: + case ROOT_ROLLUP_HONK: af.honk_recursion_constraints.push_back(c); af.original_opcode_indices.honk_recursion_constraints.push_back(opcode_index); break; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp index 473ea82cce6..9718c72d3bc 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp @@ -42,7 +42,7 @@ class AcirAvmRecursionConstraint : public ::testing::Test { using OuterVerificationKey = UltraFlavor::VerificationKey; using OuterBuilder = UltraCircuitBuilder; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } // mutate the input kernel_public_inputs_vec to add end gas values static InnerBuilder create_inner_circuit([[maybe_unused]] std::vector& kernel_public_inputs_vec) diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/bigint_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/bigint_constraint.test.cpp index 00021bcbbba..4500e1780fd 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/bigint_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/bigint_constraint.test.cpp @@ -17,7 +17,7 @@ using Composer = plonk::UltraComposer; class BigIntTests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; using fr = field; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp index 53ae075c146..6f76f393ae1 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp @@ -16,7 +16,7 @@ using Composer = plonk::UltraComposer; class UltraPlonkRAM : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; class MegaHonk : public ::testing::Test { @@ -40,7 +40,7 @@ class MegaHonk : public ::testing::Test { } protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; size_t generate_block_constraint(BlockConstraint& constraint, WitnessVector& witness_values) { diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ec_operations.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ec_operations.test.cpp index a9e08c2eadf..e6e4db3d328 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ec_operations.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ec_operations.test.cpp @@ -19,7 +19,7 @@ using curve_ct = bb::stdlib::secp256k1; class EcOperations : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; size_t generate_ec_add_constraint(EcAdd& ec_add_constraint, WitnessVector& witness_values) diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp index 9c088a9a9cd..74c592635b2 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp @@ -18,7 +18,7 @@ using Composer = plonk::UltraComposer; class ECDSASecp256k1 : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; size_t generate_ecdsa_constraint(EcdsaSecp256k1Constraint& ecdsa_constraint, WitnessVector& witness_values) diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp index 5d46d49e701..4dcec537907 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp @@ -98,7 +98,7 @@ size_t generate_ecdsa_constraint(EcdsaSecp256r1Constraint& ecdsa_r1_constraint, TEST(ECDSASecp256r1, test_hardcoded) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); EcdsaSecp256r1Constraint ecdsa_r1_constraint; WitnessVector witness_values; @@ -177,7 +177,7 @@ TEST(ECDSASecp256r1, test_hardcoded) TEST(ECDSASecp256r1, TestECDSAConstraintSucceed) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); EcdsaSecp256r1Constraint ecdsa_r1_constraint; WitnessVector witness_values; size_t num_variables = generate_ecdsa_constraint(ecdsa_r1_constraint, witness_values); @@ -230,7 +230,7 @@ TEST(ECDSASecp256r1, TestECDSAConstraintSucceed) // even though we are just building the circuit. TEST(ECDSASecp256r1, TestECDSACompilesForVerifier) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); EcdsaSecp256r1Constraint ecdsa_r1_constraint; WitnessVector witness_values; size_t num_variables = generate_ecdsa_constraint(ecdsa_r1_constraint, witness_values); @@ -272,7 +272,7 @@ TEST(ECDSASecp256r1, TestECDSACompilesForVerifier) TEST(ECDSASecp256r1, TestECDSAConstraintFail) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); EcdsaSecp256r1Constraint ecdsa_r1_constraint; WitnessVector witness_values; size_t num_variables = generate_ecdsa_constraint(ecdsa_r1_constraint, witness_values); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.cpp index 38849d2554b..e44428be1a4 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.cpp @@ -229,7 +229,7 @@ HonkRecursionConstraintOutput create_honk_recursion_constraints( using RecursiveVerifier = bb::stdlib::recursion::honk::UltraRecursiveVerifier_; ASSERT(input.proof_type == HONK || HasIPAAccumulator); - ASSERT((input.proof_type == ROLLUP_HONK || input.proof_type == ROLLUP_ROOT_HONK) == HasIPAAccumulator); + ASSERT((input.proof_type == ROLLUP_HONK || input.proof_type == ROOT_ROLLUP_HONK) == HasIPAAccumulator); // Construct an in-circuit representation of the verification key. // For now, the v-key is a circuit constant and is fixed for the circuit. diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.test.cpp index bec5fb78019..72ebeb1e9db 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.test.cpp @@ -201,8 +201,8 @@ template class AcirHonkRecursionConstraint : public ::testing: protected: static void SetUpTestSuite() { - bb::srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } }; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ivc_recursion_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ivc_recursion_constraint.test.cpp index 283f675e59a..57cc857db36 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ivc_recursion_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ivc_recursion_constraint.test.cpp @@ -131,8 +131,8 @@ class IvcRecursionConstraintTest : public ::testing::Test { protected: void SetUp() override { - bb::srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } }; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/multi_scalar_mul.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/multi_scalar_mul.test.cpp index a30a79985b1..f9f89dae0a4 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/multi_scalar_mul.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/multi_scalar_mul.test.cpp @@ -18,7 +18,7 @@ using Composer = plonk::UltraComposer; class MSMTests : public ::testing::Test { protected: - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; using fr = field; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/poseidon2_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/poseidon2_constraint.test.cpp index 269898e1225..2f5fd1d2806 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/poseidon2_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/poseidon2_constraint.test.cpp @@ -18,7 +18,7 @@ using Composer = plonk::UltraComposer; class Poseidon2Tests : public ::testing::Test { protected: - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; using fr = field; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.hpp index c7ae3ab1d07..01fdeccd75c 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.hpp @@ -10,7 +10,7 @@ namespace acir_format { // ACIR // Keep this enum values in sync with their noir counterpart constants defined in // noir-protocol-circuits/crates/types/src/constants.nr -enum PROOF_TYPE { PLONK, HONK, OINK, PG, AVM, ROLLUP_HONK, ROLLUP_ROOT_HONK }; +enum PROOF_TYPE { PLONK, HONK, OINK, PG, AVM, ROLLUP_HONK, ROOT_ROLLUP_HONK }; using namespace bb::plonk; using Builder = bb::UltraCircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp index e9e8c8ace77..51e7a088a13 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp @@ -15,7 +15,7 @@ using namespace bb::plonk; using Composer = plonk::UltraComposer; class AcirRecursionConstraint : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; Builder create_inner_circuit() { diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.test.cpp index 6a256234353..7e76c44f98b 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.test.cpp @@ -15,7 +15,7 @@ using Composer = plonk::UltraComposer; class Sha256Tests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(Sha256Tests, TestSha256Compression) diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_circuit_builder.test.cpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_circuit_builder.test.cpp index 44181433bd0..0ee34da7aa7 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_circuit_builder.test.cpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_circuit_builder.test.cpp @@ -471,7 +471,7 @@ TEST(ECCVMCircuitBuilderTests, InfinityFailure) using Fr = fr; auto P1 = G1::infinity(); - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); // Add the same operations to the ECC op queue; the native computation is performed under the hood. auto op_queue = std::make_shared(); diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.test.cpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.test.cpp index 364c602b7d2..16525eb8b9f 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.test.cpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.test.cpp @@ -16,7 +16,7 @@ using namespace bb; class ECCVMTests : public ::testing::Test { protected: - void SetUp() override { srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); }; + void SetUp() override { srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); }; }; namespace { auto& engine = numeric::get_debug_randomness(); diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_transcript.test.cpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_transcript.test.cpp index 92d3ffc5f13..c285c8112e8 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_transcript.test.cpp @@ -11,7 +11,7 @@ using namespace bb; class ECCVMTranscriptTests : public ::testing::Test { public: - void SetUp() override { srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); }; + void SetUp() override { srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); }; using FF = grumpkin::fr; using Flavor = ECCVMFlavor; diff --git a/barretenberg/cpp/src/barretenberg/examples/join_split/notes/circuit/value/value_note.test.cpp b/barretenberg/cpp/src/barretenberg/examples/join_split/notes/circuit/value/value_note.test.cpp index 0c5393050af..c3d08097fe1 100644 --- a/barretenberg/cpp/src/barretenberg/examples/join_split/notes/circuit/value/value_note.test.cpp +++ b/barretenberg/cpp/src/barretenberg/examples/join_split/notes/circuit/value/value_note.test.cpp @@ -14,7 +14,7 @@ using namespace bb::join_split_example::proofs::notes::circuit::value; class ValueNote : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(ValueNote, Commits) diff --git a/barretenberg/cpp/src/barretenberg/examples/simple/simple.test.cpp b/barretenberg/cpp/src/barretenberg/examples/simple/simple.test.cpp index 17689497a75..3daaee9f6e8 100644 --- a/barretenberg/cpp/src/barretenberg/examples/simple/simple.test.cpp +++ b/barretenberg/cpp/src/barretenberg/examples/simple/simple.test.cpp @@ -7,7 +7,7 @@ namespace examples::simple { TEST(examples_simple, create_proof) { - auto srs_path = std::filesystem::absolute("../srs_db/ignition"); + auto srs_path = std::filesystem::absolute(bb::srs::get_ignition_crs_path()); srs::init_crs_factory(srs_path); auto ptrs = create_builder_and_composer(); auto proof = create_proof(ptrs); diff --git a/barretenberg/cpp/src/barretenberg/flavor/flavor.test.cpp b/barretenberg/cpp/src/barretenberg/flavor/flavor.test.cpp index e5ee7c6259c..7e850cb2f6f 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/flavor.test.cpp +++ b/barretenberg/cpp/src/barretenberg/flavor/flavor.test.cpp @@ -7,7 +7,7 @@ using namespace bb; TEST(Flavor, Getters) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); using Flavor = UltraFlavor; using FF = Flavor::FF; using ProvingKey = typename Flavor::ProvingKey; diff --git a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp index 237e51a46d7..9a23c848af5 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp +++ b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp @@ -150,7 +150,7 @@ class GoblinMockCircuits { op_queue->set_size_data(); // Manually compute the op queue transcript commitments (which would normally be done by the merge prover) - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto bn254_commitment_key = commitment_key ? commitment_key : std::make_shared(op_queue->get_current_size()); std::array op_queue_commitments; diff --git a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits_pinning.test.cpp b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits_pinning.test.cpp index 4ea86024cfe..193535fee32 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits_pinning.test.cpp +++ b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits_pinning.test.cpp @@ -14,7 +14,7 @@ using namespace bb; class MegaMockCircuitsPinning : public ::testing::Test { protected: using DeciderProvingKey = DeciderProvingKey_; - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(MegaMockCircuitsPinning, FunctionSizes) diff --git a/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp index bfc8c9cff84..4f958be8cb3 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp @@ -15,7 +15,7 @@ auto& engine = numeric::get_debug_randomness(); class StandardPlonkComposer : public ::testing::Test { public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(StandardPlonkComposer, BaseCase) @@ -45,7 +45,7 @@ TEST_F(StandardPlonkComposer, ComposerFromSerializedKeys) auto pk_data = from_buffer(pk_buf); auto vk_data = from_buffer(vk_buf); - auto crs = std::make_unique>("../srs_db/ignition"); + auto crs = std::make_unique>(bb::srs::get_ignition_crs_path()); auto proving_key = std::make_shared(std::move(pk_data), crs->get_prover_crs(pk_data.circuit_size + 1)); auto verification_key = std::make_shared(std::move(vk_data), crs->get_verifier_crs()); diff --git a/barretenberg/cpp/src/barretenberg/plonk/composer/ultra_composer.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/composer/ultra_composer.test.cpp index bf20e3800ca..cd25f6a86af 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/composer/ultra_composer.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/composer/ultra_composer.test.cpp @@ -31,7 +31,7 @@ std::vector add_variables(UltraCircuitBuilder& builder, std::vector class ultra_plonk_composer : public ::testing::Test { public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } void prove_and_verify(UltraCircuitBuilder& builder, bool expected_result) { @@ -770,7 +770,7 @@ TYPED_TEST(ultra_plonk_composer, range_checks_on_duplicates) // before range constraints are applied to it. TEST(ultra_plonk_composer, range_constraint_small_variable) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto builder = UltraCircuitBuilder(); uint16_t mask = (1 << 8) - 1; diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/commitment_scheme.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/commitment_scheme.test.cpp index bcc58f7abe8..5c00d808c57 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/commitment_scheme.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/commitment_scheme.test.cpp @@ -36,8 +36,9 @@ TEST(commitment_scheme, kate_open) plonk::KateCommitmentScheme newKate; // std::shared_ptr> crs_factory = (new - // FileReferenceStringFactory("../srs_db/ignition")); - auto file_crs = std::make_shared>("../srs_db/ignition"); + // FileReferenceStringFactory(bb::srs::get_ignition_crs_path())); + auto file_crs = + std::make_shared>(bb::srs::get_ignition_crs_path()); auto crs = file_crs->get_prover_crs(n); auto circuit_proving_key = std::make_shared(n, 0, crs, CircuitType::STANDARD); work_queue queue(circuit_proving_key.get(), &inp_tx); @@ -94,7 +95,8 @@ TEST(commitment_scheme, kate_batch_open) transcript::StandardTranscript inp_tx = transcript::StandardTranscript(transcript::Manifest()); plonk::KateCommitmentScheme newKate; - auto file_crs = std::make_shared>("../srs_db/ignition"); + auto file_crs = + std::make_shared>(bb::srs::get_ignition_crs_path()); auto crs = file_crs->get_prover_crs(n); auto circuit_proving_key = std::make_shared(n, 0, crs, CircuitType::STANDARD); work_queue queue(circuit_proving_key.get(), &inp_tx); diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.test.cpp index 0e9dbb679ce..164cd306b9a 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.test.cpp @@ -113,7 +113,8 @@ plonk::Prover generate_test_data(const size_t n) // even indices = mul gates, odd incides = add gates - auto reference_string = std::make_shared>(n + 1, "../srs_db/ignition"); + auto reference_string = + std::make_shared>(n + 1, bb::srs::get_ignition_crs_path()); std::shared_ptr key = std::make_shared(n, 0, reference_string, CircuitType::STANDARD); polynomial w_l(n); diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp index 63de18110b3..2f858f6d98f 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp @@ -17,7 +17,7 @@ using namespace bb::plonk; // Test proving key serialization/deserialization to/from buffer TEST(proving_key, proving_key_from_serialized_key) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto builder = StandardCircuitBuilder(); auto composer = StandardComposer(); fr a = fr::one(); @@ -55,7 +55,7 @@ TEST(proving_key, proving_key_from_serialized_key) // Test proving key serialization/deserialization to/from buffer using UltraPlonkComposer TEST(proving_key, proving_key_from_serialized_key_ultra) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto builder = UltraCircuitBuilder(); auto composer = UltraComposer(); fr a = fr::one(); diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.test.cpp index 8008d2de53b..58275ee9b97 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.test.cpp @@ -39,7 +39,7 @@ plonk::Verifier generate_verifier(std::shared_ptr circuit_proving_k state)); } - auto crs = std::make_shared>("../srs_db/ignition"); + auto crs = std::make_shared>(bb::srs::get_ignition_crs_path()); std::shared_ptr circuit_verification_key = std::make_shared(circuit_proving_key->circuit_size, circuit_proving_key->num_public_inputs, @@ -75,7 +75,8 @@ plonk::Prover generate_test_data(const size_t n) // even indices = mul gates, odd incides = add gates - auto crs = std::make_shared>(n + 1, "../srs_db/ignition"); + auto crs = + std::make_shared>(n + 1, bb::srs::get_ignition_crs_path()); std::shared_ptr key = std::make_shared(n, 0, crs, CircuitType::STANDARD); polynomial w_l(n); diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp index ccdc191c62a..1d2729bc725 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp @@ -14,7 +14,7 @@ class ComposerLibTests : public ::testing::Test { using FF = typename Flavor::FF; protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; /** diff --git a/barretenberg/cpp/src/barretenberg/polynomials/legacy_polynomials.bench.cpp b/barretenberg/cpp/src/barretenberg/polynomials/legacy_polynomials.bench.cpp index 0c07b1725ec..8fb6baf47f7 100644 --- a/barretenberg/cpp/src/barretenberg/polynomials/legacy_polynomials.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/polynomials/legacy_polynomials.bench.cpp @@ -8,6 +8,7 @@ #include "barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp" #include "barretenberg/numeric/bitop/get_msb.hpp" #include "barretenberg/polynomials/polynomial_arithmetic.hpp" +#include "barretenberg/srs/global_crs.hpp" #include "barretenberg/srs/io.hpp" #include @@ -63,7 +64,7 @@ const auto init = []() { printf("generating test data\n"); g2::affine_element g2_x; globals.monomials = (g1::affine_element*)(aligned_alloc(64, sizeof(g1::affine_element) * MAX_GATES * 2)); - srs::IO::read_transcript(&globals.monomials[0], g2_x, MAX_GATES, "../srs_db/ignition"); + srs::IO::read_transcript(&globals.monomials[0], g2_x, MAX_GATES, bb::srs::get_ignition_crs_path()); globals.scalars = (fr*)(aligned_alloc(32, sizeof(fr) * MAX_GATES * MAX_ROUNDS)); globals.data = (fr*)(aligned_alloc(32, sizeof(fr) * (8 * 17 * MAX_GATES))); memset((void*)globals.monomials, 0x00, MAX_GATES * 2 * sizeof(globals.monomials)); diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp index bcbd70090d6..d7d3e0418fa 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp @@ -44,7 +44,7 @@ template class ProtogalaxyTests : public testing::Test { using TupleOfKeys = std::tuple>, std::vector>>; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } static void construct_circuit(Builder& builder) { diff --git a/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp b/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp index a0ab01417b0..8689f027d1d 100644 --- a/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp @@ -3,6 +3,7 @@ #include "barretenberg/ecc/curves/bn254/pairing.hpp" #include "barretenberg/srs/factories/mem_bn254_crs_factory.hpp" #include "barretenberg/srs/factories/mem_grumpkin_crs_factory.hpp" +#include "barretenberg/srs/global_crs.hpp" #include "file_crs_factory.hpp" #include #include @@ -14,14 +15,14 @@ using namespace bb::curve; TEST(reference_string, mem_bn254_file_consistency) { // Load 1024 from file. - auto file_crs = FileCrsFactory("../srs_db/ignition", 1024); + auto file_crs = FileCrsFactory(bb::srs::get_ignition_crs_path(), 1024); // Use low level io lib to read 1024 from file. std::vector points(1024); - ::srs::IO::read_transcript_g1(points.data(), 1024, "../srs_db/ignition"); + ::srs::IO::read_transcript_g1(points.data(), 1024, bb::srs::get_ignition_crs_path()); g2::affine_element g2_point; - ::srs::IO::read_transcript_g2(g2_point, "../srs_db/ignition"); + ::srs::IO::read_transcript_g2(g2_point, bb::srs::get_ignition_crs_path()); MemBn254CrsFactory mem_crs(points, g2_point); auto file_prover_crs = file_crs.get_prover_crs(1024); @@ -48,11 +49,11 @@ TEST(reference_string, mem_bn254_file_consistency) TEST(reference_string, mem_grumpkin_file_consistency) { // Load 1024 from file. - auto file_crs = FileCrsFactory("../srs_db/grumpkin", 1024); + auto file_crs = FileCrsFactory(bb::srs::get_grumpkin_crs_path(), 1024); // Use low level io lib to read 1024 from file. std::vector points(1024); - ::srs::IO::read_transcript_g1(points.data(), 1024, "../srs_db/grumpkin"); + ::srs::IO::read_transcript_g1(points.data(), 1024, bb::srs::get_grumpkin_crs_path()); MemGrumpkinCrsFactory mem_crs(points); auto file_prover_crs = file_crs.get_prover_crs(1024); diff --git a/barretenberg/cpp/src/barretenberg/srs/global_crs.hpp b/barretenberg/cpp/src/barretenberg/srs/global_crs.hpp index d1bf55bee1b..48f35fce448 100644 --- a/barretenberg/cpp/src/barretenberg/srs/global_crs.hpp +++ b/barretenberg/cpp/src/barretenberg/srs/global_crs.hpp @@ -1,9 +1,40 @@ +#pragma once #include "./factories/crs_factory.hpp" #include "barretenberg/ecc/curves/bn254/bn254.hpp" #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" namespace bb::srs { +// TODO(cody): Not sure why these functions are even being called from wasm context. +// We end up aborting due to the wasi call to resolve the environment variables. +// Nor do I understand how this "fix" is not failing as most wasi api functions (e.g. open file) should abort. +// The call comes from GoblinProver ctor and call to perform_op_queue_interactions_for_mock_first_circuit. +// Delete this ifdef block once resolved. +#ifdef __wasm__ +inline std::string get_ignition_crs_path() +{ + return "../srs_db/ignition"; +} + +inline std::string get_grumpkin_crs_path() +{ + return "../srs_db/grumpkin"; +} +#else + +inline std::string get_ignition_crs_path() +{ + const char* env_var = std::getenv("IGNITION_CRS_PATH"); + return env_var != nullptr ? std::string(env_var) : "../srs_db/ignition"; +} + +inline std::string get_grumpkin_crs_path() +{ + const char* env_var = std::getenv("GRUMPKIN_CRS_PATH"); + return env_var != nullptr ? std::string(env_var) : "../srs_db/grumpkin"; +} +#endif + // Initializes the crs using files void init_crs_factory(std::string crs_path); void init_grumpkin_crs_factory(std::string crs_path); diff --git a/barretenberg/cpp/src/barretenberg/srs/io.test.cpp b/barretenberg/cpp/src/barretenberg/srs/io.test.cpp index f9d2db9e30f..d24aa44b154 100644 --- a/barretenberg/cpp/src/barretenberg/srs/io.test.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/io.test.cpp @@ -2,6 +2,7 @@ #include "barretenberg/common/mem.hpp" #include "barretenberg/ecc/curves/bn254/fq12.hpp" #include "barretenberg/ecc/curves/bn254/pairing.hpp" +#include "barretenberg/srs/global_crs.hpp" #include using namespace bb; @@ -11,7 +12,7 @@ TEST(io, read_transcript_loads_well_formed_srs) size_t degree = 100000; g1::affine_element* monomials = (g1::affine_element*)(aligned_alloc(32, sizeof(g1::affine_element) * (degree + 2))); g2::affine_element g2_x; - srs::IO::read_transcript(monomials, g2_x, degree, "../srs_db/ignition"); + srs::IO::read_transcript(monomials, g2_x, degree, bb::srs::get_ignition_crs_path()); EXPECT_EQ(g1::affine_one, monomials[0]); diff --git a/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp b/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp index 5c6b6b996ee..3af3068bf9b 100644 --- a/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp @@ -15,6 +15,7 @@ #include "barretenberg/ecc/scalar_multiplication/point_table.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "barretenberg/srs/factories/file_crs_factory.hpp" +#include "barretenberg/srs/global_crs.hpp" #include "barretenberg/srs/io.hpp" #include @@ -30,9 +31,9 @@ template class ScalarMultiplicationTests : public ::testing::Te public: const std::string SRS_PATH = []() { if constexpr (std::same_as) { - return "../srs_db/ignition"; + return bb::srs::get_ignition_crs_path(); } else if constexpr (std::same_as) { - return "../srs_db/grumpkin"; + return bb::srs::get_grumpkin_crs_path(); } }(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp index dcee5a4eb73..1e436faba75 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp @@ -21,8 +21,8 @@ class ClientIVCRecursionTests : public testing::Test { static void SetUpTestSuite() { - bb::srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } struct ClientIVCProverOutput { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp index 8c5581e22b6..d180fe037fa 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp @@ -32,8 +32,8 @@ template class ECCVMRecursiveTests : public ::testing using OuterDeciderProvingKey = DeciderProvingKey_; static void SetUpTestSuite() { - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); - bb::srs::init_crs_factory("../srs_db/ignition"); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** diff --git a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.test.cpp index 86523f98b2a..fa8b4c676d9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.test.cpp @@ -11,8 +11,8 @@ template class RecursiveVeriferCommitmentKeyTest : public testi using VK = VerifierCommitmentKey; static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } /** diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin.test.cpp index fa5b91590c4..14d4ffbad4a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin.test.cpp @@ -11,8 +11,8 @@ class GoblinTests : public ::testing::Test { protected: static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } using Builder = MegaCircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursion.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursion.test.cpp index 75428a74229..18ca69a5d78 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursion.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursion.test.cpp @@ -11,8 +11,8 @@ class GoblinRecursionTests : public ::testing::Test { protected: static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } using Curve = curve::BN254; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.test.cpp index a7f9512ec9b..bc3a1574ea6 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.test.cpp @@ -19,8 +19,8 @@ class GoblinRecursiveVerifierTests : public testing::Test { static void SetUpTestSuite() { - bb::srs::init_crs_factory("../srs_db/ignition"); - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } static MegaCircuitBuilder construct_mock_circuit(std::shared_ptr op_queue) @@ -125,8 +125,8 @@ TEST_F(GoblinRecursiveVerifierTests, ECCVMFailure) GoblinRecursiveVerifier verifier{ &builder, verifier_input }; GoblinRecursiveVerifierOutput goblin_rec_verifier_output = verifier.verify(proof); - auto crs_factory = - std::make_shared>("../srs_db/grumpkin", 1 << CONST_ECCVM_LOG_N); + auto crs_factory = std::make_shared>( + bb::srs::get_grumpkin_crs_path(), 1 << CONST_ECCVM_LOG_N); auto grumpkin_verifier_commitment_key = std::make_shared>(1 << CONST_ECCVM_LOG_N, crs_factory); OpeningClaim native_claim = goblin_rec_verifier_output.opening_claim.get_native_opening_claim(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_verifier.test.cpp index 1dc9e686b80..a7887a9c96e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_verifier.test.cpp @@ -35,7 +35,7 @@ template class RecursiveMergeVerifierTest : public test using MergeVerifier = MergeVerifier_; public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** * @brief Test recursive merge verification for the ops generated by a sample circuit diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp index 2280ddbac5f..bb7c633f120 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp @@ -44,6 +44,8 @@ template class RecursiveVerifierTest : public testing using RecursiveVerifier = UltraRecursiveVerifier_; using VerificationKey = typename RecursiveVerifier::VerificationKey; + using AggState = aggregation_state; + using VerifierOutput = bb::stdlib::recursion::honk::UltraRecursiveVerifierOutput; /** * @brief Create a non-trivial arbitrary inner circuit, the proof of which will be recursively verified * @@ -105,7 +107,7 @@ template class RecursiveVerifierTest : public testing public: static void SetUpTestSuite() { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); if constexpr (HasIPAAccumulator) { bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); } @@ -252,11 +254,9 @@ template class RecursiveVerifierTest : public testing OuterBuilder outer_circuit; RecursiveVerifier verifier{ &outer_circuit, verification_key }; - aggregation_state agg_obj = - init_default_aggregation_state(outer_circuit); - bb::stdlib::recursion::honk::UltraRecursiveVerifierOutput output = - verifier.verify_proof(inner_proof, agg_obj); - aggregation_state pairing_points = output.agg_obj; + AggState agg_obj = init_default_aggregation_state(outer_circuit); + VerifierOutput output = verifier.verify_proof(inner_proof, agg_obj); + AggState pairing_points = output.agg_obj; if constexpr (HasIPAAccumulator) { outer_circuit.add_ipa_claim(output.ipa_opening_claim.get_witness_indices()); outer_circuit.ipa_proof = convert_stdlib_proof_to_native(output.ipa_proof); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verification_key/verification_key.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verification_key/verification_key.test.cpp index 0abc008cb2f..ae62954416f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verification_key/verification_key.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verification_key/verification_key.test.cpp @@ -24,7 +24,7 @@ template class VerificationKeyFixture : public testing::Test using Curve = stdlib::bn254; using RecursVk = stdlib::recursion::verification_key; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** * @brief generate a random vk data for use in tests @@ -56,7 +56,8 @@ TYPED_TEST(VerificationKeyFixture, VkDataVsRecursionHashNative) verification_key_data vk_data = TestFixture::rand_vk_data(); verification_key_data vk_data_copy = vk_data; - auto file_crs = std::make_unique>("../srs_db/ignition"); + auto file_crs = + std::make_unique>(bb::srs::get_ignition_crs_path()); auto file_verifier = file_crs->get_verifier_crs(); auto native_vk = std::make_shared(std::move(vk_data_copy), file_verifier); @@ -76,7 +77,8 @@ TYPED_TEST(VerificationKeyFixture, HashVsHashNative) verification_key_data vk_data = TestFixture::rand_vk_data(); - auto file_crs = std::make_unique>("../srs_db/ignition"); + auto file_crs = + std::make_unique>(bb::srs::get_ignition_crs_path()); auto file_verifier = file_crs->get_verifier_crs(); auto native_vk = std::make_shared(std::move(vk_data), file_verifier); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verifier/verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verifier/verifier.test.cpp index c1772d50f7c..c6058681fd5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verifier/verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verifier/verifier.test.cpp @@ -352,7 +352,7 @@ template class stdlib_verifier : public testing::Test { } public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } static void test_inner_circuit() { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp index 1df95fb7be9..9e319d8fb4b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/primitives/safe_uint/safe_uint.test.cpp @@ -95,7 +95,7 @@ TYPED_TEST(SafeUintTest, TestMultiplyOperationOutOfRangeFails) { STDLIB_TYPE_ALIASES auto builder = Builder(); - // Since max is initally set to (1 << 2) - 1 = 3 (as bit range checks are easier than generic integer bounds), + // Since max is initially set to (1 << 2) - 1 = 3 (as bit range checks are easier than generic integer bounds), // should allow largest power of 3 smaller than r iterations, which is 159. Hence below we should exceed r, and // expect a throw field_ct a(witness_ct(&builder, 2)); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp index 81586173b6c..fcd1a878f25 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp @@ -52,7 +52,7 @@ template class ProtogalaxyRecursiveTests : public tes using InnerFoldingVerifier = ProtogalaxyVerifier_; using InnerFoldingProver = ProtogalaxyProver_; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** * @brief Create a non-trivial arbitrary inner circuit, the proof of which will be recursively verified * diff --git a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.test.cpp index 05bd7342ce0..9e7c0d5745d 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.test.cpp @@ -42,7 +42,7 @@ template class TranslatorRecursiveTests : public ::te using Transcript = InnerFlavor::Transcript; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } static void test_recursive_verification() { diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/flavor_serialization.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/flavor_serialization.test.cpp index 162385bdcba..6214b125743 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/flavor_serialization.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/flavor_serialization.test.cpp @@ -23,7 +23,7 @@ template class FlavorSerializationTests : public ::testing::Te using VerificationKey = typename Flavor::VerificationKey; protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; using FlavorTypes = testing::Types; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/grand_product_library.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/grand_product_library.test.cpp index f03d59be664..526d0ec164d 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/grand_product_library.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/grand_product_library.test.cpp @@ -12,7 +12,7 @@ template class GrandProductTests : public testing::Test { using Polynomial = bb::Polynomial; public: - void SetUp() { srs::init_crs_factory("../srs_db/ignition"); } + void SetUp() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } static void populate_span(auto& polynomial_view, const auto& polynomial) { diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/permutation_lib.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/permutation_lib.test.cpp index 0999c063ca4..54579846efa 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/permutation_lib.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/permutation_lib.test.cpp @@ -18,7 +18,7 @@ class PermutationHelperTests : public ::testing::Test { virtual void SetUp() { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); circuit_constructor.add_public_variable(1024); circuit_constructor.add_public_variable(1025); diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp index ffbc979548e..2ceab9efb91 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp @@ -22,7 +22,7 @@ template class SumcheckTests : public ::testing::Test { using ProverPolynomials = typename Flavor::ProverPolynomials; using RelationSeparator = Flavor::RelationSeparator; const size_t NUM_POLYNOMIALS = Flavor::NUM_ALL_ENTITIES; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } Polynomial random_poly(size_t size) { diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/relation_correctness.test.cpp b/barretenberg/cpp/src/barretenberg/translator_vm/relation_correctness.test.cpp index 292c868f2c0..ad10259ad9c 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/relation_correctness.test.cpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/relation_correctness.test.cpp @@ -33,7 +33,7 @@ template void check_relation(auto circuit_s class TranslatorRelationCorrectnessTests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; /** diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator.test.cpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator.test.cpp index b9f2327b747..ef4c99e7d6b 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator.test.cpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator.test.cpp @@ -35,7 +35,7 @@ void ensure_non_zero(auto& polynomial) class TranslatorTests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; } // namespace diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.cpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.cpp index 73a77c2c075..b7fa93455b8 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.cpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.cpp @@ -14,7 +14,6 @@ #include "barretenberg/stdlib_circuit_builders/op_queue/ecc_op_queue.hpp" #include namespace bb { -using ECCVMOperation = ECCOpQueue::ECCVMOperation; /** * @brief Given the transcript values from the EccOpQueue, the values of the previous accumulator, batching challenge @@ -34,32 +33,23 @@ using ECCVMOperation = ECCOpQueue::ECCVMOperation; * @param evaluation_input_x The value at which we evaluate the polynomials * @return TranslatorCircuitBuilder::AccumulationInput */ -template -TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, - Fr p_x_lo, - Fr p_x_hi, - Fr p_y_lo, - Fr p_y_hi, - Fr z1, - Fr z2, - Fq previous_accumulator, - Fq batching_challenge_v, - Fq evaluation_input_x) +TranslatorCircuitBuilder::AccumulationInput TranslatorCircuitBuilder::generate_witness_values( + const Fr op_code, + const Fr p_x_lo, + const Fr p_x_hi, + const Fr p_y_lo, + const Fr p_y_hi, + const Fr z1, + const Fr z2, + const Fq previous_accumulator, + const Fq batching_challenge_v, + const Fq evaluation_input_x) { // All parameters are well-described in the header, this is just for convenience - constexpr size_t NUM_LIMB_BITS = TranslatorCircuitBuilder::NUM_LIMB_BITS; - constexpr size_t NUM_BINARY_LIMBS = TranslatorCircuitBuilder::NUM_BINARY_LIMBS; - constexpr size_t NUM_MICRO_LIMBS = TranslatorCircuitBuilder::NUM_MICRO_LIMBS; - constexpr size_t NUM_LAST_LIMB_BITS = TranslatorCircuitBuilder::NUM_LAST_LIMB_BITS; - constexpr size_t MICRO_LIMB_BITS = TranslatorCircuitBuilder::MICRO_LIMB_BITS; constexpr size_t TOP_STANDARD_MICROLIMB_BITS = NUM_LAST_LIMB_BITS % MICRO_LIMB_BITS; - constexpr size_t NUM_Z_BITS = TranslatorCircuitBuilder::NUM_Z_BITS; constexpr size_t TOP_Z_MICROLIMB_BITS = (NUM_Z_BITS % NUM_LIMB_BITS) % MICRO_LIMB_BITS; constexpr size_t TOP_QUOTIENT_MICROLIMB_BITS = (TranslatorCircuitBuilder::NUM_QUOTIENT_BITS % NUM_LIMB_BITS) % MICRO_LIMB_BITS; - constexpr auto shift_1 = TranslatorCircuitBuilder::SHIFT_1; - constexpr auto neg_modulus_limbs = TranslatorCircuitBuilder::NEGATIVE_MODULUS_LIMBS; - constexpr auto shift_2_inverse = TranslatorCircuitBuilder::SHIFT_2_INVERSE; /** * @brief A small function to transform a native element Fq into its bigfield representation in Fr scalars @@ -67,7 +57,7 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, * @details We transform Fq into an integer and then split it into 68-bit limbs, then convert them to Fr. * */ - auto base_element_to_limbs = [](Fq& original) { + auto base_element_to_limbs = [](const Fq& original) { uint256_t original_uint = original; return std::array({ Fr(original_uint.slice(0, NUM_LIMB_BITS)), @@ -83,7 +73,7 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, * convert to Fr * */ - auto uint512_t_to_limbs = [](uint512_t& original) { + auto uint512_t_to_limbs = [](const uint512_t& original) { return std::array{ Fr(original.slice(0, NUM_LIMB_BITS).lo), Fr(original.slice(NUM_LIMB_BITS, 2 * NUM_LIMB_BITS).lo), Fr(original.slice(2 * NUM_LIMB_BITS, 3 * NUM_LIMB_BITS).lo), @@ -94,16 +84,15 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, * @brief A method for splitting wide limbs (P_x_lo, P_y_hi, etc) into two limbs * */ - auto split_wide_limb_into_2_limbs = [](Fr& wide_limb) { - return std::array{ Fr(uint256_t(wide_limb).slice(0, NUM_LIMB_BITS)), - Fr(uint256_t(wide_limb).slice( - NUM_LIMB_BITS, 2 * NUM_LIMB_BITS)) }; + auto split_wide_limb_into_2_limbs = [](const Fr& wide_limb) { + return std::array{ Fr(uint256_t(wide_limb).slice(0, NUM_LIMB_BITS)), + Fr(uint256_t(wide_limb).slice(NUM_LIMB_BITS, 2 * NUM_LIMB_BITS)) }; }; /** * @brief A method to split a full 68-bit limb into 5 14-bit limb and 1 shifted limb for a more secure constraint * */ - auto split_standard_limb_into_micro_limbs = [](Fr& limb) { + auto split_standard_limb_into_micro_limbs = [](const Fr& limb) { static_assert(MICRO_LIMB_BITS == 14); return std::array{ uint256_t(limb).slice(0, MICRO_LIMB_BITS), @@ -121,7 +110,7 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, * (plus there is 1 extra space for other constraints) * */ - auto split_top_limb_into_micro_limbs = [](Fr& limb, size_t last_limb_bits) { + auto split_top_limb_into_micro_limbs = [](const Fr& limb, const size_t last_limb_bits) { static_assert(MICRO_LIMB_BITS == 14); return std::array{ uint256_t(limb).slice(0, MICRO_LIMB_BITS), uint256_t(limb).slice(MICRO_LIMB_BITS, 2 * MICRO_LIMB_BITS), @@ -137,7 +126,7 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, * the last limb) * */ - auto split_top_z_limb_into_micro_limbs = [](Fr& limb, size_t last_limb_bits) { + auto split_top_z_limb_into_micro_limbs = [](const Fr& limb, const size_t last_limb_bits) { static_assert(MICRO_LIMB_BITS == 14); return std::array{ uint256_t(limb).slice(0, MICRO_LIMB_BITS), uint256_t(limb).slice(MICRO_LIMB_BITS, 2 * MICRO_LIMB_BITS), @@ -153,7 +142,7 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, * ensure non-overflow of the modulus) * */ - auto split_relation_limb_into_micro_limbs = [](Fr& limb) { + auto split_relation_limb_into_micro_limbs = [](const Fr& limb) { static_assert(MICRO_LIMB_BITS == 14); return std::array{ uint256_t(limb).slice(0, MICRO_LIMB_BITS), @@ -237,7 +226,7 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, Fr low_wide_relation_limb_part_1 = previous_accumulator_limbs[0] * x_witnesses[0] + op_code + v_witnesses[0] * p_x_limbs[0] + v_squared_witnesses[0] * p_y_limbs[0] + v_cubed_witnesses[0] * z_1_limbs[0] + v_quarted_witnesses[0] * z_2_limbs[0] + - quotient_limbs[0] * neg_modulus_limbs[0] - + quotient_limbs[0] * NEGATIVE_MODULUS_LIMBS[0] - remainder_limbs[0]; // This covers the lowest limb Fr low_wide_relation_limb = @@ -246,14 +235,14 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, v_witnesses[1] * p_x_limbs[0] + p_x_limbs[1] * v_witnesses[0] + v_squared_witnesses[1] * p_y_limbs[0] + v_squared_witnesses[0] * p_y_limbs[1] + v_cubed_witnesses[1] * z_1_limbs[0] + z_1_limbs[1] * v_cubed_witnesses[0] + v_quarted_witnesses[1] * z_2_limbs[0] + - v_quarted_witnesses[0] * z_2_limbs[1] + quotient_limbs[0] * neg_modulus_limbs[1] + - quotient_limbs[1] * neg_modulus_limbs[0] - remainder_limbs[1]) * - shift_1; + v_quarted_witnesses[0] * z_2_limbs[1] + quotient_limbs[0] * NEGATIVE_MODULUS_LIMBS[1] + + quotient_limbs[1] * NEGATIVE_MODULUS_LIMBS[0] - remainder_limbs[1]) * + SHIFT_1; // Low bits have to be zero ASSERT(uint256_t(low_wide_relation_limb).slice(0, 2 * NUM_LIMB_BITS) == 0); - Fr low_wide_relation_limb_divided = low_wide_relation_limb * shift_2_inverse; + Fr low_wide_relation_limb_divided = low_wide_relation_limb * SHIFT_2_INVERSE; // The high relation limb is the accumulation of the low limb divided by 2¹³⁶ and the combination of limbs with // indices (0*2,1*1,2*0) with limbs with indices (0*3,1*2,2*1,3*0) multiplied by 2⁶⁸ @@ -265,8 +254,9 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, v_squared_witnesses[2] * p_y_limbs[0] + v_squared_witnesses[1] * p_y_limbs[1] + v_squared_witnesses[0] * p_y_limbs[2] + v_cubed_witnesses[2] * z_1_limbs[0] + v_cubed_witnesses[1] * z_1_limbs[1] + v_quarted_witnesses[2] * z_2_limbs[0] + - v_quarted_witnesses[1] * z_2_limbs[1] + quotient_limbs[2] * neg_modulus_limbs[0] + - quotient_limbs[1] * neg_modulus_limbs[1] + quotient_limbs[0] * neg_modulus_limbs[2] - remainder_limbs[2] + + v_quarted_witnesses[1] * z_2_limbs[1] + quotient_limbs[2] * NEGATIVE_MODULUS_LIMBS[0] + + quotient_limbs[1] * NEGATIVE_MODULUS_LIMBS[1] + quotient_limbs[0] * NEGATIVE_MODULUS_LIMBS[2] - + remainder_limbs[2] + (previous_accumulator_limbs[3] * x_witnesses[0] + previous_accumulator_limbs[2] * x_witnesses[1] + previous_accumulator_limbs[1] * x_witnesses[2] + previous_accumulator_limbs[0] * x_witnesses[3] + v_witnesses[3] * p_x_limbs[0] + v_witnesses[2] * p_x_limbs[1] + v_witnesses[1] * p_x_limbs[2] + @@ -274,19 +264,19 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, v_squared_witnesses[1] * p_y_limbs[2] + v_squared_witnesses[0] * p_y_limbs[3] + v_cubed_witnesses[3] * z_1_limbs[0] + v_cubed_witnesses[2] * z_1_limbs[1] + v_quarted_witnesses[3] * z_2_limbs[0] + v_quarted_witnesses[2] * z_2_limbs[1] + - quotient_limbs[3] * neg_modulus_limbs[0] + quotient_limbs[2] * neg_modulus_limbs[1] + - quotient_limbs[1] * neg_modulus_limbs[2] + quotient_limbs[0] * neg_modulus_limbs[3] - remainder_limbs[3]) * - shift_1; + quotient_limbs[3] * NEGATIVE_MODULUS_LIMBS[0] + quotient_limbs[2] * NEGATIVE_MODULUS_LIMBS[1] + + quotient_limbs[1] * NEGATIVE_MODULUS_LIMBS[2] + quotient_limbs[0] * NEGATIVE_MODULUS_LIMBS[3] - + remainder_limbs[3]) * + SHIFT_1; // Check that the results lower 136 bits are zero ASSERT(uint256_t(high_wide_relation_limb).slice(0, 2 * NUM_LIMB_BITS) == 0); // Get divided version - auto high_wide_relation_limb_divided = high_wide_relation_limb * shift_2_inverse; + auto high_wide_relation_limb_divided = high_wide_relation_limb * SHIFT_2_INVERSE; - const auto last_limb_index = TranslatorCircuitBuilder::NUM_BINARY_LIMBS - 1; + const auto last_limb_index = NUM_BINARY_LIMBS - 1; - const auto NUM_Z_LIMBS = TranslatorCircuitBuilder::NUM_Z_LIMBS; std::array, NUM_BINARY_LIMBS> P_x_microlimbs; std::array, NUM_BINARY_LIMBS> P_y_microlimbs; std::array, NUM_Z_LIMBS> z_1_microlimbs; @@ -312,10 +302,10 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, z_1_microlimbs[i] = split_standard_limb_into_micro_limbs(z_1_limbs[i]); z_2_microlimbs[i] = split_standard_limb_into_micro_limbs(z_2_limbs[i]); } - z_1_microlimbs[TranslatorCircuitBuilder::NUM_Z_LIMBS - 1] = - split_top_z_limb_into_micro_limbs(z_1_limbs[TranslatorCircuitBuilder::NUM_Z_LIMBS - 1], TOP_Z_MICROLIMB_BITS); - z_2_microlimbs[TranslatorCircuitBuilder::NUM_Z_LIMBS - 1] = - split_top_z_limb_into_micro_limbs(z_2_limbs[TranslatorCircuitBuilder::NUM_Z_LIMBS - 1], TOP_Z_MICROLIMB_BITS); + z_1_microlimbs[NUM_Z_LIMBS - 1] = + split_top_z_limb_into_micro_limbs(z_1_limbs[NUM_Z_LIMBS - 1], TOP_Z_MICROLIMB_BITS); + z_2_microlimbs[NUM_Z_LIMBS - 1] = + split_top_z_limb_into_micro_limbs(z_2_limbs[NUM_Z_LIMBS - 1], TOP_Z_MICROLIMB_BITS); // Split current accumulator into microlimbs for range constraining for (size_t i = 0; i < last_limb_index; i++) { @@ -332,7 +322,7 @@ TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, split_top_limb_into_micro_limbs(quotient_limbs[last_limb_index], TOP_QUOTIENT_MICROLIMB_BITS); // Start filling the witness container - TranslatorCircuitBuilder::AccumulationInput input{ + AccumulationInput input{ .op_code = op_code, .P_x_lo = p_x_lo, .P_x_hi = p_x_hi, @@ -561,14 +551,13 @@ void TranslatorCircuitBuilder::create_accumulation_gate(const AccumulationInput * @tparam Fq * @return TranslatorCircuitBuilder::AccumulationInput */ -template -TranslatorCircuitBuilder::AccumulationInput compute_witness_values_for_one_ecc_op(const ECCVMOperation& ecc_op, - Fq previous_accumulator, - Fq batching_challenge_v, - Fq evaluation_input_x) -{ - using Fr = bb::fr; +TranslatorCircuitBuilder::AccumulationInput TranslatorCircuitBuilder::compute_witness_values_for_one_ecc_op( + const ECCVMOperation& ecc_op, + const Fq previous_accumulator, + const Fq batching_challenge_v, + const Fq evaluation_input_x) +{ // Get the Opcode value Fr op(ecc_op.get_opcode_value()); Fr p_x_lo(0); @@ -582,12 +571,10 @@ TranslatorCircuitBuilder::AccumulationInput compute_witness_values_for_one_ecc_o // the original in-circuit coordinate values are also zero const auto [x_256, y_256] = ecc_op.get_base_point_standard_form(); - p_x_lo = Fr(uint256_t(x_256).slice(0, 2 * TranslatorCircuitBuilder::NUM_LIMB_BITS)); - p_x_hi = Fr(uint256_t(x_256).slice(2 * TranslatorCircuitBuilder::NUM_LIMB_BITS, - 4 * TranslatorCircuitBuilder::NUM_LIMB_BITS)); - p_y_lo = Fr(uint256_t(y_256).slice(0, 2 * TranslatorCircuitBuilder::NUM_LIMB_BITS)); - p_y_hi = Fr(uint256_t(y_256).slice(2 * TranslatorCircuitBuilder::NUM_LIMB_BITS, - 4 * TranslatorCircuitBuilder::NUM_LIMB_BITS)); + p_x_lo = Fr(uint256_t(x_256).slice(0, 2 * NUM_LIMB_BITS)); + p_x_hi = Fr(uint256_t(x_256).slice(2 * NUM_LIMB_BITS, 4 * NUM_LIMB_BITS)); + p_y_lo = Fr(uint256_t(y_256).slice(0, 2 * NUM_LIMB_BITS)); + p_y_hi = Fr(uint256_t(y_256).slice(2 * NUM_LIMB_BITS, 4 * NUM_LIMB_BITS)); // Generate the full witness values return generate_witness_values(op, @@ -601,7 +588,7 @@ TranslatorCircuitBuilder::AccumulationInput compute_witness_values_for_one_ecc_o batching_challenge_v, evaluation_input_x); } -void TranslatorCircuitBuilder::feed_ecc_op_queue_into_circuit(std::shared_ptr ecc_op_queue) +void TranslatorCircuitBuilder::feed_ecc_op_queue_into_circuit(const std::shared_ptr ecc_op_queue) { using Fq = bb::fq; const auto& raw_ops = ecc_op_queue->get_raw_ops(); @@ -1068,6 +1055,4 @@ bool TranslatorCircuitBuilder::check_circuit() } return true; }; -template TranslatorCircuitBuilder::AccumulationInput generate_witness_values( - bb::fr, bb::fr, bb::fr, bb::fr, bb::fr, bb::fr, bb::fr, bb::fq, bb::fq, bb::fq); } // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.hpp index 9a3b6e6b523..cc10a1803a9 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.hpp @@ -18,9 +18,9 @@ namespace bb { /** * @brief TranslatorCircuitBuilder creates a circuit that evaluates the correctness of the evaluation of - * EccOpQueue in Fq while operating in the Fr scalar field (r is the modulus of Fr and p is the modulus of Fp) + * EccOpQueue in Fq while operating in the Fr scalar field (r is the modulus of Fr and q is the modulus of Fq) * - * @details Translator Circuit Builder builds a circuit the purpose of which is to calculate the batched + * @details Translator Circuit Builder builds a circuit whose purpose is to calculate the batched * evaluation of 5 polynomials in non-native field represented through coefficients in 4 native polynomials (op, * x_lo_y_hi, x_hi_z_1, y_lo_z_2): * @@ -33,11 +33,11 @@ namespace bb { * * Translator calculates the result of evaluation of a polynomial op + P.x⋅v +P.y⋅v² + z1 ⋅ v³ + z2⋅v⁴ at the * given challenge x (evaluation_input_x). For this it uses logic similar to the stdlib bigfield class. We operate in Fr - * while trying to calculate values in Fq. To show that a⋅b=c mod p, we: + * while trying to calculate values in Fq. To show that a⋅b=c mod q, we: * 1) Compute a⋅b in integers - * 2) Compute quotient=a⋅b/p - * 3) Show that a⋅b - quotient⋅p - c = 0 mod 2²⁷² - * 4) Show that a⋅b - quotient⋅p - c = 0 mod r (scalar field modulus) + * 2) Compute quotient=a⋅b/q + * 3) Show that a⋅b - quotient⋅q - c = 0 mod 2²⁷² + * 4) Show that a⋅b - quotient⋅q - c = 0 mod r (scalar field modulus) * This ensures that the logic is sound modulo 2²⁷²⋅r, which means it's correct in integers, if all the values are * sufficiently constrained (there is no way to undeflow or overflow) * @@ -73,6 +73,7 @@ class TranslatorCircuitBuilder : public CircuitBuilderBase { // We don't need templating for Goblin using Fr = bb::fr; using Fq = bb::fq; + using ECCVMOperation = ECCOpQueue::ECCVMOperation; public: static constexpr size_t NUM_WIRES = 81; @@ -272,7 +273,7 @@ class TranslatorCircuitBuilder : public CircuitBuilderBase { * @brief The accumulation input structure contains all the necessary values to initalize an accumulation gate as * well as additional values for checking its correctness * - * @details For example, we don't really nead the prime limbs, but they serve to check the correctness of over + * @details For example, we don't really need the prime limbs, but they serve to check the correctness of over * values. We also don't need the values of x's and v's limbs during circuit construction, since they are added to * relations directly, but this allows us to check correctness of the computed accumulator */ @@ -448,7 +449,7 @@ class TranslatorCircuitBuilder : public CircuitBuilderBase { * * @param ecc_op_queue The queue */ - void feed_ecc_op_queue_into_circuit(std::shared_ptr ecc_op_queue); + void feed_ecc_op_queue_into_circuit(const std::shared_ptr ecc_op_queue); /** * @brief Check the witness satisifies the circuit @@ -459,16 +460,20 @@ class TranslatorCircuitBuilder : public CircuitBuilderBase { * @return false */ bool check_circuit(); + static AccumulationInput generate_witness_values(const Fr op_code, + const Fr p_x_lo, + const Fr p_x_hi, + const Fr p_y_lo, + const Fr p_y_hi, + const Fr z1, + const Fr z2, + const Fq previous_accumulator, + const Fq batching_challenge_v, + const Fq evaluation_input_x); + static AccumulationInput compute_witness_values_for_one_ecc_op(const ECCVMOperation& ecc_op, + const Fq previous_accumulator, + const Fq batching_challenge_v, + const Fq evaluation_input_x); }; -template -TranslatorCircuitBuilder::AccumulationInput generate_witness_values(Fr op_code, - Fr p_x_lo, - Fr p_x_hi, - Fr p_y_lo, - Fr p_y_hi, - Fr z1, - Fr z2, - Fq previous_accumulator, - Fq batching_challenge_v, - Fq evaluation_input_x); + } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.test.cpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.test.cpp index 2f70b2c6213..95492d1acc0 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.test.cpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_circuit_builder.test.cpp @@ -58,12 +58,14 @@ TEST(TranslatorCircuitBuilder, CircuitBuilderBaseCase) Fq previous_accumulator = Fq::random_element(); + // Create a circuit builder + auto circuit_builder = TranslatorCircuitBuilder(v, x); + // Generate the witness for a single step TranslatorCircuitBuilder::AccumulationInput single_accumulation_step = - generate_witness_values(op, p_x_lo, p_x_hi, p_y_lo, p_y_hi, z_1, z_2, previous_accumulator, v, x); + TranslatorCircuitBuilder::generate_witness_values( + op, p_x_lo, p_x_hi, p_y_lo, p_y_hi, z_1, z_2, previous_accumulator, v, x); - // Create a circuit builder - auto circuit_builder = TranslatorCircuitBuilder(v, x); // Submit one accumulation step in the builder circuit_builder.create_accumulation_gate(single_accumulation_step); // Check if the circuit fails diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_composer.fuzzer.cpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_composer.fuzzer.cpp index 33636a911dc..f9532294048 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_composer.fuzzer.cpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_composer.fuzzer.cpp @@ -3,7 +3,7 @@ #include "barretenberg/translator_vm/translator_verifier.hpp" extern "C" void LLVMFuzzerInitialize(int*, char***) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** * @brief A very primitive fuzzer for the composer diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp index e1208cf7e02..904c65f5acc 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp @@ -132,14 +132,7 @@ class TranslatorFlavor { static constexpr size_t NUM_RELATIONS = std::tuple_size_v; // define the containers for storing the contributions from each relation in Sumcheck - using SumcheckTupleOfTuplesOfUnivariates = - std::tuple::SumcheckTupleOfUnivariatesOverSubrelations, - typename TranslatorDeltaRangeConstraintRelation::SumcheckTupleOfUnivariatesOverSubrelations, - typename TranslatorOpcodeConstraintRelation::SumcheckTupleOfUnivariatesOverSubrelations, - typename TranslatorAccumulatorTransferRelation::SumcheckTupleOfUnivariatesOverSubrelations, - typename TranslatorDecompositionRelation::SumcheckTupleOfUnivariatesOverSubrelations, - typename TranslatorNonNativeFieldRelation::SumcheckTupleOfUnivariatesOverSubrelations, - typename TranslatorZeroConstraintsRelation::SumcheckTupleOfUnivariatesOverSubrelations>; + using SumcheckTupleOfTuplesOfUnivariates = decltype(create_sumcheck_tuple_of_tuples_of_univariates()); using TupleOfArraysOfValues = decltype(create_tuple_of_arrays_of_values()); /** @@ -168,7 +161,6 @@ class TranslatorFlavor { concatenated_range_constraints_2, // column 2 concatenated_range_constraints_3) // column 3 }; - // TODO(https://github.com/AztecProtocol/barretenberg/issues/790) dedupe with shifted? template class WireToBeShiftedWithoutConcatenated { public: DEFINE_FLAVOR_MEMBERS(DataType, diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/databus.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/databus.test.cpp index f1efed42252..a891f5a11db 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/databus.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/databus.test.cpp @@ -19,7 +19,7 @@ using FlavorTypes = ::testing::Types; template class DataBusTests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } using Curve = curve::BN254; using FF = Curve::ScalarField; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_honk.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_honk.test.cpp index 0804bb3c97b..b4a502c6747 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_honk.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_honk.test.cpp @@ -21,7 +21,7 @@ using FlavorTypes = ::testing::Types; template class MegaHonkTests : public ::testing::Test { public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } using Curve = curve::BN254; using FF = Curve::ScalarField; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp index 31f345c83d1..4808bb2c2a8 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp @@ -15,7 +15,7 @@ using FlavorTypes = ::testing::Types; template class MegaTranscriptTests : public ::testing::Test { public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } using DeciderProvingKey = DeciderProvingKey_; using FF = Flavor::FF; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/relation_correctness.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/relation_correctness.test.cpp index 9169f22a183..23c90a2bea8 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/relation_correctness.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/relation_correctness.test.cpp @@ -229,7 +229,7 @@ template void create_some_ecc_op_queue_gates(auto& circuit_bui class UltraRelationCorrectnessTests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; /** diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp index 2a7c3d5646b..8595d8f17ae 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp @@ -19,7 +19,7 @@ using FF = typename Flavor::FF; class SumcheckTestsRealCircuit : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; /** diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp index b671c9fbb3a..3f7ffe9defe 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp @@ -44,7 +44,7 @@ template class UltraHonkTests : public ::testing::Test { }; protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; using FlavorTypes = testing::Types; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp index c07c75b34a3..a211564ae5d 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp @@ -4,6 +4,14 @@ #include "barretenberg/ultra_honk/oink_prover.hpp" namespace bb { +template +UltraProver_::UltraProver_(const std::shared_ptr& proving_key, + const std::shared_ptr& commitment_key) + : proving_key(std::move(proving_key)) + , transcript(std::make_shared()) + , commitment_key(commitment_key) +{} + /** * @brief Create UltraProver_ from a decider proving key. * diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp index 82608299ed5..896e5fd96f4 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.hpp @@ -37,6 +37,8 @@ template class UltraProver_ { std::shared_ptr commitment_key; + UltraProver_(const std::shared_ptr&, const std::shared_ptr&); + explicit UltraProver_(const std::shared_ptr&, const std::shared_ptr& transcript = std::make_shared()); diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp index 147db031ead..43a8e0cbb41 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp @@ -14,7 +14,7 @@ using namespace bb; class UltraTranscriptTests : public ::testing::Test { public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } using Flavor = UltraFlavor; using VerificationKey = Flavor::VerificationKey; diff --git a/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/CMakeLists.txt new file mode 100644 index 00000000000..e8120167c08 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/CMakeLists.txt @@ -0,0 +1 @@ +barretenberg_module(ultra_vanilla_client_ivc stdlib_honk_verifier) \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/mock_circuit_producer.hpp b/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/mock_circuit_producer.hpp new file mode 100644 index 00000000000..75f451c13bc --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/mock_circuit_producer.hpp @@ -0,0 +1,90 @@ + +#include "barretenberg/common/op_count.hpp" +#include "barretenberg/goblin/mock_circuits.hpp" +#include "barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp" +#include "barretenberg/ultra_honk/ultra_verifier.hpp" +#include "barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.hpp" + +using namespace bb; + +namespace { + +/** + * @brief Manage the construction of mock app/kernel circuits for the private function execution setting + * @details Per the medium complexity benchmark spec, the first app circuit is size 2^19. Subsequent app and kernel + * circuits are size 2^17. Circuits produced are alternatingly app and kernel. Mock databus data is passed between the + * circuits in a manor conistent with the real architecture in order to facilitate testing of databus consistency + * checks. + */ +class PrivateFunctionExecutionMockCircuitProducer { + using ClientCircuit = UltraVanillaClientIVC::ClientCircuit; + using Flavor = MegaFlavor; + using VerificationKey = Flavor::VerificationKey; + + size_t circuit_counter = 0; + + bool large_first_app = true; // if true, first app is 2^19, else 2^17 + + public: + PrivateFunctionExecutionMockCircuitProducer(bool large_first_app = true) + : large_first_app(large_first_app) + {} + + /** + * @brief Create the next circuit (app/kernel) in a mocked private function execution stack + */ + ClientCircuit create_next_circuit(UltraVanillaClientIVC& ivc, bool force_is_kernel = false) + { + circuit_counter++; + + // Assume only every second circuit is a kernel, unless force_is_kernel == true + bool is_kernel = (circuit_counter % 2 == 0) || force_is_kernel; + + ClientCircuit circuit{ ivc.goblin.op_queue }; + if (is_kernel) { + GoblinMockCircuits::construct_mock_folding_kernel(circuit); // construct mock base logic + mock_databus.populate_kernel_databus(circuit); // populate databus inputs/outputs + ivc.complete_kernel_circuit_logic(circuit); // complete with recursive verifiers etc + } else { + bool use_large_circuit = large_first_app && (circuit_counter == 1); // first circuit is size 2^19 + GoblinMockCircuits::construct_mock_app_circuit(circuit, use_large_circuit); // construct mock app + mock_databus.populate_app_databus(circuit); // populate databus outputs + } + return circuit; + } + + /** + * @brief Tamper with databus data to facilitate failure testing + */ + void tamper_with_databus() { mock_databus.tamper_with_app_return_data(); } + + /** + * @brief Compute and return the verification keys for a mocked private function execution IVC + * @details For testing/benchmarking only. This method is robust at the cost of being extremely inefficient. It + * simply executes a full IVC for a given number of circuits and stores the verification keys along the way. (In + * practice these VKs will be known to a client prover in advance). + * + * @param num_circuits + * @param trace_structure Trace structuring must be known in advance because it effects the VKs + * @return set of num_circuits-many verification keys + */ + auto precompute_verification_keys(const size_t num_circuits, TraceSettings trace_settings) + { + UltraVanillaClientIVC ivc{ + trace_settings + }; // temporary IVC instance needed to produce the complete kernel circuits + + std::vector> vkeys; + + for (size_t idx = 0; idx < num_circuits; ++idx) { + ClientCircuit circuit = create_next_circuit(ivc); // create the next circuit + ivc.accumulate(circuit); // accumulate the circuit + vkeys.emplace_back(ivc.honk_vk); // save the VK for the circuit + } + circuit_counter = 0; // reset the internal circuit counter back to 0 + + return vkeys; + } +}; + +} // namespace \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.cpp b/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.cpp new file mode 100644 index 00000000000..77b22b521e2 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.cpp @@ -0,0 +1,91 @@ +#include "barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.hpp" +#include "barretenberg/ultra_honk/oink_prover.hpp" + +namespace bb { + +void UltraVanillaClientIVC::accumulate(Circuit& circuit, const Proof& proof, const std::shared_ptr& vk) +{ + RecursiveVerifier verifier{ &circuit, std::make_shared(&circuit, vk) }; + Accumulator agg_obj = stdlib::recursion::init_default_aggregation_state>(circuit); + accumulator = verifier.verify_proof(proof, agg_obj).agg_obj; +} + +HonkProof UltraVanillaClientIVC::prove(CircuitSource& source, const bool cache_vks) +{ + for (size_t step = 0; step < source.num_circuits(); step++) { + auto [circuit, vk] = source.next(); + if (step == 0) { + accumulator_indices = stdlib::recursion::init_default_agg_obj_indices(circuit); + } else { + accumulate(circuit, previous_proof, previous_vk); + accumulator_indices = accumulator.get_witness_indices(); + } + + circuit.add_pairing_point_accumulator(accumulator_indices); + accumulator_value = { accumulator.P0.get_value(), accumulator.P1.get_value() }; + + auto proving_key = std::make_shared(circuit); + + if (step < source.num_circuits() - 1) { + UltraProver prover{ proving_key, commitment_key }; + previous_proof = prover.construct_proof(); + } else { + // TODO(https://github.com/AztecProtocol/barretenberg/issues/1176) Use UltraZKProver when it exists + UltraProver prover{ proving_key, commitment_key }; + previous_proof = prover.construct_proof(); + } + + previous_vk = vk ? vk : std::make_shared(proving_key->proving_key); + if (cache_vks) { + vk_cache.push_back(previous_vk); + } + } + return previous_proof; +}; + +bool UltraVanillaClientIVC::verify(const Proof& proof, const std::shared_ptr& vk) +{ + + UltraVerifier verifer{ vk }; + bool verified = verifer.verify_proof(proof); + vinfo("proof verified: ", verified); + + using VerifierCommitmentKey = typename Flavor::VerifierCommitmentKey; + auto pcs_verification_key = std::make_shared(); + verified &= pcs_verification_key->pairing_check(accumulator_value[0], accumulator_value[1]); + vinfo("pairing verified: ", verified); + return verified; +} + +/** + * @brief Construct and verify a proof for the IVC + * @note Use of this method only makes sense when the prover and verifier are the same entity, e.g. in + * development/testing. + * + */ +bool UltraVanillaClientIVC::prove_and_verify(CircuitSource& source, const bool cache_vks) +{ + auto start = std::chrono::steady_clock::now(); + prove(source, cache_vks); + auto end = std::chrono::steady_clock::now(); + auto diff = std::chrono::duration_cast(end - start); + vinfo("time to call UltraVanillaClientIVC::prove: ", diff.count(), " ms."); + + start = end; + bool verified = verify(previous_proof, previous_vk); + end = std::chrono::steady_clock::now(); + + diff = std::chrono::duration_cast(end - start); + vinfo("time to verify UltraVanillaClientIVC proof: ", diff.count(), " ms."); + + return verified; +} + +std::vector> UltraVanillaClientIVC::compute_vks( + CircuitSource& source) +{ + prove_and_verify(source, /*cache_vks=*/true); + return vk_cache; +}; + +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.hpp b/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.hpp new file mode 100644 index 00000000000..b035ce672ce --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.hpp @@ -0,0 +1,114 @@ +#pragma once + +#include "barretenberg/plonk_honk_shared/execution_trace/execution_trace_usage_tracker.hpp" +#include "barretenberg/plonk_honk_shared/types/aggregation_object_type.hpp" +#include "barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.hpp" +#include "barretenberg/stdlib/plonk_recursion/aggregation_state/aggregation_state.hpp" +#include "barretenberg/ultra_honk/ultra_prover.hpp" +#include "barretenberg/ultra_honk/ultra_verifier.hpp" +#include +namespace bb { + +/** + * @brief A function that produces a set of circuits and possibly their precomputed vks + * @details One has the option of not providing vks--just provide nullptr instead. + * This class is introduced as an experiment. We _could_ just use vectors of vks and shared_ptrs, but this limits + * applicability of the class because, in practice, we don't have sufficient memory to store all circuit builders at + * once. The idea is this class is applicable in both situations we care about testing via mocks (cf the test file for + * UltraVanillaClientIVC, which implements a source of mock circuits), and IVC of circuits written in Noir, where the + * source (not yet implemented) is ACIR and partial witnesses which are processed by our DSL code, expanding blackbox + * function calls. + * @todo Relocate this at the appropriate time, if it does become a standard interface. + */ +template + +class CircuitSource { + public: + struct Output { + Builder circuit; + std::shared_ptr vk; + }; + + virtual Output next(); + virtual size_t num_circuits() const; +}; + +/** + * @brief A class encapsulating multiple sequential steps of the IVC scheme that arises most naturally from recursive + * proof verification. + * + * @details "Vanilla" is in the colloquial sense of meaning "plain". "Client" refers to the fact that this is intended + * for executing proof construction in constrained environments. + */ +class UltraVanillaClientIVC { + + public: + using Flavor = UltraFlavor; + using FF = Flavor::FF; + using Circuit = UltraCircuitBuilder; + using PK = DeciderProvingKey_; + using VK = UltraFlavor::VerificationKey; + using Proof = HonkProof; + + using RecursiveFlavor = UltraRecursiveFlavor_; + using RecursiveVerifier = stdlib::recursion::honk::UltraRecursiveVerifier_; + using RecursiveVK = RecursiveFlavor::VerificationKey; + using Curve = stdlib::bn254; + using Accumulator = stdlib::recursion::aggregation_state; + + /** + * @brief Append a recursive verifier and update the accumulator. + */ + void accumulate(Circuit&, const Proof&, const std::shared_ptr&); + + public: + std::shared_ptr> commitment_key; + Proof previous_proof; + std::shared_ptr previous_vk; + Accumulator accumulator; + std::array accumulator_value; + PairingPointAccumulatorIndices accumulator_indices; + std::vector> vk_cache; + + UltraVanillaClientIVC(const size_t dyadic_size = 1 << 20) + : commitment_key(std::make_shared>(dyadic_size)) + {} + + /** + * @brief Iterate through all circuits and prove each, appending a recursive verifier of the previous proof after + * the first step. + * @param source A source of circuits, possibly accompanied by precomputed verification keys. + * @param cache_vks If true, case the verification key that is computed. + * @return HonkProof A proof of the final circuit which through recursive verification, demonstrates that all + * circuits were satisfied, or one of them was not satisfied, depending on whether it verifies or does not verify. + */ + HonkProof prove(CircuitSource& source, const bool cache_vks = false); + + /** + * @brief Verify an IVC proof. + * @details This verifies the final proof, including (natively) checking the pairing of the two points in the final + * accumulator. + * + * @param proof + * @param vk + * @return true All circuits provided have been satisfied. + * @return false Some circuit provided was not satisfied. + */ + bool verify(const Proof& proof, const std::shared_ptr& vk); + + /** + * @brief Prove and then verify the proof. This is used for testing. + */ + bool prove_and_verify(CircuitSource& source, const bool cache_vks = false); + + /** + * @brief Compute the verification key of each circuit provided by the source. + * @details This runs a full IVC prover. Our public interface provides a faster but more brittle method via dummy + * witnesses. This is a useful fallback that we might want for debugging. Currently it is used to test the prover + * flow that using precomputed verification keys. + */ + std::vector> compute_vks(CircuitSource& source); +}; +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.test.cpp new file mode 100644 index 00000000000..653b7d8f641 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.test.cpp @@ -0,0 +1,93 @@ +#include "barretenberg/ultra_vanilla_client_ivc/ultra_vanilla_client_ivc.hpp" +#include "barretenberg/goblin/goblin.hpp" +#include "barretenberg/goblin/mock_circuits.hpp" +#include "barretenberg/protogalaxy/folding_test_utils.hpp" +#include "barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp" +#include "barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp" +#include + +using namespace bb; + +class UltraVanillaClientIVCTests : public ::testing::Test { + protected: + static void SetUpTestSuite() + { + srs::init_crs_factory("../srs_db/ignition"); + srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + } + + using Flavor = UltraVanillaClientIVC::Flavor; + using Builder = UltraCircuitBuilder; + using FF = typename Flavor::FF; + using VK = Flavor::VerificationKey; + using PK = DeciderProvingKey_; + + class MockCircuitSource : public CircuitSource { + std::vector _sizes; + std::vector> _vks; + uint32_t step{ 0 }; + + public: + MockCircuitSource(const std::vector& sizes) + : _sizes(sizes) + { + std::fill_n(std::back_inserter(_vks), sizes.size(), nullptr); + } + + MockCircuitSource(const MockCircuitSource& source_without_sizes, std::vector> vks) + : _sizes(source_without_sizes._sizes) + , _vks(vks) + {} + + Output next() override + { + Builder circuit; + MockCircuits::construct_arithmetic_circuit(circuit, _sizes[step]); + const auto& vk = _vks[step]; + ++step; + return { circuit, vk }; + } + + size_t num_circuits() const override + { + ASSERT(_sizes.size() == _vks.size()); + return _sizes.size(); + } + }; +}; + +TEST_F(UltraVanillaClientIVCTests, TwoCircuits) +{ + static constexpr size_t LOG_SIZE = 10; + UltraVanillaClientIVC ivc(1 << LOG_SIZE); + MockCircuitSource circuit_source{ { LOG_SIZE, LOG_SIZE } }; + EXPECT_TRUE(ivc.prove_and_verify(circuit_source)); +}; + +TEST_F(UltraVanillaClientIVCTests, ThreeCircuits) +{ + static constexpr size_t LOG_SIZE = 10; + UltraVanillaClientIVC ivc(1 << LOG_SIZE); + MockCircuitSource circuit_source{ { LOG_SIZE, LOG_SIZE, LOG_SIZE } }; + EXPECT_TRUE(ivc.prove_and_verify(circuit_source)); +}; + +/** + * @brief Prove and verify accumulation of an arbitrary set of circuits using precomputed verification keys + * @details The tests precomputed the keys via one pass of the ivc prover, then it usese then in a second pass. + */ +TEST_F(UltraVanillaClientIVCTests, PrecomputedVerificationKeys) +{ + + static constexpr size_t LOG_SIZE = 10; + + UltraVanillaClientIVC ivc_1(1 << LOG_SIZE); + MockCircuitSource circuit_source_no_vks{ { LOG_SIZE, LOG_SIZE } }; + auto vks = ivc_1.compute_vks(circuit_source_no_vks); + + UltraVanillaClientIVC ivc_2(1 << LOG_SIZE); // need to refactor accumulator_value use to reuse ivc_1 + MockCircuitSource circuit_source_with_vks{ circuit_source_no_vks, vks }; + EXPECT_TRUE(ivc_2.prove_and_verify(circuit_source_with_vks)); +}; + +// TODO(https://github.com/AztecProtocol/barretenberg/issues/1177) Implement failure tests \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/arithmetic.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/arithmetic.test.cpp index 3d2ddb3ccdd..e839674ca35 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/arithmetic.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/arithmetic.test.cpp @@ -209,7 +209,7 @@ class AvmArithmeticTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/bitwise.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/bitwise.test.cpp index 49c58bbee57..deb1c3e808a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/bitwise.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/bitwise.test.cpp @@ -352,7 +352,7 @@ class AvmBitwiseTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/cast.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/cast.test.cpp index 51364e48153..36021469d7e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/cast.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/cast.test.cpp @@ -21,7 +21,7 @@ class AvmCastTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/comparison.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/comparison.test.cpp index 955b09be126..aa0b0d4e291 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/comparison.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/comparison.test.cpp @@ -90,7 +90,7 @@ class AvmCmpTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/control_flow.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/control_flow.test.cpp index 41686e7bf78..8222b152ff3 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/control_flow.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/control_flow.test.cpp @@ -35,7 +35,7 @@ class AvmControlFlowTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp index 5ed0171cd44..acbfdfeca82 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp @@ -49,7 +49,7 @@ class AvmExecutionTests : public ::testing::Test { // TODO(640): The Standard Honk on Grumpkin test suite fails unless the SRS is initialised for every test. void SetUp() override { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); public_inputs.gas_settings.gas_limits.l2_gas = DEFAULT_INITIAL_L2_GAS; public_inputs.gas_settings.gas_limits.da_gas = DEFAULT_INITIAL_DA_GAS; public_inputs.start_gas_used.l2_gas = 0; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp index d32e11811ff..91b81ec1e58 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp @@ -12,7 +12,7 @@ using namespace bb::avm_trace; class AvmGasTests : public ::testing::Test { protected: // TODO(640): The Standard Honk on Grumpkin test suite fails unless the SRS is initialised for every test. - void SetUp() override { srs::init_crs_factory("../srs_db/ignition"); }; + void SetUp() override { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); }; }; class AvmGasPositiveTests : public AvmGasTests {}; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/indirect_mem.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/indirect_mem.test.cpp index e01f85cefad..12b748a4b8c 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/indirect_mem.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/indirect_mem.test.cpp @@ -13,7 +13,7 @@ class AvmIndirectMemTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/inter_table.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/inter_table.test.cpp index 4a3502513a5..1cb98178341 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/inter_table.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/inter_table.test.cpp @@ -19,7 +19,7 @@ class AvmInterTableTests : public ::testing::Test { : public_inputs(generate_base_public_inputs()) , trace_builder(AvmTraceBuilder(public_inputs)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp index c2f7fc1f1ef..a8c42306045 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp @@ -18,7 +18,7 @@ // class AvmKernelTests : public ::testing::Test { // protected: // // TODO(640): The Standard Honk on Grumpkin test suite fails unless the SRS is initialised for every test. -// void SetUp() override { srs::init_crs_factory("../srs_db/ignition"); }; +// void SetUp() override { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); }; // }; // // class AvmKernelPositiveTests : public AvmKernelTests {}; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp index 687628f936a..a0b551aba25 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp @@ -22,7 +22,7 @@ class AvmMemOpcodeTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/memory.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/memory.test.cpp index f7cb7656e71..a68aa711af8 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/memory.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/memory.test.cpp @@ -14,7 +14,7 @@ class AvmMemoryTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/recursive_verifier.test.cpp index 23b23c20435..a9d0d9231cc 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/recursive_verifier.test.cpp @@ -41,7 +41,7 @@ class AvmRecursiveTests : public ::testing::Test { using OuterVerifier = UltraVerifier; using OuterDeciderProvingKey = DeciderProvingKey_; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/slice.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/slice.test.cpp index dbdd0ae929f..88ad944be4d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/slice.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/slice.test.cpp @@ -22,7 +22,7 @@ class AvmSliceTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } void gen_trace_builder(std::vector const& calldata) diff --git a/barretenberg/cpp/src/barretenberg/world_state_napi/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/world_state_napi/CMakeLists.txt index 5c1ba6d9159..31a88dc17c0 100644 --- a/barretenberg/cpp/src/barretenberg/world_state_napi/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/world_state_napi/CMakeLists.txt @@ -5,7 +5,7 @@ file(GLOB_RECURSE SOURCE_FILES *.cpp) file(GLOB_RECURSE HEADER_FILES *.hpp *.tcc) execute_process( - COMMAND yarn --frozen-lockfile --prefer-offline + COMMAND yarn --immutable WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/barretenberg/ts/CHANGELOG.md b/barretenberg/ts/CHANGELOG.md index bb740bf5c01..2e80b2f1e38 100644 --- a/barretenberg/ts/CHANGELOG.md +++ b/barretenberg/ts/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.69.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg.js-v0.68.2...barretenberg.js-v0.69.0) (2025-01-03) + + +### Miscellaneous + +* Cl/ci3.2 ([#10919](https://github.com/AztecProtocol/aztec-packages/issues/10919)) ([49dacc3](https://github.com/AztecProtocol/aztec-packages/commit/49dacc3378a339f8cc36971b630c52952249f60c)) + ## [0.68.2](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg.js-v0.68.1...barretenberg.js-v0.68.2) (2024-12-24) diff --git a/barretenberg/ts/bootstrap.sh b/barretenberg/ts/bootstrap.sh index 20733fb6734..48309f59a81 100755 --- a/barretenberg/ts/bootstrap.sh +++ b/barretenberg/ts/bootstrap.sh @@ -20,12 +20,12 @@ function build { } function test { - if test_should_run bb.js-tests-$hash; then - github_group "bb.js test" - denoise yarn test - cache_upload_flag bb.js-tests-$hash - github_endgroup - fi + test_should_run bb.js-tests-$hash || return 0 + + github_group "bb.js test" + denoise yarn test + cache_upload_flag bb.js-tests-$hash + github_endgroup } case "$cmd" in @@ -38,6 +38,13 @@ case "$cmd" in "test") test ;; + "test-cmds") + wd=$(realpath --relative-to=$root $PWD) + ./node_modules/.bin/jest --listTests --testRegex '\.test\.js$' --rootDir ./dest/node | \ + sed "s|$(pwd)/||" | while read -r test; do + echo "$wd/scripts/run_test.sh $test" + done + ;; "ci") build test diff --git a/barretenberg/ts/package.json b/barretenberg/ts/package.json index 090dc36482c..0995f7b5f20 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.68.2", + "version": "0.69.0", "homepage": "https://github.com/AztecProtocol/aztec-packages/tree/master/barretenberg/ts", "license": "MIT", "type": "module", @@ -31,23 +31,34 @@ "formatting": "prettier --check ./src && eslint --max-warnings 0 ./src", "formatting:fix": "prettier -w ./src", "test": "NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests", - "test:debug": "NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node --inspect-brk=0.0.0.0 --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests --runInBand", - "simple_test": "NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node ./src/examples/simple.rawtest.ts", + "test:debug": "NODE_NO_WARNINGS=1 node --inspect-brk=0.0.0.0 --experimental-vm-modules ./node_modules/.bin/jest --no-cache --passWithNoTests --runInBand", + "simple_test": "NODE_NO_WARNINGS=1 node ./src/examples/simple.rawtest.ts", "deploy": "npm publish --access public" }, "jest": { "preset": "ts-jest/presets/default-esm", "transform": { - "./src/.*\\.ts": [ - "ts-jest", + "^.+\\.tsx?$": [ + "@swc/jest", { - "useESM": true + "jsc": { + "parser": { + "syntax": "typescript", + "decorators": true + }, + "transform": { + "decoratorVersion": "2022-03" + } + } } ] }, "moduleNameMapper": { "^(\\.{1,2}/.*)\\.js$": "$1" }, + "extensionsToTreatAsEsm": [ + ".ts" + ], "testRegex": "./src/.*\\.test\\.ts$", "rootDir": "./src" }, @@ -62,6 +73,8 @@ "devDependencies": { "@jest/globals": "^29.4.3", "@msgpack/msgpack": "^3.0.0-beta2", + "@swc/core": "^1.10.1", + "@swc/jest": "^0.2.37", "@types/debug": "^4.1.7", "@types/detect-node": "^2.0.0", "@types/jest": "^29.4.0", diff --git a/barretenberg/ts/scripts/build_wasm.sh b/barretenberg/ts/scripts/build_wasm.sh index 022f6c6d7ee..16d423307d7 100755 --- a/barretenberg/ts/scripts/build_wasm.sh +++ b/barretenberg/ts/scripts/build_wasm.sh @@ -1,4 +1,6 @@ #!/bin/sh +# Builds the wasm and copies it into it's location in dest. +# If you want to build the wasm with debug info for stack traces, use NO_STRIP=1. set -e cd $(dirname $0)/.. @@ -10,7 +12,7 @@ if [ -z "$SKIP_CPP_BUILD" ]; then if [ -z "$SKIP_ST_BUILD" ]; then cmake --preset wasm -DCMAKE_MESSAGE_LOG_LEVEL=Warning && cmake --build --preset wasm fi - ./scripts/strip-wasm.sh + [ -z "$NO_STRIP" ] && ./scripts/strip-wasm.sh ./scripts/gzip-wasm.sh cd ../ts fi diff --git a/barretenberg/ts/scripts/run_test.sh b/barretenberg/ts/scripts/run_test.sh new file mode 100755 index 00000000000..dac17f926b4 --- /dev/null +++ b/barretenberg/ts/scripts/run_test.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# This runs an individual test from the dest folder. +# It's the script used by ./bootstrap.sh test-cmds. +# It means we can return a concise, easy to read, easy to run command for reproducing a test run. +set -eu + +cd $(dirname $0)/.. + +export NODE_OPTIONS="--no-warnings --experimental-vm-modules" + +./node_modules/.bin/jest --testRegex '\.test\.js$' --rootDir ./dest/node $1 \ No newline at end of file diff --git a/barretenberg/ts/scripts/run_tests b/barretenberg/ts/scripts/run_tests deleted file mode 100755 index 0f0d2895cec..00000000000 --- a/barretenberg/ts/scripts/run_tests +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -xe - -$(aws ecr get-login --region us-east-2 --no-include-email) 2> /dev/null - -REPOSITORY=bb.js -IMAGE_URI=$($(git rev-parse --show-toplevel)/build-system/scripts/calculate_image_uri $REPOSITORY) -docker run --rm $IMAGE_URI diff --git a/barretenberg/ts/src/barretenberg_wasm/barretenberg_wasm_base/index.ts b/barretenberg/ts/src/barretenberg_wasm/barretenberg_wasm_base/index.ts index 76a5d337353..48e5d187ecb 100644 --- a/barretenberg/ts/src/barretenberg_wasm/barretenberg_wasm_base/index.ts +++ b/barretenberg/ts/src/barretenberg_wasm/barretenberg_wasm_base/index.ts @@ -1,6 +1,5 @@ import createDebug from 'debug'; import { randomBytes } from '../../random/index.js'; -import { killSelf } from '../helpers/index.js'; const debug = createDebug('bb.js:wasm'); @@ -34,9 +33,8 @@ export class BarretenbergWasmBase { view.setBigUint64(out, ts, true); }, proc_exit: () => { - this.logger('PANIC: proc_exit was called. This is maybe caused by "joining" with unstable wasi pthreads.'); - this.logger(new Error().stack!); - killSelf(); + this.logger('PANIC: proc_exit was called.'); + throw new Error(); }, }, diff --git a/barretenberg/ts/yarn.lock b/barretenberg/ts/yarn.lock index 3a88619a180..1573426e9e8 100644 --- a/barretenberg/ts/yarn.lock +++ b/barretenberg/ts/yarn.lock @@ -28,6 +28,8 @@ __metadata: dependencies: "@jest/globals": "npm:^29.4.3" "@msgpack/msgpack": "npm:^3.0.0-beta2" + "@swc/core": "npm:^1.10.1" + "@swc/jest": "npm:^0.2.37" "@types/debug": "npm:^4.1.7" "@types/detect-node": "npm:^2.0.0" "@types/jest": "npm:^29.4.0" @@ -630,6 +632,15 @@ __metadata: languageName: node linkType: hard +"@jest/create-cache-key-function@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/create-cache-key-function@npm:29.7.0" + dependencies: + "@jest/types": "npm:^29.6.3" + checksum: 10/061ef63b13ec8c8e5d08e4456f03b5cf8c7f9c1cab4fed8402e1479153cafce6eea80420e308ef62027abb7e29b825fcfa06551856bd021d98e92e381bf91723 + languageName: node + linkType: hard + "@jest/environment@npm:^29.7.0": version: 29.7.0 resolution: "@jest/environment@npm:29.7.0" @@ -962,6 +973,151 @@ __metadata: languageName: node linkType: hard +"@swc/core-darwin-arm64@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-darwin-arm64@npm:1.10.1" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@swc/core-darwin-x64@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-darwin-x64@npm:1.10.1" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@swc/core-linux-arm-gnueabihf@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.10.1" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@swc/core-linux-arm64-gnu@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-linux-arm64-gnu@npm:1.10.1" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@swc/core-linux-arm64-musl@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-linux-arm64-musl@npm:1.10.1" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@swc/core-linux-x64-gnu@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-linux-x64-gnu@npm:1.10.1" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@swc/core-linux-x64-musl@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-linux-x64-musl@npm:1.10.1" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@swc/core-win32-arm64-msvc@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-win32-arm64-msvc@npm:1.10.1" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@swc/core-win32-ia32-msvc@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-win32-ia32-msvc@npm:1.10.1" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@swc/core-win32-x64-msvc@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-win32-x64-msvc@npm:1.10.1" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@swc/core@npm:^1.10.1": + version: 1.10.1 + resolution: "@swc/core@npm:1.10.1" + dependencies: + "@swc/core-darwin-arm64": "npm:1.10.1" + "@swc/core-darwin-x64": "npm:1.10.1" + "@swc/core-linux-arm-gnueabihf": "npm:1.10.1" + "@swc/core-linux-arm64-gnu": "npm:1.10.1" + "@swc/core-linux-arm64-musl": "npm:1.10.1" + "@swc/core-linux-x64-gnu": "npm:1.10.1" + "@swc/core-linux-x64-musl": "npm:1.10.1" + "@swc/core-win32-arm64-msvc": "npm:1.10.1" + "@swc/core-win32-ia32-msvc": "npm:1.10.1" + "@swc/core-win32-x64-msvc": "npm:1.10.1" + "@swc/counter": "npm:^0.1.3" + "@swc/types": "npm:^0.1.17" + peerDependencies: + "@swc/helpers": "*" + dependenciesMeta: + "@swc/core-darwin-arm64": + optional: true + "@swc/core-darwin-x64": + optional: true + "@swc/core-linux-arm-gnueabihf": + optional: true + "@swc/core-linux-arm64-gnu": + optional: true + "@swc/core-linux-arm64-musl": + optional: true + "@swc/core-linux-x64-gnu": + optional: true + "@swc/core-linux-x64-musl": + optional: true + "@swc/core-win32-arm64-msvc": + optional: true + "@swc/core-win32-ia32-msvc": + optional: true + "@swc/core-win32-x64-msvc": + optional: true + peerDependenciesMeta: + "@swc/helpers": + optional: true + checksum: 10/e9c8a42488db77b3c199d1696d45bb9c7e917267e810c091e5161a7096f3db9c01813ade1e942290285210b4590ec7a00399b2ba3edc4d8cae9b2e824fac7d45 + languageName: node + linkType: hard + +"@swc/counter@npm:^0.1.3": + version: 0.1.3 + resolution: "@swc/counter@npm:0.1.3" + checksum: 10/df8f9cfba9904d3d60f511664c70d23bb323b3a0803ec9890f60133954173047ba9bdeabce28cd70ba89ccd3fd6c71c7b0bd58be85f611e1ffbe5d5c18616598 + languageName: node + linkType: hard + +"@swc/jest@npm:^0.2.37": + version: 0.2.37 + resolution: "@swc/jest@npm:0.2.37" + dependencies: + "@jest/create-cache-key-function": "npm:^29.7.0" + "@swc/counter": "npm:^0.1.3" + jsonc-parser: "npm:^3.2.0" + peerDependencies: + "@swc/core": "*" + checksum: 10/bbec37079b4f5c1ff1c95aeec07d08277c646a0c5e16e057ea3a8fe5c6e2bd59bbfc4312e53ddd05d25fa4de20a03607be274f560f28bb5e229dd08124780e16 + languageName: node + linkType: hard + +"@swc/types@npm:^0.1.17": + version: 0.1.17 + resolution: "@swc/types@npm:0.1.17" + dependencies: + "@swc/counter": "npm:^0.1.3" + checksum: 10/ddef1ad5bfead3acdfc41f14e79ba43a99200eb325afbad5716058dbe36358b0513400e9f22aff32432be84a98ae93df95a20b94192f69b8687144270e4eaa18 + languageName: node + linkType: hard + "@tsconfig/node10@npm:^1.0.7": version: 1.0.9 resolution: "@tsconfig/node10@npm:1.0.9" @@ -4753,6 +4909,13 @@ __metadata: languageName: node linkType: hard +"jsonc-parser@npm:^3.2.0": + version: 3.3.1 + resolution: "jsonc-parser@npm:3.3.1" + checksum: 10/9b0dc391f20b47378f843ef1e877e73ec652a5bdc3c5fa1f36af0f119a55091d147a86c1ee86a232296f55c929bba174538c2bf0312610e0817a22de131cc3f4 + languageName: node + linkType: hard + "keyv@npm:^4.5.3": version: 4.5.4 resolution: "keyv@npm:4.5.4" diff --git a/bootstrap.sh b/bootstrap.sh index d59fa4ba5ab..e0e4a070cd2 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -13,6 +13,7 @@ export DENOISE=1 export FORCE_COLOR=true cmd=${1:-} +[ -n "$cmd" ] && shift function encourage_dev_container { echo -e "${bold}${red}ERROR: Toolchain incompatibility. We encourage use of our dev container. See build-images/README.md.${reset}" @@ -26,6 +27,7 @@ function check_toolchains { if ! command -v $util > /dev/null; then encourage_dev_container echo "Utility $util not found." + echo "Installation: sudo apt install $util" exit 1 fi done @@ -67,7 +69,7 @@ function check_toolchains { echo "$tool not in PATH or incorrect version (requires 25f24e677a6a32a62512ad4f561995589ac2c7dc)." echo "Installation: https://book.getfoundry.sh/getting-started/installation" echo " curl -L https://foundry.paradigm.xyz | bash" - echo " foundryup -v nightly-25f24e677a6a32a62512ad4f561995589ac2c7dc" + echo " foundryup -i nightly-25f24e677a6a32a62512ad4f561995589ac2c7dc" exit 1 fi done @@ -107,6 +109,52 @@ function check_toolchains { fi } +function test_all { + # Rust is very annoying. + # You sneeze and everything needs recompiling and you can't avoid recompiling when running tests. + # Ensure tests are up-to-date first so parallel doesn't complain about slow startup. + echo "Building tests..." + ./noir/bootstrap.sh build-tests + + # Starting txe servers with incrementing port numbers. + export NUM_TXES=8 + trap 'kill $(jobs -p)' EXIT + for i in $(seq 0 $((NUM_TXES-1))); do + (cd $root/yarn-project/txe && LOG_LEVEL=silent TXE_PORT=$((45730 + i)) yarn start) & + done + echo "Waiting for TXE's to start..." + for i in $(seq 0 $((NUM_TXES-1))); do + while ! nc -z 127.0.0.1 $((45730 + i)) &>/dev/null; do sleep 1; done + done + + echo "Gathering tests to run..." + { + set -euo pipefail + + if [ "$#" -gt 0 ]; then + for arg in "$@"; do + "$arg/bootstrap.sh" test-cmds + done + else + # Ordered with longest running first, to ensure they get scheduled earliest. + ./yarn-project/bootstrap.sh test-cmds + ./noir-projects/bootstrap.sh test-cmds + ./boxes/bootstrap.sh test-cmds + ./barretenberg/bootstrap.sh test-cmds + ./l1-contracts/bootstrap.sh test-cmds + ./noir/bootstrap.sh test-cmds + fi + } | parallel -j96 --bar --joblog joblog.txt --halt now,fail=1 'dump_fail {} >/dev/null' + + slow_jobs=$(cat joblog.txt | \ + awk 'NR>1 && $4 > 300 {print | "sort -k4,4"}' | \ + awk '{print $4 ": " substr($0, index($0, $9))}' | sed -E "s/^(.*: ).*'([^']+)'.*$/\1\2/") + if [ -n "$slow_jobs" ]; then + echo -e "${yellow}WARNING: The following tests exceed 5 minute runtimes. Break them up.${reset}" + echo "$slow_jobs" + fi +} + case "$cmd" in "clean") echo "WARNING: This will erase *all* untracked files, including hooks and submodules." @@ -214,6 +262,10 @@ case "$cmd" in github_endgroup exit ;; + "test-all") + test_all + exit + ;; ""|"fast"|"full"|"test"|"ci") # Drop through. source_bootstrap on script entry has set flags. ;; diff --git a/bootstrap/Dockerfile.alpine b/bootstrap/Dockerfile.alpine deleted file mode 100644 index 81661fd5a70..00000000000 --- a/bootstrap/Dockerfile.alpine +++ /dev/null @@ -1,25 +0,0 @@ -# At present this doesn't work, as we don't have an alpine wasm toolchain we can use (or it's not directly obvious). -# Keeping this around though, as it would be nice to resolve this in the future. -FROM alpine:latest -RUN apk update && apk add --no-cache \ - build-base \ - curl \ - git \ - cmake \ - lsb-release \ - wget \ - gnupg \ - ninja \ - npm \ - pkgconf \ - openssl-dev \ - jq \ - llvm \ - clang \ - rust \ - cargo \ - bash -RUN npm install -g yarn -WORKDIR /usr/src -COPY . . -RUN ./bootstrap.sh \ No newline at end of file diff --git a/bootstrap/Dockerfile.lunar b/bootstrap/Dockerfile.lunar deleted file mode 100644 index daf60c11b61..00000000000 --- a/bootstrap/Dockerfile.lunar +++ /dev/null @@ -1,23 +0,0 @@ -FROM ubuntu:lunar -ENV DEBIAN_FRONTEND=noninteractive -RUN apt update && apt install -y \ - build-essential \ - curl \ - git \ - cmake \ - lsb-release \ - wget \ - software-properties-common \ - gnupg \ - ninja-build \ - npm \ - pkg-config \ - libssl-dev \ - jq -RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" -RUN npm install -g yarn -WORKDIR /usr/src -COPY . . -RUN ./bootstrap.sh \ No newline at end of file diff --git a/bootstrap/bootstrap_test.sh b/bootstrap/bootstrap_test.sh deleted file mode 100755 index 8e05b2650ef..00000000000 --- a/bootstrap/bootstrap_test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# This script takes the state of your current repository, and clones it inside of a docker container. -# You likely don't have a fresh clone, and it's paramount that to test bootstrapping, we don't have any -# intermediate build state in the context. -# To achieve this we mount your working directory into the container, and then perform the clone into the container. -# After cloning the repo we build the relevant dockerfile to bootstrap. -# "docker-in-docker" is achieved by mounting the host systems docker socket into the container. - -DOCKERFILE=${1:-Dockerfile.lunar} - -docker build -t bootstrap-build - < /dev/null 2>&1; done - -cd /project -docker build -f bootstrap/$DOCKERFILE . -" \ No newline at end of file diff --git a/boxes/.rebuild_patterns b/boxes/.rebuild_patterns new file mode 100644 index 00000000000..dd81b210e0e --- /dev/null +++ b/boxes/.rebuild_patterns @@ -0,0 +1 @@ +^boxes/ \ No newline at end of file diff --git a/boxes/bootstrap.sh b/boxes/bootstrap.sh index fef3cb83f18..c8bf46d9008 100755 --- a/boxes/bootstrap.sh +++ b/boxes/bootstrap.sh @@ -9,32 +9,38 @@ export NARGO=$PWD/../noir/noir-repo/target/release/nargo export AZTEC_NARGO=$PWD/../aztec-nargo/compile_then_postprocess.sh export AZTEC_BUILDER=$PWD/../yarn-project/builder/aztec-builder-dest -hash=$(cache_content_hash ../noir/.rebuild_patterns \ +hash=$(cache_content_hash \ + .rebuild_patterns \ + ../noir/.rebuild_patterns \ ../{avm-transpiler,noir-projects,l1-contracts,yarn-project}/.rebuild_patterns \ ../barretenberg/*/.rebuild_patterns) function build { - # Moved to test for now as there was no cache here. - return + if ! cache_download boxes-$hash.tar.gz; then + denoise 'yarn && echo "Building... " && yarn build' + cache_upload boxes-$hash.tar.gz boxes/*/{artifacts,dist} + else + denoise yarn && yarn build + fi } function test { - function test_box { - set -eu - BOX=$1 BROWSER=$2 denoise docker compose -p $1-$2 up --exit-code-from=boxes --force-recreate - } - export -f test_box + test_should_run "boxes-test-$hash" || return 0 github_group "boxes" - if test_should_run "boxes-test-$hash"; then - # TODO: Move back to build and use cache. - denoise 'yarn && echo "Building... " && yarn build' - parallel --tag --line-buffered --timeout 5m --halt now,fail=1 test_box {1} {2} ::: vanilla react ::: chromium webkit - cache_upload_flag boxes-test-$hash - fi + test_cmds | (cd $root; parallel --tag --line-buffered --timeout 5m --halt now,fail=1) + cache_upload_flag boxes-test-$hash github_endgroup } +function test_cmds { + for browser in chromium webkit; do + for box in vanilla react; do + echo "boxes/scripts/run_test.sh $box $browser" + done + done +} + case "$cmd" in "clean") git clean -fdx @@ -45,6 +51,9 @@ case "$cmd" in "test") test ;; + "test-cmds") + test_cmds + ;; "hash") echo $hash ;; diff --git a/boxes/scripts/run_test.sh b/boxes/scripts/run_test.sh new file mode 100755 index 00000000000..0a81e0c9b67 --- /dev/null +++ b/boxes/scripts/run_test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -eu + +cd $(dirname $0)/.. + +BOX=$1 BROWSER=$2 denoise docker compose -p $1-$2 up --exit-code-from=boxes --force-recreate \ No newline at end of file diff --git a/build-images/bootstrap.sh b/build-images/bootstrap.sh index 6b5d377ad96..ede7695e055 100755 --- a/build-images/bootstrap.sh +++ b/build-images/bootstrap.sh @@ -7,7 +7,6 @@ hash=$(cache_content_hash "^build-images/Earthfile") function build { github_group "build-images build" - export TEST=1 # for test_should_run if test_should_run build-images-$hash; then args="" if [ "${CI:-0}" = 1 ]; then diff --git a/ci3/bootstrap_local b/ci3/bootstrap_local index 28a141afe13..19af7409234 100755 --- a/ci3/bootstrap_local +++ b/ci3/bootstrap_local @@ -19,7 +19,8 @@ docker run --name aztec_build -ti --rm \ --privileged \ -v bootstrap_ci_local_docker:/var/lib/docker \ -v $root:/aztec-packages-host:ro \ - -v $HOME/.aws:/root/.aws \ + -v $HOME/.aws:/root/.aws:ro \ + -v $HOME/.bb-crs:/root/.bb-crs:ro \ aztecprotocol/ci:2.0 bash -c " set -e /usr/local/share/docker-init.sh &> /dev/null diff --git a/ci3/denoise b/ci3/denoise index 986e60f24e6..daee9d6bc4a 100755 --- a/ci3/denoise +++ b/ci3/denoise @@ -17,6 +17,9 @@ dots_per_line=${LINE_WIDTH:-64} dot_count=0 status=0 +# We don't want to lose color just because we're wrapping. +export FORCE_COLOR=1 + # Create a new file descriptor for capturing output exec 3>&1 diff --git a/ci3/dump_fail b/ci3/dump_fail index 5e933822055..f16788421e3 100755 --- a/ci3/dump_fail +++ b/ci3/dump_fail @@ -28,6 +28,7 @@ if [ "$status" -ne 0 ]; then echo -e "$output" echo -e "${blue}--- stderr ---${reset}" cat "$stderr" + echo -e "${blue}--------------${reset}" } >&2 else echo -n "$output" diff --git a/ci3/source b/ci3/source index 063437456d9..d1415c11562 100644 --- a/ci3/source +++ b/ci3/source @@ -2,12 +2,15 @@ # This is a basis for shell scripts that use the ci3 framework. # Set BASH best practices for early error exit and undefined variables. set -euo pipefail +# Enable extended bash globs. +shopt -s extglob # Enter our script directory, allowing usage of scripts from any directory. [ -z "${NO_CD:-}" ] && cd "$(dirname $0)" -# Add ci3 to path. -export ci3="$(git rev-parse --show-toplevel)/ci3" +# We export so we can use from exported functions. +export root="$(git rev-parse --show-toplevel)" +export ci3="$root/ci3" [[ "$PATH" != *"$ci3:" ]] && export PATH=$ci3:$PATH # Conditionally print all statements ran in CI scripts. diff --git a/ci3/source_bootstrap b/ci3/source_bootstrap index 2a3cc2ba030..bfcc4d9c020 100644 --- a/ci3/source_bootstrap +++ b/ci3/source_bootstrap @@ -6,13 +6,9 @@ case "${1:-}" in "ci") export CI=1 export USE_CACHE=${USE_CACHE:-1} - export TEST=1 export DENOISE=${DENOISE:-1} ;; ""|"fast") export USE_CACHE=${USE_CACHE:-1} ;; - "test") - export TEST=1 - ;; esac \ No newline at end of file diff --git a/ci3/test_should_run b/ci3/test_should_run index 6d909bc1618..0bb8e95f145 100755 --- a/ci3/test_should_run +++ b/ci3/test_should_run @@ -1,22 +1,8 @@ #!/bin/bash +# This is called within test functions to provide an early out for running tests in CI. source $(git rev-parse --show-toplevel)/ci3/source -# Are we able to download from a file with the flag name? -# if TEST=0 is explicit, don't run tests. -if [ "${TEST:-}" = 0 ]; then - echo "Skipping test $1 because TEST=0." +# If we're in CI and the cache flag is present, we skip running tests. +if [ "${CI:-0}" -eq 1 ] && cache_download_flag "$1"; then exit 1 -fi - -if [ "${TEST:-}" != 1 ] && [ "${CI:-}" != 1 ]; then - echo "Skipping test $1 because neither CI or TEST are 1." - exit 1 -fi - -# if we download the test s3 flag, don't run this -if cache_download_flag "$1"; then - exit 1 -fi - -# otherwise CI=1 or TEST=1 and we have not found our flag in S3, run -exit 0 \ No newline at end of file +fi \ No newline at end of file diff --git a/docs/components/snippet.js b/docs/components/snippet.js new file mode 100644 index 00000000000..7496220cac5 --- /dev/null +++ b/docs/components/snippet.js @@ -0,0 +1,8 @@ +import React from 'react'; + +const Spec_Placeholder = () => ( +

The design and implementation have largely changed since the original specification, and these docs will soon be updated to reflect the latest implementation. +

+); + +export default Spec_Placeholder; \ No newline at end of file diff --git a/docs/docs/protocol-specs/addresses-and-keys/address.md b/docs/docs/_protocol-specs/addresses-and-keys/address.md similarity index 100% rename from docs/docs/protocol-specs/addresses-and-keys/address.md rename to docs/docs/_protocol-specs/addresses-and-keys/address.md diff --git a/docs/docs/protocol-specs/addresses-and-keys/diversified-and-stealth.md b/docs/docs/_protocol-specs/addresses-and-keys/diversified-and-stealth.md similarity index 100% rename from docs/docs/protocol-specs/addresses-and-keys/diversified-and-stealth.md rename to docs/docs/_protocol-specs/addresses-and-keys/diversified-and-stealth.md diff --git a/docs/docs/protocol-specs/addresses-and-keys/example-usage/diversified-and-stealth-keys.md b/docs/docs/_protocol-specs/addresses-and-keys/example-usage/diversified-and-stealth-keys.md similarity index 100% rename from docs/docs/protocol-specs/addresses-and-keys/example-usage/diversified-and-stealth-keys.md rename to docs/docs/_protocol-specs/addresses-and-keys/example-usage/diversified-and-stealth-keys.md diff --git a/docs/docs/protocol-specs/addresses-and-keys/example-usage/encrypt-and-tag.md b/docs/docs/_protocol-specs/addresses-and-keys/example-usage/encrypt-and-tag.md similarity index 100% rename from docs/docs/protocol-specs/addresses-and-keys/example-usage/encrypt-and-tag.md rename to docs/docs/_protocol-specs/addresses-and-keys/example-usage/encrypt-and-tag.md diff --git a/docs/docs/protocol-specs/addresses-and-keys/example-usage/nullifier.md b/docs/docs/_protocol-specs/addresses-and-keys/example-usage/nullifier.md similarity index 100% rename from docs/docs/protocol-specs/addresses-and-keys/example-usage/nullifier.md rename to docs/docs/_protocol-specs/addresses-and-keys/example-usage/nullifier.md diff --git a/docs/docs/protocol-specs/addresses-and-keys/example-usage/tag-sequence-derivation.md b/docs/docs/_protocol-specs/addresses-and-keys/example-usage/tag-sequence-derivation.md similarity index 100% rename from docs/docs/protocol-specs/addresses-and-keys/example-usage/tag-sequence-derivation.md rename to docs/docs/_protocol-specs/addresses-and-keys/example-usage/tag-sequence-derivation.md diff --git a/docs/docs/protocol-specs/addresses-and-keys/index.md b/docs/docs/_protocol-specs/addresses-and-keys/index.md similarity index 100% rename from docs/docs/protocol-specs/addresses-and-keys/index.md rename to docs/docs/_protocol-specs/addresses-and-keys/index.md diff --git a/docs/docs/protocol-specs/addresses-and-keys/keys-requirements.md b/docs/docs/_protocol-specs/addresses-and-keys/keys-requirements.md similarity index 100% rename from docs/docs/protocol-specs/addresses-and-keys/keys-requirements.md rename to docs/docs/_protocol-specs/addresses-and-keys/keys-requirements.md diff --git a/docs/docs/protocol-specs/addresses-and-keys/keys.md b/docs/docs/_protocol-specs/addresses-and-keys/keys.md similarity index 100% rename from docs/docs/protocol-specs/addresses-and-keys/keys.md rename to docs/docs/_protocol-specs/addresses-and-keys/keys.md diff --git a/docs/docs/protocol-specs/addresses-and-keys/precompiles.md b/docs/docs/_protocol-specs/addresses-and-keys/precompiles.md similarity index 100% rename from docs/docs/protocol-specs/addresses-and-keys/precompiles.md rename to docs/docs/_protocol-specs/addresses-and-keys/precompiles.md diff --git a/docs/docs/protocol-specs/bytecode/index.md b/docs/docs/_protocol-specs/bytecode/index.md similarity index 100% rename from docs/docs/protocol-specs/bytecode/index.md rename to docs/docs/_protocol-specs/bytecode/index.md diff --git a/docs/docs/protocol-specs/calls/batched-calls.md b/docs/docs/_protocol-specs/calls/batched-calls.md similarity index 100% rename from docs/docs/protocol-specs/calls/batched-calls.md rename to docs/docs/_protocol-specs/calls/batched-calls.md diff --git a/docs/docs/protocol-specs/calls/enqueued-calls.md b/docs/docs/_protocol-specs/calls/enqueued-calls.md similarity index 100% rename from docs/docs/protocol-specs/calls/enqueued-calls.md rename to docs/docs/_protocol-specs/calls/enqueued-calls.md diff --git a/docs/docs/protocol-specs/calls/index.md b/docs/docs/_protocol-specs/calls/index.md similarity index 100% rename from docs/docs/protocol-specs/calls/index.md rename to docs/docs/_protocol-specs/calls/index.md diff --git a/docs/docs/protocol-specs/calls/public-private-messaging.md b/docs/docs/_protocol-specs/calls/public-private-messaging.md similarity index 100% rename from docs/docs/protocol-specs/calls/public-private-messaging.md rename to docs/docs/_protocol-specs/calls/public-private-messaging.md diff --git a/docs/docs/protocol-specs/calls/static-calls.md b/docs/docs/_protocol-specs/calls/static-calls.md similarity index 100% rename from docs/docs/protocol-specs/calls/static-calls.md rename to docs/docs/_protocol-specs/calls/static-calls.md diff --git a/docs/docs/protocol-specs/calls/sync-calls.md b/docs/docs/_protocol-specs/calls/sync-calls.md similarity index 100% rename from docs/docs/protocol-specs/calls/sync-calls.md rename to docs/docs/_protocol-specs/calls/sync-calls.md diff --git a/docs/docs/protocol-specs/calls/unconstrained-calls.md b/docs/docs/_protocol-specs/calls/unconstrained-calls.md similarity index 100% rename from docs/docs/protocol-specs/calls/unconstrained-calls.md rename to docs/docs/_protocol-specs/calls/unconstrained-calls.md diff --git a/docs/docs/protocol-specs/circuits/high-level-topology.md b/docs/docs/_protocol-specs/circuits/high-level-topology.md similarity index 100% rename from docs/docs/protocol-specs/circuits/high-level-topology.md rename to docs/docs/_protocol-specs/circuits/high-level-topology.md diff --git a/docs/docs/protocol-specs/circuits/private-function.md b/docs/docs/_protocol-specs/circuits/private-function.md similarity index 100% rename from docs/docs/protocol-specs/circuits/private-function.md rename to docs/docs/_protocol-specs/circuits/private-function.md diff --git a/docs/docs/protocol-specs/circuits/private-kernel-initial.mdx b/docs/docs/_protocol-specs/circuits/private-kernel-initial.mdx similarity index 100% rename from docs/docs/protocol-specs/circuits/private-kernel-initial.mdx rename to docs/docs/_protocol-specs/circuits/private-kernel-initial.mdx diff --git a/docs/docs/protocol-specs/circuits/private-kernel-inner.mdx b/docs/docs/_protocol-specs/circuits/private-kernel-inner.mdx similarity index 100% rename from docs/docs/protocol-specs/circuits/private-kernel-inner.mdx rename to docs/docs/_protocol-specs/circuits/private-kernel-inner.mdx diff --git a/docs/docs/protocol-specs/circuits/private-kernel-reset.md b/docs/docs/_protocol-specs/circuits/private-kernel-reset.md similarity index 100% rename from docs/docs/protocol-specs/circuits/private-kernel-reset.md rename to docs/docs/_protocol-specs/circuits/private-kernel-reset.md diff --git a/docs/docs/protocol-specs/circuits/private-kernel-tail.md b/docs/docs/_protocol-specs/circuits/private-kernel-tail.md similarity index 100% rename from docs/docs/protocol-specs/circuits/private-kernel-tail.md rename to docs/docs/_protocol-specs/circuits/private-kernel-tail.md diff --git a/docs/docs/protocol-specs/circuits/public-kernel-initial.md b/docs/docs/_protocol-specs/circuits/public-kernel-initial.md similarity index 100% rename from docs/docs/protocol-specs/circuits/public-kernel-initial.md rename to docs/docs/_protocol-specs/circuits/public-kernel-initial.md diff --git a/docs/docs/protocol-specs/circuits/public-kernel-inner.md b/docs/docs/_protocol-specs/circuits/public-kernel-inner.md similarity index 100% rename from docs/docs/protocol-specs/circuits/public-kernel-inner.md rename to docs/docs/_protocol-specs/circuits/public-kernel-inner.md diff --git a/docs/docs/protocol-specs/circuits/public-kernel-tail.md b/docs/docs/_protocol-specs/circuits/public-kernel-tail.md similarity index 100% rename from docs/docs/protocol-specs/circuits/public-kernel-tail.md rename to docs/docs/_protocol-specs/circuits/public-kernel-tail.md diff --git a/docs/docs/protocol-specs/constants.md b/docs/docs/_protocol-specs/constants.md similarity index 100% rename from docs/docs/protocol-specs/constants.md rename to docs/docs/_protocol-specs/constants.md diff --git a/docs/docs/protocol-specs/contract-deployment/classes.md b/docs/docs/_protocol-specs/contract-deployment/classes.md similarity index 100% rename from docs/docs/protocol-specs/contract-deployment/classes.md rename to docs/docs/_protocol-specs/contract-deployment/classes.md diff --git a/docs/docs/protocol-specs/contract-deployment/index.md b/docs/docs/_protocol-specs/contract-deployment/index.md similarity index 100% rename from docs/docs/protocol-specs/contract-deployment/index.md rename to docs/docs/_protocol-specs/contract-deployment/index.md diff --git a/docs/docs/protocol-specs/contract-deployment/instances.md b/docs/docs/_protocol-specs/contract-deployment/instances.md similarity index 100% rename from docs/docs/protocol-specs/contract-deployment/instances.md rename to docs/docs/_protocol-specs/contract-deployment/instances.md diff --git a/docs/docs/protocol-specs/cryptography/hashing/hashing.md b/docs/docs/_protocol-specs/cryptography/hashing/hashing.md similarity index 100% rename from docs/docs/protocol-specs/cryptography/hashing/hashing.md rename to docs/docs/_protocol-specs/cryptography/hashing/hashing.md diff --git a/docs/docs/protocol-specs/cryptography/hashing/pedersen.md b/docs/docs/_protocol-specs/cryptography/hashing/pedersen.md similarity index 100% rename from docs/docs/protocol-specs/cryptography/hashing/pedersen.md rename to docs/docs/_protocol-specs/cryptography/hashing/pedersen.md diff --git a/docs/docs/protocol-specs/cryptography/hashing/poseidon2.md b/docs/docs/_protocol-specs/cryptography/hashing/poseidon2.md similarity index 100% rename from docs/docs/protocol-specs/cryptography/hashing/poseidon2.md rename to docs/docs/_protocol-specs/cryptography/hashing/poseidon2.md diff --git a/docs/docs/protocol-specs/cryptography/index.md b/docs/docs/_protocol-specs/cryptography/index.md similarity index 100% rename from docs/docs/protocol-specs/cryptography/index.md rename to docs/docs/_protocol-specs/cryptography/index.md diff --git a/docs/docs/protocol-specs/cryptography/merkle-trees.md b/docs/docs/_protocol-specs/cryptography/merkle-trees.md similarity index 100% rename from docs/docs/protocol-specs/cryptography/merkle-trees.md rename to docs/docs/_protocol-specs/cryptography/merkle-trees.md diff --git a/docs/docs/protocol-specs/cryptography/proving-system/data-bus.md b/docs/docs/_protocol-specs/cryptography/proving-system/data-bus.md similarity index 100% rename from docs/docs/protocol-specs/cryptography/proving-system/data-bus.md rename to docs/docs/_protocol-specs/cryptography/proving-system/data-bus.md diff --git a/docs/docs/protocol-specs/cryptography/proving-system/overview.md b/docs/docs/_protocol-specs/cryptography/proving-system/overview.md similarity index 100% rename from docs/docs/protocol-specs/cryptography/proving-system/overview.md rename to docs/docs/_protocol-specs/cryptography/proving-system/overview.md diff --git a/docs/docs/protocol-specs/cryptography/proving-system/performance-targets.md b/docs/docs/_protocol-specs/cryptography/proving-system/performance-targets.md similarity index 100% rename from docs/docs/protocol-specs/cryptography/proving-system/performance-targets.md rename to docs/docs/_protocol-specs/cryptography/proving-system/performance-targets.md diff --git a/docs/docs/protocol-specs/data-publication-and-availability/index.md b/docs/docs/_protocol-specs/data-publication-and-availability/index.md similarity index 100% rename from docs/docs/protocol-specs/data-publication-and-availability/index.md rename to docs/docs/_protocol-specs/data-publication-and-availability/index.md diff --git a/docs/docs/protocol-specs/data-publication-and-availability/overview.md b/docs/docs/_protocol-specs/data-publication-and-availability/overview.md similarity index 100% rename from docs/docs/protocol-specs/data-publication-and-availability/overview.md rename to docs/docs/_protocol-specs/data-publication-and-availability/overview.md diff --git a/docs/docs/protocol-specs/data-publication-and-availability/published-data.md b/docs/docs/_protocol-specs/data-publication-and-availability/published-data.md similarity index 100% rename from docs/docs/protocol-specs/data-publication-and-availability/published-data.md rename to docs/docs/_protocol-specs/data-publication-and-availability/published-data.md diff --git a/docs/docs/protocol-specs/decentralization/actors.md b/docs/docs/_protocol-specs/decentralization/actors.md similarity index 100% rename from docs/docs/protocol-specs/decentralization/actors.md rename to docs/docs/_protocol-specs/decentralization/actors.md diff --git a/docs/docs/protocol-specs/decentralization/block-production.md b/docs/docs/_protocol-specs/decentralization/block-production.md similarity index 100% rename from docs/docs/protocol-specs/decentralization/block-production.md rename to docs/docs/_protocol-specs/decentralization/block-production.md diff --git a/docs/docs/protocol-specs/decentralization/governance.md b/docs/docs/_protocol-specs/decentralization/governance.md similarity index 100% rename from docs/docs/protocol-specs/decentralization/governance.md rename to docs/docs/_protocol-specs/decentralization/governance.md diff --git a/docs/docs/protocol-specs/decentralization/p2p-network.md b/docs/docs/_protocol-specs/decentralization/p2p-network.md similarity index 100% rename from docs/docs/protocol-specs/decentralization/p2p-network.md rename to docs/docs/_protocol-specs/decentralization/p2p-network.md diff --git a/docs/docs/protocol-specs/gas-and-fees/fee-juice.md b/docs/docs/_protocol-specs/gas-and-fees/fee-juice.md similarity index 100% rename from docs/docs/protocol-specs/gas-and-fees/fee-juice.md rename to docs/docs/_protocol-specs/gas-and-fees/fee-juice.md diff --git a/docs/docs/protocol-specs/gas-and-fees/fee-schedule.md b/docs/docs/_protocol-specs/gas-and-fees/fee-schedule.md similarity index 100% rename from docs/docs/protocol-specs/gas-and-fees/fee-schedule.md rename to docs/docs/_protocol-specs/gas-and-fees/fee-schedule.md diff --git a/docs/docs/protocol-specs/gas-and-fees/index.md b/docs/docs/_protocol-specs/gas-and-fees/index.md similarity index 100% rename from docs/docs/protocol-specs/gas-and-fees/index.md rename to docs/docs/_protocol-specs/gas-and-fees/index.md diff --git a/docs/docs/protocol-specs/gas-and-fees/kernel-tracking.md b/docs/docs/_protocol-specs/gas-and-fees/kernel-tracking.md similarity index 100% rename from docs/docs/protocol-specs/gas-and-fees/kernel-tracking.md rename to docs/docs/_protocol-specs/gas-and-fees/kernel-tracking.md diff --git a/docs/docs/protocol-specs/gas-and-fees/published-gas-and-fee-data.md b/docs/docs/_protocol-specs/gas-and-fees/published-gas-and-fee-data.md similarity index 100% rename from docs/docs/protocol-specs/gas-and-fees/published-gas-and-fee-data.md rename to docs/docs/_protocol-specs/gas-and-fees/published-gas-and-fee-data.md diff --git a/docs/docs/protocol-specs/gas-and-fees/specifying-gas-fee-info.md b/docs/docs/_protocol-specs/gas-and-fees/specifying-gas-fee-info.md similarity index 100% rename from docs/docs/protocol-specs/gas-and-fees/specifying-gas-fee-info.md rename to docs/docs/_protocol-specs/gas-and-fees/specifying-gas-fee-info.md diff --git a/docs/docs/protocol-specs/gas-and-fees/tx-setup-and-teardown.md b/docs/docs/_protocol-specs/gas-and-fees/tx-setup-and-teardown.md similarity index 100% rename from docs/docs/protocol-specs/gas-and-fees/tx-setup-and-teardown.md rename to docs/docs/_protocol-specs/gas-and-fees/tx-setup-and-teardown.md diff --git a/docs/docs/protocol-specs/intro.md b/docs/docs/_protocol-specs/intro.md similarity index 100% rename from docs/docs/protocol-specs/intro.md rename to docs/docs/_protocol-specs/intro.md diff --git a/docs/docs/protocol-specs/l1-smart-contracts/frontier.md b/docs/docs/_protocol-specs/l1-smart-contracts/frontier.md similarity index 100% rename from docs/docs/protocol-specs/l1-smart-contracts/frontier.md rename to docs/docs/_protocol-specs/l1-smart-contracts/frontier.md diff --git a/docs/docs/protocol-specs/l1-smart-contracts/index.md b/docs/docs/_protocol-specs/l1-smart-contracts/index.md similarity index 100% rename from docs/docs/protocol-specs/l1-smart-contracts/index.md rename to docs/docs/_protocol-specs/l1-smart-contracts/index.md diff --git a/docs/docs/protocol-specs/logs/index.md b/docs/docs/_protocol-specs/logs/index.md similarity index 100% rename from docs/docs/protocol-specs/logs/index.md rename to docs/docs/_protocol-specs/logs/index.md diff --git a/docs/docs/protocol-specs/pre-compiled-contracts/index.md b/docs/docs/_protocol-specs/pre-compiled-contracts/index.md similarity index 100% rename from docs/docs/protocol-specs/pre-compiled-contracts/index.md rename to docs/docs/_protocol-specs/pre-compiled-contracts/index.md diff --git a/docs/docs/protocol-specs/pre-compiled-contracts/registry.md b/docs/docs/_protocol-specs/pre-compiled-contracts/registry.md similarity index 100% rename from docs/docs/protocol-specs/pre-compiled-contracts/registry.md rename to docs/docs/_protocol-specs/pre-compiled-contracts/registry.md diff --git a/docs/docs/protocol-specs/private-message-delivery/index.md b/docs/docs/_protocol-specs/private-message-delivery/index.md similarity index 100% rename from docs/docs/protocol-specs/private-message-delivery/index.md rename to docs/docs/_protocol-specs/private-message-delivery/index.md diff --git a/docs/docs/protocol-specs/private-message-delivery/private-msg-delivery.md b/docs/docs/_protocol-specs/private-message-delivery/private-msg-delivery.md similarity index 100% rename from docs/docs/protocol-specs/private-message-delivery/private-msg-delivery.md rename to docs/docs/_protocol-specs/private-message-delivery/private-msg-delivery.md diff --git a/docs/docs/protocol-specs/private-message-delivery/send-note-guidelines.md b/docs/docs/_protocol-specs/private-message-delivery/send-note-guidelines.md similarity index 100% rename from docs/docs/protocol-specs/private-message-delivery/send-note-guidelines.md rename to docs/docs/_protocol-specs/private-message-delivery/send-note-guidelines.md diff --git a/docs/docs/protocol-specs/public-vm/_nested-context.md b/docs/docs/_protocol-specs/public-vm/_nested-context.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/_nested-context.md rename to docs/docs/_protocol-specs/public-vm/_nested-context.md diff --git a/docs/docs/protocol-specs/public-vm/alu.md b/docs/docs/_protocol-specs/public-vm/alu.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/alu.md rename to docs/docs/_protocol-specs/public-vm/alu.md diff --git a/docs/docs/protocol-specs/public-vm/avm-circuit.md b/docs/docs/_protocol-specs/public-vm/avm-circuit.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/avm-circuit.md rename to docs/docs/_protocol-specs/public-vm/avm-circuit.md diff --git a/docs/docs/protocol-specs/public-vm/bytecode-validation-circuit.md b/docs/docs/_protocol-specs/public-vm/bytecode-validation-circuit.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/bytecode-validation-circuit.md rename to docs/docs/_protocol-specs/public-vm/bytecode-validation-circuit.md diff --git a/docs/docs/protocol-specs/public-vm/circuit-index.md b/docs/docs/_protocol-specs/public-vm/circuit-index.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/circuit-index.md rename to docs/docs/_protocol-specs/public-vm/circuit-index.md diff --git a/docs/docs/protocol-specs/public-vm/context.mdx b/docs/docs/_protocol-specs/public-vm/context.mdx similarity index 100% rename from docs/docs/protocol-specs/public-vm/context.mdx rename to docs/docs/_protocol-specs/public-vm/context.mdx diff --git a/docs/docs/protocol-specs/public-vm/control-flow.md b/docs/docs/_protocol-specs/public-vm/control-flow.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/control-flow.md rename to docs/docs/_protocol-specs/public-vm/control-flow.md diff --git a/docs/docs/protocol-specs/public-vm/execution.md b/docs/docs/_protocol-specs/public-vm/execution.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/execution.md rename to docs/docs/_protocol-specs/public-vm/execution.md diff --git a/docs/docs/_protocol-specs/public-vm/gen/_instruction-set.mdx b/docs/docs/_protocol-specs/public-vm/gen/_instruction-set.mdx new file mode 100644 index 00000000000..b7de3caf134 --- /dev/null +++ b/docs/docs/_protocol-specs/public-vm/gen/_instruction-set.mdx @@ -0,0 +1,1603 @@ +[comment]: # (THIS IS A GENERATED FILE! DO NOT EDIT!) +[comment]: # (Generated via `yarn preprocess`) + +[comment]: # (Generated by genMarkdown.js, InstructionSet.js, InstructionSize.js) + +import Markdown from 'react-markdown' +import CodeBlock from '@theme/CodeBlock' + + +## Instructions Table + +Click on an instruction name to jump to its section. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OpcodeNameSummaryExpression
0x00\[\`ADD\`\](#isa-section-add)Addition (a + b){ + `M[dstOffset] = M[aOffset] + M[bOffset] mod 2^k` + }
0x01\[\`SUB\`\](#isa-section-sub)Subtraction (a - b){ + `M[dstOffset] = M[aOffset] - M[bOffset] mod 2^k` + }
0x02\[\`MUL\`\](#isa-section-mul)Multiplication (a * b){ + `M[dstOffset] = M[aOffset] * M[bOffset] mod 2^k` + }
0x03\[\`DIV\`\](#isa-section-div)Unsigned integer division (a / b){ + `M[dstOffset] = M[aOffset] / M[bOffset]` + }
0x04\[\`FDIV\`\](#isa-section-fdiv)Field division (a / b){ + `M[dstOffset] = M[aOffset] / M[bOffset]` + }
0x05\[\`EQ\`\](#isa-section-eq)Equality check (a == b){ + `M[dstOffset] = M[aOffset] == M[bOffset] ? 1 : 0` + }
0x06\[\`LT\`\](#isa-section-lt)Less-than check (a < b){ + `M[dstOffset] = M[aOffset] < M[bOffset] ? 1 : 0` + }
0x07\[\`LTE\`\](#isa-section-lte)Less-than-or-equals check (a <= b){ + `M[dstOffset] = M[aOffset] <= M[bOffset] ? 1 : 0` + }
0x08\[\`AND\`\](#isa-section-and)Bitwise AND (a & b){ + `M[dstOffset] = M[aOffset] AND M[bOffset]` + }
0x09\[\`OR\`\](#isa-section-or)Bitwise OR (a | b){ + `M[dstOffset] = M[aOffset] OR M[bOffset]` + }
0x0a\[\`XOR\`\](#isa-section-xor)Bitwise XOR (a ^ b){ + `M[dstOffset] = M[aOffset] XOR M[bOffset]` + }
0x0b\[\`NOT\`\](#isa-section-not)Bitwise NOT (inversion){ + `M[dstOffset] = NOT M[aOffset]` + }
0x0c\[\`SHL\`\](#isa-section-shl)Bitwise leftward shift (a << b){ + `M[dstOffset] = M[aOffset] << M[bOffset]` + }
0x0d\[\`SHR\`\](#isa-section-shr)Bitwise rightward shift (a >> b){ + `M[dstOffset] = M[aOffset] >> M[bOffset]` + }
0x0e\[\`CAST\`\](#isa-section-cast)Type cast{ + `M[dstOffset] = cast(M[aOffset])` + }
0x0f\[\`ADDRESS\`\](#isa-section-address)Get the address of the currently executing l2 contract{ + `M[dstOffset] = context.environment.address` + }
0x10\[\`SENDER\`\](#isa-section-sender)Get the address of the sender (caller of the current context){ + `M[dstOffset] = context.environment.sender` + }
0x11\[\`TRANSACTIONFEE\`\](#isa-section-transactionfee)Get the computed transaction fee during teardown phase, zero otherwise{ + `M[dstOffset] = context.environment.transactionFee` + }
0x12\[\`CHAINID\`\](#isa-section-chainid)Get this rollup's L1 chain ID{ + `M[dstOffset] = context.environment.globals.chainId` + }
0x13\[\`VERSION\`\](#isa-section-version)Get this rollup's L2 version ID{ + `M[dstOffset] = context.environment.globals.version` + }
0x14\[\`BLOCKNUMBER\`\](#isa-section-blocknumber)Get this L2 block's number{ + `M[dstOffset] = context.environment.globals.blocknumber` + }
0x15\[\`TIMESTAMP\`\](#isa-section-timestamp)Get this L2 block's timestamp{ + `M[dstOffset] = context.environment.globals.timestamp` + }
0x16\[\`FEEPERL2GAS\`\](#isa-section-feeperl2gas)Get the fee to be paid per "L2 gas" - constant for entire transaction{ + `M[dstOffset] = context.environment.globals.feePerL2Gas` + }
0x17\[\`FEEPERDAGAS\`\](#isa-section-feeperdagas)Get the fee to be paid per "DA gas" - constant for entire transaction{ + `M[dstOffset] = context.environment.globals.feePerDaGas` + }
0x18\[\`CALLDATACOPY\`\](#isa-section-calldatacopy)Copy calldata into memory{ + `M[dstOffset:dstOffset+copySize] = context.environment.calldata[cdOffset:cdOffset+copySize]` + }
0x19\[\`L2GASLEFT\`\](#isa-section-l2gasleft)Remaining "L2 gas" for this call (after this instruction){ + `M[dstOffset] = context.MachineState.l2GasLeft` + }
0x1a\[\`DAGASLEFT\`\](#isa-section-dagasleft)Remaining "DA gas" for this call (after this instruction){ + `M[dstOffset] = context.machineState.daGasLeft` + }
0x1b\[\`JUMP\`\](#isa-section-jump)Jump to a location in the bytecode{ + `context.machineState.pc = loc` + }
0x1c\[\`JUMPI\`\](#isa-section-jumpi)Conditionally jump to a location in the bytecode{ + `context.machineState.pc = M[condOffset] > 0 ? loc : context.machineState.pc` + }
0x1d\[\`INTERNALCALL\`\](#isa-section-internalcall)Make an internal call. Push the current PC to the internal call stack and jump to the target location. +{`context.machineState.internalCallStack.push(context.machineState.pc) +context.machineState.pc = loc`} +
0x1e\[\`INTERNALRETURN\`\](#isa-section-internalreturn)Return from an internal call. Pop from the internal call stack and jump to the popped location.{ + `context.machineState.pc = context.machineState.internalCallStack.pop()` + }
0x1f\[\`SET\`\](#isa-section-set)Set a memory word from a constant in the bytecode{ + `M[dstOffset] = const` + }
0x20\[\`MOV\`\](#isa-section-mov)Move a word from source memory location to destination{ + `M[dstOffset] = M[srcOffset]` + }
0x21\[\`CMOV\`\](#isa-section-cmov)Move a word (conditionally chosen) from one memory location to another (`d = cond > 0 ? a : b`){ + `M[dstOffset] = M[condOffset] > 0 ? M[aOffset] : M[bOffset]` + }
0x22\[\`SLOAD\`\](#isa-section-sload)Load a word from this contract's persistent public storage. Zero is loaded for unwritten slots. +{`M[dstOffset] = S[M[slotOffset]]`} +
0x23\[\`SSTORE\`\](#isa-section-sstore)Write a word to this contract's persistent public storage +{`S[M[slotOffset]] = M[srcOffset]`} +
0x24\[\`NOTEHASHEXISTS\`\](#isa-section-notehashexists)Check whether a note hash exists in the note hash tree (as of the start of the current block) +{`exists = context.worldState.noteHashes.has({ + leafIndex: M[leafIndexOffset] + leaf: hash(context.environment.address, M[noteHashOffset]), +}) +M[existsOffset] = exists`} +
0x25\[\`EMITNOTEHASH\`\](#isa-section-emitnotehash)Emit a new note hash to be inserted into the note hash tree +{`context.worldState.noteHashes.append( + hash(context.environment.address, M[noteHashOffset]) +)`} +
0x26\[\`NULLIFIEREXISTS\`\](#isa-section-nullifierexists)Check whether a nullifier exists in the nullifier tree (including nullifiers from earlier in the current transaction or from earlier in the current block) +{`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( + hash(M[addressOffset], M[nullifierOffset]) +) +M[existsOffset] = exists`} +
0x27\[\`EMITNULLIFIER\`\](#isa-section-emitnullifier)Emit a new nullifier to be inserted into the nullifier tree +{`context.worldState.nullifiers.append( + hash(context.environment.address, M[nullifierOffset]) +)`} +
0x28\[\`L1TOL2MSGEXISTS\`\](#isa-section-l1tol2msgexists)Check if a message exists in the L1-to-L2 message tree +{`exists = context.worldState.l1ToL2Messages.has({ + leafIndex: M[msgLeafIndexOffset], leaf: M[msgHashOffset] +}) +M[existsOffset] = exists`} +
0x29\[\`GETCONTRACTINSTANCE\`\](#isa-section-getcontractinstance)Copies contract instance data to memory +{`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ + instance_found_in_address, + instance.salt ?? 0, + instance.deployer ?? 0, + instance.contractClassId ?? 0, + instance.initializationHash ?? 0, + instance.portalContractAddress ?? 0, + instance.publicKeysHash ?? 0, +]`} +
0x2a\[\`EMITUNENCRYPTEDLOG\`\](#isa-section-emitunencryptedlog)Emit an unencrypted log +{`context.accruedSubstate.unencryptedLogs.append( + UnencryptedLog { + address: context.environment.address, + log: M[logOffset:logOffset+M[logSizeOffset]], + } +)`} +
0x2b\[\`SENDL2TOL1MSG\`\](#isa-section-sendl2tol1msg)Send an L2-to-L1 message +{`context.accruedSubstate.sentL2ToL1Messages.append( + SentL2ToL1Message { + address: context.environment.address, + recipient: M[recipientOffset], + message: M[contentOffset] + } +)`} +
0x2c\[\`CALL\`\](#isa-section-call)Call into another contract +{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } +chargeGas(context, + l2GasCost=M[instr.args.gasOffset], + daGasCost=M[instr.args.gasOffset+1]) +traceNestedCall(context, instr.args.addrOffset) +nestedContext = deriveContext(context, instr.args, isStaticCall=false) +execute(nestedContext) +updateContextAfterNestedCall(context, instr.args, nestedContext)`} +
0x2d\[\`STATICCALL\`\](#isa-section-staticcall)Call into another contract, disallowing World State and Accrued Substate modifications +{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } +chargeGas(context, + l2GasCost=M[instr.args.gasOffset], + daGasCost=M[instr.args.gasOffset+1]) +traceNestedCall(context, instr.args.addrOffset) +nestedContext = deriveContext(context, instr.args, isStaticCall=true +execute(nestedContext) +updateContextAfterNestedCall(context, instr.args, nestedContext)`} +
0x2e\[\`RETURN\`\](#isa-section-return)Halt execution within this context (without revert), optionally returning some data +{`context.contractCallResults.output = M[retOffset:retOffset+retSize] +halt`} +
0x2f\[\`REVERT\`\](#isa-section-revert)Halt execution within this context as `reverted`, optionally returning some data +{`context.contractCallResults.output = M[retOffset:retOffset+retSize] +context.contractCallResults.reverted = true +halt`} +
0x30\[\`TORADIXLE\`\](#isa-section-to_radix_le)Convert a word to an array of limbs in little-endian radix formTBD: Storage of limbs and if T[dstOffset] is constrained to U8
+ + +## Instructions + +### `ADD` +Addition (a + b) + +[See in table.](#isa-table-add) + +- **Opcode**: 0x00 +- **Category**: Compute - Arithmetic +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] + M[bOffset] mod 2^k` +- **Details**: Wraps on overflow +- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` +- **Tag updates**: `T[dstOffset] = inTag` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/ADD.png)](/img/protocol-specs/public-vm/bit-formats/ADD.png) + +### `SUB` +Subtraction (a - b) + +[See in table.](#isa-table-sub) + +- **Opcode**: 0x01 +- **Category**: Compute - Arithmetic +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] - M[bOffset] mod 2^k` +- **Details**: Wraps on undeflow +- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` +- **Tag updates**: `T[dstOffset] = inTag` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/SUB.png)](/img/protocol-specs/public-vm/bit-formats/SUB.png) + +### `MUL` +Multiplication (a * b) + +[See in table.](#isa-table-mul) + +- **Opcode**: 0x02 +- **Category**: Compute - Arithmetic +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] * M[bOffset] mod 2^k` +- **Details**: Wraps on overflow +- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` +- **Tag updates**: `T[dstOffset] = inTag` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/MUL.png)](/img/protocol-specs/public-vm/bit-formats/MUL.png) + +### `DIV` +Unsigned integer division (a / b) + +[See in table.](#isa-table-div) + +- **Opcode**: 0x03 +- **Category**: Compute - Arithmetic +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] / M[bOffset]` +- **Details**: If the input is a field, it will be interpreted as an integer +- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` +- **Tag updates**: `T[dstOffset] = inTag` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/DIV.png)](/img/protocol-specs/public-vm/bit-formats/DIV.png) + +### `FDIV` +Field division (a / b) + +[See in table.](#isa-table-fdiv) + +- **Opcode**: 0x04 +- **Category**: Compute - Arithmetic +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] / M[bOffset]` +- **Tag checks**: `T[aOffset] == T[bOffset] == field` +- **Tag updates**: `T[dstOffset] = field` +- **Bit-size**: 120 + + +### `EQ` +Equality check (a \=\= b) + +[See in table.](#isa-table-eq) + +- **Opcode**: 0x05 +- **Category**: Compute - Comparators +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] == M[bOffset] ? 1 : 0` +- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` +- **Tag updates**: `T[dstOffset] = u8` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/EQ.png)](/img/protocol-specs/public-vm/bit-formats/EQ.png) + +### `LT` +Less-than check (a \< b) + +[See in table.](#isa-table-lt) + +- **Opcode**: 0x06 +- **Category**: Compute - Comparators +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] < M[bOffset] ? 1 : 0` +- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` +- **Tag updates**: `T[dstOffset] = u8` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/LT.png)](/img/protocol-specs/public-vm/bit-formats/LT.png) + +### `LTE` +Less-than-or-equals check (a \<\= b) + +[See in table.](#isa-table-lte) + +- **Opcode**: 0x07 +- **Category**: Compute - Comparators +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] <= M[bOffset] ? 1 : 0` +- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` +- **Tag updates**: `T[dstOffset] = u8` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/LTE.png)](/img/protocol-specs/public-vm/bit-formats/LTE.png) + +### `AND` +Bitwise AND (a & b) + +[See in table.](#isa-table-and) + +- **Opcode**: 0x08 +- **Category**: Compute - Bitwise +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] AND M[bOffset]` +- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` +- **Tag updates**: `T[dstOffset] = inTag` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/AND.png)](/img/protocol-specs/public-vm/bit-formats/AND.png) + +### `OR` +Bitwise OR (a | b) + +[See in table.](#isa-table-or) + +- **Opcode**: 0x09 +- **Category**: Compute - Bitwise +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] OR M[bOffset]` +- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` +- **Tag updates**: `T[dstOffset] = inTag` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/OR.png)](/img/protocol-specs/public-vm/bit-formats/OR.png) + +### `XOR` +Bitwise XOR (a ^ b) + +[See in table.](#isa-table-xor) + +- **Opcode**: 0x0a +- **Category**: Compute - Bitwise +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] XOR M[bOffset]` +- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` +- **Tag updates**: `T[dstOffset] = inTag` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/XOR.png)](/img/protocol-specs/public-vm/bit-formats/XOR.png) + +### `NOT` +Bitwise NOT (inversion) + +[See in table.](#isa-table-not) + +- **Opcode**: 0x0b +- **Category**: Compute - Bitwise +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = NOT M[aOffset]` +- **Tag checks**: `T[aOffset] == inTag` +- **Tag updates**: `T[dstOffset] = inTag` +- **Bit-size**: 96 + +[![](/img/protocol-specs/public-vm/bit-formats/NOT.png)](/img/protocol-specs/public-vm/bit-formats/NOT.png) + +### `SHL` +Bitwise leftward shift (a \<\< b) + +[See in table.](#isa-table-shl) + +- **Opcode**: 0x0c +- **Category**: Compute - Bitwise +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] << M[bOffset]` +- **Tag checks**: `T[aOffset] == inTag`, `T[bOffset] == u8` +- **Tag updates**: `T[dstOffset] = inTag` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/SHL.png)](/img/protocol-specs/public-vm/bit-formats/SHL.png) + +### `SHR` +Bitwise rightward shift (a \>\> b) + +[See in table.](#isa-table-shr) + +- **Opcode**: 0x0d +- **Category**: Compute - Bitwise +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[aOffset] >> M[bOffset]` +- **Tag checks**: `T[aOffset] == inTag`, `T[bOffset] == u8` +- **Tag updates**: `T[dstOffset] = inTag` +- **Bit-size**: 128 + +[![](/img/protocol-specs/public-vm/bit-formats/SHR.png)](/img/protocol-specs/public-vm/bit-formats/SHR.png) + +### `CAST` +Type cast + +[See in table.](#isa-table-cast) + +- **Opcode**: 0x0e +- **Category**: Type Conversions +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **dstTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to tag the destination with but not to check inputs against. +- **Args**: + - **aOffset**: memory offset of word to cast + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = cast(M[aOffset])` +- **Details**: Cast a word in memory based on the `dstTag` specified in the bytecode. Truncates (`M[dstOffset] = M[aOffset] mod 2^dstsize`) when casting to a smaller type, left-zero-pads when casting to a larger type. See [here](./memory-model#cast-and-tag-conversions) for more details. +- **Tag updates**: `T[dstOffset] = dstTag` +- **Bit-size**: 96 + +[![](/img/protocol-specs/public-vm/bit-formats/CAST.png)](/img/protocol-specs/public-vm/bit-formats/CAST.png) + +### `ADDRESS` +Get the address of the currently executing l2 contract + +[See in table.](#isa-table-address) + +- **Opcode**: 0x0f +- **Category**: Execution Environment +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = context.environment.address` +- **Tag updates**: `T[dstOffset] = field` +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/ADDRESS.png)](/img/protocol-specs/public-vm/bit-formats/ADDRESS.png) + +### `SENDER` +Get the address of the sender (caller of the current context) + +[See in table.](#isa-table-sender) + +- **Opcode**: 0x10 +- **Category**: Execution Environment +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = context.environment.sender` +- **Tag updates**: `T[dstOffset] = field` +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/SENDER.png)](/img/protocol-specs/public-vm/bit-formats/SENDER.png) + +### `TRANSACTIONFEE` +Get the computed transaction fee during teardown phase, zero otherwise + +[See in table.](#isa-table-transactionfee) + +- **Opcode**: 0x11 +- **Category**: Execution Environment +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = context.environment.transactionFee` +- **Tag updates**: `T[dstOffset] = field` +- **Bit-size**: 56 + + +### `CHAINID` +Get this rollup's L1 chain ID + +[See in table.](#isa-table-chainid) + +- **Opcode**: 0x12 +- **Category**: Execution Environment - Globals +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = context.environment.globals.chainId` +- **Tag updates**: `T[dstOffset] = field` +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/CHAINID.png)](/img/protocol-specs/public-vm/bit-formats/CHAINID.png) + +### `VERSION` +Get this rollup's L2 version ID + +[See in table.](#isa-table-version) + +- **Opcode**: 0x13 +- **Category**: Execution Environment - Globals +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = context.environment.globals.version` +- **Tag updates**: `T[dstOffset] = field` +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/VERSION.png)](/img/protocol-specs/public-vm/bit-formats/VERSION.png) + +### `BLOCKNUMBER` +Get this L2 block's number + +[See in table.](#isa-table-blocknumber) + +- **Opcode**: 0x14 +- **Category**: Execution Environment - Globals +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = context.environment.globals.blocknumber` +- **Tag updates**: `T[dstOffset] = field` +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/BLOCKNUMBER.png)](/img/protocol-specs/public-vm/bit-formats/BLOCKNUMBER.png) + +### `TIMESTAMP` +Get this L2 block's timestamp + +[See in table.](#isa-table-timestamp) + +- **Opcode**: 0x15 +- **Category**: Execution Environment - Globals +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = context.environment.globals.timestamp` +- **Tag updates**: `T[dstOffset] = u64` +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/TIMESTAMP.png)](/img/protocol-specs/public-vm/bit-formats/TIMESTAMP.png) + +### `FEEPERL2GAS` +Get the fee to be paid per "L2 gas" - constant for entire transaction + +[See in table.](#isa-table-feeperl2gas) + +- **Opcode**: 0x16 +- **Category**: Execution Environment - Globals - Gas +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = context.environment.globals.feePerL2Gas` +- **Tag updates**: `T[dstOffset] = field` +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/FEEPERL2GAS.png)](/img/protocol-specs/public-vm/bit-formats/FEEPERL2GAS.png) + +### `FEEPERDAGAS` +Get the fee to be paid per "DA gas" - constant for entire transaction + +[See in table.](#isa-table-feeperdagas) + +- **Opcode**: 0x17 +- **Category**: Execution Environment - Globals - Gas +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = context.environment.globals.feePerDaGas` +- **Tag updates**: `T[dstOffset] = field` +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/FEEPERDAGAS.png)](/img/protocol-specs/public-vm/bit-formats/FEEPERDAGAS.png) + +### `CALLDATACOPY` +Copy calldata into memory + +[See in table.](#isa-table-calldatacopy) + +- **Opcode**: 0x18 +- **Category**: Execution Environment - Calldata +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **cdOffset**: offset into calldata to copy from + - **copySize**: number of words to copy + - **dstOffset**: memory offset specifying where to copy the first word to +- **Expression**: `M[dstOffset:dstOffset+copySize] = context.environment.calldata[cdOffset:cdOffset+copySize]` +- **Details**: Calldata is read-only and cannot be directly operated on by other instructions. This instruction moves words from calldata into memory so they can be operated on normally. +- **Tag updates**: `T[dstOffset:dstOffset+copySize] = field` +- **Bit-size**: 120 + +[![](/img/protocol-specs/public-vm/bit-formats/CALLDATACOPY.png)](/img/protocol-specs/public-vm/bit-formats/CALLDATACOPY.png) + +### `L2GASLEFT` +Remaining "L2 gas" for this call (after this instruction) + +[See in table.](#isa-table-l2gasleft) + +- **Opcode**: 0x19 +- **Category**: Machine State - Gas +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = context.MachineState.l2GasLeft` +- **Tag updates**: `T[dstOffset] = u32` +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/L2GASLEFT.png)](/img/protocol-specs/public-vm/bit-formats/L2GASLEFT.png) + +### `DAGASLEFT` +Remaining "DA gas" for this call (after this instruction) + +[See in table.](#isa-table-dagasleft) + +- **Opcode**: 0x1a +- **Category**: Machine State - Gas +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = context.machineState.daGasLeft` +- **Tag updates**: `T[dstOffset] = u32` +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/DAGASLEFT.png)](/img/protocol-specs/public-vm/bit-formats/DAGASLEFT.png) + +### `JUMP` +Jump to a location in the bytecode + +[See in table.](#isa-table-jump) + +- **Opcode**: 0x1b +- **Category**: Machine State - Control Flow +- **Args**: + - **loc**: target location to jump to +- **Expression**: `context.machineState.pc = loc` +- **Details**: Target location is an immediate value (a constant in the bytecode). +- **Bit-size**: 48 + +[![](/img/protocol-specs/public-vm/bit-formats/JUMP.png)](/img/protocol-specs/public-vm/bit-formats/JUMP.png) + +### `JUMPI` +Conditionally jump to a location in the bytecode + +[See in table.](#isa-table-jumpi) + +- **Opcode**: 0x1c +- **Category**: Machine State - Control Flow +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **loc**: target location conditionally jump to + - **condOffset**: memory offset of the operations 'conditional' input +- **Expression**: `context.machineState.pc = M[condOffset] > 0 ? loc : context.machineState.pc` +- **Details**: Target location is an immediate value (a constant in the bytecode). `T[condOffset]` is not checked because the greater-than-zero suboperation is the same regardless of type. +- **Bit-size**: 88 + +[![](/img/protocol-specs/public-vm/bit-formats/JUMPI.png)](/img/protocol-specs/public-vm/bit-formats/JUMPI.png) + +### `INTERNALCALL` +Make an internal call. Push the current PC to the internal call stack and jump to the target location. + +[See in table.](#isa-table-internalcall) + +- **Opcode**: 0x1d +- **Category**: Machine State - Control Flow +- **Args**: + - **loc**: target location to jump/call to +- **Expression**: + +{`context.machineState.internalCallStack.push(context.machineState.pc) +context.machineState.pc = loc`} + +- **Details**: Target location is an immediate value (a constant in the bytecode). +- **Bit-size**: 48 + + +### `INTERNALRETURN` +Return from an internal call. Pop from the internal call stack and jump to the popped location. + +[See in table.](#isa-table-internalreturn) + +- **Opcode**: 0x1e +- **Category**: Machine State - Control Flow +- **Expression**: `context.machineState.pc = context.machineState.internalCallStack.pop()` +- **Bit-size**: 16 + +[![](/img/protocol-specs/public-vm/bit-formats/INTERNALRETURN.png)](/img/protocol-specs/public-vm/bit-formats/INTERNALRETURN.png) + +### `SET` +Set a memory word from a constant in the bytecode + +[See in table.](#isa-table-set) + +- **Opcode**: 0x1f +- **Category**: Machine State - Memory +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [type/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for SET. +- **Args**: + - **const**: an N-bit constant value from the bytecode to store in memory (any type except `field`) + - **dstOffset**: memory offset specifying where to store the constant +- **Expression**: `M[dstOffset] = const` +- **Details**: Set memory word at `dstOffset` to `const`'s immediate value. `const`'s bit-size (N) can be 8, 16, 32, 64, or 128 based on `inTag`. It _cannot be 254 (`field` type)_! +- **Tag updates**: `T[dstOffset] = inTag` +- **Bit-size**: 64+N + +[![](/img/protocol-specs/public-vm/bit-formats/SET.png)](/img/protocol-specs/public-vm/bit-formats/SET.png) + +### `MOV` +Move a word from source memory location to destination + +[See in table.](#isa-table-mov) + +- **Opcode**: 0x20 +- **Category**: Machine State - Memory +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **srcOffset**: memory offset of word to move + - **dstOffset**: memory offset specifying where to store that word +- **Expression**: `M[dstOffset] = M[srcOffset]` +- **Tag updates**: `T[dstOffset] = T[srcOffset]` +- **Bit-size**: 88 + +[![](/img/protocol-specs/public-vm/bit-formats/MOV.png)](/img/protocol-specs/public-vm/bit-formats/MOV.png) + +### `CMOV` +Move a word (conditionally chosen) from one memory location to another (`d \= cond \> 0 ? a : b`) + +[See in table.](#isa-table-cmov) + +- **Opcode**: 0x21 +- **Category**: Machine State - Memory +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **aOffset**: memory offset of word 'a' to conditionally move + - **bOffset**: memory offset of word 'b' to conditionally move + - **condOffset**: memory offset of the operations 'conditional' input + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: `M[dstOffset] = M[condOffset] > 0 ? M[aOffset] : M[bOffset]` +- **Details**: One of two source memory locations is chosen based on the condition. `T[condOffset]` is not checked because the greater-than-zero suboperation is the same regardless of type. +- **Tag updates**: `T[dstOffset] = M[condOffset] > 0 ? T[aOffset] : T[bOffset]` +- **Bit-size**: 152 + +[![](/img/protocol-specs/public-vm/bit-formats/CMOV.png)](/img/protocol-specs/public-vm/bit-formats/CMOV.png) + +### `SLOAD` +Load a word from this contract's persistent public storage. Zero is loaded for unwritten slots. + +[See in table.](#isa-table-sload) + +- **Opcode**: 0x22 +- **Category**: World State - Public Storage +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **slotOffset**: memory offset of the storage slot to load from + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: + +{`M[dstOffset] = S[M[slotOffset]]`} + +- **Details**: + +{`// Expression is shorthand for +leafIndex = hash(context.environment.address, M[slotOffset]) +exists = context.worldState.publicStorage.has(leafIndex) // exists == previously-written +if exists: + value = context.worldState.publicStorage.get(leafIndex: leafIndex) +else: + value = 0 +M[dstOffset] = value`} + +- **World State access tracing**: + +{`context.worldStateAccessTrace.publicStorageReads.append( + TracedStorageRead { + callPointer: context.environment.callPointer, + slot: M[slotOffset], + exists: exists, // defined above + value: value, // defined above + counter: ++context.worldStateAccessTrace.accessCounter, + } +)`} + +- **Triggers downstream circuit operations**: Storage slot siloing (hash with contract address), public data tree membership check +- **Tag updates**: `T[dstOffset] = field` +- **Bit-size**: 88 + +[![](/img/protocol-specs/public-vm/bit-formats/SLOAD.png)](/img/protocol-specs/public-vm/bit-formats/SLOAD.png) + +### `SSTORE` +Write a word to this contract's persistent public storage + +[See in table.](#isa-table-sstore) + +- **Opcode**: 0x23 +- **Category**: World State - Public Storage +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **srcOffset**: memory offset of the word to store + - **slotOffset**: memory offset containing the storage slot to store to +- **Expression**: + +{`S[M[slotOffset]] = M[srcOffset]`} + +- **Details**: + +{`// Expression is shorthand for +context.worldState.publicStorage.set({ + leafIndex: hash(context.environment.address, M[slotOffset]), + leaf: M[srcOffset], +})`} + +- **World State access tracing**: + +{`context.worldStateAccessTrace.publicStorageWrites.append( + TracedStorageWrite { + callPointer: context.environment.callPointer, + slot: M[slotOffset], + value: M[srcOffset], + counter: ++context.worldStateAccessTrace.accessCounter, + } +)`} + +- **Triggers downstream circuit operations**: Storage slot siloing (hash with contract address), public data tree update +- **Bit-size**: 88 + +[![](/img/protocol-specs/public-vm/bit-formats/SSTORE.png)](/img/protocol-specs/public-vm/bit-formats/SSTORE.png) + +### `NOTEHASHEXISTS` +Check whether a note hash exists in the note hash tree (as of the start of the current block) + +[See in table.](#isa-table-notehashexists) + +- **Opcode**: 0x24 +- **Category**: World State - Notes & Nullifiers +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **noteHashOffset**: memory offset of the note hash + - **leafIndexOffset**: memory offset of the leaf index + - **existsOffset**: memory offset specifying where to store operation's result (whether the note hash leaf exists) +- **Expression**: + +{`exists = context.worldState.noteHashes.has({ + leafIndex: M[leafIndexOffset] + leaf: hash(context.environment.address, M[noteHashOffset]), +}) +M[existsOffset] = exists`} + +- **World State access tracing**: + +{`context.worldStateAccessTrace.noteHashChecks.append( + TracedNoteHashCheck { + callPointer: context.environment.callPointer, + leafIndex: M[leafIndexOffset] + noteHash: M[noteHashOffset], + exists: exists, // defined above + counter: ++context.worldStateAccessTrace.accessCounter, + } +)`} + +- **Triggers downstream circuit operations**: Note hash siloing (hash with storage contract address), note hash tree membership check +- **Tag updates**: `T[existsOffset] = u8` +- **Bit-size**: 120 + + +### `EMITNOTEHASH` +Emit a new note hash to be inserted into the note hash tree + +[See in table.](#isa-table-emitnotehash) + +- **Opcode**: 0x25 +- **Category**: World State - Notes & Nullifiers +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **noteHashOffset**: memory offset of the note hash +- **Expression**: + +{`context.worldState.noteHashes.append( + hash(context.environment.address, M[noteHashOffset]) +)`} + +- **World State access tracing**: + +{`context.worldStateAccessTrace.noteHashes.append( + TracedNoteHash { + callPointer: context.environment.callPointer, + noteHash: M[noteHashOffset], // unsiloed note hash + counter: ++context.worldStateAccessTrace.accessCounter, + } +)`} + +- **Triggers downstream circuit operations**: Note hash siloing (hash with contract address), note hash tree insertion. +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/EMITNOTEHASH.png)](/img/protocol-specs/public-vm/bit-formats/EMITNOTEHASH.png) + +### `NULLIFIEREXISTS` +Check whether a nullifier exists in the nullifier tree (including nullifiers from earlier in the current transaction or from earlier in the current block) + +[See in table.](#isa-table-nullifierexists) + +- **Opcode**: 0x26 +- **Category**: World State - Notes & Nullifiers +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **nullifierOffset**: memory offset of the unsiloed nullifier + - **addressOffset**: memory offset of the storage address + - **existsOffset**: memory offset specifying where to store operation's result (whether the nullifier exists) +- **Expression**: + +{`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( + hash(M[addressOffset], M[nullifierOffset]) +) +M[existsOffset] = exists`} + +- **World State access tracing**: + +{`context.worldStateAccessTrace.nullifierChecks.append( + TracedNullifierCheck { + callPointer: context.environment.callPointer, + nullifier: M[nullifierOffset], + address: M[addressOffset], + exists: exists, // defined above + counter: ++context.worldStateAccessTrace.accessCounter, + } +)`} + +- **Triggers downstream circuit operations**: Nullifier siloing (hash with storage contract address), nullifier tree membership check +- **Tag updates**: `T[existsOffset] = u8` +- **Bit-size**: 120 + + +### `EMITNULLIFIER` +Emit a new nullifier to be inserted into the nullifier tree + +[See in table.](#isa-table-emitnullifier) + +- **Opcode**: 0x27 +- **Category**: World State - Notes & Nullifiers +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **nullifierOffset**: memory offset of nullifier +- **Expression**: + +{`context.worldState.nullifiers.append( + hash(context.environment.address, M[nullifierOffset]) +)`} + +- **World State access tracing**: + +{`context.worldStateAccessTrace.nullifiers.append( + TracedNullifier { + callPointer: context.environment.callPointer, + nullifier: M[nullifierOffset], // unsiloed nullifier + counter: ++context.worldStateAccessTrace.accessCounter, + } +)`} + +- **Triggers downstream circuit operations**: Nullifier siloing (hash with contract address), nullifier tree non-membership-check and insertion. +- **Bit-size**: 56 + +[![](/img/protocol-specs/public-vm/bit-formats/EMITNULLIFIER.png)](/img/protocol-specs/public-vm/bit-formats/EMITNULLIFIER.png) + +### `L1TOL2MSGEXISTS` +Check if a message exists in the L1-to-L2 message tree + +[See in table.](#isa-table-l1tol2msgexists) + +- **Opcode**: 0x28 +- **Category**: World State - Messaging +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **msgHashOffset**: memory offset of the message hash + - **msgLeafIndexOffset**: memory offset of the message's leaf index in the L1-to-L2 message tree + - **existsOffset**: memory offset specifying where to store operation's result (whether the message exists in the L1-to-L2 message tree) +- **Expression**: + +{`exists = context.worldState.l1ToL2Messages.has({ + leafIndex: M[msgLeafIndexOffset], leaf: M[msgHashOffset] +}) +M[existsOffset] = exists`} + +- **World State access tracing**: + +{`context.worldStateAccessTrace.l1ToL2MessagesChecks.append( + L1ToL2Message { + callPointer: context.environment.callPointer, + leafIndex: M[msgLeafIndexOffset], + msgHash: M[msgHashOffset], + exists: exists, // defined above + } +)`} + +- **Triggers downstream circuit operations**: L1-to-L2 message tree membership check +- **Tag updates**: + +{`T[existsOffset] = u8,`} + +- **Bit-size**: 120 + + +### `GETCONTRACTINSTANCE` +Copies contract instance data to memory + +[See in table.](#isa-table-getcontractinstance) + +- **Opcode**: 0x29 +- **Category**: Other +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **addressOffset**: memory offset of the contract instance address + - **dstOffset**: location to write the contract instance information to +- **Expression**: + +{`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ + instance_found_in_address, + instance.salt ?? 0, + instance.deployer ?? 0, + instance.contractClassId ?? 0, + instance.initializationHash ?? 0, + instance.portalContractAddress ?? 0, + instance.publicKeysHash ?? 0, +]`} + +- **Additional AVM circuit checks**: TO-DO +- **Triggers downstream circuit operations**: TO-DO +- **Tag updates**: T[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = field +- **Bit-size**: 88 + + +### `EMITUNENCRYPTEDLOG` +Emit an unencrypted log + +[See in table.](#isa-table-emitunencryptedlog) + +- **Opcode**: 0x2a +- **Category**: Accrued Substate - Logging +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **logOffset**: memory offset of the data to log + - **logSizeOffset**: memory offset to number of words to log +- **Expression**: + +{`context.accruedSubstate.unencryptedLogs.append( + UnencryptedLog { + address: context.environment.address, + log: M[logOffset:logOffset+M[logSizeOffset]], + } +)`} + +- **Bit-size**: 88 + +[![](/img/protocol-specs/public-vm/bit-formats/EMITUNENCRYPTEDLOG.png)](/img/protocol-specs/public-vm/bit-formats/EMITUNENCRYPTEDLOG.png) + +### `SENDL2TOL1MSG` +Send an L2-to-L1 message + +[See in table.](#isa-table-sendl2tol1msg) + +- **Opcode**: 0x2b +- **Category**: Accrued Substate - Messaging +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **recipientOffset**: memory offset of the message recipient + - **contentOffset**: memory offset of the message content +- **Expression**: + +{`context.accruedSubstate.sentL2ToL1Messages.append( + SentL2ToL1Message { + address: context.environment.address, + recipient: M[recipientOffset], + message: M[contentOffset] + } +)`} + +- **Bit-size**: 88 + +[![](/img/protocol-specs/public-vm/bit-formats/SENDL2TOL1MSG.png)](/img/protocol-specs/public-vm/bit-formats/SENDL2TOL1MSG.png) + +### `CALL` +Call into another contract + +[See in table.](#isa-table-call) + +- **Opcode**: 0x2c +- **Category**: Control Flow - Contract Calls +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee + - **addrOffset**: address of the contract to call + - **argsOffset**: memory offset to args (will become the callee's calldata) + - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata + - **retOffset**: destination memory offset specifying where to store the data returned from the callee + - **retSize**: number of words to copy from data returned by callee + - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) +- **Expression**: + +{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } +chargeGas(context, + l2GasCost=M[instr.args.gasOffset], + daGasCost=M[instr.args.gasOffset+1]) +traceNestedCall(context, instr.args.addrOffset) +nestedContext = deriveContext(context, instr.args, isStaticCall=false) +execute(nestedContext) +updateContextAfterNestedCall(context, instr.args, nestedContext)`} + +- **Details**: Creates a new (nested) execution context and triggers execution within that context. + Execution proceeds in the nested context until it reaches a halt at which point + execution resumes in the current/calling context. + A non-existent contract or one with no code will return success. + ["Nested contract calls"](./nested-calls) provides a full explanation of this + instruction along with the shorthand used in the expression above. + The explanation includes details on charging gas for nested calls, + nested context derivation, world state tracing, and updating the parent context + after the nested call halts. +- **Tag checks**: `T[gasOffset] == T[gasOffset+1] == T[gasOffset+2] == u32` +- **Tag updates**: + +{`T[successOffset] = u8 +T[retOffset:retOffset+retSize] = field`} + +- **Bit-size**: 248 + +[![](/img/protocol-specs/public-vm/bit-formats/CALL.png)](/img/protocol-specs/public-vm/bit-formats/CALL.png) + +### `STATICCALL` +Call into another contract, disallowing World State and Accrued Substate modifications + +[See in table.](#isa-table-staticcall) + +- **Opcode**: 0x2d +- **Category**: Control Flow - Contract Calls +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee + - **addrOffset**: address of the contract to call + - **argsOffset**: memory offset to args (will become the callee's calldata) + - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata + - **retOffset**: destination memory offset specifying where to store the data returned from the callee + - **retSize**: number of words to copy from data returned by callee + - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) +- **Expression**: + +{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } +chargeGas(context, + l2GasCost=M[instr.args.gasOffset], + daGasCost=M[instr.args.gasOffset+1]) +traceNestedCall(context, instr.args.addrOffset) +nestedContext = deriveContext(context, instr.args, isStaticCall=true +execute(nestedContext) +updateContextAfterNestedCall(context, instr.args, nestedContext)`} + +- **Details**: Same as `CALL`, but disallows World State and Accrued Substate modifications. + ["Nested contract calls"](./nested-calls) provides a full explanation of this + instruction along with the shorthand used in the expression above. + The explanation includes details on charging gas for nested calls, + nested context derivation, world state tracing, and updating the parent context + after the nested call halts. +- **Tag checks**: `T[gasOffset] == T[gasOffset+1] == T[gasOffset+2] == u32` +- **Tag updates**: + +{`T[successOffset] = u8 +T[retOffset:retOffset+retSize] = field`} + +- **Bit-size**: 248 + +[![](/img/protocol-specs/public-vm/bit-formats/STATICCALL.png)](/img/protocol-specs/public-vm/bit-formats/STATICCALL.png) + +### `RETURN` +Halt execution within this context (without revert), optionally returning some data + +[See in table.](#isa-table-return) + +- **Opcode**: 0x2e +- **Category**: Control Flow - Contract Calls +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **retOffset**: memory offset of first word to return + - **retSize**: number of words to return +- **Expression**: + +{`context.contractCallResults.output = M[retOffset:retOffset+retSize] +halt`} + +- **Details**: Return control flow to the calling context/contract. Caller will accept World State and Accrued Substate modifications. See ["Halting"](./execution#halting) to learn more. See ["Nested contract calls"](./nested-calls) to see how the caller updates its context after the nested call halts. +- **Bit-size**: 88 + +[![](/img/protocol-specs/public-vm/bit-formats/RETURN.png)](/img/protocol-specs/public-vm/bit-formats/RETURN.png) + +### `REVERT` +Halt execution within this context as `reverted`, optionally returning some data + +[See in table.](#isa-table-revert) + +- **Opcode**: 0x2f +- **Category**: Control Flow - Contract Calls +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **retOffset**: memory offset of first word to return + - **retSize**: number of words to return +- **Expression**: + +{`context.contractCallResults.output = M[retOffset:retOffset+retSize] +context.contractCallResults.reverted = true +halt`} + +- **Details**: Return control flow to the calling context/contract. Caller will reject World State and Accrued Substate modifications. See ["Halting"](./execution#halting) to learn more. See ["Nested contract calls"](./nested-calls) to see how the caller updates its context after the nested call halts. +- **Bit-size**: 88 + +[![](/img/protocol-specs/public-vm/bit-formats/REVERT.png)](/img/protocol-specs/public-vm/bit-formats/REVERT.png) + +### `TORADIXLE` +Convert a word to an array of limbs in little-endian radix form + +[See in table.](#isa-table-to_radix_le) + +- **Opcode**: 0x30 +- **Category**: Conversions +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **srcOffset**: memory offset of word to convert. + - **dstOffset**: memory offset specifying where the first limb of the radix-conversion result is stored. + - **radix**: the maximum bit-size of each limb. + - **numLimbs**: the number of limbs the word will be converted into. +- **Expression**: TBD: Storage of limbs and if T[dstOffset] is constrained to U8 +- **Details**: The limbs will be stored in a contiguous memory block starting at `dstOffset`. +- **Tag checks**: `T[srcOffset] == field` +- **Bit-size**: 152 + diff --git a/docs/docs/protocol-specs/public-vm/index.md b/docs/docs/_protocol-specs/public-vm/index.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/index.md rename to docs/docs/_protocol-specs/public-vm/index.md diff --git a/docs/docs/protocol-specs/public-vm/instruction-set.mdx b/docs/docs/_protocol-specs/public-vm/instruction-set.mdx similarity index 100% rename from docs/docs/protocol-specs/public-vm/instruction-set.mdx rename to docs/docs/_protocol-specs/public-vm/instruction-set.mdx diff --git a/docs/docs/protocol-specs/public-vm/intro.md b/docs/docs/_protocol-specs/public-vm/intro.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/intro.md rename to docs/docs/_protocol-specs/public-vm/intro.md diff --git a/docs/docs/protocol-specs/public-vm/memory-model.md b/docs/docs/_protocol-specs/public-vm/memory-model.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/memory-model.md rename to docs/docs/_protocol-specs/public-vm/memory-model.md diff --git a/docs/docs/protocol-specs/public-vm/nested-calls.mdx b/docs/docs/_protocol-specs/public-vm/nested-calls.mdx similarity index 100% rename from docs/docs/protocol-specs/public-vm/nested-calls.mdx rename to docs/docs/_protocol-specs/public-vm/nested-calls.mdx diff --git a/docs/docs/protocol-specs/public-vm/security.md b/docs/docs/_protocol-specs/public-vm/security.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/security.md rename to docs/docs/_protocol-specs/public-vm/security.md diff --git a/docs/docs/protocol-specs/public-vm/state.md b/docs/docs/_protocol-specs/public-vm/state.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/state.md rename to docs/docs/_protocol-specs/public-vm/state.md diff --git a/docs/docs/protocol-specs/public-vm/type-structs.md b/docs/docs/_protocol-specs/public-vm/type-structs.md similarity index 100% rename from docs/docs/protocol-specs/public-vm/type-structs.md rename to docs/docs/_protocol-specs/public-vm/type-structs.md diff --git a/docs/docs/protocol-specs/rollup-circuits/base-rollup.md b/docs/docs/_protocol-specs/rollup-circuits/base-rollup.md similarity index 100% rename from docs/docs/protocol-specs/rollup-circuits/base-rollup.md rename to docs/docs/_protocol-specs/rollup-circuits/base-rollup.md diff --git a/docs/docs/protocol-specs/rollup-circuits/index.md b/docs/docs/_protocol-specs/rollup-circuits/index.md similarity index 100% rename from docs/docs/protocol-specs/rollup-circuits/index.md rename to docs/docs/_protocol-specs/rollup-circuits/index.md diff --git a/docs/docs/protocol-specs/rollup-circuits/merge-rollup.md b/docs/docs/_protocol-specs/rollup-circuits/merge-rollup.md similarity index 100% rename from docs/docs/protocol-specs/rollup-circuits/merge-rollup.md rename to docs/docs/_protocol-specs/rollup-circuits/merge-rollup.md diff --git a/docs/docs/protocol-specs/rollup-circuits/root-rollup.md b/docs/docs/_protocol-specs/rollup-circuits/root-rollup.md similarity index 100% rename from docs/docs/protocol-specs/rollup-circuits/root-rollup.md rename to docs/docs/_protocol-specs/rollup-circuits/root-rollup.md diff --git a/docs/docs/protocol-specs/rollup-circuits/tree-parity.md b/docs/docs/_protocol-specs/rollup-circuits/tree-parity.md similarity index 100% rename from docs/docs/protocol-specs/rollup-circuits/tree-parity.md rename to docs/docs/_protocol-specs/rollup-circuits/tree-parity.md diff --git a/docs/docs/protocol-specs/state/archive.md b/docs/docs/_protocol-specs/state/archive.md similarity index 100% rename from docs/docs/protocol-specs/state/archive.md rename to docs/docs/_protocol-specs/state/archive.md diff --git a/docs/docs/protocol-specs/state/index.md b/docs/docs/_protocol-specs/state/index.md similarity index 100% rename from docs/docs/protocol-specs/state/index.md rename to docs/docs/_protocol-specs/state/index.md diff --git a/docs/docs/protocol-specs/state/note-hash-tree.md b/docs/docs/_protocol-specs/state/note-hash-tree.md similarity index 100% rename from docs/docs/protocol-specs/state/note-hash-tree.md rename to docs/docs/_protocol-specs/state/note-hash-tree.md diff --git a/docs/docs/protocol-specs/state/nullifier-tree.md b/docs/docs/_protocol-specs/state/nullifier-tree.md similarity index 100% rename from docs/docs/protocol-specs/state/nullifier-tree.md rename to docs/docs/_protocol-specs/state/nullifier-tree.md diff --git a/docs/docs/protocol-specs/state/public-data-tree.md b/docs/docs/_protocol-specs/state/public-data-tree.md similarity index 100% rename from docs/docs/protocol-specs/state/public-data-tree.md rename to docs/docs/_protocol-specs/state/public-data-tree.md diff --git a/docs/docs/protocol-specs/state/tree-implementations.md b/docs/docs/_protocol-specs/state/tree-implementations.md similarity index 100% rename from docs/docs/protocol-specs/state/tree-implementations.md rename to docs/docs/_protocol-specs/state/tree-implementations.md diff --git a/docs/docs/protocol-specs/state/wonky-tree.md b/docs/docs/_protocol-specs/state/wonky-tree.md similarity index 100% rename from docs/docs/protocol-specs/state/wonky-tree.md rename to docs/docs/_protocol-specs/state/wonky-tree.md diff --git a/docs/docs/protocol-specs/todo.md b/docs/docs/_protocol-specs/todo.md similarity index 100% rename from docs/docs/protocol-specs/todo.md rename to docs/docs/_protocol-specs/todo.md diff --git a/docs/docs/protocol-specs/transactions/index.md b/docs/docs/_protocol-specs/transactions/index.md similarity index 100% rename from docs/docs/protocol-specs/transactions/index.md rename to docs/docs/_protocol-specs/transactions/index.md diff --git a/docs/docs/protocol-specs/transactions/local-execution.md b/docs/docs/_protocol-specs/transactions/local-execution.md similarity index 100% rename from docs/docs/protocol-specs/transactions/local-execution.md rename to docs/docs/_protocol-specs/transactions/local-execution.md diff --git a/docs/docs/protocol-specs/transactions/public-execution.md b/docs/docs/_protocol-specs/transactions/public-execution.md similarity index 100% rename from docs/docs/protocol-specs/transactions/public-execution.md rename to docs/docs/_protocol-specs/transactions/public-execution.md diff --git a/docs/docs/protocol-specs/transactions/tx-object.md b/docs/docs/_protocol-specs/transactions/tx-object.md similarity index 100% rename from docs/docs/protocol-specs/transactions/tx-object.md rename to docs/docs/_protocol-specs/transactions/tx-object.md diff --git a/docs/docs/protocol-specs/transactions/validity.md b/docs/docs/_protocol-specs/transactions/validity.md similarity index 100% rename from docs/docs/protocol-specs/transactions/validity.md rename to docs/docs/_protocol-specs/transactions/validity.md diff --git a/docs/docs/aztec/concepts/accounts/index.md b/docs/docs/aztec/concepts/accounts/index.md index 07c6e0aa4d6..4f29f273ecb 100644 --- a/docs/docs/aztec/concepts/accounts/index.md +++ b/docs/docs/aztec/concepts/accounts/index.md @@ -156,5 +156,3 @@ NOTE: While we entertained the idea of abstracting note encryption, where accoun In order to be considered valid, an account must prove that it has locked enough funds to pay for itself. However, this does not mandate where those funds come from. This fee abstraction allows for easy implementation of paymasters or payment-in-kind via on-the-fly swaps. However, there is one major consideration around public execution reverts. In the current design, if one of the public function executions enqueued in a transaction fails, then the entire transaction is reverted. But reverting the whole transaction would also revert the fee payment, and leave the sequencer with their hands empty after running the public execution. This means we will need to enshrine an initial verification and fee payment phase that is _not_ reverted if public execution fails. - -You can read the latest information about fees in the [protocol specs](../../../protocol-specs/gas-and-fees/index.md). diff --git a/docs/docs/aztec/concepts/accounts/keys.md b/docs/docs/aztec/concepts/accounts/keys.md index 87572444485..7df96c9c13f 100644 --- a/docs/docs/aztec/concepts/accounts/keys.md +++ b/docs/docs/aztec/concepts/accounts/keys.md @@ -4,7 +4,6 @@ tags: [accounts, keys] --- The goal of this section is to give app developer a good idea what keys there are used in the system. -For a detailed description head over to the [protocol specification](../../../protocol-specs/addresses-and-keys/index.md). In short, there is a **nullifier key** (to spend your notes), an **incoming viewing key** (to view any notes or logs that were sent to you), an **outgoing viewing key** (to view any logs or notes you sent to another entity), a **tagging key** (to quickly find notes relevant to you) and oftentimes a signing key. A signing key is not strictly required by the protocol, but are often used with specific account contracts for authorization purposes. @@ -13,10 +12,10 @@ Each account in Aztec is backed by 4 key pairs: - A **nullifier key pair** used for note nullifier computation, comprising the master nullifier secret key (`nsk_m`) and master nullifier public key (`Npk_m`). - An **incoming viewing key pair** used to encrypt a note for the recipient, consisting of the master incoming viewing secret key (`ivsk_m`) and master incoming viewing public key (`Ivpk_m`). - An **outgoing viewing key pair** used to encrypt a note for the sender, includes the master outgoing viewing secret key (`ovsk_m`) and master outgoing viewing public key (`Ovpk_m`). -- A **tagging key pair** used to compute tags in a [tagging note discovery scheme](../../../protocol-specs/private-message-delivery/private-msg-delivery.md#note-tagging), comprising the master tagging secret key (`tsk_m`) and master tagging public key (`Tpk_m`). +- A **tagging key pair** used to compute tags in a tagging note discovery scheme, comprising the master tagging secret key (`tsk_m`) and master tagging public key (`Tpk_m`). :::info -All key pairs above are derived from a secret using a ZCash inspired scheme defined in [protocol specification](../../../protocol-specs/addresses-and-keys/keys.md#cheat-sheet). +Key pairs are derived from a secret using a ZCash inspired scheme. ::: :::note @@ -52,7 +51,6 @@ If that happens, only the nullifier secret for that application is compromised ( Above we mentioned that the notes typically contain `Npk_m`. It might seem like a mistake given that the notes are nullified with `nsk_app`. This is intentional and instead of directly trying to derive `Npk_m` from `nsk_app` we instead verify that both of the keys were derived from the same `nsk_m` in our protocol circuits. -If you are curious how the derivation scheme works head over to [protocol specification](../../../protocol-specs/addresses-and-keys/example-usage/nullifier#diagram). ## Protocol key types @@ -71,7 +69,7 @@ An application in Aztec.nr can request a secret from the current user for comput Typically, `Npk_m` is stored in a note and later on, the note is nullified using the secret app-siloed version (denoted `nsk_app`). `nsk_app` is derived by hashing `nsk_m` with the app contract address and it is necessary to present it to compute the nullifier. -Validity of `nsk_app` is verified by our [protocol kernel circuits](../../../protocol-specs/circuits/private-kernel-tail#verifying-and-splitting-ordered-data). +Validity of `nsk_app` is verified by our protocol kernel circuits. ## Incoming viewing keys @@ -86,7 +84,7 @@ If these keys were not used and a new device would be synched there would be no ## Tagging keys -Used to compute tags in a [tagging note discovery scheme](../../../protocol-specs/private-message-delivery/private-msg-delivery#note-tagging). +Used to compute tags in a tagging note discovery scheme. :::note Tagging note discovery scheme won't be present in our testnet so we are intentionally not providing you with much info yet. diff --git a/docs/docs/aztec/concepts/circuits/index.md b/docs/docs/aztec/concepts/circuits/index.md index 9e6272b37e4..606d7ca54a4 100644 --- a/docs/docs/aztec/concepts/circuits/index.md +++ b/docs/docs/aztec/concepts/circuits/index.md @@ -61,14 +61,6 @@ What kind of extra rules / checks does a rollup need, to enforce notions of priv So what kinds of core protocol circuits does Aztec have? -### Kernel Circuits +### Kernel, Rollup, and Squisher Circuits -Read more about the Kernel circuits in the protocol specs [here](../../../protocol-specs/circuits/high-level-topology.md). - -### Rollup Circuits - -- [Rollup Circuits](../../../protocol-specs/rollup-circuits/index.md) - -#### Squisher Circuits - -We haven't fully spec'ed these out, as Honk and Goblin Plonk schemes are still being improved! But we'll need some extra circuit(s) to squish a Honk proof (as produced by the Root Rollup Circuit) into a Standard Plonk or Fflonk proof, for cheap verification on Ethereum. +The specs of these have recently been updated. Eg for squisher circuits since Honk and Goblin Plonk schemes are still being improved! But we'll need some extra circuit(s) to squish a Honk proof (as produced by the Root Rollup Circuit) into a Standard Plonk or Fflonk proof, for cheap verification on Ethereum. diff --git a/docs/docs/aztec/concepts/circuits/kernels/private_kernel.md b/docs/docs/aztec/concepts/circuits/kernels/private_kernel.md index 9bdba98cb8a..10f8880efbf 100644 --- a/docs/docs/aztec/concepts/circuits/kernels/private_kernel.md +++ b/docs/docs/aztec/concepts/circuits/kernels/private_kernel.md @@ -5,8 +5,6 @@ tags: [protocol, circuits] This circuit is executed by the user, on their own device. This is to ensure private inputs to the circuit remain private! -Read the latest information about the Aztec Private Kernel Circuit in the [protocol specs section](../../../../protocol-specs/circuits/private-kernel-tail.md). - :::note **This is the only core protocol circuit which actually needs to be "zk" (zero-knowledge)!!!** That's because this is the only core protocol circuit which handles private data, and hence the only circuit for which proofs must not leak any information about witnesses! (The private data being handled includes: details of the Aztec.nr Contract function which has been executed; the address of the user who executed the function; the intelligible inputs and outputs of that function). diff --git a/docs/docs/aztec/concepts/circuits/kernels/public_kernel.md b/docs/docs/aztec/concepts/circuits/kernels/public_kernel.md index e7f139f8662..c5466010908 100644 --- a/docs/docs/aztec/concepts/circuits/kernels/public_kernel.md +++ b/docs/docs/aztec/concepts/circuits/kernels/public_kernel.md @@ -4,5 +4,3 @@ tags: [protocol, circuits] --- This circuit is executed by a Sequencer, since only a Sequencer knows the current state of the [public data tree](../../storage/trees/index.md) at any time. A Sequencer might choose to delegate proof generation to the Prover pool. - -Read more about the public kernel circuits in the protocol specs [here](../../../../protocol-specs/circuits/public-kernel-initial.md). diff --git a/docs/docs/aztec/concepts/circuits/rollup_circuits/index.md b/docs/docs/aztec/concepts/circuits/rollup_circuits/index.md index 7935d44c591..db7a11e0b9b 100644 --- a/docs/docs/aztec/concepts/circuits/rollup_circuits/index.md +++ b/docs/docs/aztec/concepts/circuits/rollup_circuits/index.md @@ -15,5 +15,3 @@ The way we 'squish' all this data is in a 'binary tree of proofs' topology. > Note: 'binary tree of proofs' is actually an oversimplification. The Rollup Circuits are designed so that a Sequencer can actually deviate from a neat, symmetrical tree, for the purposes of efficiency, and instead sometimes create wonky trees. Some of the Rollup Circuits also do some protocol checks and computations, for efficiency reasons. We might rearrange which circuit does what computation, as we discover opportunities for efficiency. - -Read more about the rollup circuits in the protocol spec [here](../../../../protocol-specs/rollup-circuits/index.md). diff --git a/docs/docs/aztec/concepts/communication/cross_chain_calls.md b/docs/docs/aztec/concepts/communication/cross_chain_calls.md index b606a5e9311..439f267ce55 100644 --- a/docs/docs/aztec/concepts/communication/cross_chain_calls.md +++ b/docs/docs/aztec/concepts/communication/cross_chain_calls.md @@ -150,7 +150,3 @@ To make it possible to hide when a specific message is consumed, the `L1ToL2Msg` The following diagram shows the overall architecture, combining the earlier sections. - -## Learn more - -Check out the [protocol specs](../../../protocol-specs/l1-smart-contracts#portals) for more information about cross-chain communication and contracts on L1. diff --git a/docs/docs/aztec/concepts/storage/partial_notes.md b/docs/docs/aztec/concepts/storage/partial_notes.md index fb597632d0b..d8bffd340ed 100644 --- a/docs/docs/aztec/concepts/storage/partial_notes.md +++ b/docs/docs/aztec/concepts/storage/partial_notes.md @@ -10,7 +10,7 @@ Partial notes are a concept that allows users to commit to an encrypted value, a Why is this useful? -Consider the case where a user wants to pay for a transaction fee, using a [fee-payment contract](../../../protocol-specs/gas-and-fees/index.md) and they want to do this privately. They can't be certain what the transaction fee will be because the state of the network will have progressed by the time the transaction is processed by the sequencer, and transaction fees are dynamic. So the user can commit to a value for the transaction fee, publicly post this commitment, the fee payer (aka paymaster) can update the public commitment, deducting the final cost of the transaction from the commitment and returning the unused value to the user. +Consider the case where a user wants to pay for a transaction fee, using a fee-payment contract and they want to do this privately. They can't be certain what the transaction fee will be because the state of the network will have progressed by the time the transaction is processed by the sequencer, and transaction fees are dynamic. So the user can commit to a value for the transaction fee, publicly post this commitment, the fee payer (aka paymaster) can update the public commitment, deducting the final cost of the transaction from the commitment and returning the unused value to the user. So, in general, the user is: diff --git a/docs/docs/aztec/concepts/storage/state_model/public_vm.md b/docs/docs/aztec/concepts/storage/state_model/public_vm.md index 528ee5f8d46..dd2f5b2d0b1 100644 --- a/docs/docs/aztec/concepts/storage/state_model/public_vm.md +++ b/docs/docs/aztec/concepts/storage/state_model/public_vm.md @@ -2,4 +2,6 @@ title: Public VM --- -Refer to the [protocol specs section](../../../../protocol-specs/public-vm/index.md) for the latest information about the Aztec Public VM. +import Spec_Placeholder from '/components/snippet'; + + diff --git a/docs/docs/aztec/concepts/storage/trees/index.md b/docs/docs/aztec/concepts/storage/trees/index.md index 0a0f0aa8ace..387a27dd87e 100644 --- a/docs/docs/aztec/concepts/storage/trees/index.md +++ b/docs/docs/aztec/concepts/storage/trees/index.md @@ -2,4 +2,6 @@ title: Trees --- -Refer to [this section](../../../../protocol-specs/state/index.md) of the protocol specification for the latest information on the trees used in Aztec. +import Spec_Placeholder from '/components/snippet'; + + diff --git a/docs/docs/aztec/concepts/transactions.md b/docs/docs/aztec/concepts/transactions.md index 6f75a98d412..04280342b20 100644 --- a/docs/docs/aztec/concepts/transactions.md +++ b/docs/docs/aztec/concepts/transactions.md @@ -31,9 +31,9 @@ _The transaction has not been broadcasted to the sequencer network yet. For now, _The transaction has still not been broadcasted to the sequencer network yet and continues to live solely within the context of the PXE._ -3. **The PXE proves correct execution** – At this point, the PXE proves correct execution (via zero-knowledge proofs) of the authorization and of the private transfer method. Once the proofs have been generated, the PXE sends the proofs and required inputs (inputs are new note commitments, stored in the [note hash tree](../../protocol-specs/state/note-hash-tree.md) and nullifiers stored in the [nullifiers tree](../../protocol-specs/state/nullifier-tree.md)) to the sequencer. Nullifiers are data that invalidate old commitments, ensuring that commitments can only be used once. +3. **The PXE proves correct execution** – At this point, the PXE proves correct execution (via zero-knowledge proofs) of the authorization and of the private transfer method. Once the proofs have been generated, the PXE sends the proofs and required inputs (inputs are new note commitments, stored in the note hash tree and nullifiers stored in the nullifiers tree) to the sequencer. Nullifiers are data that invalidate old commitments, ensuring that commitments can only be used once. -_The sequencer has received the transaction proof and can begin to process the transaction - verifying proofs and applying updates to the relevant [data trees](../../protocol-specs/state/index.md) - alongside other public and private transactions._ +_The sequencer has received the transaction proof and can begin to process the transaction - verifying proofs and applying updates to the relevant data trees - alongside other public and private transactions._ 4. **The sequencer has the necessary information to act** – the randomly-selected sequencer (based on the Fernet sequencer selection protocol) validates the transaction proofs along with required inputs (e.g. the note commitments and nullifiers) for this private transfer. The sequencer also executes public functions and requests proofs of public execution from a prover network. The sequencer updates the corresponding data trees and does the same for other private transactions. When the sequencer receives proofs from the prover network, the proofs will be bundled into a final rollup proof. diff --git a/docs/docs/aztec/concepts/wallets/index.md b/docs/docs/aztec/concepts/wallets/index.md index 1c64d7a2843..02b0f04fee9 100644 --- a/docs/docs/aztec/concepts/wallets/index.md +++ b/docs/docs/aztec/concepts/wallets/index.md @@ -28,9 +28,9 @@ Note that users must be able to receive funds in Aztec before deploying their ac Every transaction in Aztec is broadcast to the network as a zero-knowledge proof of correct execution, in order to preserve privacy. This means that transaction proofs are generated on the wallet and not on a remote node. This is one of the biggest differences with regard to EVM chain wallets. -A wallet is responsible for **creating** an _execution request_ out of one or more _function calls_ requested by a dapp. For example, a dapp may request a wallet to "invoke the `transfer` function on the contract at `0x1234` with the following arguments", in response to a user action. The wallet [turns that into an execution request](../../../protocol-specs/transactions/local-execution.md#execution-request) with the signed instructions to execute that function call from the user's account contract. In an [ECDSA-based account](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/noir-contracts/contracts/ecdsa_k_account_contract/src/main.nr), for instance, this is an execution request that encodes the function call in the _entrypoint payload_, and includes its ECDSA signature with the account's signing private key. +A wallet is responsible for **creating** an _execution request_ out of one or more _function calls_ requested by a dapp. For example, a dapp may request a wallet to "invoke the `transfer` function on the contract at `0x1234` with the following arguments", in response to a user action. The wallet turns that into an execution request with the signed instructions to execute that function call from the user's account contract. In an [ECDSA-based account](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/noir-contracts/contracts/ecdsa_k_account_contract/src/main.nr), for instance, this is an execution request that encodes the function call in the _entrypoint payload_, and includes its ECDSA signature with the account's signing private key. -Once the _execution request_ is created, the wallet is responsible for **simulating** and **proving** the execution of its private functions. The simulation yields an execution trace, which can be used to provide the user with a list of side effects of the private execution of the transaction. During this simulation, the wallet is responsible of providing data to the virtual machine, such as private notes, encryption keys, or nullifier secrets. This execution trace is fed into the prover, which returns a zero-knowledge proof that guarantees correct execution and hides all private information. The output of this process is a [_transaction object_](../../../protocol-specs/transactions/tx-object.md). +Once the _execution request_ is created, the wallet is responsible for **simulating** and **proving** the execution of its private functions. The simulation yields an execution trace, which can be used to provide the user with a list of side effects of the private execution of the transaction. During this simulation, the wallet is responsible of providing data to the virtual machine, such as private notes, encryption keys, or nullifier secrets. This execution trace is fed into the prover, which returns a zero-knowledge proof that guarantees correct execution and hides all private information. The output of this process is a _transaction object_. :::info Since private functions rely on a UTXO model, the private execution trace of a transaction is determined exclusively by the notes used as inputs. Since these notes are immutable, the trace of a transaction is always the same, so any effects observed during simulation will be exactly the same when the transaction is mined. However, the transaction may be dropped if it attempts to consume a private note that another transaction nullified before it gets mined. Note that this applies only to private function execution. Public functions rely on an account model, similar to Ethereum, so their execution trace depends on the chain's public state at the point they are included in a block, which may have changed since the transaction was simulated locally. diff --git a/docs/docs/aztec/concepts_overview.md b/docs/docs/aztec/concepts_overview.md index 878cd2c3796..701e2e69b44 100644 --- a/docs/docs/aztec/concepts_overview.md +++ b/docs/docs/aztec/concepts_overview.md @@ -10,7 +10,7 @@ This page outlines Aztec's fundamental technical concepts. It is recommended to ## What is Aztec? -Aztec is a privacy-first Layer 2 on Ethereum. It supports smart contracts with both private & public state and private & public execution. +Aztec is a privacy-first Layer 2 on Ethereum. It supports smart contracts with both private & public state and private & public execution. ## High level view @@ -33,7 +33,7 @@ Private functions are executed first on the user's device in the Private Executi ### Aztec VM -Public functions are executed by the Aztec Virtual Machine (AVM), which is conceptually similar to the Ethereum Virtual Machine (EVM). To learn more about how it works and its instruction set, go to the [protocol specs](../protocol-specs/public-vm/intro.md). +Public functions are executed by the Aztec Virtual Machine (AVM), which is conceptually similar to the Ethereum Virtual Machine (EVM). The PXE is unaware of the Public VM. And the Public VM is unaware of the PXE. They are completely separate execution environments. This means: @@ -54,7 +54,7 @@ Aztec [smart contract](./smart_contracts_overview.md) developers should keep in ### Account abstraction -Every account in Aztec is a smart contract (account abstraction). This allows implementing different schemes for authorizing transactions, nonce management, and fee payments. +Every account in Aztec is a smart contract (account abstraction). This allows implementing different schemes for authorizing transactions, nonce management, and fee payments. Developers can write their own account contract to define the rules by which user transactions are authorized and paid for, as well as how user keys are managed. diff --git a/docs/docs/aztec/smart_contracts/contract_creation.md b/docs/docs/aztec/smart_contracts/contract_creation.md index 02858dca070..6872b582fb8 100644 --- a/docs/docs/aztec/smart_contracts/contract_creation.md +++ b/docs/docs/aztec/smart_contracts/contract_creation.md @@ -3,7 +3,9 @@ title: Contract Deployment tags: [contracts, protocol] --- -The latest information about contract deployment has moved to the protocol specification. You can find it [here](../../protocol-specs/contract-deployment/index.md). +import Spec_Placeholder from '/components/snippet'; + + ## Further reading diff --git a/docs/docs/aztec/smart_contracts/functions/context.md b/docs/docs/aztec/smart_contracts/functions/context.md index f8b0eae3c16..346e822a25a 100644 --- a/docs/docs/aztec/smart_contracts/functions/context.md +++ b/docs/docs/aztec/smart_contracts/functions/context.md @@ -127,7 +127,7 @@ The public call stack contains all of the external function calls that are creat ### New L2 to L1 msgs -New L2 to L1 messages contains messages that are delivered to the [l1 outbox](../../../protocol-specs/l1-smart-contracts/index.md) on the execution of each rollup. +New L2 to L1 messages contains messages that are delivered to the l1 outbox on the execution of each rollup. ## Public Context diff --git a/docs/docs/aztec/smart_contracts/functions/function_transforms.md b/docs/docs/aztec/smart_contracts/functions/function_transforms.md index a66761f872a..2254bb44a31 100644 --- a/docs/docs/aztec/smart_contracts/functions/function_transforms.md +++ b/docs/docs/aztec/smart_contracts/functions/function_transforms.md @@ -192,7 +192,7 @@ fn compute_fn_signature_hash(fn_name: &str, parameters: &[Type]) -> u32 { - A string representation of the function is created, including the function name and parameter types - This signature string is then hashed using Keccak-256 -- The first 4 bytes of the resulting hash are coverted to a u32 integer +- The first 4 bytes of the resulting hash are converted to a u32 integer ### Integration into contract interface @@ -274,4 +274,4 @@ Contract artifacts are important because: - They help decode function return values in the simulator ## Further reading -- [Function attributes and macros](./attributes.md) \ No newline at end of file +- [Function attributes and macros](./attributes.md) diff --git a/docs/docs/guides/developer_guides/smart_contracts/writing_contracts/initializers.md b/docs/docs/guides/developer_guides/smart_contracts/writing_contracts/initializers.md index 19b525524f7..2f28727e3c0 100644 --- a/docs/docs/guides/developer_guides/smart_contracts/writing_contracts/initializers.md +++ b/docs/docs/guides/developer_guides/smart_contracts/writing_contracts/initializers.md @@ -45,6 +45,4 @@ You can set multiple functions as an initializer function simply by annotating e Calling any one of the functions annotated with `#[initializer]` will mark the contract as initialized. -See [this page of the protocol specs](../../../../protocol-specs/contract-deployment/instances.md#initialization) for more info about what marking a function as initialized means. - To see an initializer in action, follow the [Counter codealong tutorial](../../../../tutorials/codealong/contract_tutorials/counter_contract.md). diff --git a/docs/docs/guides/developer_guides/smart_contracts/writing_contracts/portals/communicate_with_portal.md b/docs/docs/guides/developer_guides/smart_contracts/writing_contracts/portals/communicate_with_portal.md index 439bf5f9377..93e00031913 100644 --- a/docs/docs/guides/developer_guides/smart_contracts/writing_contracts/portals/communicate_with_portal.md +++ b/docs/docs/guides/developer_guides/smart_contracts/writing_contracts/portals/communicate_with_portal.md @@ -3,8 +3,6 @@ title: Communicating with L1 tags: [contracts, portals] --- -Is this your first time hearing the word `Portal`? You might want to check out the [protocol specs](../../../../../protocol-specs/l1-smart-contracts/index.md). - Follow the [token bridge tutorial](../../../../../tutorials/codealong/contract_tutorials/token_bridge/index.md) for hands-on experience writing and deploying a Portal contract. ## Passing data to the rollup diff --git a/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx b/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx index d5409d96aef..b7de3caf134 100644 --- a/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx +++ b/docs/docs/protocol-specs/public-vm/gen/_instruction-set.mdx @@ -1,636 +1,367 @@ -[comment]: # "THIS IS A GENERATED FILE! DO NOT EDIT!" -[comment]: # "Generated via `yarn preprocess`" -[comment]: # "Generated by genMarkdown.js, InstructionSet.js, InstructionSize.js" +[comment]: # (THIS IS A GENERATED FILE! DO NOT EDIT!) +[comment]: # (Generated via `yarn preprocess`) + +[comment]: # (Generated by genMarkdown.js, InstructionSet.js, InstructionSize.js) + +import Markdown from 'react-markdown' +import CodeBlock from '@theme/CodeBlock' -import Markdown from "react-markdown"; -import CodeBlock from "@theme/CodeBlock"; ## Instructions Table Click on an instruction name to jump to its section. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + +
OpcodeNameSummaryExpression
0x00 - - \[\`ADD\`\](#isa-section-add) - - Addition (a + b) - - {`M[dstOffset] = M[aOffset] + M[bOffset] mod 2^k`} -
0x01 - - \[\`SUB\`\](#isa-section-sub) - - Subtraction (a - b) - - {`M[dstOffset] = M[aOffset] - M[bOffset] mod 2^k`} -
0x02 - - \[\`MUL\`\](#isa-section-mul) - - Multiplication (a * b) - - {`M[dstOffset] = M[aOffset] * M[bOffset] mod 2^k`} -
0x03 - - \[\`DIV\`\](#isa-section-div) - - Unsigned integer division (a / b) - - {`M[dstOffset] = M[aOffset] / M[bOffset]`} -
0x04 - - \[\`FDIV\`\](#isa-section-fdiv) - - Field division (a / b) - - {`M[dstOffset] = M[aOffset] / M[bOffset]`} -
0x05 - - \[\`EQ\`\](#isa-section-eq) - - Equality check (a == b) - - {`M[dstOffset] = M[aOffset] == M[bOffset] ? 1 : 0`} -
0x06 - - \[\`LT\`\](#isa-section-lt) - - Less-than check (a < b) - - {`M[dstOffset] = M[aOffset] < M[bOffset] ? 1 : 0`} -
0x07 - - \[\`LTE\`\](#isa-section-lte) - - Less-than-or-equals check (a <= b) - - {`M[dstOffset] = M[aOffset] <= M[bOffset] ? 1 : 0`} -
0x08 - - \[\`AND\`\](#isa-section-and) - - Bitwise AND (a & b) - - {`M[dstOffset] = M[aOffset] AND M[bOffset]`} -
0x09 - - \[\`OR\`\](#isa-section-or) - - Bitwise OR (a | b) - - {`M[dstOffset] = M[aOffset] OR M[bOffset]`} -
0x0a - - \[\`XOR\`\](#isa-section-xor) - - Bitwise XOR (a ^ b) - - {`M[dstOffset] = M[aOffset] XOR M[bOffset]`} -
0x0b - - \[\`NOT\`\](#isa-section-not) - - Bitwise NOT (inversion) - - {`M[dstOffset] = NOT M[aOffset]`} -
0x0c - - \[\`SHL\`\](#isa-section-shl) - - Bitwise leftward shift (a << b) - - {`M[dstOffset] = M[aOffset] << M[bOffset]`} -
0x0d - - \[\`SHR\`\](#isa-section-shr) - - Bitwise rightward shift (a >> b) - - {`M[dstOffset] = M[aOffset] >> M[bOffset]`} -
0x0e - - \[\`CAST\`\](#isa-section-cast) - - Type cast - - {`M[dstOffset] = cast(M[aOffset])`} -
0x0f - - \[\`ADDRESS\`\](#isa-section-address) - - - Get the address of the currently executing l2 contract - - - {`M[dstOffset] = context.environment.address`} -
0x10 - - \[\`SENDER\`\](#isa-section-sender) - - - Get the address of the sender (caller of the current context) - - - {`M[dstOffset] = context.environment.sender`} -
0x12 - - \[\`TRANSACTIONFEE\`\](#isa-section-transactionfee) - - - Get the computed transaction fee during teardown phase, zero otherwise - - - {`M[dstOffset] = context.environment.transactionFee`} -
0x13 - - \[\`CHAINID\`\](#isa-section-chainid) - - Get this rollup's L1 chain ID - - {`M[dstOffset] = context.environment.globals.chainId`} -
0x14 - - \[\`VERSION\`\](#isa-section-version) - - Get this rollup's L2 version ID - - {`M[dstOffset] = context.environment.globals.version`} -
0x15 - - \[\`BLOCKNUMBER\`\](#isa-section-blocknumber) - - Get this L2 block's number - - {`M[dstOffset] = context.environment.globals.blocknumber`} -
0x16 - - \[\`TIMESTAMP\`\](#isa-section-timestamp) - - Get this L2 block's timestamp - - {`M[dstOffset] = context.environment.globals.timestamp`} -
0x17 - - \[\`FEEPERL2GAS\`\](#isa-section-feeperl2gas) - - - Get the fee to be paid per "L2 gas" - constant for entire transaction - - - {`M[dstOffset] = context.environment.globals.feePerL2Gas`} -
0x18 - - \[\`FEEPERDAGAS\`\](#isa-section-feeperdagas) - - - Get the fee to be paid per "DA gas" - constant for entire transaction - - - {`M[dstOffset] = context.environment.globals.feePerDaGas`} -
0x19 - - \[\`CALLDATACOPY\`\](#isa-section-calldatacopy) - - Copy calldata into memory - - {`M[dstOffset:dstOffset+copySize] = context.environment.calldata[cdOffset:cdOffset+copySize]`} -
0x1a - - \[\`L2GASLEFT\`\](#isa-section-l2gasleft) - - - Remaining "L2 gas" for this call (after this instruction) - - - {`M[dstOffset] = context.MachineState.l2GasLeft`} -
0x1b - - \[\`DAGASLEFT\`\](#isa-section-dagasleft) - - - Remaining "DA gas" for this call (after this instruction) - - - {`M[dstOffset] = context.machineState.daGasLeft`} -
0x1c - - \[\`JUMP\`\](#isa-section-jump) - - Jump to a location in the bytecode - - {`context.machineState.pc = loc`} -
0x1d - - \[\`JUMPI\`\](#isa-section-jumpi) - - Conditionally jump to a location in the bytecode - - {`context.machineState.pc = M[condOffset] > 0 ? loc : context.machineState.pc`} -
0x1e - - \[\`INTERNALCALL\`\](#isa-section-internalcall) - - - Make an internal call. Push the current PC to the internal call stack - and jump to the target location. - - - - {`context.machineState.internalCallStack.push(context.machineState.pc) +OpcodeNameSummaryExpression
0x00\[\`ADD\`\](#isa-section-add)Addition (a + b){ + `M[dstOffset] = M[aOffset] + M[bOffset] mod 2^k` + }
0x01\[\`SUB\`\](#isa-section-sub)Subtraction (a - b){ + `M[dstOffset] = M[aOffset] - M[bOffset] mod 2^k` + }
0x02\[\`MUL\`\](#isa-section-mul)Multiplication (a * b){ + `M[dstOffset] = M[aOffset] * M[bOffset] mod 2^k` + }
0x03\[\`DIV\`\](#isa-section-div)Unsigned integer division (a / b){ + `M[dstOffset] = M[aOffset] / M[bOffset]` + }
0x04\[\`FDIV\`\](#isa-section-fdiv)Field division (a / b){ + `M[dstOffset] = M[aOffset] / M[bOffset]` + }
0x05\[\`EQ\`\](#isa-section-eq)Equality check (a == b){ + `M[dstOffset] = M[aOffset] == M[bOffset] ? 1 : 0` + }
0x06\[\`LT\`\](#isa-section-lt)Less-than check (a < b){ + `M[dstOffset] = M[aOffset] < M[bOffset] ? 1 : 0` + }
0x07\[\`LTE\`\](#isa-section-lte)Less-than-or-equals check (a <= b){ + `M[dstOffset] = M[aOffset] <= M[bOffset] ? 1 : 0` + }
0x08\[\`AND\`\](#isa-section-and)Bitwise AND (a & b){ + `M[dstOffset] = M[aOffset] AND M[bOffset]` + }
0x09\[\`OR\`\](#isa-section-or)Bitwise OR (a | b){ + `M[dstOffset] = M[aOffset] OR M[bOffset]` + }
0x0a\[\`XOR\`\](#isa-section-xor)Bitwise XOR (a ^ b){ + `M[dstOffset] = M[aOffset] XOR M[bOffset]` + }
0x0b\[\`NOT\`\](#isa-section-not)Bitwise NOT (inversion){ + `M[dstOffset] = NOT M[aOffset]` + }
0x0c\[\`SHL\`\](#isa-section-shl)Bitwise leftward shift (a << b){ + `M[dstOffset] = M[aOffset] << M[bOffset]` + }
0x0d\[\`SHR\`\](#isa-section-shr)Bitwise rightward shift (a >> b){ + `M[dstOffset] = M[aOffset] >> M[bOffset]` + }
0x0e\[\`CAST\`\](#isa-section-cast)Type cast{ + `M[dstOffset] = cast(M[aOffset])` + }
0x0f\[\`ADDRESS\`\](#isa-section-address)Get the address of the currently executing l2 contract{ + `M[dstOffset] = context.environment.address` + }
0x10\[\`SENDER\`\](#isa-section-sender)Get the address of the sender (caller of the current context){ + `M[dstOffset] = context.environment.sender` + }
0x11\[\`TRANSACTIONFEE\`\](#isa-section-transactionfee)Get the computed transaction fee during teardown phase, zero otherwise{ + `M[dstOffset] = context.environment.transactionFee` + }
0x12\[\`CHAINID\`\](#isa-section-chainid)Get this rollup's L1 chain ID{ + `M[dstOffset] = context.environment.globals.chainId` + }
0x13\[\`VERSION\`\](#isa-section-version)Get this rollup's L2 version ID{ + `M[dstOffset] = context.environment.globals.version` + }
0x14\[\`BLOCKNUMBER\`\](#isa-section-blocknumber)Get this L2 block's number{ + `M[dstOffset] = context.environment.globals.blocknumber` + }
0x15\[\`TIMESTAMP\`\](#isa-section-timestamp)Get this L2 block's timestamp{ + `M[dstOffset] = context.environment.globals.timestamp` + }
0x16\[\`FEEPERL2GAS\`\](#isa-section-feeperl2gas)Get the fee to be paid per "L2 gas" - constant for entire transaction{ + `M[dstOffset] = context.environment.globals.feePerL2Gas` + }
0x17\[\`FEEPERDAGAS\`\](#isa-section-feeperdagas)Get the fee to be paid per "DA gas" - constant for entire transaction{ + `M[dstOffset] = context.environment.globals.feePerDaGas` + }
0x18\[\`CALLDATACOPY\`\](#isa-section-calldatacopy)Copy calldata into memory{ + `M[dstOffset:dstOffset+copySize] = context.environment.calldata[cdOffset:cdOffset+copySize]` + }
0x19\[\`L2GASLEFT\`\](#isa-section-l2gasleft)Remaining "L2 gas" for this call (after this instruction){ + `M[dstOffset] = context.MachineState.l2GasLeft` + }
0x1a\[\`DAGASLEFT\`\](#isa-section-dagasleft)Remaining "DA gas" for this call (after this instruction){ + `M[dstOffset] = context.machineState.daGasLeft` + }
0x1b\[\`JUMP\`\](#isa-section-jump)Jump to a location in the bytecode{ + `context.machineState.pc = loc` + }
0x1c\[\`JUMPI\`\](#isa-section-jumpi)Conditionally jump to a location in the bytecode{ + `context.machineState.pc = M[condOffset] > 0 ? loc : context.machineState.pc` + }
0x1d\[\`INTERNALCALL\`\](#isa-section-internalcall)Make an internal call. Push the current PC to the internal call stack and jump to the target location. +{`context.machineState.internalCallStack.push(context.machineState.pc) context.machineState.pc = loc`} - -
0x1f - - \[\`INTERNALRETURN\`\](#isa-section-internalreturn) - - - Return from an internal call. Pop from the internal call stack and jump - to the popped location. - - - {`context.machineState.pc = context.machineState.internalCallStack.pop()`} -
0x20 - - \[\`SET\`\](#isa-section-set) - - Set a memory word from a constant in the bytecode - - {`M[dstOffset] = const`} -
0x21 - - \[\`MOV\`\](#isa-section-mov) - - - Move a word from source memory location to destination - - - {`M[dstOffset] = M[srcOffset]`} -
0x22 - - \[\`CMOV\`\](#isa-section-cmov) - - - Move a word (conditionally chosen) from one memory location to another - (`d = cond > 0 ? a : b`) - - - {`M[dstOffset] = M[condOffset] > 0 ? M[aOffset] : M[bOffset]`} -
0x23 - - \[\`SLOAD\`\](#isa-section-sload) - - - Load a word from this contract's persistent public storage. Zero is - loaded for unwritten slots. - - - {`M[dstOffset] = S[M[slotOffset]]`} -
0x24 - - \[\`SSTORE\`\](#isa-section-sstore) - - - Write a word to this contract's persistent public storage - - - {`S[M[slotOffset]] = M[srcOffset]`} -
0x25 - - \[\`NOTEHASHEXISTS\`\](#isa-section-notehashexists) - - - Check whether a note hash exists in the note hash tree (as of the start - of the current block) - - - - {`exists = context.worldState.noteHashes.has({ +
0x1e\[\`INTERNALRETURN\`\](#isa-section-internalreturn)Return from an internal call. Pop from the internal call stack and jump to the popped location.{ + `context.machineState.pc = context.machineState.internalCallStack.pop()` + }
0x1f\[\`SET\`\](#isa-section-set)Set a memory word from a constant in the bytecode{ + `M[dstOffset] = const` + }
0x20\[\`MOV\`\](#isa-section-mov)Move a word from source memory location to destination{ + `M[dstOffset] = M[srcOffset]` + }
0x21\[\`CMOV\`\](#isa-section-cmov)Move a word (conditionally chosen) from one memory location to another (`d = cond > 0 ? a : b`){ + `M[dstOffset] = M[condOffset] > 0 ? M[aOffset] : M[bOffset]` + }
0x22\[\`SLOAD\`\](#isa-section-sload)Load a word from this contract's persistent public storage. Zero is loaded for unwritten slots. +{`M[dstOffset] = S[M[slotOffset]]`} +
0x23\[\`SSTORE\`\](#isa-section-sstore)Write a word to this contract's persistent public storage +{`S[M[slotOffset]] = M[srcOffset]`} +
0x24\[\`NOTEHASHEXISTS\`\](#isa-section-notehashexists)Check whether a note hash exists in the note hash tree (as of the start of the current block) +{`exists = context.worldState.noteHashes.has({ leafIndex: M[leafIndexOffset] leaf: hash(context.environment.address, M[noteHashOffset]), }) M[existsOffset] = exists`} - -
0x26 - - \[\`EMITNOTEHASH\`\](#isa-section-emitnotehash) - - - Emit a new note hash to be inserted into the note hash tree - - - - {`context.worldState.noteHashes.append( +
0x25\[\`EMITNOTEHASH\`\](#isa-section-emitnotehash)Emit a new note hash to be inserted into the note hash tree +{`context.worldState.noteHashes.append( hash(context.environment.address, M[noteHashOffset]) )`} - -
0x27 - - \[\`NULLIFIEREXISTS\`\](#isa-section-nullifierexists) - - - Check whether a nullifier exists in the nullifier tree (including - nullifiers from earlier in the current transaction or from earlier in - the current block) - - - - {`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( +
0x26\[\`NULLIFIEREXISTS\`\](#isa-section-nullifierexists)Check whether a nullifier exists in the nullifier tree (including nullifiers from earlier in the current transaction or from earlier in the current block) +{`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( hash(M[addressOffset], M[nullifierOffset]) ) M[existsOffset] = exists`} - -
0x28 - - \[\`EMITNULLIFIER\`\](#isa-section-emitnullifier) - - - Emit a new nullifier to be inserted into the nullifier tree - - - - {`context.worldState.nullifiers.append( +
0x27\[\`EMITNULLIFIER\`\](#isa-section-emitnullifier)Emit a new nullifier to be inserted into the nullifier tree +{`context.worldState.nullifiers.append( hash(context.environment.address, M[nullifierOffset]) )`} - -
0x29 - - \[\`L1TOL2MSGEXISTS\`\](#isa-section-l1tol2msgexists) - - - Check if a message exists in the L1-to-L2 message tree - - - - {`exists = context.worldState.l1ToL2Messages.has({ +
0x28\[\`L1TOL2MSGEXISTS\`\](#isa-section-l1tol2msgexists)Check if a message exists in the L1-to-L2 message tree +{`exists = context.worldState.l1ToL2Messages.has({ leafIndex: M[msgLeafIndexOffset], leaf: M[msgHashOffset] }) M[existsOffset] = exists`} - -
0x2a - - - \[\`GETCONTRACTINSTANCE\`\](#isa-section-getcontractinstance) - - - Copies contract instance data to memory - - - {`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ +
0x29\[\`GETCONTRACTINSTANCE\`\](#isa-section-getcontractinstance)Copies contract instance data to memory +{`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ instance_found_in_address, instance.salt ?? 0, instance.deployer ?? 0, @@ -639,64 +370,41 @@ M[existsOffset] = exists`} instance.portalContractAddress ?? 0, instance.publicKeysHash ?? 0, ]`} - -
0x2b - - - \[\`EMITUNENCRYPTEDLOG\`\](#isa-section-emitunencryptedlog) - - - Emit an unencrypted log - - - {`context.accruedSubstate.unencryptedLogs.append( +
0x2a\[\`EMITUNENCRYPTEDLOG\`\](#isa-section-emitunencryptedlog)Emit an unencrypted log +{`context.accruedSubstate.unencryptedLogs.append( UnencryptedLog { address: context.environment.address, log: M[logOffset:logOffset+M[logSizeOffset]], } )`} - -
0x2c - - \[\`SENDL2TOL1MSG\`\](#isa-section-sendl2tol1msg) - - Send an L2-to-L1 message - - - {`context.accruedSubstate.sentL2ToL1Messages.append( +
0x2b\[\`SENDL2TOL1MSG\`\](#isa-section-sendl2tol1msg)Send an L2-to-L1 message +{`context.accruedSubstate.sentL2ToL1Messages.append( SentL2ToL1Message { address: context.environment.address, recipient: M[recipientOffset], message: M[contentOffset] } )`} - -
0x2d - - \[\`CALL\`\](#isa-section-call) - - Call into another contract - - - {`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } +
0x2c\[\`CALL\`\](#isa-section-call)Call into another contract +{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } chargeGas(context, l2GasCost=M[instr.args.gasOffset], daGasCost=M[instr.args.gasOffset+1]) @@ -704,24 +412,14 @@ traceNestedCall(context, instr.args.addrOffset) nestedContext = deriveContext(context, instr.args, isStaticCall=false) execute(nestedContext) updateContextAfterNestedCall(context, instr.args, nestedContext)`} - -
0x2e - - \[\`STATICCALL\`\](#isa-section-staticcall) - - - Call into another contract, disallowing World State and Accrued Substate - modifications - - - - {`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } +
0x2d\[\`STATICCALL\`\](#isa-section-staticcall)Call into another contract, disallowing World State and Accrued Substate modifications +{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } chargeGas(context, l2GasCost=M[instr.args.gasOffset], daGasCost=M[instr.args.gasOffset+1]) @@ -729,84 +427,52 @@ traceNestedCall(context, instr.args.addrOffset) nestedContext = deriveContext(context, instr.args, isStaticCall=true execute(nestedContext) updateContextAfterNestedCall(context, instr.args, nestedContext)`} - -
0x2f - - \[\`RETURN\`\](#isa-section-return) - - - Halt execution within this context (without revert), optionally - returning some data - - - - {`context.contractCallResults.output = M[retOffset:retOffset+retSize] +
0x2e\[\`RETURN\`\](#isa-section-return)Halt execution within this context (without revert), optionally returning some data +{`context.contractCallResults.output = M[retOffset:retOffset+retSize] halt`} - -
0x30 - - \[\`REVERT\`\](#isa-section-revert) - - - Halt execution within this context as `reverted`, optionally returning - some data - - - - {`context.contractCallResults.output = M[retOffset:retOffset+retSize] +
0x2f\[\`REVERT\`\](#isa-section-revert)Halt execution within this context as `reverted`, optionally returning some data +{`context.contractCallResults.output = M[retOffset:retOffset+retSize] context.contractCallResults.reverted = true halt`} - -
0x31 - - \[\`TORADIXLE\`\](#isa-section-to_radix_le) - - - Convert a word to an array of limbs in little-endian radix form - - - - TBD: Storage of limbs and if T[dstOffset] is constrained to U8 - -
0x30\[\`TORADIXLE\`\](#isa-section-to_radix_le)Convert a word to an array of limbs in little-endian radix formTBD: Storage of limbs and if T[dstOffset] is constrained to U8
+ ## Instructions ###
`ADD` - Addition (a + b) [See in table.](#isa-table-add) - **Opcode**: 0x00 - **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] + M[bOffset] mod 2^k` - **Details**: Wraps on overflow - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` @@ -816,20 +482,19 @@ Addition (a + b) [![](/img/protocol-specs/public-vm/bit-formats/ADD.png)](/img/protocol-specs/public-vm/bit-formats/ADD.png) ### `SUB` - Subtraction (a - b) [See in table.](#isa-table-sub) - **Opcode**: 0x01 - **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] - M[bOffset] mod 2^k` - **Details**: Wraps on undeflow - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` @@ -839,20 +504,19 @@ Subtraction (a - b) [![](/img/protocol-specs/public-vm/bit-formats/SUB.png)](/img/protocol-specs/public-vm/bit-formats/SUB.png) ### `MUL` - -Multiplication (a \* b) +Multiplication (a * b) [See in table.](#isa-table-mul) - **Opcode**: 0x02 - **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] * M[bOffset] mod 2^k` - **Details**: Wraps on overflow - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` @@ -862,20 +526,19 @@ Multiplication (a \* b) [![](/img/protocol-specs/public-vm/bit-formats/MUL.png)](/img/protocol-specs/public-vm/bit-formats/MUL.png) ### `DIV` - Unsigned integer division (a / b) [See in table.](#isa-table-div) - **Opcode**: 0x03 - **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] / M[bOffset]` - **Details**: If the input is a field, it will be interpreted as an integer - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` @@ -885,39 +548,38 @@ Unsigned integer division (a / b) [![](/img/protocol-specs/public-vm/bit-formats/DIV.png)](/img/protocol-specs/public-vm/bit-formats/DIV.png) ### `FDIV` - Field division (a / b) [See in table.](#isa-table-fdiv) - **Opcode**: 0x04 - **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] / M[bOffset]` - **Tag checks**: `T[aOffset] == T[bOffset] == field` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 120 -### `EQ` +### `EQ` Equality check (a \=\= b) [See in table.](#isa-table-eq) - **Opcode**: 0x05 - **Category**: Compute - Comparators -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] == M[bOffset] ? 1 : 0` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = u8` @@ -926,20 +588,19 @@ Equality check (a \=\= b) [![](/img/protocol-specs/public-vm/bit-formats/EQ.png)](/img/protocol-specs/public-vm/bit-formats/EQ.png) ### `LT` - Less-than check (a \< b) [See in table.](#isa-table-lt) - **Opcode**: 0x06 - **Category**: Compute - Comparators -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] < M[bOffset] ? 1 : 0` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = u8` @@ -948,20 +609,19 @@ Less-than check (a \< b) [![](/img/protocol-specs/public-vm/bit-formats/LT.png)](/img/protocol-specs/public-vm/bit-formats/LT.png) ### `LTE` - Less-than-or-equals check (a \<\= b) [See in table.](#isa-table-lte) - **Opcode**: 0x07 - **Category**: Compute - Comparators -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] <= M[bOffset] ? 1 : 0` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = u8` @@ -970,20 +630,19 @@ Less-than-or-equals check (a \<\= b) [![](/img/protocol-specs/public-vm/bit-formats/LTE.png)](/img/protocol-specs/public-vm/bit-formats/LTE.png) ### `AND` - Bitwise AND (a & b) [See in table.](#isa-table-and) - **Opcode**: 0x08 - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] AND M[bOffset]` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = inTag` @@ -992,20 +651,19 @@ Bitwise AND (a & b) [![](/img/protocol-specs/public-vm/bit-formats/AND.png)](/img/protocol-specs/public-vm/bit-formats/AND.png) ### `OR` - Bitwise OR (a | b) [See in table.](#isa-table-or) - **Opcode**: 0x09 - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] OR M[bOffset]` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = inTag` @@ -1014,20 +672,19 @@ Bitwise OR (a | b) [![](/img/protocol-specs/public-vm/bit-formats/OR.png)](/img/protocol-specs/public-vm/bit-formats/OR.png) ### `XOR` - Bitwise XOR (a ^ b) [See in table.](#isa-table-xor) - **Opcode**: 0x0a - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] XOR M[bOffset]` - **Tag checks**: `T[aOffset] == T[bOffset] == inTag` - **Tag updates**: `T[dstOffset] = inTag` @@ -1036,19 +693,18 @@ Bitwise XOR (a ^ b) [![](/img/protocol-specs/public-vm/bit-formats/XOR.png)](/img/protocol-specs/public-vm/bit-formats/XOR.png) ### `NOT` - Bitwise NOT (inversion) [See in table.](#isa-table-not) - **Opcode**: 0x0b - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = NOT M[aOffset]` - **Tag checks**: `T[aOffset] == inTag` - **Tag updates**: `T[dstOffset] = inTag` @@ -1057,20 +713,19 @@ Bitwise NOT (inversion) [![](/img/protocol-specs/public-vm/bit-formats/NOT.png)](/img/protocol-specs/public-vm/bit-formats/NOT.png) ### `SHL` - Bitwise leftward shift (a \<\< b) [See in table.](#isa-table-shl) - **Opcode**: 0x0c - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] << M[bOffset]` - **Tag checks**: `T[aOffset] == inTag`, `T[bOffset] == u8` - **Tag updates**: `T[dstOffset] = inTag` @@ -1079,20 +734,19 @@ Bitwise leftward shift (a \<\< b) [![](/img/protocol-specs/public-vm/bit-formats/SHL.png)](/img/protocol-specs/public-vm/bit-formats/SHL.png) ### `SHR` - Bitwise rightward shift (a \>\> b) [See in table.](#isa-table-shr) - **Opcode**: 0x0d - **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. +- **Args**: + - **aOffset**: memory offset of the operation's left input + - **bOffset**: memory offset of the operation's right input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[aOffset] >> M[bOffset]` - **Tag checks**: `T[aOffset] == inTag`, `T[bOffset] == u8` - **Tag updates**: `T[dstOffset] = inTag` @@ -1101,19 +755,18 @@ Bitwise rightward shift (a \>\> b) [![](/img/protocol-specs/public-vm/bit-formats/SHR.png)](/img/protocol-specs/public-vm/bit-formats/SHR.png) ### `CAST` - Type cast [See in table.](#isa-table-cast) - **Opcode**: 0x0e - **Category**: Type Conversions -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **dstTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to tag the destination with but not to check inputs against. -- **Args**: - - **aOffset**: memory offset of word to cast - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **dstTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to tag the destination with but not to check inputs against. +- **Args**: + - **aOffset**: memory offset of word to cast + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = cast(M[aOffset])` - **Details**: Cast a word in memory based on the `dstTag` specified in the bytecode. Truncates (`M[dstOffset] = M[aOffset] mod 2^dstsize`) when casting to a smaller type, left-zero-pads when casting to a larger type. See [here](./memory-model#cast-and-tag-conversions) for more details. - **Tag updates**: `T[dstOffset] = dstTag` @@ -1122,17 +775,16 @@ Type cast [![](/img/protocol-specs/public-vm/bit-formats/CAST.png)](/img/protocol-specs/public-vm/bit-formats/CAST.png) ### `ADDRESS` - Get the address of the currently executing l2 contract [See in table.](#isa-table-address) - **Opcode**: 0x0f - **Category**: Execution Environment -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.address` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -1140,17 +792,16 @@ Get the address of the currently executing l2 contract [![](/img/protocol-specs/public-vm/bit-formats/ADDRESS.png)](/img/protocol-specs/public-vm/bit-formats/ADDRESS.png) ### `SENDER` - Get the address of the sender (caller of the current context) [See in table.](#isa-table-sender) - **Opcode**: 0x10 - **Category**: Execution Environment -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.sender` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -1158,33 +809,32 @@ Get the address of the sender (caller of the current context) [![](/img/protocol-specs/public-vm/bit-formats/SENDER.png)](/img/protocol-specs/public-vm/bit-formats/SENDER.png) ### `TRANSACTIONFEE` - Get the computed transaction fee during teardown phase, zero otherwise [See in table.](#isa-table-transactionfee) -- **Opcode**: 0x12 +- **Opcode**: 0x11 - **Category**: Execution Environment -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.transactionFee` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 -### `CHAINID` +### `CHAINID` Get this rollup's L1 chain ID [See in table.](#isa-table-chainid) -- **Opcode**: 0x13 +- **Opcode**: 0x12 - **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.chainId` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -1192,17 +842,16 @@ Get this rollup's L1 chain ID [![](/img/protocol-specs/public-vm/bit-formats/CHAINID.png)](/img/protocol-specs/public-vm/bit-formats/CHAINID.png) ### `VERSION` - Get this rollup's L2 version ID [See in table.](#isa-table-version) -- **Opcode**: 0x14 +- **Opcode**: 0x13 - **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.version` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -1210,17 +859,16 @@ Get this rollup's L2 version ID [![](/img/protocol-specs/public-vm/bit-formats/VERSION.png)](/img/protocol-specs/public-vm/bit-formats/VERSION.png) ### `BLOCKNUMBER` - Get this L2 block's number [See in table.](#isa-table-blocknumber) -- **Opcode**: 0x15 +- **Opcode**: 0x14 - **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.blocknumber` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -1228,17 +876,16 @@ Get this L2 block's number [![](/img/protocol-specs/public-vm/bit-formats/BLOCKNUMBER.png)](/img/protocol-specs/public-vm/bit-formats/BLOCKNUMBER.png) ### `TIMESTAMP` - Get this L2 block's timestamp [See in table.](#isa-table-timestamp) -- **Opcode**: 0x16 +- **Opcode**: 0x15 - **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.timestamp` - **Tag updates**: `T[dstOffset] = u64` - **Bit-size**: 56 @@ -1246,17 +893,16 @@ Get this L2 block's timestamp [![](/img/protocol-specs/public-vm/bit-formats/TIMESTAMP.png)](/img/protocol-specs/public-vm/bit-formats/TIMESTAMP.png) ### `FEEPERL2GAS` - Get the fee to be paid per "L2 gas" - constant for entire transaction [See in table.](#isa-table-feeperl2gas) -- **Opcode**: 0x17 +- **Opcode**: 0x16 - **Category**: Execution Environment - Globals - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.feePerL2Gas` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -1264,17 +910,16 @@ Get the fee to be paid per "L2 gas" - constant for entire transaction [![](/img/protocol-specs/public-vm/bit-formats/FEEPERL2GAS.png)](/img/protocol-specs/public-vm/bit-formats/FEEPERL2GAS.png) ### `FEEPERDAGAS` - Get the fee to be paid per "DA gas" - constant for entire transaction [See in table.](#isa-table-feeperdagas) -- **Opcode**: 0x18 +- **Opcode**: 0x17 - **Category**: Execution Environment - Globals - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.environment.globals.feePerDaGas` - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 56 @@ -1282,19 +927,18 @@ Get the fee to be paid per "DA gas" - constant for entire transaction [![](/img/protocol-specs/public-vm/bit-formats/FEEPERDAGAS.png)](/img/protocol-specs/public-vm/bit-formats/FEEPERDAGAS.png) ### `CALLDATACOPY` - Copy calldata into memory [See in table.](#isa-table-calldatacopy) -- **Opcode**: 0x19 +- **Opcode**: 0x18 - **Category**: Execution Environment - Calldata -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **cdOffset**: offset into calldata to copy from - - **copySize**: number of words to copy - - **dstOffset**: memory offset specifying where to copy the first word to +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **cdOffset**: offset into calldata to copy from + - **copySize**: number of words to copy + - **dstOffset**: memory offset specifying where to copy the first word to - **Expression**: `M[dstOffset:dstOffset+copySize] = context.environment.calldata[cdOffset:cdOffset+copySize]` - **Details**: Calldata is read-only and cannot be directly operated on by other instructions. This instruction moves words from calldata into memory so they can be operated on normally. - **Tag updates**: `T[dstOffset:dstOffset+copySize] = field` @@ -1303,17 +947,16 @@ Copy calldata into memory [![](/img/protocol-specs/public-vm/bit-formats/CALLDATACOPY.png)](/img/protocol-specs/public-vm/bit-formats/CALLDATACOPY.png) ### `L2GASLEFT` - Remaining "L2 gas" for this call (after this instruction) [See in table.](#isa-table-l2gasleft) -- **Opcode**: 0x1a +- **Opcode**: 0x19 - **Category**: Machine State - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.MachineState.l2GasLeft` - **Tag updates**: `T[dstOffset] = u32` - **Bit-size**: 56 @@ -1321,17 +964,16 @@ Remaining "L2 gas" for this call (after this instruction) [![](/img/protocol-specs/public-vm/bit-formats/L2GASLEFT.png)](/img/protocol-specs/public-vm/bit-formats/L2GASLEFT.png) ### `DAGASLEFT` - Remaining "DA gas" for this call (after this instruction) [See in table.](#isa-table-dagasleft) -- **Opcode**: 0x1b +- **Opcode**: 0x1a - **Category**: Machine State - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = context.machineState.daGasLeft` - **Tag updates**: `T[dstOffset] = u32` - **Bit-size**: 56 @@ -1339,15 +981,14 @@ Remaining "DA gas" for this call (after this instruction) [![](/img/protocol-specs/public-vm/bit-formats/DAGASLEFT.png)](/img/protocol-specs/public-vm/bit-formats/DAGASLEFT.png) ### `JUMP` - Jump to a location in the bytecode [See in table.](#isa-table-jump) -- **Opcode**: 0x1c +- **Opcode**: 0x1b - **Category**: Machine State - Control Flow -- **Args**: - - **loc**: target location to jump to +- **Args**: + - **loc**: target location to jump to - **Expression**: `context.machineState.pc = loc` - **Details**: Target location is an immediate value (a constant in the bytecode). - **Bit-size**: 48 @@ -1355,18 +996,17 @@ Jump to a location in the bytecode [![](/img/protocol-specs/public-vm/bit-formats/JUMP.png)](/img/protocol-specs/public-vm/bit-formats/JUMP.png) ### `JUMPI` - Conditionally jump to a location in the bytecode [See in table.](#isa-table-jumpi) -- **Opcode**: 0x1d +- **Opcode**: 0x1c - **Category**: Machine State - Control Flow -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **loc**: target location conditionally jump to - - **condOffset**: memory offset of the operations 'conditional' input +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **loc**: target location conditionally jump to + - **condOffset**: memory offset of the operations 'conditional' input - **Expression**: `context.machineState.pc = M[condOffset] > 0 ? loc : context.machineState.pc` - **Details**: Target location is an immediate value (a constant in the bytecode). `T[condOffset]` is not checked because the greater-than-zero suboperation is the same regardless of type. - **Bit-size**: 88 @@ -1374,35 +1014,29 @@ Conditionally jump to a location in the bytecode [![](/img/protocol-specs/public-vm/bit-formats/JUMPI.png)](/img/protocol-specs/public-vm/bit-formats/JUMPI.png) ### `INTERNALCALL` - Make an internal call. Push the current PC to the internal call stack and jump to the target location. [See in table.](#isa-table-internalcall) -- **Opcode**: 0x1e +- **Opcode**: 0x1d - **Category**: Machine State - Control Flow -- **Args**: - - **loc**: target location to jump/call to -- **Expression**: - {" "} - {" "} - {" "} - - {`context.machineState.internalCallStack.push(context.machineState.pc) +- **Args**: + - **loc**: target location to jump/call to +- **Expression**: + +{`context.machineState.internalCallStack.push(context.machineState.pc) context.machineState.pc = loc`} - + - **Details**: Target location is an immediate value (a constant in the bytecode). - **Bit-size**: 48 -[![](/img/protocol-specs/public-vm/bit-formats/INTERNALCALL.png)](/img/protocol-specs/public-vm/bit-formats/INTERNALCALL.png) ### `INTERNALRETURN` - Return from an internal call. Pop from the internal call stack and jump to the popped location. [See in table.](#isa-table-internalreturn) -- **Opcode**: 0x1f +- **Opcode**: 0x1e - **Category**: Machine State - Control Flow - **Expression**: `context.machineState.pc = context.machineState.internalCallStack.pop()` - **Bit-size**: 16 @@ -1410,19 +1044,18 @@ Return from an internal call. Pop from the internal call stack and jump to the p [![](/img/protocol-specs/public-vm/bit-formats/INTERNALRETURN.png)](/img/protocol-specs/public-vm/bit-formats/INTERNALRETURN.png) ### `SET` - Set a memory word from a constant in the bytecode [See in table.](#isa-table-set) -- **Opcode**: 0x20 +- **Opcode**: 0x1f - **Category**: Machine State - Memory -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [type/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for SET. -- **Args**: - - **const**: an N-bit constant value from the bytecode to store in memory (any type except `field`) - - **dstOffset**: memory offset specifying where to store the constant +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. + - **inTag**: The [type/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for SET. +- **Args**: + - **const**: an N-bit constant value from the bytecode to store in memory (any type except `field`) + - **dstOffset**: memory offset specifying where to store the constant - **Expression**: `M[dstOffset] = const` - **Details**: Set memory word at `dstOffset` to `const`'s immediate value. `const`'s bit-size (N) can be 8, 16, 32, 64, or 128 based on `inTag`. It _cannot be 254 (`field` type)_! - **Tag updates**: `T[dstOffset] = inTag` @@ -1431,18 +1064,17 @@ Set a memory word from a constant in the bytecode [![](/img/protocol-specs/public-vm/bit-formats/SET.png)](/img/protocol-specs/public-vm/bit-formats/SET.png) ### `MOV` - Move a word from source memory location to destination [See in table.](#isa-table-mov) -- **Opcode**: 0x21 +- **Opcode**: 0x20 - **Category**: Machine State - Memory -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **srcOffset**: memory offset of word to move - - **dstOffset**: memory offset specifying where to store that word +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **srcOffset**: memory offset of word to move + - **dstOffset**: memory offset specifying where to store that word - **Expression**: `M[dstOffset] = M[srcOffset]` - **Tag updates**: `T[dstOffset] = T[srcOffset]` - **Bit-size**: 88 @@ -1450,20 +1082,19 @@ Move a word from source memory location to destination [![](/img/protocol-specs/public-vm/bit-formats/MOV.png)](/img/protocol-specs/public-vm/bit-formats/MOV.png) ### `CMOV` - Move a word (conditionally chosen) from one memory location to another (`d \= cond \> 0 ? a : b`) [See in table.](#isa-table-cmov) -- **Opcode**: 0x22 +- **Opcode**: 0x21 - **Category**: Machine State - Memory -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **aOffset**: memory offset of word 'a' to conditionally move - - **bOffset**: memory offset of word 'b' to conditionally move - - **condOffset**: memory offset of the operations 'conditional' input - - **dstOffset**: memory offset specifying where to store operation's result +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **aOffset**: memory offset of word 'a' to conditionally move + - **bOffset**: memory offset of word 'b' to conditionally move + - **condOffset**: memory offset of the operations 'conditional' input + - **dstOffset**: memory offset specifying where to store operation's result - **Expression**: `M[dstOffset] = M[condOffset] > 0 ? M[aOffset] : M[bOffset]` - **Details**: One of two source memory locations is chosen based on the condition. `T[condOffset]` is not checked because the greater-than-zero suboperation is the same regardless of type. - **Tag updates**: `T[dstOffset] = M[condOffset] > 0 ? T[aOffset] : T[bOffset]` @@ -1472,26 +1103,24 @@ Move a word (conditionally chosen) from one memory location to another (`d \= co [![](/img/protocol-specs/public-vm/bit-formats/CMOV.png)](/img/protocol-specs/public-vm/bit-formats/CMOV.png) ### `SLOAD` - Load a word from this contract's persistent public storage. Zero is loaded for unwritten slots. [See in table.](#isa-table-sload) -- **Opcode**: 0x23 +- **Opcode**: 0x22 - **Category**: World State - Public Storage -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **slotOffset**: memory offset of the storage slot to load from - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: - {`M[dstOffset] = S[M[slotOffset]]`} -- **Details**: - {" "} - {" "} - {" "} - - {`// Expression is shorthand for +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **slotOffset**: memory offset of the storage slot to load from + - **dstOffset**: memory offset specifying where to store operation's result +- **Expression**: + +{`M[dstOffset] = S[M[slotOffset]]`} + +- **Details**: + +{`// Expression is shorthand for leafIndex = hash(context.environment.address, M[slotOffset]) exists = context.worldState.publicStorage.has(leafIndex) // exists == previously-written if exists: @@ -1499,13 +1128,10 @@ if exists: else: value = 0 M[dstOffset] = value`} - -- **World State access tracing**: - {" "} - {" "} - {" "} - - {`context.worldStateAccessTrace.publicStorageReads.append( + +- **World State access tracing**: + +{`context.worldStateAccessTrace.publicStorageReads.append( TracedStorageRead { callPointer: context.environment.callPointer, slot: M[slotOffset], @@ -1514,7 +1140,7 @@ M[dstOffset] = value`} counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Storage slot siloing (hash with contract address), public data tree membership check - **Tag updates**: `T[dstOffset] = field` - **Bit-size**: 88 @@ -1522,37 +1148,32 @@ M[dstOffset] = value`} [![](/img/protocol-specs/public-vm/bit-formats/SLOAD.png)](/img/protocol-specs/public-vm/bit-formats/SLOAD.png) ### `SSTORE` - Write a word to this contract's persistent public storage [See in table.](#isa-table-sstore) -- **Opcode**: 0x24 +- **Opcode**: 0x23 - **Category**: World State - Public Storage -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **srcOffset**: memory offset of the word to store - - **slotOffset**: memory offset containing the storage slot to store to -- **Expression**: - {`S[M[slotOffset]] = M[srcOffset]`} -- **Details**: - {" "} - {" "} - {" "} - - {`// Expression is shorthand for +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **srcOffset**: memory offset of the word to store + - **slotOffset**: memory offset containing the storage slot to store to +- **Expression**: + +{`S[M[slotOffset]] = M[srcOffset]`} + +- **Details**: + +{`// Expression is shorthand for context.worldState.publicStorage.set({ leafIndex: hash(context.environment.address, M[slotOffset]), leaf: M[srcOffset], })`} - -- **World State access tracing**: - {" "} - {" "} - {" "} - - {`context.worldStateAccessTrace.publicStorageWrites.append( + +- **World State access tracing**: + +{`context.worldStateAccessTrace.publicStorageWrites.append( TracedStorageWrite { callPointer: context.environment.callPointer, slot: M[slotOffset], @@ -1560,43 +1181,36 @@ context.worldState.publicStorage.set({ counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Storage slot siloing (hash with contract address), public data tree update - **Bit-size**: 88 [![](/img/protocol-specs/public-vm/bit-formats/SSTORE.png)](/img/protocol-specs/public-vm/bit-formats/SSTORE.png) ### `NOTEHASHEXISTS` - Check whether a note hash exists in the note hash tree (as of the start of the current block) [See in table.](#isa-table-notehashexists) -- **Opcode**: 0x25 +- **Opcode**: 0x24 - **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **noteHashOffset**: memory offset of the note hash - - **leafIndexOffset**: memory offset of the leaf index - - **existsOffset**: memory offset specifying where to store operation's result (whether the note hash leaf exists) -- **Expression**: - {" "} - {" "} - {" "} - - {`exists = context.worldState.noteHashes.has({ +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **noteHashOffset**: memory offset of the note hash + - **leafIndexOffset**: memory offset of the leaf index + - **existsOffset**: memory offset specifying where to store operation's result (whether the note hash leaf exists) +- **Expression**: + +{`exists = context.worldState.noteHashes.has({ leafIndex: M[leafIndexOffset] leaf: hash(context.environment.address, M[noteHashOffset]), }) M[existsOffset] = exists`} - -- **World State access tracing**: - {" "} - {" "} - {" "} - - {`context.worldStateAccessTrace.noteHashChecks.append( + +- **World State access tracing**: + +{`context.worldStateAccessTrace.noteHashChecks.append( TracedNoteHashCheck { callPointer: context.environment.callPointer, leafIndex: M[leafIndexOffset] @@ -1605,80 +1219,67 @@ M[existsOffset] = exists`} counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Note hash siloing (hash with storage contract address), note hash tree membership check - **Tag updates**: `T[existsOffset] = u8` - **Bit-size**: 120 -### `EMITNOTEHASH` +### `EMITNOTEHASH` Emit a new note hash to be inserted into the note hash tree [See in table.](#isa-table-emitnotehash) -- **Opcode**: 0x26 +- **Opcode**: 0x25 - **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **noteHashOffset**: memory offset of the note hash -- **Expression**: - {" "} - {" "} - {" "} - - {`context.worldState.noteHashes.append( +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **noteHashOffset**: memory offset of the note hash +- **Expression**: + +{`context.worldState.noteHashes.append( hash(context.environment.address, M[noteHashOffset]) )`} - -- **World State access tracing**: - {" "} - {" "} - {" "} - - {`context.worldStateAccessTrace.noteHashes.append( + +- **World State access tracing**: + +{`context.worldStateAccessTrace.noteHashes.append( TracedNoteHash { callPointer: context.environment.callPointer, noteHash: M[noteHashOffset], // unsiloed note hash counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Note hash siloing (hash with contract address), note hash tree insertion. - **Bit-size**: 56 [![](/img/protocol-specs/public-vm/bit-formats/EMITNOTEHASH.png)](/img/protocol-specs/public-vm/bit-formats/EMITNOTEHASH.png) ### `NULLIFIEREXISTS` - Check whether a nullifier exists in the nullifier tree (including nullifiers from earlier in the current transaction or from earlier in the current block) [See in table.](#isa-table-nullifierexists) -- **Opcode**: 0x27 +- **Opcode**: 0x26 - **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **nullifierOffset**: memory offset of the unsiloed nullifier - - **addressOffset**: memory offset of the storage address - - **existsOffset**: memory offset specifying where to store operation's result (whether the nullifier exists) -- **Expression**: - {" "} - {" "} - {" "} - - {`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **nullifierOffset**: memory offset of the unsiloed nullifier + - **addressOffset**: memory offset of the storage address + - **existsOffset**: memory offset specifying where to store operation's result (whether the nullifier exists) +- **Expression**: + +{`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( hash(M[addressOffset], M[nullifierOffset]) ) M[existsOffset] = exists`} - -- **World State access tracing**: - {" "} - {" "} - {" "} - - {`context.worldStateAccessTrace.nullifierChecks.append( + +- **World State access tracing**: + +{`context.worldStateAccessTrace.nullifierChecks.append( TracedNullifierCheck { callPointer: context.environment.callPointer, nullifier: M[nullifierOffset], @@ -1687,80 +1288,67 @@ M[existsOffset] = exists`} counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Nullifier siloing (hash with storage contract address), nullifier tree membership check - **Tag updates**: `T[existsOffset] = u8` - **Bit-size**: 120 -### `EMITNULLIFIER` +### `EMITNULLIFIER` Emit a new nullifier to be inserted into the nullifier tree [See in table.](#isa-table-emitnullifier) -- **Opcode**: 0x28 +- **Opcode**: 0x27 - **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **nullifierOffset**: memory offset of nullifier -- **Expression**: - {" "} - {" "} - {" "} - - {`context.worldState.nullifiers.append( +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **nullifierOffset**: memory offset of nullifier +- **Expression**: + +{`context.worldState.nullifiers.append( hash(context.environment.address, M[nullifierOffset]) )`} - -- **World State access tracing**: - {" "} - {" "} - {" "} - - {`context.worldStateAccessTrace.nullifiers.append( + +- **World State access tracing**: + +{`context.worldStateAccessTrace.nullifiers.append( TracedNullifier { callPointer: context.environment.callPointer, nullifier: M[nullifierOffset], // unsiloed nullifier counter: ++context.worldStateAccessTrace.accessCounter, } )`} - + - **Triggers downstream circuit operations**: Nullifier siloing (hash with contract address), nullifier tree non-membership-check and insertion. - **Bit-size**: 56 [![](/img/protocol-specs/public-vm/bit-formats/EMITNULLIFIER.png)](/img/protocol-specs/public-vm/bit-formats/EMITNULLIFIER.png) ### `L1TOL2MSGEXISTS` - Check if a message exists in the L1-to-L2 message tree [See in table.](#isa-table-l1tol2msgexists) -- **Opcode**: 0x29 +- **Opcode**: 0x28 - **Category**: World State - Messaging -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **msgHashOffset**: memory offset of the message hash - - **msgLeafIndexOffset**: memory offset of the message's leaf index in the L1-to-L2 message tree - - **existsOffset**: memory offset specifying where to store operation's result (whether the message exists in the L1-to-L2 message tree) -- **Expression**: - {" "} - {" "} - {" "} - - {`exists = context.worldState.l1ToL2Messages.has({ +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **msgHashOffset**: memory offset of the message hash + - **msgLeafIndexOffset**: memory offset of the message's leaf index in the L1-to-L2 message tree + - **existsOffset**: memory offset specifying where to store operation's result (whether the message exists in the L1-to-L2 message tree) +- **Expression**: + +{`exists = context.worldState.l1ToL2Messages.has({ leafIndex: M[msgLeafIndexOffset], leaf: M[msgHashOffset] }) M[existsOffset] = exists`} - -- **World State access tracing**: - {" "} - {" "} - {" "} - - {`context.worldStateAccessTrace.l1ToL2MessagesChecks.append( + +- **World State access tracing**: + +{`context.worldStateAccessTrace.l1ToL2MessagesChecks.append( L1ToL2Message { callPointer: context.environment.callPointer, leafIndex: M[msgLeafIndexOffset], @@ -1768,31 +1356,30 @@ M[existsOffset] = exists`} exists: exists, // defined above } )`} - + - **Triggers downstream circuit operations**: L1-to-L2 message tree membership check -- **Tag updates**: - {`T[existsOffset] = u8,`} +- **Tag updates**: + +{`T[existsOffset] = u8,`} + - **Bit-size**: 120 -### `GETCONTRACTINSTANCE` +### `GETCONTRACTINSTANCE` Copies contract instance data to memory [See in table.](#isa-table-getcontractinstance) -- **Opcode**: 0x2a +- **Opcode**: 0x29 - **Category**: Other -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **addressOffset**: memory offset of the contract instance address - - **dstOffset**: location to write the contract instance information to -- **Expression**: - {" "} - {" "} - {" "} - - {`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **addressOffset**: memory offset of the contract instance address + - **dstOffset**: location to write the contract instance information to +- **Expression**: + +{`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ instance_found_in_address, instance.salt ?? 0, instance.deployer ?? 0, @@ -1801,95 +1388,84 @@ Copies contract instance data to memory instance.portalContractAddress ?? 0, instance.publicKeysHash ?? 0, ]`} - + - **Additional AVM circuit checks**: TO-DO - **Triggers downstream circuit operations**: TO-DO - **Tag updates**: T[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = field - **Bit-size**: 88 -### `EMITUNENCRYPTEDLOG` +### `EMITUNENCRYPTEDLOG` Emit an unencrypted log [See in table.](#isa-table-emitunencryptedlog) -- **Opcode**: 0x2b +- **Opcode**: 0x2a - **Category**: Accrued Substate - Logging -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **logOffset**: memory offset of the data to log - - **logSizeOffset**: memory offset to number of words to log -- **Expression**: - {" "} - {" "} - {" "} - - {`context.accruedSubstate.unencryptedLogs.append( +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **logOffset**: memory offset of the data to log + - **logSizeOffset**: memory offset to number of words to log +- **Expression**: + +{`context.accruedSubstate.unencryptedLogs.append( UnencryptedLog { address: context.environment.address, log: M[logOffset:logOffset+M[logSizeOffset]], } )`} - + - **Bit-size**: 88 [![](/img/protocol-specs/public-vm/bit-formats/EMITUNENCRYPTEDLOG.png)](/img/protocol-specs/public-vm/bit-formats/EMITUNENCRYPTEDLOG.png) ### `SENDL2TOL1MSG` - Send an L2-to-L1 message [See in table.](#isa-table-sendl2tol1msg) -- **Opcode**: 0x2c +- **Opcode**: 0x2b - **Category**: Accrued Substate - Messaging -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **recipientOffset**: memory offset of the message recipient - - **contentOffset**: memory offset of the message content -- **Expression**: - {" "} - {" "} - {" "} - - {`context.accruedSubstate.sentL2ToL1Messages.append( +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **recipientOffset**: memory offset of the message recipient + - **contentOffset**: memory offset of the message content +- **Expression**: + +{`context.accruedSubstate.sentL2ToL1Messages.append( SentL2ToL1Message { address: context.environment.address, recipient: M[recipientOffset], message: M[contentOffset] } )`} - + - **Bit-size**: 88 [![](/img/protocol-specs/public-vm/bit-formats/SENDL2TOL1MSG.png)](/img/protocol-specs/public-vm/bit-formats/SENDL2TOL1MSG.png) ### `CALL` - Call into another contract [See in table.](#isa-table-call) -- **Opcode**: 0x2d +- **Opcode**: 0x2c - **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee - - **addrOffset**: address of the contract to call - - **argsOffset**: memory offset to args (will become the callee's calldata) - - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata - - **retOffset**: destination memory offset specifying where to store the data returned from the callee - - **retSize**: number of words to copy from data returned by callee - - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) -- **Expression**: - {" "} - {" "} - {" "} - - {`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee + - **addrOffset**: address of the contract to call + - **argsOffset**: memory offset to args (will become the callee's calldata) + - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata + - **retOffset**: destination memory offset specifying where to store the data returned from the callee + - **retSize**: number of words to copy from data returned by callee + - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) +- **Expression**: + +{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } chargeGas(context, l2GasCost=M[instr.args.gasOffset], daGasCost=M[instr.args.gasOffset+1]) @@ -1897,53 +1473,46 @@ traceNestedCall(context, instr.args.addrOffset) nestedContext = deriveContext(context, instr.args, isStaticCall=false) execute(nestedContext) updateContextAfterNestedCall(context, instr.args, nestedContext)`} - + - **Details**: Creates a new (nested) execution context and triggers execution within that context. - Execution proceeds in the nested context until it reaches a halt at which point - execution resumes in the current/calling context. - A non-existent contract or one with no code will return success. - ["Nested contract calls"](./nested-calls) provides a full explanation of this - instruction along with the shorthand used in the expression above. - The explanation includes details on charging gas for nested calls, - nested context derivation, world state tracing, and updating the parent context - after the nested call halts. + Execution proceeds in the nested context until it reaches a halt at which point + execution resumes in the current/calling context. + A non-existent contract or one with no code will return success. + ["Nested contract calls"](./nested-calls) provides a full explanation of this + instruction along with the shorthand used in the expression above. + The explanation includes details on charging gas for nested calls, + nested context derivation, world state tracing, and updating the parent context + after the nested call halts. - **Tag checks**: `T[gasOffset] == T[gasOffset+1] == T[gasOffset+2] == u32` -- **Tag updates**: - {" "} - {" "} - {" "} - - {`T[successOffset] = u8 +- **Tag updates**: + +{`T[successOffset] = u8 T[retOffset:retOffset+retSize] = field`} - + - **Bit-size**: 248 [![](/img/protocol-specs/public-vm/bit-formats/CALL.png)](/img/protocol-specs/public-vm/bit-formats/CALL.png) ### `STATICCALL` - Call into another contract, disallowing World State and Accrued Substate modifications [See in table.](#isa-table-staticcall) -- **Opcode**: 0x2e +- **Opcode**: 0x2d - **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee - - **addrOffset**: address of the contract to call - - **argsOffset**: memory offset to args (will become the callee's calldata) - - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata - - **retOffset**: destination memory offset specifying where to store the data returned from the callee - - **retSize**: number of words to copy from data returned by callee - - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) -- **Expression**: - {" "} - {" "} - {" "} - - {`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee + - **addrOffset**: address of the contract to call + - **argsOffset**: memory offset to args (will become the callee's calldata) + - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata + - **retOffset**: destination memory offset specifying where to store the data returned from the callee + - **retSize**: number of words to copy from data returned by callee + - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) +- **Expression**: + +{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } chargeGas(context, l2GasCost=M[instr.args.gasOffset], daGasCost=M[instr.args.gasOffset+1]) @@ -1951,95 +1520,84 @@ traceNestedCall(context, instr.args.addrOffset) nestedContext = deriveContext(context, instr.args, isStaticCall=true execute(nestedContext) updateContextAfterNestedCall(context, instr.args, nestedContext)`} - -- **Details**: Same as `CALL`, but disallows World State and Accrued Substate modifications. - ["Nested contract calls"](./nested-calls) provides a full explanation of this - instruction along with the shorthand used in the expression above. - The explanation includes details on charging gas for nested calls, - nested context derivation, world state tracing, and updating the parent context - after the nested call halts. + +- **Details**: Same as `CALL`, but disallows World State and Accrued Substate modifications. + ["Nested contract calls"](./nested-calls) provides a full explanation of this + instruction along with the shorthand used in the expression above. + The explanation includes details on charging gas for nested calls, + nested context derivation, world state tracing, and updating the parent context + after the nested call halts. - **Tag checks**: `T[gasOffset] == T[gasOffset+1] == T[gasOffset+2] == u32` -- **Tag updates**: - {" "} - {" "} - {" "} - - {`T[successOffset] = u8 +- **Tag updates**: + +{`T[successOffset] = u8 T[retOffset:retOffset+retSize] = field`} - + - **Bit-size**: 248 [![](/img/protocol-specs/public-vm/bit-formats/STATICCALL.png)](/img/protocol-specs/public-vm/bit-formats/STATICCALL.png) ### `RETURN` - Halt execution within this context (without revert), optionally returning some data [See in table.](#isa-table-return) -- **Opcode**: 0x2f +- **Opcode**: 0x2e - **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **retOffset**: memory offset of first word to return - - **retSize**: number of words to return -- **Expression**: - {" "} - {" "} - {" "} - - {`context.contractCallResults.output = M[retOffset:retOffset+retSize] +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **retOffset**: memory offset of first word to return + - **retSize**: number of words to return +- **Expression**: + +{`context.contractCallResults.output = M[retOffset:retOffset+retSize] halt`} - + - **Details**: Return control flow to the calling context/contract. Caller will accept World State and Accrued Substate modifications. See ["Halting"](./execution#halting) to learn more. See ["Nested contract calls"](./nested-calls) to see how the caller updates its context after the nested call halts. - **Bit-size**: 88 [![](/img/protocol-specs/public-vm/bit-formats/RETURN.png)](/img/protocol-specs/public-vm/bit-formats/RETURN.png) ### `REVERT` - Halt execution within this context as `reverted`, optionally returning some data [See in table.](#isa-table-revert) -- **Opcode**: 0x30 +- **Opcode**: 0x2f - **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **retOffset**: memory offset of first word to return - - **retSize**: number of words to return -- **Expression**: - {" "} - {" "} - {" "} - - {`context.contractCallResults.output = M[retOffset:retOffset+retSize] +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **retOffset**: memory offset of first word to return + - **retSize**: number of words to return +- **Expression**: + +{`context.contractCallResults.output = M[retOffset:retOffset+retSize] context.contractCallResults.reverted = true halt`} - + - **Details**: Return control flow to the calling context/contract. Caller will reject World State and Accrued Substate modifications. See ["Halting"](./execution#halting) to learn more. See ["Nested contract calls"](./nested-calls) to see how the caller updates its context after the nested call halts. - **Bit-size**: 88 [![](/img/protocol-specs/public-vm/bit-formats/REVERT.png)](/img/protocol-specs/public-vm/bit-formats/REVERT.png) ### `TORADIXLE` - Convert a word to an array of limbs in little-endian radix form [See in table.](#isa-table-to_radix_le) -- **Opcode**: 0x31 +- **Opcode**: 0x30 - **Category**: Conversions -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **srcOffset**: memory offset of word to convert. - - **dstOffset**: memory offset specifying where the first limb of the radix-conversion result is stored. - - **radix**: the maximum bit-size of each limb. - - **numLimbs**: the number of limbs the word will be converted into. +- **Flags**: + - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. +- **Args**: + - **srcOffset**: memory offset of word to convert. + - **dstOffset**: memory offset specifying where the first limb of the radix-conversion result is stored. + - **radix**: the maximum bit-size of each limb. + - **numLimbs**: the number of limbs the word will be converted into. - **Expression**: TBD: Storage of limbs and if T[dstOffset] is constrained to U8 - **Details**: The limbs will be stored in a contiguous memory block starting at `dstOffset`. - **Tag checks**: `T[srcOffset] == field` - **Bit-size**: 152 + diff --git a/docs/docs/reference/developer_references/cli_wallet_reference.md b/docs/docs/reference/developer_references/cli_wallet_reference.md index f19293d8648..2d8fc65a8e6 100644 --- a/docs/docs/reference/developer_references/cli_wallet_reference.md +++ b/docs/docs/reference/developer_references/cli_wallet_reference.md @@ -9,7 +9,7 @@ For development, it may be useful to deploy, transact, or create notes in a non- - Deploying contracts - Sending transactions -- Bridging L1 [Fee Juice](../../protocol-specs/gas-and-fees/fee-juice.md) into Aztec +- Bridging L1 "Fee Juice" into Aztec - Pushing arbitrary [notes](../../guides/developer_guides/smart_contracts/writing_contracts/notes/index.md) to your PXE - Creating [authwits](../../guides/developer_guides/smart_contracts/writing_contracts/authwit.md) - Aliasing info and secrets for further usage @@ -144,7 +144,7 @@ aztec-wallet simulate --profile --from master_yoda --contract-address jedi_order ### Bridge Fee Juice -The wallet provides an easy way to mint the fee-paying asset on L1 and bridging it to L2. We call it Fee Juice and you can read more about it in the [protocol specs](../../protocol-specs/gas-and-fees/fee-juice.md). +The wallet provides an easy way to mint the fee-paying asset on L1 and bridging it to L2. Current placeholder-name "fee juice". Using the sandbox, there's already a Fee Juice contract that manages this enshrined asset. You can optionally mint more Juice before bridging it. diff --git a/docs/docs/reference/developer_references/smart_contract_reference/macros.md b/docs/docs/reference/developer_references/smart_contract_reference/macros.md index edf3adc8442..cabe9000e99 100644 --- a/docs/docs/reference/developer_references/smart_contract_reference/macros.md +++ b/docs/docs/reference/developer_references/smart_contract_reference/macros.md @@ -13,7 +13,7 @@ It is also worth mentioning Noir's `unconstrained` function type [here (Noir doc - `#[public]` or `#[private]` - Whether the function is to be executed from a public or private context (see Further Reading) - `#[initializer]` - If one or more functions are marked as an initializer, then one of them must be called before any non-initializer functions - `#[noinitcheck]` - The function is able to be called before an initializer (if one exists) -- `#[view]` - Makes calls to the function static (see also [Static calls in the protocol spec](../../../protocol-specs/calls/static-calls.md)) +- `#[view]` - Makes calls to the function static - `#[internal]` - Function can only be called from within the contract - `#[note]` - Creates a custom note - `#[storage]` - Defines contract storage diff --git a/docs/docs/tutorials/codealong/contract_tutorials/token_bridge/4_typescript_glue_code.md b/docs/docs/tutorials/codealong/contract_tutorials/token_bridge/4_typescript_glue_code.md index cf7a02878be..4020d5f6df8 100644 --- a/docs/docs/tutorials/codealong/contract_tutorials/token_bridge/4_typescript_glue_code.md +++ b/docs/docs/tutorials/codealong/contract_tutorials/token_bridge/4_typescript_glue_code.md @@ -171,5 +171,4 @@ Follow the tutorial [here](../../js_tutorials/aztecjs-getting-started.md). ### Optional: Learn more about concepts mentioned here -- [Portals (protocol specs)](../../../../protocol-specs/l1-smart-contracts/index.md#portals) - [Functions under the hood (concepts)](../../../../aztec/smart_contracts/functions/function_transforms.md) diff --git a/docs/docs/tutorials/codealong/contract_tutorials/token_bridge/index.md b/docs/docs/tutorials/codealong/contract_tutorials/token_bridge/index.md index 2853f11bf5a..b853430a2a1 100644 --- a/docs/docs/tutorials/codealong/contract_tutorials/token_bridge/index.md +++ b/docs/docs/tutorials/codealong/contract_tutorials/token_bridge/index.md @@ -5,7 +5,7 @@ sidebar_position: 6 import Image from "@theme/IdealImage"; -In this tutorial, we will learn how to build the entire flow of a cross-chain token using portals. If this is your first time hearing the word portal, you’ll want to read [this page in the protocol specs](../../../../protocol-specs/l1-smart-contracts/index.md). +In this tutorial, we will learn how to build the entire flow of a cross-chain token using portals. ## A refresher on Portals diff --git a/docs/docs/tutorials/codealong/contract_tutorials/write_accounts_contract.md b/docs/docs/tutorials/codealong/contract_tutorials/write_accounts_contract.md index 4f9c242c993..43cd5b5902f 100644 --- a/docs/docs/tutorials/codealong/contract_tutorials/write_accounts_contract.md +++ b/docs/docs/tutorials/codealong/contract_tutorials/write_accounts_contract.md @@ -115,4 +115,3 @@ Lo and behold, we get `Error: Assertion failed: 'verification == true'` when run - [Schnorr signer account contract (GitHub link)](https://github.com/AztecProtocol/aztec-packages/tree/#include_aztec_version/noir-projects/noir-contracts/contracts/schnorr_account_contract) - [Account abstraction](../../../aztec/concepts/accounts/index.md#what-is-account-abstraction) - [Authentication witness](../../../aztec/concepts/accounts/authwit.md) -- [Fee abstraction](../../../protocol-specs/gas-and-fees/tx-setup-and-teardown.md). diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 3c480ffaba6..df9dff30a4d 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -292,12 +292,6 @@ const config = { label: "Aztec Connect Sunset", className: "no-external-icon", }, - { - type: "docSidebar", - sidebarId: "protocolSpecSidebar", - label: "Protocol Specification", - className: "no-external-icon", - }, { type: "docSidebar", sidebarId: "roadmapSidebar", diff --git a/docs/sidebars.js b/docs/sidebars.js index 673ca9602fa..3c6fd4f846d 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -68,9 +68,9 @@ export default { guidesSidebar: [ { - type: "doc", - id: "guides/index", - label: "Guides and Tutorials", + type: "doc", + id: "guides/index", + label: "Guides and Tutorials", }, { type: "html", @@ -80,7 +80,7 @@ export default { { type: "doc", label: "Quickstart", - id: "guides/getting_started" + id: "guides/getting_started" }, { type: "html", @@ -121,7 +121,7 @@ export default { type: "html", value: '', }, - ], + ], referenceSidebar: [ { @@ -150,7 +150,7 @@ export default { { type: "doc", label: "Privacy Considerations", - id: "guides/privacy_considerations" + id: "guides/privacy_considerations" }, { type: "html", @@ -160,7 +160,7 @@ export default { type: "doc", id: "aztec_connect_sunset", }, - ], + ], roadmapSidebar: [ { @@ -168,224 +168,4 @@ export default { dirName: "aztec/roadmap", }, ], - protocolSpecSidebar: [ - "protocol-specs/intro", - { - label: "Cryptography", - type: "category", - link: { type: "doc", id: "protocol-specs/cryptography/index" }, - items: [ - { - label: "Proving System", - type: "category", - items: [ - "protocol-specs/cryptography/proving-system/performance-targets", - "protocol-specs/cryptography/proving-system/overview", - "protocol-specs/cryptography/proving-system/data-bus", - ], - }, - { - label: "Hashing", - type: "category", - items: [ - "protocol-specs/cryptography/hashing/hashing", - "protocol-specs/cryptography/hashing/poseidon2", - "protocol-specs/cryptography/hashing/pedersen", - ], - }, - "protocol-specs/cryptography/merkle-trees", - ], - }, - { - label: "Addresses & Keys", - type: "category", - link: { type: "doc", id: "protocol-specs/addresses-and-keys/index" }, - items: [ - "protocol-specs/addresses-and-keys/address", - "protocol-specs/addresses-and-keys/keys-requirements", - "protocol-specs/addresses-and-keys/keys", - { - label: "Example Usage of Keys", - type: "category", - items: [ - "protocol-specs/addresses-and-keys/example-usage/nullifier", - "protocol-specs/addresses-and-keys/example-usage/diversified-and-stealth-keys", - "protocol-specs/addresses-and-keys/example-usage/tag-sequence-derivation", - "protocol-specs/addresses-and-keys/example-usage/encrypt-and-tag", - ], - }, - "protocol-specs/addresses-and-keys/precompiles", - "protocol-specs/addresses-and-keys/diversified-and-stealth", - ], - }, - { - label: "State", - type: "category", - link: { type: "doc", id: "protocol-specs/state/index" }, - items: [ - "protocol-specs/state/tree-implementations", - "protocol-specs/state/archive", - "protocol-specs/state/note-hash-tree", - "protocol-specs/state/nullifier-tree", - "protocol-specs/state/public-data-tree", - "protocol-specs/state/wonky-tree", - ], - }, - { - label: "Transactions", - type: "category", - link: { type: "doc", id: "protocol-specs/transactions/index" }, - items: [ - "protocol-specs/transactions/local-execution", - "protocol-specs/transactions/public-execution", - "protocol-specs/transactions/tx-object", - "protocol-specs/transactions/validity", - ], - }, - { - label: "Bytecode", - type: "category", - link: { type: "doc", id: "protocol-specs/bytecode/index" }, - items: [], - }, - { - label: "Contract Deployment", - type: "category", - link: { type: "doc", id: "protocol-specs/contract-deployment/index" }, - items: [ - "protocol-specs/contract-deployment/classes", - "protocol-specs/contract-deployment/instances", - ], - }, - { - label: "Calls", - type: "category", - link: { type: "doc", id: "protocol-specs/calls/index" }, - items: [ - "protocol-specs/calls/sync-calls", - "protocol-specs/calls/enqueued-calls", - "protocol-specs/calls/batched-calls", - "protocol-specs/calls/static-calls", - "protocol-specs/calls/unconstrained-calls", - "protocol-specs/calls/public-private-messaging", - ], - }, - { - label: "L1 smart contracts", - type: "category", - link: { type: "doc", id: "protocol-specs/l1-smart-contracts/index" }, - items: ["protocol-specs/l1-smart-contracts/frontier"], - }, - { - label: "Data availability", - type: "category", - link: { - type: "doc", - id: "protocol-specs/data-publication-and-availability/index", - }, - items: [ - "protocol-specs/data-publication-and-availability/overview", - "protocol-specs/data-publication-and-availability/published-data", - ], - }, - { - label: "Logs", - type: "category", - link: { type: "doc", id: "protocol-specs/logs/index" }, - items: [], - }, - { - label: "Pre-compiled Contracts", - type: "category", - link: { type: "doc", id: "protocol-specs/pre-compiled-contracts/index" }, - items: ["protocol-specs/pre-compiled-contracts/registry"], - }, - { - label: "Private Message Delivery", - type: "category", - link: { - type: "doc", - id: "protocol-specs/private-message-delivery/index", - }, - items: [ - "protocol-specs/private-message-delivery/private-msg-delivery", // renamed to avoid routing problems - "protocol-specs/private-message-delivery/send-note-guidelines", - ], - }, - { - label: "Gas & Fees", - type: "category", - link: { type: "doc", id: "protocol-specs/gas-and-fees/index" }, - items: [ - "protocol-specs/gas-and-fees/fee-juice", - "protocol-specs/gas-and-fees/specifying-gas-fee-info", - "protocol-specs/gas-and-fees/tx-setup-and-teardown", - "protocol-specs/gas-and-fees/kernel-tracking", - "protocol-specs/gas-and-fees/fee-schedule", - "protocol-specs/gas-and-fees/published-gas-and-fee-data", - ], - }, - { - label: "Decentralization", - type: "category", - items: [ - "protocol-specs/decentralization/actors", - "protocol-specs/decentralization/governance", - "protocol-specs/decentralization/block-production", - "protocol-specs/decentralization/p2p-network", - ], - }, - { - label: "Circuits", - type: "category", - link: { type: "doc", id: "protocol-specs/circuits/high-level-topology" }, - items: [ - "protocol-specs/circuits/private-function", - "protocol-specs/circuits/private-kernel-initial", - "protocol-specs/circuits/private-kernel-inner", - "protocol-specs/circuits/private-kernel-reset", - "protocol-specs/circuits/private-kernel-tail", - "protocol-specs/circuits/public-kernel-initial", - "protocol-specs/circuits/public-kernel-inner", - "protocol-specs/circuits/public-kernel-tail", - ], - }, - { - label: "Rollup Circuits", - type: "category", - link: { type: "doc", id: "protocol-specs/rollup-circuits/index" }, - items: [ - "protocol-specs/rollup-circuits/base-rollup", - "protocol-specs/rollup-circuits/merge-rollup", - "protocol-specs/rollup-circuits/tree-parity", - "protocol-specs/rollup-circuits/root-rollup", - ], - }, - { - label: "Aztec (Public) VM", - type: "category", - link: { type: "doc", id: "protocol-specs/public-vm/index" }, - items: [ - "protocol-specs/public-vm/intro", - "protocol-specs/public-vm/state", - "protocol-specs/public-vm/memory-model", - "protocol-specs/public-vm/context", - "protocol-specs/public-vm/execution", - "protocol-specs/public-vm/nested-calls", - "protocol-specs/public-vm/instruction-set", - { - label: "AVM Circuit", - type: "category", - link: { type: "doc", id: "protocol-specs/public-vm/circuit-index" }, - items: [ - "protocol-specs/public-vm/avm-circuit", - "protocol-specs/public-vm/control-flow", - "protocol-specs/public-vm/alu", - "protocol-specs/public-vm/bytecode-validation-circuit", - ], - }, - "protocol-specs/public-vm/type-structs", - ], - }, - ], }; diff --git a/l1-contracts/bootstrap.sh b/l1-contracts/bootstrap.sh index ee2d2c69c84..3f2ee1f6b52 100755 --- a/l1-contracts/bootstrap.sh +++ b/l1-contracts/bootstrap.sh @@ -29,14 +29,14 @@ function build { function test { set -eu local test_flag=l1-contracts-test-$hash - if test_should_run $test_flag; then - github_group "l1-contracts test" - solhint --config ./.solhint.json "src/**/*.sol" - forge fmt --check - forge test --no-match-contract UniswapPortalTest - cache_upload_flag $test_flag - github_endgroup - fi + test_should_run $test_flag || return 0 + + github_group "l1-contracts test" + solhint --config ./.solhint.json "src/**/*.sol" + forge fmt --check + forge test --no-match-contract UniswapPortalTest + cache_upload_flag $test_flag + github_endgroup } export -f test @@ -50,6 +50,9 @@ case "$cmd" in "test") test ;; + "test-cmds") + echo "cd l1-contracts && forge test --no-match-contract UniswapPortalTest" + ;; "ci") build denoise test diff --git a/l1-contracts/src/core/Leonidas.sol b/l1-contracts/src/core/Leonidas.sol index 77244bec628..213b6da3925 100644 --- a/l1-contracts/src/core/Leonidas.sol +++ b/l1-contracts/src/core/Leonidas.sol @@ -42,13 +42,17 @@ contract Leonidas is Staking, TimeFns, ILeonidas { LeonidasStorage private leonidasStore; constructor( - address _ares, IERC20 _stakingAsset, uint256 _minimumStake, + uint256 _slashingQuorum, + uint256 _roundSize, uint256 _slotDuration, uint256 _epochDuration, uint256 _targetCommitteeSize - ) Staking(_ares, _stakingAsset, _minimumStake) TimeFns(_slotDuration, _epochDuration) { + ) + Staking(_stakingAsset, _minimumStake, _slashingQuorum, _roundSize) + TimeFns(_slotDuration, _epochDuration) + { GENESIS_TIME = Timestamp.wrap(block.timestamp); SLOT_DURATION = _slotDuration; EPOCH_DURATION = _epochDuration; diff --git a/l1-contracts/src/core/Rollup.sol b/l1-contracts/src/core/Rollup.sol index 2e6dedc15b2..531f58186eb 100644 --- a/l1-contracts/src/core/Rollup.sol +++ b/l1-contracts/src/core/Rollup.sol @@ -51,6 +51,8 @@ struct Config { uint256 targetCommitteeSize; uint256 aztecEpochProofClaimWindowInL2Slots; uint256 minimumStake; + uint256 slashingQuorum; + uint256 slashingRoundSize; } /** @@ -110,15 +112,15 @@ contract Rollup is EIP712("Aztec Rollup", "1"), Ownable, Leonidas, IRollup, ITes ) Ownable(_ares) Leonidas( - _ares, _stakingAsset, _config.minimumStake, + _config.slashingQuorum, + _config.slashingRoundSize, _config.aztecSlotDuration, _config.aztecEpochDuration, _config.targetCommitteeSize ) { - rollupStore.epochProofVerifier = new MockVerifier(); FEE_JUICE_PORTAL = _fpcJuicePortal; REWARD_DISTRIBUTOR = _rewardDistributor; ASSET = _fpcJuicePortal.UNDERLYING(); @@ -127,14 +129,16 @@ contract Rollup is EIP712("Aztec Rollup", "1"), Ownable, Leonidas, IRollup, ITes ); INBOX = IInbox(address(new Inbox(address(this), Constants.L1_TO_L2_MSG_SUBTREE_HEIGHT))); OUTBOX = IOutbox(address(new Outbox(address(this)))); - rollupStore.vkTreeRoot = _vkTreeRoot; - rollupStore.protocolContractTreeRoot = _protocolContractTreeRoot; VERSION = 1; L1_BLOCK_AT_GENESIS = block.number; CLAIM_DURATION_IN_L2_SLOTS = _config.aztecEpochProofClaimWindowInL2Slots; IS_FOUNDRY_TEST = VM_ADDRESS.code.length > 0; + rollupStore.epochProofVerifier = new MockVerifier(); + rollupStore.vkTreeRoot = _vkTreeRoot; + rollupStore.protocolContractTreeRoot = _protocolContractTreeRoot; + // Genesis block rollupStore.blocks[0] = BlockLog({ feeHeader: FeeHeader({ diff --git a/l1-contracts/src/core/interfaces/ISlasher.sol b/l1-contracts/src/core/interfaces/ISlasher.sol new file mode 100644 index 00000000000..6ad8c695719 --- /dev/null +++ b/l1-contracts/src/core/interfaces/ISlasher.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Aztec Labs. +pragma solidity >=0.8.27; + +import {IPayload} from "@aztec/governance/interfaces/IPayload.sol"; + +interface ISlasher { + function slash(IPayload _payload) external returns (bool); +} diff --git a/l1-contracts/src/core/staking/Slasher.sol b/l1-contracts/src/core/staking/Slasher.sol new file mode 100644 index 00000000000..39e44791ff2 --- /dev/null +++ b/l1-contracts/src/core/staking/Slasher.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Aztec Labs. +pragma solidity >=0.8.27; + +import {ISlasher} from "@aztec/core/interfaces/ISlasher.sol"; +import {SlashingProposer} from "@aztec/core/staking/SlashingProposer.sol"; +import {IPayload} from "@aztec/governance/interfaces/IPayload.sol"; + +contract Slasher is ISlasher { + SlashingProposer public immutable PROPOSER; + + event SlashFailed(address target, bytes data, bytes returnData); + + error Slasher__CallerNotProposer(address caller, address proposer); // 0x44c1f74f + + constructor(uint256 _n, uint256 _m) { + PROPOSER = new SlashingProposer(msg.sender, this, _n, _m); + } + + function slash(IPayload _payload) external override(ISlasher) returns (bool) { + require( + msg.sender == address(PROPOSER), Slasher__CallerNotProposer(msg.sender, address(PROPOSER)) + ); + + IPayload.Action[] memory actions = _payload.getActions(); + + for (uint256 i = 0; i < actions.length; i++) { + // Allow failure of individual calls but emit the failure! + (bool success, bytes memory returnData) = actions[i].target.call(actions[i].data); + if (!success) { + emit SlashFailed(actions[i].target, actions[i].data, returnData); + } + } + + return true; + } +} diff --git a/l1-contracts/src/core/staking/SlashingProposer.sol b/l1-contracts/src/core/staking/SlashingProposer.sol new file mode 100644 index 00000000000..dfd445af937 --- /dev/null +++ b/l1-contracts/src/core/staking/SlashingProposer.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Aztec Labs. +pragma solidity >=0.8.27; + +import {ISlasher} from "@aztec/core/interfaces/ISlasher.sol"; +import {IGovernanceProposer} from "@aztec/governance/interfaces/IGovernanceProposer.sol"; +import {IPayload} from "@aztec/governance/interfaces/IPayload.sol"; +import {EmpireBase} from "@aztec/governance/proposer/EmpireBase.sol"; + +/** + * @notice A SlashingProposer implementation following the empire model + */ +contract SlashingProposer is IGovernanceProposer, EmpireBase { + address public immutable INSTANCE; + ISlasher public immutable SLASHER; + + constructor(address _instance, ISlasher _slasher, uint256 _slashingQuorum, uint256 _roundSize) + EmpireBase(_slashingQuorum, _roundSize) + { + INSTANCE = _instance; + SLASHER = _slasher; + } + + function getExecutor() public view override(EmpireBase, IGovernanceProposer) returns (address) { + return address(SLASHER); + } + + function getInstance() public view override(EmpireBase, IGovernanceProposer) returns (address) { + return INSTANCE; + } + + function _execute(IPayload _proposal) internal override(EmpireBase) returns (bool) { + return SLASHER.slash(_proposal); + } +} diff --git a/l1-contracts/src/core/staking/Staking.sol b/l1-contracts/src/core/staking/Staking.sol index 0d75e74e1c1..5e928f64c56 100644 --- a/l1-contracts/src/core/staking/Staking.sol +++ b/l1-contracts/src/core/staking/Staking.sol @@ -12,6 +12,7 @@ import { } from "@aztec/core/interfaces/IStaking.sol"; import {Errors} from "@aztec/core/libraries/Errors.sol"; import {Timestamp} from "@aztec/core/libraries/TimeMath.sol"; +import {Slasher} from "@aztec/core/staking/Slasher.sol"; import {IERC20} from "@oz/token/ERC20/IERC20.sol"; import {SafeERC20} from "@oz/token/ERC20/utils/SafeERC20.sol"; import {EnumerableSet} from "@oz/utils/structs/EnumerableSet.sol"; @@ -23,14 +24,19 @@ contract Staking is IStaking { // Constant pulled out of the ass Timestamp public constant EXIT_DELAY = Timestamp.wrap(60 * 60 * 24); - address public immutable SLASHER; + Slasher public immutable SLASHER; IERC20 public immutable STAKING_ASSET; uint256 public immutable MINIMUM_STAKE; StakingStorage internal stakingStore; - constructor(address _slasher, IERC20 _stakingAsset, uint256 _minimumStake) { - SLASHER = _slasher; + constructor( + IERC20 _stakingAsset, + uint256 _minimumStake, + uint256 _slashingQuorum, + uint256 _roundSize + ) { + SLASHER = new Slasher(_slashingQuorum, _roundSize); STAKING_ASSET = _stakingAsset; MINIMUM_STAKE = _minimumStake; } @@ -57,7 +63,9 @@ contract Staking is IStaking { } function slash(address _attester, uint256 _amount) external override(IStaking) { - require(msg.sender == SLASHER, Errors.Staking__NotSlasher(SLASHER, msg.sender)); + require( + msg.sender == address(SLASHER), Errors.Staking__NotSlasher(address(SLASHER), msg.sender) + ); ValidatorInfo storage validator = stakingStore.info[_attester]; require(validator.status != Status.NONE, Errors.Staking__NoOneToSlash(_attester)); diff --git a/l1-contracts/src/governance/CoinIssuer.sol b/l1-contracts/src/governance/CoinIssuer.sol index 37ac8f18b4d..33a0c06df0e 100644 --- a/l1-contracts/src/governance/CoinIssuer.sol +++ b/l1-contracts/src/governance/CoinIssuer.sol @@ -33,7 +33,7 @@ contract CoinIssuer is ICoinIssuer, Ownable { */ function mint(address _to, uint256 _amount) external override(ICoinIssuer) onlyOwner { uint256 maxMint = mintAvailable(); - require(_amount <= maxMint, Errors.CoinIssuer__InssuficientMintAvailable(maxMint, _amount)); + require(_amount <= maxMint, Errors.CoinIssuer__InsufficientMintAvailable(maxMint, _amount)); timeOfLastMint = block.timestamp; ASSET.mint(_to, _amount); } diff --git a/l1-contracts/src/governance/interfaces/IGovernanceProposer.sol b/l1-contracts/src/governance/interfaces/IGovernanceProposer.sol index 7539446a1de..52ac72e8d6f 100644 --- a/l1-contracts/src/governance/interfaces/IGovernanceProposer.sol +++ b/l1-contracts/src/governance/interfaces/IGovernanceProposer.sol @@ -3,19 +3,19 @@ pragma solidity >=0.8.27; import {Slot} from "@aztec/core/libraries/TimeMath.sol"; -import {IGovernance} from "@aztec/governance/interfaces/IGovernance.sol"; import {IPayload} from "@aztec/governance/interfaces/IPayload.sol"; interface IGovernanceProposer { event VoteCast(IPayload indexed proposal, uint256 indexed round, address indexed voter); - event ProposalPushed(IPayload indexed proposal, uint256 indexed round); + event ProposalExecuted(IPayload indexed proposal, uint256 indexed round); - function vote(IPayload _proposa) external returns (bool); - function pushProposal(uint256 _roundNumber) external returns (bool); + function vote(IPayload _proposal) external returns (bool); + function executeProposal(uint256 _roundNumber) external returns (bool); function yeaCount(address _instance, uint256 _round, IPayload _proposal) external view returns (uint256); function computeRound(Slot _slot) external view returns (uint256); - function getGovernance() external view returns (IGovernance); + function getInstance() external view returns (address); + function getExecutor() external view returns (address); } diff --git a/l1-contracts/src/governance/libraries/Errors.sol b/l1-contracts/src/governance/libraries/Errors.sol index fb835660287..b6654440e55 100644 --- a/l1-contracts/src/governance/libraries/Errors.sol +++ b/l1-contracts/src/governance/libraries/Errors.sol @@ -45,20 +45,20 @@ library Errors { error Governance__ProposalLib__ZeroYeaVotesNeeded(); error Governance__ProposalLib__MoreYeaVoteThanExistNeeded(); - error GovernanceProposer__CanOnlyPushProposalInPast(); // 0x49fdf611" - error GovernanceProposer__FailedToPropose(IPayload proposal); // 0x6ca2a2ed - error GovernanceProposer__InstanceHaveNoCode(address instance); // 0x20a3b441 - error GovernanceProposer__InsufficientVotes(); // 0xba1e05ef + error GovernanceProposer__CanOnlyExecuteProposalInPast(); // 0x8bf1d3b8 + error GovernanceProposer__FailedToPropose(IPayload proposal); // 0x8d94fbfc + error GovernanceProposer__InstanceHaveNoCode(address instance); // 0x5fa92625 + error GovernanceProposer__InsufficientVotes(uint256 votesCast, uint256 votesNeeded); // 0xd4ad89c2 error GovernanceProposer__InvalidNAndMValues(uint256 n, uint256 m); // 0x520d9704 error GovernanceProposer__NCannotBeLargerTHanM(uint256 n, uint256 m); // 0x2fdfc063 error GovernanceProposer__OnlyProposerCanVote(address caller, address proposer); // 0xba27df38 error GovernanceProposer__ProposalAlreadyExecuted(uint256 roundNumber); // 0x7aeacb17 - error GovernanceProposer__ProposalCannotBeAddressZero(); // 0xdb3e4b6e - error GovernanceProposer__ProposalHaveNoCode(IPayload proposal); // 0xdce0615b - error GovernanceProposer__ProposalTooOld(uint256 roundNumber, uint256 currentRoundNumber); //0x02283b1a - error GovernanceProposer__VoteAlreadyCastForSlot(Slot slot); //0xc2201452 + error GovernanceProposer__ProposalCannotBeAddressZero(); // 0x16ac1942 + error GovernanceProposer__ProposalHaveNoCode(IPayload proposal); // 0xb69440a1 + error GovernanceProposer__ProposalTooOld(uint256 roundNumber, uint256 currentRoundNumber); // 0xc3d7aa4f + error GovernanceProposer__VoteAlreadyCastForSlot(Slot slot); // 0x3a6150ca - error CoinIssuer__InssuficientMintAvailable(uint256 available, uint256 needed); // 0xf268b931 + error CoinIssuer__InsufficientMintAvailable(uint256 available, uint256 needed); // 0xa1cc8799 error Registry__RollupAlreadyRegistered(address rollup); // 0x3c34eabf error Registry__RollupNotRegistered(address rollup); // 0xa1fee4cf diff --git a/l1-contracts/src/governance/GovernanceProposer.sol b/l1-contracts/src/governance/proposer/EmpireBase.sol similarity index 81% rename from l1-contracts/src/governance/GovernanceProposer.sol rename to l1-contracts/src/governance/proposer/EmpireBase.sol index 7e665ee3aa8..349fa7b880c 100644 --- a/l1-contracts/src/governance/GovernanceProposer.sol +++ b/l1-contracts/src/governance/proposer/EmpireBase.sol @@ -4,10 +4,8 @@ pragma solidity >=0.8.27; import {ILeonidas} from "@aztec/core/interfaces/ILeonidas.sol"; import {Slot, SlotLib} from "@aztec/core/libraries/TimeMath.sol"; -import {IGovernance} from "@aztec/governance/interfaces/IGovernance.sol"; import {IGovernanceProposer} from "@aztec/governance/interfaces/IGovernanceProposer.sol"; import {IPayload} from "@aztec/governance/interfaces/IPayload.sol"; -import {IRegistry} from "@aztec/governance/interfaces/IRegistry.sol"; import {Errors} from "@aztec/governance/libraries/Errors.sol"; /** @@ -17,7 +15,7 @@ import {Errors} from "@aztec/governance/libraries/Errors.sol"; * This also means that the implementation here will need to be "updated" if * the interfaces of the sequencer selection changes, for example going optimistic. */ -contract GovernanceProposer is IGovernanceProposer { +abstract contract EmpireBase is IGovernanceProposer { using SlotLib for Slot; struct RoundAccounting { @@ -29,14 +27,12 @@ contract GovernanceProposer is IGovernanceProposer { uint256 public constant LIFETIME_IN_ROUNDS = 5; - IRegistry public immutable REGISTRY; uint256 public immutable N; uint256 public immutable M; mapping(address instance => mapping(uint256 roundNumber => RoundAccounting)) public rounds; - constructor(IRegistry _registry, uint256 _n, uint256 _m) { - REGISTRY = _registry; + constructor(uint256 _n, uint256 _m) { N = _n; M = _m; @@ -57,11 +53,12 @@ contract GovernanceProposer is IGovernanceProposer { * @return True if executed successfully, false otherwise */ function vote(IPayload _proposal) external override(IGovernanceProposer) returns (bool) { - require( + // For now, skipping this as the check is not really needed but there were not full agreement + /*require( address(_proposal).code.length > 0, Errors.GovernanceProposer__ProposalHaveNoCode(_proposal) - ); + );*/ - address instance = REGISTRY.getRollup(); + address instance = getInstance(); require(instance.code.length > 0, Errors.GovernanceProposer__InstanceHaveNoCode(instance)); ILeonidas selection = ILeonidas(instance); @@ -94,22 +91,26 @@ contract GovernanceProposer is IGovernanceProposer { } /** - * @notice Push the proposal to the appela + * @notice Executes the proposal using the `_execute` function * * @param _roundNumber - The round number to execute * * @return True if executed successfully, false otherwise */ - function pushProposal(uint256 _roundNumber) external override(IGovernanceProposer) returns (bool) { + function executeProposal(uint256 _roundNumber) + external + override(IGovernanceProposer) + returns (bool) + { // Need to ensure that the round is not active. - address instance = REGISTRY.getRollup(); + address instance = getInstance(); require(instance.code.length > 0, Errors.GovernanceProposer__InstanceHaveNoCode(instance)); ILeonidas selection = ILeonidas(instance); Slot currentSlot = selection.getCurrentSlot(); uint256 currentRound = computeRound(currentSlot); - require(_roundNumber < currentRound, Errors.GovernanceProposer__CanOnlyPushProposalInPast()); + require(_roundNumber < currentRound, Errors.GovernanceProposer__CanOnlyExecuteProposalInPast()); require( _roundNumber + LIFETIME_IN_ROUNDS >= currentRound, Errors.GovernanceProposer__ProposalTooOld(_roundNumber, currentRound) @@ -120,16 +121,14 @@ contract GovernanceProposer is IGovernanceProposer { require( round.leader != IPayload(address(0)), Errors.GovernanceProposer__ProposalCannotBeAddressZero() ); - require(round.yeaCount[round.leader] >= N, Errors.GovernanceProposer__InsufficientVotes()); + uint256 votesCast = round.yeaCount[round.leader]; + require(votesCast >= N, Errors.GovernanceProposer__InsufficientVotes(votesCast, N)); round.executed = true; - emit ProposalPushed(round.leader, _roundNumber); + emit ProposalExecuted(round.leader, _roundNumber); - require( - getGovernance().propose(round.leader), - Errors.GovernanceProposer__FailedToPropose(round.leader) - ); + require(_execute(round.leader), Errors.GovernanceProposer__FailedToPropose(round.leader)); return true; } @@ -162,7 +161,8 @@ contract GovernanceProposer is IGovernanceProposer { return _slot.unwrap() / M; } - function getGovernance() public view override(IGovernanceProposer) returns (IGovernance) { - return IGovernance(REGISTRY.getGovernance()); - } + // Virtual functions + function getInstance() public view virtual override(IGovernanceProposer) returns (address); + function getExecutor() public view virtual override(IGovernanceProposer) returns (address); + function _execute(IPayload _proposal) internal virtual returns (bool); } diff --git a/l1-contracts/src/governance/proposer/GovernanceProposer.sol b/l1-contracts/src/governance/proposer/GovernanceProposer.sol new file mode 100644 index 00000000000..734a42172e5 --- /dev/null +++ b/l1-contracts/src/governance/proposer/GovernanceProposer.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Aztec Labs. +pragma solidity >=0.8.27; + +import {IGovernance} from "@aztec/governance/interfaces/IGovernance.sol"; +import {IGovernanceProposer} from "@aztec/governance/interfaces/IGovernanceProposer.sol"; +import {IPayload} from "@aztec/governance/interfaces/IPayload.sol"; +import {IRegistry} from "@aztec/governance/interfaces/IRegistry.sol"; +import {EmpireBase} from "./EmpireBase.sol"; + +/** + * @notice A GovernanceProposer implementation following the empire model + * Beware that while governance generally do not care about the implementation + * this implementation will since it is dependent on the sequencer selection. + * This also means that the implementation here will need to be "updated" if + * the interfaces of the sequencer selection changes, for example going optimistic. + */ +contract GovernanceProposer is IGovernanceProposer, EmpireBase { + IRegistry public immutable REGISTRY; + + constructor(IRegistry _registry, uint256 _n, uint256 _m) EmpireBase(_n, _m) { + REGISTRY = _registry; + } + + function getExecutor() public view override(EmpireBase, IGovernanceProposer) returns (address) { + return REGISTRY.getGovernance(); + } + + function getInstance() public view override(EmpireBase, IGovernanceProposer) returns (address) { + return REGISTRY.getRollup(); + } + + function _execute(IPayload _proposal) internal override(EmpireBase) returns (bool) { + return IGovernance(getExecutor()).propose(_proposal); + } +} diff --git a/l1-contracts/src/periphery/SlashFactory.sol b/l1-contracts/src/periphery/SlashFactory.sol new file mode 100644 index 00000000000..14904c1f62e --- /dev/null +++ b/l1-contracts/src/periphery/SlashFactory.sol @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Aztec Labs. +pragma solidity >=0.8.27; + +import {ILeonidas} from "@aztec/core/interfaces/ILeonidas.sol"; +import {Epoch} from "@aztec/core/libraries/TimeMath.sol"; +import {IPayload} from "@aztec/governance/interfaces/IPayload.sol"; +import {ISlashFactory} from "./interfaces/ISlashFactory.sol"; +import {SlashPayload} from "./SlashPayload.sol"; + +contract SlashFactory is ISlashFactory { + ILeonidas public immutable LEONIDAS; + + constructor(ILeonidas _leonidas) { + LEONIDAS = _leonidas; + } + + function createSlashPayload(Epoch _epoch, uint256 _amount) + external + override(ISlashFactory) + returns (IPayload) + { + (address predictedAddress, bool isDeployed) = getAddressAndIsDeployed(_epoch, _amount); + + if (isDeployed) { + return IPayload(predictedAddress); + } + + SlashPayload payload = + new SlashPayload{salt: bytes32(Epoch.unwrap(_epoch))}(_epoch, LEONIDAS, _amount); + + emit SlashPayloadCreated(address(payload), _epoch, _amount); + return IPayload(address(payload)); + } + + function getAddressAndIsDeployed(Epoch _epoch, uint256 _amount) + public + view + override(ISlashFactory) + returns (address, bool) + { + address predictedAddress = _computeSlashPayloadAddress(_epoch, _amount); + bool isDeployed = predictedAddress.code.length > 0; + return (predictedAddress, isDeployed); + } + + function _computeSlashPayloadAddress(Epoch _epoch, uint256 _amount) + internal + view + returns (address) + { + bytes32 salt = bytes32(Epoch.unwrap(_epoch)); + return address( + uint160( + uint256( + keccak256( + abi.encodePacked( + bytes1(0xff), + address(this), + salt, + keccak256( + abi.encodePacked( + type(SlashPayload).creationCode, abi.encode(_epoch, LEONIDAS, _amount) + ) + ) + ) + ) + ) + ) + ); + } +} diff --git a/l1-contracts/src/periphery/SlashPayload.sol b/l1-contracts/src/periphery/SlashPayload.sol new file mode 100644 index 00000000000..4410cfe0ae9 --- /dev/null +++ b/l1-contracts/src/periphery/SlashPayload.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Aztec Labs. +pragma solidity >=0.8.27; + +import {ILeonidas} from "@aztec/core/interfaces/ILeonidas.sol"; +import {IStaking} from "@aztec/core/interfaces/IStaking.sol"; +import {Epoch} from "@aztec/core/libraries/TimeMath.sol"; +import {IPayload} from "@aztec/governance/interfaces/IPayload.sol"; + +/** + * @notice The simplest payload that you can find, slash all attesters for an epoch. + */ +contract SlashPayload is IPayload { + Epoch public immutable EPOCH; + ILeonidas public immutable LEONIDAS; + uint256 public immutable AMOUNT; + + constructor(Epoch _epoch, ILeonidas _leonidas, uint256 _amount) { + EPOCH = _epoch; + LEONIDAS = _leonidas; + AMOUNT = _amount; + } + + function getActions() external view override(IPayload) returns (IPayload.Action[] memory) { + address[] memory attesters = ILeonidas(LEONIDAS).getEpochCommittee(EPOCH); + IPayload.Action[] memory actions = new IPayload.Action[](attesters.length); + + for (uint256 i = 0; i < attesters.length; i++) { + actions[i] = IPayload.Action({ + target: address(LEONIDAS), + data: abi.encodeWithSelector(IStaking.slash.selector, attesters[i], AMOUNT) + }); + } + + return actions; + } +} diff --git a/l1-contracts/src/periphery/interfaces/ISlashFactory.sol b/l1-contracts/src/periphery/interfaces/ISlashFactory.sol new file mode 100644 index 00000000000..7300cfbba84 --- /dev/null +++ b/l1-contracts/src/periphery/interfaces/ISlashFactory.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2024 Aztec Labs. +pragma solidity >=0.8.27; + +import {Epoch} from "@aztec/core/libraries/TimeMath.sol"; +import {IPayload} from "@aztec/governance/interfaces/IPayload.sol"; + +interface ISlashFactory { + event SlashPayloadCreated( + address indexed payloadAddress, Epoch indexed epoch, uint256 indexed amount + ); + + function createSlashPayload(Epoch _epoch, uint256 _amount) external returns (IPayload); + function getAddressAndIsDeployed(Epoch _epoch, uint256 _amount) + external + view + returns (address, bool); +} diff --git a/l1-contracts/terraform/main.tf b/l1-contracts/terraform/main.tf index d619a827877..a9b9b4a3faa 100644 --- a/l1-contracts/terraform/main.tf +++ b/l1-contracts/terraform/main.tf @@ -109,4 +109,13 @@ variable "GOVERNANCE_CONTRACT_ADDRESS" { output "GOVERNANCE_CONTRACT_ADDRESS" { value = var.GOVERNANCE_CONTRACT_ADDRESS -} \ No newline at end of file +} + +variable "SLASH_FACTORY_CONTRACT_ADDRESS" { + type = string + default = "" +} + +output "SLASH_FACTORY_CONTRACT_ADDRESS" { + value = var.SLASH_FACTORY_CONTRACT_ADDRESS +} diff --git a/l1-contracts/test/Rollup.t.sol b/l1-contracts/test/Rollup.t.sol index 0164b72a770..f060e39bb5f 100644 --- a/l1-contracts/test/Rollup.t.sol +++ b/l1-contracts/test/Rollup.t.sol @@ -75,9 +75,10 @@ contract RollupTest is DecoderBase, TimeFns { testERC20 = new TestERC20("test", "TEST", address(this)); leo = new Leonidas( - address(1), testERC20, TestConstants.AZTEC_MINIMUM_STAKE, + TestConstants.AZTEC_SLASHING_QUORUM, + TestConstants.AZTEC_SLASHING_ROUND_SIZE, TestConstants.AZTEC_SLOT_DURATION, TestConstants.AZTEC_EPOCH_DURATION, TestConstants.AZTEC_TARGET_COMMITTEE_SIZE diff --git a/l1-contracts/test/fees/FeeRollup.t.sol b/l1-contracts/test/fees/FeeRollup.t.sol index 4463ea51cfb..b01f373bd9a 100644 --- a/l1-contracts/test/fees/FeeRollup.t.sol +++ b/l1-contracts/test/fees/FeeRollup.t.sol @@ -131,7 +131,9 @@ contract FeeRollupTest is FeeModelTestPoints, DecoderBase { aztecEpochDuration: EPOCH_DURATION, targetCommitteeSize: 48, aztecEpochProofClaimWindowInL2Slots: 16, - minimumStake: 100 ether + minimumStake: TestConstants.AZTEC_MINIMUM_STAKE, + slashingQuorum: TestConstants.AZTEC_SLASHING_QUORUM, + slashingRoundSize: TestConstants.AZTEC_SLASHING_ROUND_SIZE }) ); fakeCanonical.setCanonicalRollup(address(rollup)); diff --git a/l1-contracts/test/governance/coin-issuer/mint.t.sol b/l1-contracts/test/governance/coin-issuer/mint.t.sol index 29304fbb589..229d2f52d91 100644 --- a/l1-contracts/test/governance/coin-issuer/mint.t.sol +++ b/l1-contracts/test/governance/coin-issuer/mint.t.sol @@ -35,7 +35,7 @@ contract MintTest is CoinIssuerBase { // it reverts uint256 amount = bound(_amount, maxMint + 1, type(uint256).max); vm.expectRevert( - abi.encodeWithSelector(Errors.CoinIssuer__InssuficientMintAvailable.selector, maxMint, amount) + abi.encodeWithSelector(Errors.CoinIssuer__InsufficientMintAvailable.selector, maxMint, amount) ); nom.mint(address(0xdead), amount); } diff --git a/l1-contracts/test/governance/governance-proposer/Base.t.sol b/l1-contracts/test/governance/governance-proposer/Base.t.sol index 1f720911438..bbfd7b54828 100644 --- a/l1-contracts/test/governance/governance-proposer/Base.t.sol +++ b/l1-contracts/test/governance/governance-proposer/Base.t.sol @@ -4,7 +4,7 @@ pragma solidity >=0.8.27; import {Test} from "forge-std/Test.sol"; import {Registry} from "@aztec/governance/Registry.sol"; -import {GovernanceProposer} from "@aztec/governance/GovernanceProposer.sol"; +import {GovernanceProposer} from "@aztec/governance/proposer/GovernanceProposer.sol"; import {IPayload} from "@aztec/governance/interfaces/IPayload.sol"; diff --git a/l1-contracts/test/governance/governance-proposer/constructor.t.sol b/l1-contracts/test/governance/governance-proposer/constructor.t.sol index f32b8aefa59..327ef727701 100644 --- a/l1-contracts/test/governance/governance-proposer/constructor.t.sol +++ b/l1-contracts/test/governance/governance-proposer/constructor.t.sol @@ -2,12 +2,22 @@ pragma solidity >=0.8.27; import {Test} from "forge-std/Test.sol"; -import {GovernanceProposer} from "@aztec/governance/GovernanceProposer.sol"; +import {GovernanceProposer} from "@aztec/governance/proposer/GovernanceProposer.sol"; import {Errors} from "@aztec/governance/libraries/Errors.sol"; import {IRegistry} from "@aztec/governance/interfaces/IRegistry.sol"; +contract FakeRegistry { + function getGovernance() external pure returns (address) { + return address(0x01); + } + + function getRollup() external pure returns (address) { + return address(0x02); + } +} + contract ConstructorTest is Test { - IRegistry internal constant REGISTRY = IRegistry(address(0x02)); + IRegistry internal REGISTRY = IRegistry(address(new FakeRegistry())); function test_WhenNIsLessThanOrEqualHalfOfM(uint256 _n, uint256 _m) external { // it revert @@ -42,5 +52,7 @@ contract ConstructorTest is Test { assertEq(address(g.REGISTRY()), address(REGISTRY)); assertEq(g.N(), n); assertEq(g.M(), m); + assertEq(g.getExecutor(), address(REGISTRY.getGovernance()), "executor"); + assertEq(g.getInstance(), address(REGISTRY.getRollup()), "instance"); } } diff --git a/l1-contracts/test/governance/governance-proposer/pushProposal.t.sol b/l1-contracts/test/governance/governance-proposer/executeProposal.t.sol similarity index 87% rename from l1-contracts/test/governance/governance-proposer/pushProposal.t.sol rename to l1-contracts/test/governance/governance-proposer/executeProposal.t.sol index 26de9a2f343..db7bd38c352 100644 --- a/l1-contracts/test/governance/governance-proposer/pushProposal.t.sol +++ b/l1-contracts/test/governance/governance-proposer/executeProposal.t.sol @@ -11,7 +11,7 @@ import {Slot, SlotLib, Timestamp} from "@aztec/core/libraries/TimeMath.sol"; import {FaultyGovernance} from "./mocks/FaultyGovernance.sol"; import {FalsyGovernance} from "./mocks/FalsyGovernance.sol"; -contract PushProposalTest is GovernanceProposerBase { +contract ExecuteProposalTest is GovernanceProposerBase { using SlotLib for Slot; Leonidas internal leonidas; @@ -26,11 +26,11 @@ contract PushProposalTest is GovernanceProposerBase { Errors.GovernanceProposer__InstanceHaveNoCode.selector, address(0xdead) ) ); - governanceProposer.pushProposal(_roundNumber); + governanceProposer.executeProposal(_roundNumber); } modifier givenCanonicalInstanceHoldCode() { - leonidas = new Leonidas(address(this)); + leonidas = new Leonidas(); vm.prank(registry.getGovernance()); registry.upgrade(address(leonidas)); @@ -42,9 +42,9 @@ contract PushProposalTest is GovernanceProposerBase { function test_WhenRoundNotInPast() external givenCanonicalInstanceHoldCode { // it revert vm.expectRevert( - abi.encodeWithSelector(Errors.GovernanceProposer__CanOnlyPushProposalInPast.selector) + abi.encodeWithSelector(Errors.GovernanceProposer__CanOnlyExecuteProposalInPast.selector) ); - governanceProposer.pushProposal(0); + governanceProposer.executeProposal(0); } modifier whenRoundInPast() { @@ -74,7 +74,7 @@ contract PushProposalTest is GovernanceProposerBase { governanceProposer.computeRound(leonidas.getCurrentSlot()) ) ); - governanceProposer.pushProposal(0); + governanceProposer.executeProposal(0); } modifier whenRoundInRecentPast() { @@ -105,13 +105,13 @@ contract PushProposalTest is GovernanceProposerBase { ) ) ); - governanceProposer.pushProposal(1); + governanceProposer.executeProposal(1); } vm.expectRevert( abi.encodeWithSelector(Errors.GovernanceProposer__ProposalAlreadyExecuted.selector, 1) ); - governanceProposer.pushProposal(1); + governanceProposer.executeProposal(1); } modifier givenRoundNotExecutedBefore() { @@ -144,7 +144,7 @@ contract PushProposalTest is GovernanceProposerBase { vm.expectRevert( abi.encodeWithSelector(Errors.GovernanceProposer__ProposalCannotBeAddressZero.selector) ); - governanceProposer.pushProposal(0); + governanceProposer.executeProposal(0); } modifier givenLeaderIsNotAddress0() { @@ -164,13 +164,17 @@ contract PushProposalTest is GovernanceProposerBase { vm.prank(proposer); governanceProposer.vote(proposal); + uint256 votesNeeded = governanceProposer.N(); + vm.warp( Timestamp.unwrap( leonidas.getTimestampForSlot(leonidas.getCurrentSlot() + Slot.wrap(governanceProposer.M())) ) ); - vm.expectRevert(abi.encodeWithSelector(Errors.GovernanceProposer__InsufficientVotes.selector)); - governanceProposer.pushProposal(1); + vm.expectRevert( + abi.encodeWithSelector(Errors.GovernanceProposer__InsufficientVotes.selector, 1, votesNeeded) + ); + governanceProposer.executeProposal(1); } modifier givenSufficientYea(uint256 _yeas) { @@ -204,7 +208,7 @@ contract PushProposalTest is GovernanceProposerBase { // it revert // When using a new registry we change the governanceProposer's interpetation of time :O - Leonidas freshInstance = new Leonidas(address(this)); + Leonidas freshInstance = new Leonidas(); vm.prank(registry.getGovernance()); registry.upgrade(address(freshInstance)); @@ -215,9 +219,9 @@ contract PushProposalTest is GovernanceProposerBase { // As time is perceived differently, round 1 is currently in the future vm.expectRevert( - abi.encodeWithSelector(Errors.GovernanceProposer__CanOnlyPushProposalInPast.selector) + abi.encodeWithSelector(Errors.GovernanceProposer__CanOnlyExecuteProposalInPast.selector) ); - governanceProposer.pushProposal(1); + governanceProposer.executeProposal(1); // Jump 2 rounds, since we are currently in round 0 vm.warp( @@ -230,7 +234,7 @@ contract PushProposalTest is GovernanceProposerBase { vm.expectRevert( abi.encodeWithSelector(Errors.GovernanceProposer__ProposalCannotBeAddressZero.selector) ); - governanceProposer.pushProposal(1); + governanceProposer.executeProposal(1); } function test_GivenGovernanceCallReturnFalse(uint256 _yeas) @@ -249,7 +253,7 @@ contract PushProposalTest is GovernanceProposerBase { vm.expectRevert( abi.encodeWithSelector(Errors.GovernanceProposer__FailedToPropose.selector, proposal) ); - governanceProposer.pushProposal(1); + governanceProposer.executeProposal(1); } function test_GivenGovernanceCallFails(uint256 _yeas) @@ -266,7 +270,7 @@ contract PushProposalTest is GovernanceProposerBase { vm.etch(address(governance), address(faulty).code); vm.expectRevert(abi.encodeWithSelector(FaultyGovernance.Faulty.selector)); - governanceProposer.pushProposal(1); + governanceProposer.executeProposal(1); } function test_GivenGovernanceCallSucceeds(uint256 _yeas) @@ -279,11 +283,11 @@ contract PushProposalTest is GovernanceProposerBase { givenSufficientYea(_yeas) { // it update executed to true - // it emits {ProposalPushed} event + // it emits {ProposalExecuted} event // it return true vm.expectEmit(true, true, true, true, address(governanceProposer)); - emit IGovernanceProposer.ProposalPushed(proposal, 1); - assertTrue(governanceProposer.pushProposal(1)); + emit IGovernanceProposer.ProposalExecuted(proposal, 1); + assertTrue(governanceProposer.executeProposal(1)); (, IPayload leader, bool executed) = governanceProposer.rounds(address(leonidas), 1); assertTrue(executed); assertEq(address(leader), address(proposal)); diff --git a/l1-contracts/test/governance/governance-proposer/pushProposal.tree b/l1-contracts/test/governance/governance-proposer/executeProposal.tree similarity index 93% rename from l1-contracts/test/governance/governance-proposer/pushProposal.tree rename to l1-contracts/test/governance/governance-proposer/executeProposal.tree index 2188b588fde..9b2acb0f3fd 100644 --- a/l1-contracts/test/governance/governance-proposer/pushProposal.tree +++ b/l1-contracts/test/governance/governance-proposer/executeProposal.tree @@ -1,4 +1,4 @@ -PushProposalTest +ExecuteProposalTest ├── given canonical instance hold no code │ └── it revert └── given canonical instance hold code @@ -25,5 +25,5 @@ PushProposalTest │ └── it revert └── given governance call succeeds ├── it update executed to true - ├── it emits {ProposalPushed} event + ├── it emits {ProposalExecuted} event └── it return true \ No newline at end of file diff --git a/l1-contracts/test/governance/governance-proposer/vote.t.sol b/l1-contracts/test/governance/governance-proposer/vote.t.sol index f78f9f009e0..91c28363912 100644 --- a/l1-contracts/test/governance/governance-proposer/vote.t.sol +++ b/l1-contracts/test/governance/governance-proposer/vote.t.sol @@ -15,7 +15,8 @@ contract VoteTest is GovernanceProposerBase { address internal proposer = address(0); Leonidas internal leonidas; - function test_WhenProposalHoldNoCode() external { + // Skipping this test since the it matches the for now skipped check in `EmpireBase::vote` + function skip__test_WhenProposalHoldNoCode() external { // it revert vm.expectRevert( abi.encodeWithSelector(Errors.GovernanceProposer__ProposalHaveNoCode.selector, proposal) @@ -39,7 +40,7 @@ contract VoteTest is GovernanceProposerBase { } modifier givenCanonicalRollupHoldCode() { - leonidas = new Leonidas(address(this)); + leonidas = new Leonidas(); vm.prank(registry.getGovernance()); registry.upgrade(address(leonidas)); @@ -138,7 +139,7 @@ contract VoteTest is GovernanceProposerBase { uint256 leonidasRound = governanceProposer.computeRound(leonidasSlot); uint256 yeaBefore = governanceProposer.yeaCount(address(leonidas), leonidasRound, proposal); - Leonidas freshInstance = new Leonidas(address(this)); + Leonidas freshInstance = new Leonidas(); vm.prank(registry.getGovernance()); registry.upgrade(address(freshInstance)); diff --git a/l1-contracts/test/governance/governance/base.t.sol b/l1-contracts/test/governance/governance/base.t.sol index cc5a9878a06..05a125f10ff 100644 --- a/l1-contracts/test/governance/governance/base.t.sol +++ b/l1-contracts/test/governance/governance/base.t.sol @@ -3,7 +3,7 @@ pragma solidity >=0.8.27; import {TestBase} from "@test/base/Base.sol"; import {Governance} from "@aztec/governance/Governance.sol"; -import {GovernanceProposer} from "@aztec/governance/GovernanceProposer.sol"; +import {GovernanceProposer} from "@aztec/governance/proposer/GovernanceProposer.sol"; import {Registry} from "@aztec/governance/Registry.sol"; import {DataStructures} from "@aztec/governance/libraries/DataStructures.sol"; import {IMintableERC20} from "@aztec/governance/interfaces/IMintableERC20.sol"; diff --git a/l1-contracts/test/governance/scenario/NewGovernanceProposerPayload.sol b/l1-contracts/test/governance/scenario/NewGovernanceProposerPayload.sol index 613dc7006b4..a4cb726dc2e 100644 --- a/l1-contracts/test/governance/scenario/NewGovernanceProposerPayload.sol +++ b/l1-contracts/test/governance/scenario/NewGovernanceProposerPayload.sol @@ -4,7 +4,7 @@ pragma solidity >=0.8.27; import {IPayload} from "@aztec/governance/interfaces/IPayload.sol"; import {IRegistry} from "@aztec/governance/interfaces/IRegistry.sol"; import {Governance} from "@aztec/governance/Governance.sol"; -import {GovernanceProposer} from "@aztec/governance/GovernanceProposer.sol"; +import {GovernanceProposer} from "@aztec/governance/proposer/GovernanceProposer.sol"; /** * @title NewGovernanceProposerPayload diff --git a/l1-contracts/test/governance/scenario/UpgradeGovernanceProposerTest.t.sol b/l1-contracts/test/governance/scenario/UpgradeGovernanceProposerTest.t.sol index 8504653da17..f5fd35a9a34 100644 --- a/l1-contracts/test/governance/scenario/UpgradeGovernanceProposerTest.t.sol +++ b/l1-contracts/test/governance/scenario/UpgradeGovernanceProposerTest.t.sol @@ -6,7 +6,7 @@ import {TestBase} from "@test/base/Base.sol"; import {IMintableERC20} from "@aztec/governance/interfaces/IMintableERC20.sol"; import {Rollup} from "../../harnesses/Rollup.sol"; import {Governance} from "@aztec/governance/Governance.sol"; -import {GovernanceProposer} from "@aztec/governance/GovernanceProposer.sol"; +import {GovernanceProposer} from "@aztec/governance/proposer/GovernanceProposer.sol"; import {Registry} from "@aztec/governance/Registry.sol"; import {DataStructures} from "@aztec/governance/libraries/DataStructures.sol"; import {IMintableERC20} from "@aztec/governance/interfaces/IMintableERC20.sol"; @@ -92,7 +92,7 @@ contract UpgradeGovernanceProposerTest is TestBase { vm.warp(Timestamp.unwrap(rollup.getTimestampForSlot(rollup.getCurrentSlot() + Slot.wrap(1)))); } - governanceProposer.pushProposal(0); + governanceProposer.executeProposal(0); proposal = governance.getProposal(0); assertEq(address(proposal.payload), address(payload)); diff --git a/l1-contracts/test/governance/scenario/slashing/Slashing.t.sol b/l1-contracts/test/governance/scenario/slashing/Slashing.t.sol new file mode 100644 index 00000000000..e2a40cec054 --- /dev/null +++ b/l1-contracts/test/governance/scenario/slashing/Slashing.t.sol @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity >=0.8.27; + +import {TestBase} from "@test/base/Base.sol"; + +import {Errors} from "@aztec/core/libraries/Errors.sol"; +import {Registry} from "@aztec/governance/Registry.sol"; +import {Rollup, Config} from "@aztec/core/Rollup.sol"; +import {TestERC20} from "@aztec/mock/TestERC20.sol"; +import {MockFeeJuicePortal} from "@aztec/mock/MockFeeJuicePortal.sol"; +import {TestConstants} from "../../../harnesses/TestConstants.sol"; +import {CheatDepositArgs} from "@aztec/core/interfaces/IRollup.sol"; + +import {RewardDistributor} from "@aztec/governance/RewardDistributor.sol"; + +import {SlashFactory} from "@aztec/periphery/SlashFactory.sol"; +import {Slasher, IPayload} from "@aztec/core/staking/Slasher.sol"; +import {ILeonidas} from "@aztec/core/interfaces/ILeonidas.sol"; +import {Status, ValidatorInfo} from "@aztec/core/interfaces/IStaking.sol"; + +import {Errors} from "@aztec/core/libraries/Errors.sol"; +import {Timestamp} from "@aztec/core/libraries/TimeMath.sol"; + +import {CheatDepositArgs} from "@aztec/core/interfaces/IRollup.sol"; +import {SlashingProposer} from "@aztec/core/staking/SlashingProposer.sol"; + +import {Slot, SlotLib, Epoch} from "@aztec/core/libraries/TimeMath.sol"; + +contract SlashingScenario is TestBase { + using SlotLib for Slot; + + TestERC20 internal testERC20; + RewardDistributor internal rewardDistributor; + Rollup internal rollup; + Slasher internal slasher; + SlashFactory internal slashFactory; + SlashingProposer internal slashingProposer; + + function test_Slashing() public { + uint256 validatorCount = 4; + + CheatDepositArgs[] memory initialValidators = new CheatDepositArgs[](validatorCount); + + for (uint256 i = 1; i < validatorCount + 1; i++) { + uint256 attesterPrivateKey = uint256(keccak256(abi.encode("attester", i))); + address attester = vm.addr(attesterPrivateKey); + uint256 proposerPrivateKey = uint256(keccak256(abi.encode("proposer", i))); + address proposer = vm.addr(proposerPrivateKey); + + initialValidators[i - 1] = CheatDepositArgs({ + attester: attester, + proposer: proposer, + withdrawer: address(this), + amount: TestConstants.AZTEC_MINIMUM_STAKE + }); + } + + testERC20 = new TestERC20("test", "TEST", address(this)); + Registry registry = new Registry(address(this)); + rewardDistributor = new RewardDistributor(testERC20, registry, address(this)); + rollup = new Rollup({ + _fpcJuicePortal: new MockFeeJuicePortal(), + _rewardDistributor: rewardDistributor, + _stakingAsset: testERC20, + _vkTreeRoot: bytes32(0), + _protocolContractTreeRoot: bytes32(0), + _ares: address(this), + _config: Config({ + aztecSlotDuration: TestConstants.AZTEC_SLOT_DURATION, + aztecEpochDuration: TestConstants.AZTEC_EPOCH_DURATION, + targetCommitteeSize: TestConstants.AZTEC_TARGET_COMMITTEE_SIZE, + aztecEpochProofClaimWindowInL2Slots: TestConstants.AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS, + minimumStake: TestConstants.AZTEC_MINIMUM_STAKE, + slashingQuorum: TestConstants.AZTEC_SLASHING_QUORUM, + slashingRoundSize: TestConstants.AZTEC_SLASHING_ROUND_SIZE + }) + }); + slasher = rollup.SLASHER(); + slashingProposer = slasher.PROPOSER(); + slashFactory = new SlashFactory(ILeonidas(address(rollup))); + + testERC20.mint(address(this), TestConstants.AZTEC_MINIMUM_STAKE * validatorCount); + testERC20.approve(address(rollup), TestConstants.AZTEC_MINIMUM_STAKE * validatorCount); + rollup.cheat__InitialiseValidatorSet(initialValidators); + + // Lets make a proposal to slash! + + uint256 slashAmount = 10e18; + IPayload payload = slashFactory.createSlashPayload(Epoch.wrap(0), slashAmount); + + // Cast a bunch of votes + vm.warp(Timestamp.unwrap(rollup.getTimestampForSlot(Slot.wrap(1)))); + + for (uint256 i = 0; i < 10; i++) { + address proposer = rollup.getCurrentProposer(); + vm.prank(proposer); + slashingProposer.vote(payload); + vm.warp(Timestamp.unwrap(rollup.getTimestampForSlot(rollup.getCurrentSlot() + Slot.wrap(1)))); + } + + address[] memory attesters = rollup.getAttesters(); + uint256[] memory stakes = new uint256[](attesters.length); + + for (uint256 i = 0; i < attesters.length; i++) { + ValidatorInfo memory info = rollup.getInfo(attesters[i]); + stakes[i] = info.stake; + assertTrue(info.status == Status.VALIDATING, "Invalid status"); + } + + slashingProposer.executeProposal(0); + + // Make sure that the slash was successful, + // Meaning that validators are now LIVING and have lost the slash amount + for (uint256 i = 0; i < attesters.length; i++) { + ValidatorInfo memory info = rollup.getInfo(attesters[i]); + uint256 stake = info.stake; + assertEq(stake, stakes[i] - slashAmount, "Invalid stake"); + assertTrue(info.status == Status.LIVING, "Invalid status"); + } + } +} diff --git a/l1-contracts/test/harnesses/Leonidas.sol b/l1-contracts/test/harnesses/Leonidas.sol index a7c78f304b1..c52eb301589 100644 --- a/l1-contracts/test/harnesses/Leonidas.sol +++ b/l1-contracts/test/harnesses/Leonidas.sol @@ -7,11 +7,12 @@ import {TestConstants} from "./TestConstants.sol"; import {TestERC20} from "@aztec/mock/TestERC20.sol"; contract Leonidas is RealLeonidas { - constructor(address _ares) + constructor() RealLeonidas( - _ares, new TestERC20("test", "TEST", address(this)), 100e18, + TestConstants.AZTEC_SLASHING_QUORUM, + TestConstants.AZTEC_SLASHING_ROUND_SIZE, TestConstants.AZTEC_SLOT_DURATION, TestConstants.AZTEC_EPOCH_DURATION, TestConstants.AZTEC_TARGET_COMMITTEE_SIZE diff --git a/l1-contracts/test/harnesses/Rollup.sol b/l1-contracts/test/harnesses/Rollup.sol index 41d72b20de9..27d55a9913e 100644 --- a/l1-contracts/test/harnesses/Rollup.sol +++ b/l1-contracts/test/harnesses/Rollup.sol @@ -29,7 +29,9 @@ contract Rollup is RealRollup { aztecEpochDuration: TestConstants.AZTEC_EPOCH_DURATION, targetCommitteeSize: TestConstants.AZTEC_TARGET_COMMITTEE_SIZE, aztecEpochProofClaimWindowInL2Slots: TestConstants.AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS, - minimumStake: TestConstants.AZTEC_MINIMUM_STAKE + minimumStake: TestConstants.AZTEC_MINIMUM_STAKE, + slashingQuorum: TestConstants.AZTEC_SLASHING_QUORUM, + slashingRoundSize: TestConstants.AZTEC_SLASHING_ROUND_SIZE }) ) {} diff --git a/l1-contracts/test/harnesses/TestConstants.sol b/l1-contracts/test/harnesses/TestConstants.sol index 371a2d8f594..aad8edd6db0 100644 --- a/l1-contracts/test/harnesses/TestConstants.sol +++ b/l1-contracts/test/harnesses/TestConstants.sol @@ -10,4 +10,6 @@ library TestConstants { uint256 internal constant AZTEC_TARGET_COMMITTEE_SIZE = 48; uint256 internal constant AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS = 13; uint256 internal constant AZTEC_MINIMUM_STAKE = 100e18; + uint256 internal constant AZTEC_SLASHING_QUORUM = 6; + uint256 internal constant AZTEC_SLASHING_ROUND_SIZE = 10; } diff --git a/l1-contracts/test/sparta/Sparta.t.sol b/l1-contracts/test/sparta/Sparta.t.sol index 165dd9f7b4f..eccf797ee16 100644 --- a/l1-contracts/test/sparta/Sparta.t.sol +++ b/l1-contracts/test/sparta/Sparta.t.sol @@ -12,7 +12,7 @@ import {Inbox} from "@aztec/core/messagebridge/Inbox.sol"; import {Outbox} from "@aztec/core/messagebridge/Outbox.sol"; import {Errors} from "@aztec/core/libraries/Errors.sol"; import {Registry} from "@aztec/governance/Registry.sol"; -import {Rollup} from "../harnesses/Rollup.sol"; +import {Rollup, Config} from "@aztec/core/Rollup.sol"; import {Leonidas} from "@aztec/core/Leonidas.sol"; import {NaiveMerkle} from "../merkle/Naive.sol"; import {MerkleTestUtil} from "../merkle/TestUtil.sol"; @@ -27,6 +27,11 @@ import {CheatDepositArgs} from "@aztec/core/interfaces/IRollup.sol"; import {Slot, Epoch, SlotLib, EpochLib} from "@aztec/core/libraries/TimeMath.sol"; import {RewardDistributor} from "@aztec/governance/RewardDistributor.sol"; + +import {SlashFactory} from "@aztec/periphery/SlashFactory.sol"; +import {Slasher, IPayload} from "@aztec/core/staking/Slasher.sol"; +import {ILeonidas} from "@aztec/core/interfaces/ILeonidas.sol"; +import {Status, ValidatorInfo} from "@aztec/core/interfaces/IStaking.sol"; // solhint-disable comprehensive-interface /** @@ -44,6 +49,8 @@ contract SpartaTest is DecoderBase { bool shouldRevert; } + SlashFactory internal slashFactory; + Slasher internal slasher; Inbox internal inbox; Outbox internal outbox; Rollup internal rollup; @@ -64,9 +71,10 @@ contract SpartaTest is DecoderBase { string memory _name = "mixed_block_1"; { Leonidas leonidas = new Leonidas( - address(1), testERC20, TestConstants.AZTEC_MINIMUM_STAKE, + TestConstants.AZTEC_SLASHING_QUORUM, + TestConstants.AZTEC_SLASHING_ROUND_SIZE, TestConstants.AZTEC_SLOT_DURATION, TestConstants.AZTEC_EPOCH_DURATION, TestConstants.AZTEC_TARGET_COMMITTEE_SIZE @@ -102,9 +110,25 @@ contract SpartaTest is DecoderBase { testERC20 = new TestERC20("test", "TEST", address(this)); Registry registry = new Registry(address(this)); rewardDistributor = new RewardDistributor(testERC20, registry, address(this)); - rollup = new Rollup( - new MockFeeJuicePortal(), rewardDistributor, testERC20, bytes32(0), bytes32(0), address(this) - ); + rollup = new Rollup({ + _fpcJuicePortal: new MockFeeJuicePortal(), + _rewardDistributor: rewardDistributor, + _stakingAsset: testERC20, + _vkTreeRoot: bytes32(0), + _protocolContractTreeRoot: bytes32(0), + _ares: address(this), + _config: Config({ + aztecSlotDuration: TestConstants.AZTEC_SLOT_DURATION, + aztecEpochDuration: TestConstants.AZTEC_EPOCH_DURATION, + targetCommitteeSize: TestConstants.AZTEC_TARGET_COMMITTEE_SIZE, + aztecEpochProofClaimWindowInL2Slots: TestConstants.AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS, + minimumStake: TestConstants.AZTEC_MINIMUM_STAKE, + slashingQuorum: TestConstants.AZTEC_SLASHING_QUORUM, + slashingRoundSize: TestConstants.AZTEC_SLASHING_ROUND_SIZE + }) + }); + slasher = rollup.SLASHER(); + slashFactory = new SlashFactory(ILeonidas(address(rollup))); testERC20.mint(address(this), TestConstants.AZTEC_MINIMUM_STAKE * _validatorCount); testERC20.approve(address(rollup), TestConstants.AZTEC_MINIMUM_STAKE * _validatorCount); @@ -180,6 +204,40 @@ contract SpartaTest is DecoderBase { _testBlock("mixed_block_2", false, 3, false); } + function testNukeFromOrbit() public setup(4) { + // We propose some blocks, and have a bunch of validators attest to them. + // Then we slash EVERYONE that was in the committees because the epoch never + // got finalised. + // This is LIKELY, not the action you really want to take, you want to slash + // the people actually attesting, etc, but for simplicity we can do this as showcase. + _testBlock("mixed_block_1", false, 3, false); + _testBlock("mixed_block_2", false, 3, false); + + address[] memory attesters = rollup.getAttesters(); + uint256[] memory stakes = new uint256[](attesters.length); + + for (uint256 i = 0; i < attesters.length; i++) { + ValidatorInfo memory info = rollup.getInfo(attesters[i]); + stakes[i] = info.stake; + assertTrue(info.status == Status.VALIDATING, "Invalid status"); + } + + // We say, these things are bad, call the baba yaga to take care of them! + uint256 slashAmount = 10e18; + IPayload slashPayload = slashFactory.createSlashPayload(rollup.getCurrentEpoch(), slashAmount); + vm.prank(address(slasher.PROPOSER())); + slasher.slash(slashPayload); + + // Make sure that the slash was successful, + // Meaning that validators are now LIVING and have lost the slash amount + for (uint256 i = 0; i < attesters.length; i++) { + ValidatorInfo memory info = rollup.getInfo(attesters[i]); + uint256 stake = info.stake; + assertEq(stake, stakes[i] - slashAmount, "Invalid stake"); + assertTrue(info.status == Status.LIVING, "Invalid status"); + } + } + function testInvalidProposer() public setup(4) { _testBlock("mixed_block_1", true, 3, true); } diff --git a/l1-contracts/test/staking/StakingCheater.sol b/l1-contracts/test/staking/StakingCheater.sol index ba89e1e07ab..a886a3d2f72 100644 --- a/l1-contracts/test/staking/StakingCheater.sol +++ b/l1-contracts/test/staking/StakingCheater.sol @@ -9,9 +9,12 @@ import {EnumerableSet} from "@oz/utils/structs/EnumerableSet.sol"; contract StakingCheater is Staking { using EnumerableSet for EnumerableSet.AddressSet; - constructor(address _slasher, IERC20 _stakingAsset, uint256 _minimumStake) - Staking(_slasher, _stakingAsset, _minimumStake) - {} + constructor( + IERC20 _stakingAsset, + uint256 _minimumStake, + uint256 _slashingQuorum, + uint256 _roundSize + ) Staking(_stakingAsset, _minimumStake, _slashingQuorum, _roundSize) {} function cheat__SetStatus(address _attester, Status _status) external { stakingStore.info[_attester].status = _status; diff --git a/l1-contracts/test/staking/base.t.sol b/l1-contracts/test/staking/base.t.sol index 6aa8eaa8ca4..441d418d244 100644 --- a/l1-contracts/test/staking/base.t.sol +++ b/l1-contracts/test/staking/base.t.sol @@ -16,10 +16,13 @@ contract StakingBase is TestBase { address internal constant ATTESTER = address(bytes20("ATTESTER")); address internal constant WITHDRAWER = address(bytes20("WITHDRAWER")); address internal constant RECIPIENT = address(bytes20("RECIPIENT")); - address internal constant SLASHER = address(bytes20("SLASHER")); + + address internal SLASHER; function setUp() public virtual { stakingAsset = new TestERC20("test", "TEST", address(this)); - staking = new StakingCheater(SLASHER, stakingAsset, MINIMUM_STAKE); + staking = new StakingCheater(stakingAsset, MINIMUM_STAKE, 1, 1); + + SLASHER = address(staking.SLASHER()); } } diff --git a/noir-projects/aztec-nr/.gitrepo b/noir-projects/aztec-nr/.gitrepo index 1d3c076994d..28f80a81d36 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 = 473a8e532e26da07b014bd07342964b6bf4cf688 + commit = e852135a829883f177a69ccbd1df29fd445fbfc1 method = merge cmdver = 0.4.6 - parent = 15accf1d540c0e8ee96a6fe96def5cca24fb2086 + parent = 33475e46f8265f8ff7e6d8980a46b240c1af8656 diff --git a/noir-projects/aztec-nr/bootstrap.sh b/noir-projects/aztec-nr/bootstrap.sh new file mode 100755 index 00000000000..2cd5d723371 --- /dev/null +++ b/noir-projects/aztec-nr/bootstrap.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +source $(git rev-parse --show-toplevel)/ci3/source_bootstrap + +cmd=${1:-} + +export RAYON_NUM_THREADS=${RAYON_NUM_THREADS:-16} +export HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-16} +export NARGO=${NARGO:-../../noir/noir-repo/target/release/nargo} + +function test_cmds { + i=0 + $NARGO test --list-tests --silence-warnings | while read -r package test; do + # We assume there are 8 txe's running. + port=$((45730 + (i++ % ${NUM_TXES:-1}))) + echo "noir-projects/scripts/run_test.sh aztec-nr $package $test $port" + done +} + +function test { + # Starting txe servers with incrementing port numbers. + trap 'kill $(jobs -p)' EXIT + (cd $root/yarn-project/txe && LOG_LEVEL=error TXE_PORT=45730 yarn start) & + echo "Waiting for TXE to start..." + while ! nc -z 127.0.0.1 45730 &>/dev/null; do sleep 1; done + + test_cmds | (cd $root; NARGO_FOREIGN_CALL_TIMEOUT=300000 parallel --bar --halt now,fail=1 'dump_fail {} >/dev/null') +} + +case "$cmd" in + "test") + test + ;; + "test-cmds") + test_cmds + ;; + *) + echo_stderr "Unknown command: $cmd" + exit 1 +esac \ No newline at end of file diff --git a/noir-projects/bootstrap.sh b/noir-projects/bootstrap.sh index 8eeda14eae4..4b98d4fa7fb 100755 --- a/noir-projects/bootstrap.sh +++ b/noir-projects/bootstrap.sh @@ -1,40 +1,55 @@ #!/usr/bin/env bash +# TODO: Testing aztec.nr/contracts requires TXE, so must be pushed to after the final yarn project build. source $(git rev-parse --show-toplevel)/ci3/source_bootstrap cmd=${1:-} -if [ "$cmd" = hash ]; then - cache_content_hash .rebuild_patterns - exit -fi - -github_group "noir-projects build" - -# TODO: Move the build image, or better, just use devcontainer as our build container. -# Or just normalize the protocol circuit keys to be added to the contract artifact, base64 encoded instead of hex. -if ! command -v xxd &> /dev/null; then - denoise "apt update && apt install -y xxd" -fi - -# Use fmt as a trick to download dependencies. -# Otherwise parallel runs of nargo will trip over each other trying to download dependencies. -# Also doubles up as our formatting check. -function prep { - set -eu - (cd noir-protocol-circuits && yarn && node ./scripts/generate_variants.js) - for dir in noir-contracts noir-protocol-circuits mock-protocol-circuits aztec-nr; do - (cd $dir && ../../noir/noir-repo/target/release/nargo fmt --check) - done +function build { + github_group "noir-projects build" + + # TODO: Move the build image, or better, just use devcontainer as our build container. + # Or just normalize the protocol circuit keys to be added to the contract artifact, base64 encoded instead of hex. + if ! command -v xxd &> /dev/null; then + denoise "apt update && apt install -y xxd" + fi + + # Use fmt as a trick to download dependencies. + # Otherwise parallel runs of nargo will trip over each other trying to download dependencies. + # Also doubles up as our formatting check. + function prep { + set -eu + (cd noir-protocol-circuits && yarn && node ./scripts/generate_variants.js) + for dir in noir-contracts noir-protocol-circuits mock-protocol-circuits aztec-nr; do + (cd $dir && ../../noir/noir-repo/target/release/nargo fmt --check) + done + } + export -f prep + + denoise prep + + parallel --tag --line-buffered --joblog joblog.txt --halt now,fail=1 ::: \ + "denoise ./mock-protocol-circuits/bootstrap.sh $cmd" \ + "denoise ./noir-protocol-circuits/bootstrap.sh $cmd" \ + "denoise ./noir-contracts/bootstrap.sh $cmd" + + github_endgroup } -export -f prep -denoise prep - -parallel -v --tag --line-buffered --joblog joblog.txt --halt now,fail=1 ::: \ - "denoise ./mock-protocol-circuits/bootstrap.sh $cmd" \ - "denoise ./noir-protocol-circuits/bootstrap.sh $cmd" \ - "denoise ./noir-contracts/bootstrap.sh $cmd" - -github_endgroup - -# TODO: Testing aztec.nr/contracts requires TXE, so must be pushed to after the final yarn project build. \ No newline at end of file +case "$cmd" in + full|fast|ci|test|"") + build + ;; + "test-cmds") + ./noir-protocol-circuits/bootstrap.sh test-cmds + ./noir-contracts/bootstrap.sh test-cmds + ./aztec-nr/bootstrap.sh test-cmds + exit + ;; + "hash") + cache_content_hash .rebuild_patterns ../noir/.rebuild_patterns + exit + ;; + *) + echo_stderr "Unknown command: $CMD" + exit 1 +esac diff --git a/noir-projects/noir-contracts/bootstrap.sh b/noir-projects/noir-contracts/bootstrap.sh index f2482f75e96..3d8b2b0f646 100755 --- a/noir-projects/noir-contracts/bootstrap.sh +++ b/noir-projects/noir-contracts/bootstrap.sh @@ -142,6 +142,31 @@ function build { # echo -e "uniswap_contract\ncontract_class_registerer_contract" | parallel --joblog joblog.txt -v --line-buffer --tag --halt now,fail=1 compile {} } +function test_cmds { + i=0 + $NARGO test --list-tests --silence-warnings | while read -r package test; do + # We assume there are 8 txe's running. + port=$((45730 + (i++ % ${NUM_TXES:-1}))) + echo "noir-projects/scripts/run_test.sh noir-contracts $package $test $port" + done +} + +function test { + # Starting txe servers with incrementing port numbers. + NUM_TXES=8 + trap 'kill $(jobs -p)' EXIT + for i in $(seq 0 $((NUM_TXES-1))); do + (cd $root/yarn-project/txe && LOG_LEVEL=silent TXE_PORT=$((45730 + i)) yarn start) & + done + echo "Waiting for TXE's to start..." + for i in $(seq 0 $((NUM_TXES-1))); do + while ! nc -z 127.0.0.1 $((45730 + i)) &>/dev/null; do sleep 1; done + done + + echo "Starting test run..." + test_cmds | (cd $root; NARGO_FOREIGN_CALL_TIMEOUT=300000 parallel --bar --halt now,fail=1 'dump_fail {} >/dev/null') +} + case "$cmd" in "clean") git clean -fdx @@ -153,7 +178,10 @@ case "$cmd" in mv "${artifact}.tmp" "$artifact" done ;; - ""|"fast"|"full"|"ci") + ""|"fast"|"full") + build + ;; + "ci") build ;; "compile") @@ -161,8 +189,10 @@ case "$cmd" in build $1 ;; "test") - # TODO: Needs TXE. Handle after yarn-project. - exit 0 + test + ;; + "test-cmds") + test_cmds ;; *) echo_stderr "Unknown command: $cmd" diff --git a/noir-projects/noir-protocol-circuits/bootstrap.sh b/noir-projects/noir-protocol-circuits/bootstrap.sh index 84f930f4b16..b2ba4044009 100755 --- a/noir-projects/noir-protocol-circuits/bootstrap.sh +++ b/noir-projects/noir-protocol-circuits/bootstrap.sh @@ -45,8 +45,6 @@ function on_exit() { } trap on_exit EXIT -[ -f package.json ] && denoise "yarn && node ./scripts/generate_variants.js" - mkdir -p $tmp_dir mkdir -p $key_dir @@ -118,6 +116,9 @@ function compile { function build { set +e set -u + + [ -f "package.json" ] && denoise "yarn && node ./scripts/generate_variants.js" + grep -oP '(?<=crates/)[^"]+' Nargo.toml | \ while read -r dir; do toml_file=./crates/$dir/Nargo.toml @@ -133,16 +134,12 @@ function build { function test { set -eu - # Whether we run the tests or not is coarse grained. name=$(basename "$PWD") CIRCUITS_HASH=$(cache_content_hash ../../noir/.rebuild_patterns "^noir-projects/$name") - if ! test_should_run $name-tests-$CIRCUITS_HASH; then - return - fi - github_group "$name test" - RAYON_NUM_THREADS= $NARGO test --silence-warnings + test_should_run $name-tests-$CIRCUITS_HASH || return 0 + + RAYON_NUM_THREADS= $NARGO test --silence-warnings --skip-brillig-constraints-check cache_upload_flag $name-tests-$CIRCUITS_HASH - github_endgroup } export -f compile test build @@ -164,8 +161,13 @@ case "$CMD" in "test") test ;; + "test-cmds") + $NARGO test --list-tests --silence-warnings | while read -r package test; do + echo "noir-projects/scripts/run_test.sh noir-protocol-circuits $package $test" + done + ;; "ci") - parallel --line-buffered bash -c {} ::: build test + parallel --tag --line-buffered {} ::: build test ;; *) echo_stderr "Unknown command: $CMD" diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-init/Prover.toml b/noir-projects/noir-protocol-circuits/crates/private-kernel-init/Prover.toml index a963c0846cc..205381406b9 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-init/Prover.toml +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-init/Prover.toml @@ -1,12 +1,12 @@ -vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" -protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" -is_private_only = true +vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" +protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" +is_private_only = false [tx_request] -args_hash = "0x23516c9ddf3cc536b189e0d22fb5a3c577804e50a0142020f8c16affe3ecd735" +args_hash = "0x2f5e98bce7d5b2867bfe2f77794a639d6dcdb827495879090a2ad3597f23ec0b" [tx_request.origin] - inner = "0x30021904ae3832fa38613650b957c74abcc7ae86fda9e53bcd89e7b638cf9d67" + inner = "0x17e5c98d998228e7de3dbb6c01ae1fd3aaf868bd45946d300e4c36f6d396dea0" [tx_request.tx_context] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" @@ -22,7 +22,11 @@ l2_gas = "0x00000000000000000000000000000000000000000000000000000000005b8d80" [tx_request.tx_context.gas_settings.max_fees_per_gas] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" -fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" + +[tx_request.tx_context.gas_settings.max_priority_fees_per_gas] +fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" [tx_request.function_data] is_private = true @@ -31,7 +35,7 @@ fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4 inner = "0x0000000000000000000000000000000000000000000000000000000027e740b2" [private_call] -contract_class_artifact_hash = "0x04592586e3066000e9d91ee7a543d5df904fe72ca117509aa8dfdc9c5b8938ad" +contract_class_artifact_hash = "0x14d1d22ca60300f65cf30fc5804be14c8ee4811a8aede317019e2c2b71cfa0c5" contract_class_public_bytecode_commitment = "0x0000000000000000000000000000000000000000000000000000000000000000" protocol_contract_sibling_path = [ "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -44,7 +48,7 @@ acir_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" key = [ "0x0000000000000000000000000000000000000000000000000000000000100000", "0x0000000000000000000000000000000000000000000000000000000000000010", - "0x0000000000000000000000000000000000000000000000000000000000000401", + "0x00000000000000000000000000000000000000000000000000000000000328b1", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", @@ -65,167 +69,167 @@ acir_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000000000a698075eea5084f7acd85a095150ac9292", - "0x00000000000000000000000000000000001e3a5f098d47b12af2f26690ef1814", - "0x000000000000000000000000000000902b0e17d845f64f95bd415bf6e790a3c6", - "0x00000000000000000000000000000000000dd76855c5fde12df8c18daeac12ce", - "0x000000000000000000000000000000a1456dc4c4b01f1c9df3d72015a0d2ee54", - "0x000000000000000000000000000000000013a3195ccc7438c5d3200b6f24e966", - "0x000000000000000000000000000000f4b88f6cfb3e0aac00b47103841c8ab577", - "0x00000000000000000000000000000000001aa7a3a9bd157615d6f291008ed091", - "0x000000000000000000000000000000b636d5874da152de58fa6cbc410b0212e9", - "0x00000000000000000000000000000000001261245776e4cdf4ccd4d99079f2f2", - "0x000000000000000000000000000000ea7e718d5deb58a4f97a3382789bf06830", - "0x00000000000000000000000000000000001163d7e4bd4647595237ece72d3442", - "0x00000000000000000000000000000049c150c843ddca31fcdebce524c2a78421", - "0x000000000000000000000000000000000026cf800a923716c266302bf3732453", - "0x0000000000000000000000000000008b09c6914f7da24b6d6de2adc1c76ee2da", - "0x000000000000000000000000000000000000fb3f8b6fb17e9e6a1658bbfe103b", - "0x0000000000000000000000000000005ab3aea5dcaea08bb80f7ed137e0192f80", - "0x000000000000000000000000000000000005a4e65cabfbe23bca1c1c65989a53", - "0x000000000000000000000000000000b38288f2b68b81157df6c9be9d4f3ea441", - "0x00000000000000000000000000000000002a54a74db2dd7f1223bbe2a17c491f", - "0x0000000000000000000000000000002a8b33965e5ad9044d9a84600ee3272758", - "0x000000000000000000000000000000000012a2e5076bd722d64fdca0a4f8effe", - "0x000000000000000000000000000000539be2d35e1c1f977ccbee60f628e7101b", - "0x00000000000000000000000000000000001ecf20c0a7532e13491c9023002108", - "0x00000000000000000000000000000017030219502b29b77d6087584f63e1f50b", - "0x00000000000000000000000000000000002a8710ad87a3c05ed5cacf8d4108d1", - "0x00000000000000000000000000000018ca9f36f974fea905e3f37e91ea88aaf5", - "0x000000000000000000000000000000000016471423bfd9ec69b6a0a90225b0c1", - "0x00000000000000000000000000000096cd9057bf18b6f3e3a47c1ba198c5e34b", - "0x00000000000000000000000000000000000e581076722752a33e38d955bd3d99", - "0x000000000000000000000000000000afe19eb7ab1b01cb03206edf503f280c21", - "0x00000000000000000000000000000000002c4af3a8249c34e719274cc51af545", - "0x000000000000000000000000000000d39c2b6cdaf2f6b899babc3236650decde", - "0x00000000000000000000000000000000000a13aa702d358ecff2773aff90483d", - "0x000000000000000000000000000000cad946b254842248764737b3a159e7febe", - "0x00000000000000000000000000000000000d89f4659f4b92a0ad16178a70f07a", - "0x0000000000000000000000000000003cef05bb04c87e3bf2fc49eb4a8cf3a8b3", - "0x00000000000000000000000000000000000b9e6791c86a30770a222aab4a71e3", - "0x000000000000000000000000000000a944f72c15e6d4c07a9f7afc737d25230b", - "0x000000000000000000000000000000000029637e80820c79a3f1837349afbde0", - "0x00000000000000000000000000000015033e79697ff3c58fe6328c1ea89e4df4", - "0x0000000000000000000000000000000000099a0a4bc57e68502bffbb94b2683e", - "0x000000000000000000000000000000f267a94bd90100e3e0850273e0a8a13bb6", - "0x00000000000000000000000000000000002125c06918f2bd4286e85601d9d835", - "0x0000000000000000000000000000008c25e7297f35b9e584b146c106e3734aa5", - "0x000000000000000000000000000000000008b6df9d9d0c0ea380bc48310ede84", - "0x00000000000000000000000000000012d16400949298c4ed8775dbd099f604eb", - "0x0000000000000000000000000000000000046a45b2ffff0b15bccb769410f0c6", - "0x000000000000000000000000000000e7e947762d2d048ce7f6665b3baa04ead7", - "0x00000000000000000000000000000000001ea232831783a7582dcc51bf4eadbf", - "0x00000000000000000000000000000086e830c4d43c3c29749b2fc7f4b5b155ce", - "0x00000000000000000000000000000000000fda317a4ac514b23a25922bbd9a1d", - "0x000000000000000000000000000000fedab61215f4a9d23814bb5a23834313c5", - "0x000000000000000000000000000000000000b858f7229c2c222a0ab6caa1880e", - "0x0000000000000000000000000000001793dceaabd48a03734262746faff95935", - "0x00000000000000000000000000000000000a4f22db0efc68cf0df17322429f0a", - "0x000000000000000000000000000000adce0e85866dc46f5f66f47df146b685c6", - "0x00000000000000000000000000000000002a231cf2a01920132b5eab94bb7405", - "0x00000000000000000000000000000033b541568e24a22ce145ae952bf21af48c", - "0x000000000000000000000000000000000007288a618a7842270c8bcdbb60fccc", - "0x000000000000000000000000000000400d4b7c71992b27cb933430e5d1264a65", - "0x000000000000000000000000000000000016817d0b7a7a4b9b6c8a5f2ceba157", - "0x000000000000000000000000000000c7b21a1f18cf4640baa93d3f2fb65da502", - "0x000000000000000000000000000000000020a2282ed1c56eede59a639225b55d", - "0x0000000000000000000000000000003caedac6fce55f60f28b97d869da639648", - "0x000000000000000000000000000000000002031183bb12a7fecfec0492f5df73", - "0x0000000000000000000000000000000deda85dbacbaf8d5b1cf52239dd6870c6", - "0x000000000000000000000000000000000013af7b44a599c0379087cccf300fc8", - "0x000000000000000000000000000000c847575824e9ee7fe7be6d249e5660cfa6", - "0x000000000000000000000000000000000019858d6072f5df05d83eef72e0d501", - "0x00000000000000000000000000000031cbd81d9d86f8edb4f1ce8c585be3ff64", - "0x00000000000000000000000000000000001ad5009483ff80711683d9c9c1eaef", - "0x00000000000000000000000000000093b62d92a5e4e671f9ff68ef459bbe41d8", - "0x00000000000000000000000000000000002bddbd810b63e9e9c1bd43c89840ee", - "0x00000000000000000000000000000014232dd2fa6be991c87d44f36ca2ef5e44", - "0x00000000000000000000000000000000000209fcd92633224af40926d1bdb534", - "0x000000000000000000000000000000645e35183a9277848e16eb402c05de12f2", - "0x0000000000000000000000000000000000242fae97ae1bbb614d2e0d4b78a004", - "0x0000000000000000000000000000008e2da2cd9211062f76b93b0f0e732e4076", - "0x00000000000000000000000000000000000b7457323fee9a61b7747f65790906", - "0x000000000000000000000000000000ef0c941754878d36cefb2bcb1b8c02b9d7", - "0x0000000000000000000000000000000000197a92707897563b7643e7b2f42280", - "0x000000000000000000000000000000c64f9f72c79dbdf07596b8f037873f29a1", - "0x000000000000000000000000000000000002b39ad1dc0e1e02ccf298a282f134", - "0x000000000000000000000000000000d2f0b7c0fec1444279003f14d31953a858", - "0x00000000000000000000000000000000002bc6486c744d35650250409cc7df8b", - "0x0000000000000000000000000000002229681f78ecec88d895ca9ac605699c6f", - "0x00000000000000000000000000000000002906b041a9bd4056ffaa884dc30a72", - "0x000000000000000000000000000000fc9c079ed09284e2586572101690a8d49e", - "0x000000000000000000000000000000000026066cbec6b411dc55a1676017dec6", - "0x0000000000000000000000000000000278fdbe7102117c64d8d409f40ca99dbd", - "0x0000000000000000000000000000000000135353d6af44393fc6c805faff5504", - "0x00000000000000000000000000000016122ef57f9df0e6b692e636f9d26883ea", - "0x00000000000000000000000000000000002b82e72b1d69fbc47688535a91ca85", - "0x0000000000000000000000000000007aa7e5d696f811195e98bc74f5732fe602", - "0x000000000000000000000000000000000025170300af048efc7b80ee01ad0950", - "0x0000000000000000000000000000008fe6566761478873a72aa49317797e588a", - "0x00000000000000000000000000000000000cd28e457786e419c674c69531c51c", - "0x000000000000000000000000000000b11c3cabf77f3cc89b2f6f16a5909b6d70", - "0x00000000000000000000000000000000000463fed5d9336e9cefa6689837a121", - "0x00000000000000000000000000000005cf6516f4d3d8934958d1a29934738886", - "0x00000000000000000000000000000000000398aade14c4fe058031eed7009d20", - "0x00000000000000000000000000000026c7c75fc879abb769520b1f061da5141f", - "0x000000000000000000000000000000000023d40f309c37a501553e8872e78be0", + "0x000000000000000000000000000000d4ebcfebbd7206c5d35159aae0c547282d", + "0x0000000000000000000000000000000000146feccfb4b108f4b04120692d35f0", + "0x000000000000000000000000000000d7be024001aca3667e9a2fd308f98597be", + "0x000000000000000000000000000000000018a12d3154e62e7d331a8ddcad91a8", + "0x000000000000000000000000000000be0a5b40a05fde9f85f041d4c51bd3d187", + "0x0000000000000000000000000000000000267415eb966a72d6a099c44de48c90", + "0x0000000000000000000000000000008e7e7edb64f3349bac0683325bd4afb51c", + "0x00000000000000000000000000000000000d2e44727a72afce981a8fe809d847", + "0x000000000000000000000000000000914d80004450d2538d2dc1419024203c22", + "0x00000000000000000000000000000000002bdc7079c51abf5dcb8a2a787c3833", + "0x0000000000000000000000000000005dd045a3d392397c1fc7e0edc6c8e6d14f", + "0x000000000000000000000000000000000021f4d4baa172b98da4d7653e716049", + "0x000000000000000000000000000000ecc7a15372e8271d7c435e0fe24df4966b", + "0x00000000000000000000000000000000002397dace37d1c02e0712c8718bb28a", + "0x0000000000000000000000000000006948de1859d5c0b9756608b99625c323ca", + "0x00000000000000000000000000000000001700e6514f1d9c13a7b05092279cf2", + "0x000000000000000000000000000000206a77c333ffdc5ce70666fed2a340e210", + "0x000000000000000000000000000000000007d5ebfea19f9d7fa0c1b410369224", + "0x0000000000000000000000000000009a5314808b45db77f3234f38ceb47cb431", + "0x0000000000000000000000000000000000107d3a1dd1e36871428cde8e3e47bc", + "0x000000000000000000000000000000d6aa212de343758b1ddb48d67cea2896b4", + "0x00000000000000000000000000000000000c5456ec044dbde3cae0e7f3ec5a8a", + "0x000000000000000000000000000000b67dee71396d980ed13ee00b9f1797cedf", + "0x000000000000000000000000000000000018ae0e6b8622d8c3799572d75a3af5", + "0x000000000000000000000000000000552393d09533e1b2004bd84e9f8a53a88f", + "0x00000000000000000000000000000000000456bb701b5b0b463bbcf0c4fe7190", + "0x00000000000000000000000000000074156481e9a3f8f091d30db1003a6daab4", + "0x00000000000000000000000000000000000380f4e6bb304776bfd4fb22e20987", + "0x000000000000000000000000000000d0a00080cd8f34ba0e37546c102665c8fe", + "0x00000000000000000000000000000000000d56bbef147278fdc057f9a336d984", + "0x000000000000000000000000000000f11f3eaed8726026211d2ee0f83e32e453", + "0x0000000000000000000000000000000000291fbbe0b7f6f2823d5469cf981a1e", + "0x00000000000000000000000000000092c0f09c92f3ca9d7e710166d118ae7554", + "0x00000000000000000000000000000000000f62e22dfc823acca2f354971ee802", + "0x0000000000000000000000000000007b625830f5f4e05a23a7cdef5433109704", + "0x00000000000000000000000000000000002d97262919b8ba306f282e4ff89a86", + "0x0000000000000000000000000000003a287679833abd0f68ee95e4969654957e", + "0x000000000000000000000000000000000000abd2e648442b207cbc5f888f27fd", + "0x000000000000000000000000000000a63465915c6743dda47c57b48d39f91949", + "0x000000000000000000000000000000000010ffd000a67a56b86b39afc0dd0944", + "0x000000000000000000000000000000c6498ab32aef0a4eaeb8ba540af21d3492", + "0x00000000000000000000000000000000002bec02ecb9ec3e706ecafcf1525e6d", + "0x0000000000000000000000000000004a14debbb6354ec457ec5352fcccd53f16", + "0x0000000000000000000000000000000000173e68a5a87291d5158b7e543f2eb5", + "0x000000000000000000000000000000e607217740cfbf4bc9d4754e365e9e3b49", + "0x0000000000000000000000000000000000220b73b9ddb031d3c0003d8c0e98ff", + "0x00000000000000000000000000000013b6575637a08998b25813e41185305a39", + "0x000000000000000000000000000000000000b1ec9feb2651dce08c9f211249bc", + "0x000000000000000000000000000000a749c1c71c87b509d7a1614d3aca240562", + "0x00000000000000000000000000000000001f8875b669e9a705b16885884b2ea6", + "0x000000000000000000000000000000538c26a5208bce38bc5be597e1e47ebd16", + "0x000000000000000000000000000000000006dcb6186920ba1438d63b024110f6", + "0x000000000000000000000000000000972a1c7250e58722cb97529c853aeda46c", + "0x00000000000000000000000000000000001dad3f4e78044bf6197cbd3e376f67", + "0x000000000000000000000000000000d68a49412f45d61ef4fa8a13437267f9de", + "0x0000000000000000000000000000000000243adeaa8a631cdf7bc2586150dba2", + "0x00000000000000000000000000000034dc0d3a5b861e339599c058b7d2cc3c98", + "0x00000000000000000000000000000000000c2f32da2eb5408773abd13d541942", + "0x000000000000000000000000000000a04ea74c6597bbf3b81cc7a53236bf3876", + "0x00000000000000000000000000000000001c91d37628aafd4ff32e52db9cac3e", + "0x000000000000000000000000000000b71768e0260f1febc4de987388c24469db", + "0x000000000000000000000000000000000009845dcaa2e999f4253c2028939b46", + "0x00000000000000000000000000000040caf1ccb7d2d91dfaf0b47e5949a6ccd2", + "0x00000000000000000000000000000000001ef6dcd11edb14ad68719546206082", + "0x000000000000000000000000000000b51f47e92a955b9da130f104de078ecc03", + "0x000000000000000000000000000000000028a3bd5482cb034f9bcdd6ca3de8ed", + "0x000000000000000000000000000000d345405bd52d00714fca255efc0f7fab89", + "0x0000000000000000000000000000000000251fc5846cb54a51ddc773333319bc", + "0x000000000000000000000000000000593b0399022baa9b81f6984ec01274e735", + "0x000000000000000000000000000000000000c3f3ab2ce825e18d6111e626ea6a", + "0x0000000000000000000000000000005cc6d90be494ca38de9eec1cdbf507fc6b", + "0x000000000000000000000000000000000011b90ad816a8acb9c480eecd63319a", + "0x00000000000000000000000000000067746684a01ceb1c5a1f81ee10d26ee633", + "0x00000000000000000000000000000000002549c43ff38806988756f5af1f3865", + "0x0000000000000000000000000000005657abf5088e2f0e04a751fa65bf435d24", + "0x000000000000000000000000000000000009fedcbcdc6451de0963b131e17bf0", + "0x000000000000000000000000000000b56ea63fc700e022df5fa6f5e913d72f40", + "0x00000000000000000000000000000000000ad26789a5de3ad9b90745917e5fbc", + "0x0000000000000000000000000000006368bce15b90d683bc81d3cf11be2acb7e", + "0x000000000000000000000000000000000011b602ecc274da10b120de12e40328", + "0x0000000000000000000000000000003e32d693be21588a079ae1360b83365516", + "0x000000000000000000000000000000000014d16ae385f587dffedad5f9759bd6", + "0x00000000000000000000000000000042606170c81331007fd775103485fe98e5", + "0x000000000000000000000000000000000025df1c7fee25fb76038dbe468f903f", + "0x0000000000000000000000000000000c4b63a0f52c0cb0044162587e05627325", + "0x00000000000000000000000000000000001d8af39d67c3e31b60c1800976077c", + "0x000000000000000000000000000000f649bb7f78848c289f41635efc567119cc", + "0x000000000000000000000000000000000019c652169411c3c0f3e7d417a55b2e", + "0x00000000000000000000000000000084a9b3527cd2ebff62b245a04aab258f92", + "0x00000000000000000000000000000000000a85019e1252699312cbd5ec6a23b2", + "0x00000000000000000000000000000000b5eee72336430c3feb7da6b8b57e1551", + "0x00000000000000000000000000000000001bba1a6e49f0ba66643e8b32fd090e", + "0x0000000000000000000000000000004d612c80fc91a269aaaaa975c84c8e58d6", + "0x000000000000000000000000000000000000b34e0082bc5aed819a81bb36744c", + "0x000000000000000000000000000000beb969e0f2c7856270dc5fda2c5d399dcc", + "0x00000000000000000000000000000000000013aea3bcc0841ec6d94b285f1beb", + "0x000000000000000000000000000000b64bcb23012aef7421ae1b97a9a33f941b", + "0x000000000000000000000000000000000005aa1eeb4d3694a5063763f82318fd", + "0x000000000000000000000000000000b8d3152c9ac8136776bbd21b731aefc643", + "0x00000000000000000000000000000000001b3938ba03ad7d153b1ffb7d6a18de", + "0x0000000000000000000000000000003a339e8cb8c648d07c34ddcb4ef4452783", + "0x000000000000000000000000000000000027807a4f7b23d9cc1c865ef9930999", + "0x000000000000000000000000000000bc4fd810c781d7b239a47a086361686edc", + "0x00000000000000000000000000000000000cbf9d6e0b6faa609ddbd5817f5d10", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000000000089ee6829d8b3a1a96f698988dd09bf2628", - "0x00000000000000000000000000000000002314ad42c59d31b78255e0f3898d19", - "0x000000000000000000000000000000fcae2710f830d60dbd1cf6625a01c91f62", - "0x00000000000000000000000000000000002107696d6ce53fa63967b840d7e538", + "0x000000000000000000000000000000c52c874f646f47f0bcb67fb225dc62b720", + "0x00000000000000000000000000000000001c7f11acb4c0f6ff1793cbc1418d1d", + "0x00000000000000000000000000000008982e8fa85bb46a3558faf65f0fdc774c", + "0x00000000000000000000000000000000000fce275683d77734592926688a261e", "0x000000000000000000000000000000b5c1eac95b264c302dc854e6f22d7330df", "0x00000000000000000000000000000000000fcbbf9d3cf402baa3eeda5f0a9e49", "0x000000000000000000000000000000def9d58fc2920836194261f7b163fefbaf", "0x0000000000000000000000000000000000283edfda89c9480597f0b3442e9752", - "0x0000000000000000000000000000004264681c9136a2fde7137335ef716fecde", - "0x000000000000000000000000000000000027ca9ccf01429923a61d872c7c224c", - "0x0000000000000000000000000000006df5ee4c1358443f5a14086b5196e13e46", - "0x0000000000000000000000000000000000192b1a6d3b14dfe5a9ad63951d2d76" + "0x000000000000000000000000000000e55ba19751adfe6c36324d3fb6c2da0989", + "0x00000000000000000000000000000000001d58aa61c64ad522043d79c4802219", + "0x00000000000000000000000000000078f4b3bc61f19d6e7069359bbf47e7f907", + "0x00000000000000000000000000000000002d7c18a93c3dae58809faaeec6a86a" ] - hash = "0x04039ee25228755a2145821cc1cd15e67baed7a5d008f159beec6bfd18424d1a" + hash = "0x14138fb13f9cd9084b68045326b4670e915b9b2eb05692448146c971083ee350" [private_call.function_leaf_membership_witness] leaf_index = "0" sibling_path = [ - "0x1dd321a6e7f97125661870111830152aafd73449199f3904d3da783c92073ea5", - "0x14a5577a8fcd6b732358c3f6295e6732907ae05ea7004399d5be652d1ebf6c59", + "0x0908953c97972b22333706d74b4504e22a9bf0cc0af39fc1a0d79dcedd974b5c", + "0x2432a2ca27afca26c98cbfa893be0a4140d90541e1b5f1a640f815a778a31764", "0x0e1ce4f11f4d51a7d3136abbd625315fff3876d322e46ad8401da96f8e43a614", "0x1a0ca5eecb1430479902264f04e557160a4666fb42bb8b283c6397e3d17ac937", "0x2a6595890719fef7967c209488728aa5342438ba52058a3c770202f55acf6854" ] [private_call.public_keys.npk_m.inner] -x = "0x175d325f91f136d09f7b5b30ee6e82a8720dcd4fadd87e9828a989461ffe5828" -y = "0x161bf54b24e177c5cbb154fc01a12732e92c21c5a04985cea5374033ed510b4c" +x = "0x1f255bbf4e02d3902299100f9b7ed75f058ec137f091c64c566fb1b64b9bb300" +y = "0x2aee0a244040faa91d2a3ab045f8212d59f509529c0ec5baf6329abc8b61a11b" is_infinite = false [private_call.public_keys.ivpk_m.inner] -x = "0x084470117b40e59472a550c5bb74fad0de825061d5116ea28b85d3a0b3634d9e" -y = "0x06a03b6a63d51193e916edec42b78bccf90846afa4c9987be4e3ee3462daf638" +x = "0x18ef1e6ff50bae10bfb4c04c671f8ae025ab7594dd586658d006220ef5c7f430" +y = "0x1664049bc703310c2c8ecf0e6325062f898e90d0b21b10e8909eb0d3c70d60d4" is_infinite = false [private_call.public_keys.ovpk_m.inner] -x = "0x09249dbe7627ff4d52c0487e62b399965ceb57300fad2bc7bbbd7b79ab7d44b9" -y = "0x24f2152543be84b54ba5f22bf6963471c20e444404750bbd5e7a0d66b503da2b" +x = "0x02ee59eb9547bf7df520c7d8df253c8b3d6d325c18957e7b08cf4498079ada3d" +y = "0x1b41e6a426c43ef0bc8719a1c8938c56627459acb12a0da9979717d6008a7e48" is_infinite = false [private_call.public_keys.tpk_m.inner] -x = "0x1c181f5eeddf86600e1c59df6e221cb8565df5e87f411ed76579c47fc43ce754" -y = "0x098969bc1d70e363cf0c5b76044acd6cf01e077cb70e3da7005569c39d118f16" +x = "0x105cc55a1af8a19fd6a71fe0b5afa66fd8386e14d1f2c0f78cdf047b14a94cf2" +y = "0x0cb7a65e8468243e2aa31100570c304483804544227b584e1f2e1626ee6bdb25" is_infinite = false [private_call.salted_initialization_hash] - inner = "0x12b797eecc7e6f3aff2a5e4f784c85141d8762484adf39130aed92c17c442b53" + inner = "0x2352a31ad816cad499a572ab5b63989c0c30edb1e3616cdfc3dcdd18846c1363" [app_public_inputs] -args_hash = "0x23516c9ddf3cc536b189e0d22fb5a3c577804e50a0142020f8c16affe3ecd735" +args_hash = "0x2f5e98bce7d5b2867bfe2f77794a639d6dcdb827495879090a2ad3597f23ec0b" returns_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" start_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000001" -end_side_effect_counter = "0x000000000000000000000000000000000000000000000000000000000000000d" +end_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000004" min_revertible_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000003" is_fee_payer = false @@ -240,13 +244,13 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" inner = "0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000" [app_public_inputs.call_context.contract_address] - inner = "0x30021904ae3832fa38613650b957c74abcc7ae86fda9e53bcd89e7b638cf9d67" + inner = "0x17e5c98d998228e7de3dbb6c01ae1fd3aaf868bd45946d300e4c36f6d396dea0" [app_public_inputs.call_context.function_selector] inner = "0x0000000000000000000000000000000000000000000000000000000027e740b2" [[app_public_inputs.note_hash_read_requests]] - value = "0x1808fa11f6b6ffdbd9f9e94a8f4c91aa954111d43f44544ed0ffbbf73ccf9a63" + value = "0x0671d5c4778f2ccff0b927cf2f5f89b768a9e969755a61a825b1334b13142927" counter = "0x0000000000000000000000000000000000000000000000000000000000000002" [[app_public_inputs.note_hash_read_requests]] @@ -694,22 +698,22 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" note_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" [[app_public_inputs.private_call_requests]] - args_hash = "0x0af1e29b064dedd2a9cf35f6bd87361362530e6618692827c46333566e356220" + args_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" returns_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" - start_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000003" - end_side_effect_counter = "0x000000000000000000000000000000000000000000000000000000000000000c" + start_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000000" + end_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000000" [app_public_inputs.private_call_requests.call_context] is_static_call = false [app_public_inputs.private_call_requests.call_context.msg_sender] - inner = "0x30021904ae3832fa38613650b957c74abcc7ae86fda9e53bcd89e7b638cf9d67" + inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [app_public_inputs.private_call_requests.call_context.contract_address] - inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" + inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [app_public_inputs.private_call_requests.call_context.function_selector] - inner = "0x000000000000000000000000000000000000000000000000000000009462d279" + inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[app_public_inputs.private_call_requests]] args_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -784,20 +788,20 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[app_public_inputs.public_call_requests]] - counter = "0x0000000000000000000000000000000000000000000000000000000000000000" + counter = "0x0000000000000000000000000000000000000000000000000000000000000003" [app_public_inputs.public_call_requests.inner] - is_static_call = false - args_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" + is_static_call = true + args_hash = "0x2d8b7f64cd689f5fdc2633f57f8eda15aff596cb11b1f76612eca8304c90fdfb" [app_public_inputs.public_call_requests.inner.msg_sender] - inner = "0x0000000000000000000000000000000000000000000000000000000000000000" + inner = "0x17e5c98d998228e7de3dbb6c01ae1fd3aaf868bd45946d300e4c36f6d396dea0" [app_public_inputs.public_call_requests.inner.contract_address] - inner = "0x0000000000000000000000000000000000000000000000000000000000000000" + inner = "0x0a762f2c969988845e3f2ec70b07cda6dadd97cc3542c63c3658211d44d09709" [app_public_inputs.public_call_requests.inner.function_selector] - inner = "0x0000000000000000000000000000000000000000000000000000000000000000" + inner = "0x00000000000000000000000000000000000000000000000000000000d5441b0d" [[app_public_inputs.public_call_requests]] counter = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -1488,51 +1492,51 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" length = "0x0000000000000000000000000000000000000000000000000000000000000000" [app_public_inputs.historical_header] - total_fees = "0x0000000000000000000000000000000000000000000000000011b417896f129a" - total_mana_used = "0x0000000000000000000000000000000000000000000000000000000000016771" + total_fees = "0x00000000000000000000000000000000000000000000000000f3d59e049eb1ac" + total_mana_used = "0x00000000000000000000000000000000000000000000000000000000001355c1" [app_public_inputs.historical_header.last_archive] - root = "0x0781b1cc32dbe21aba1e27519e765bd44222b52ef464c6b63dfa97b399376c2e" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000009" + root = "0x2686a574dfb90890de58e447bcd7f12504950a18bbe781d95758161ca30dcf66" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000005" [app_public_inputs.historical_header.content_commitment] num_txs = "0x0000000000000000000000000000000000000000000000000000000000000002" - blobs_hash = "0x0008822f60476d6dc34ec6109d3ad69dd1747a9484777021d8e717166bc7d5e6" + blobs_hash = "0x002ee5246d9ece5e2f64027ac8216616887df1da344019d0e0f0cfd1c2483af7" in_hash = "0x00089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c" out_hash = "0x00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb" [app_public_inputs.historical_header.state.l1_to_l2_message_tree] root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000090" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050" [app_public_inputs.historical_header.state.partial.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000480" +root = "0x265f2fb8ecbd96d51d74d79901934e60af982af7b6caa46153eafcf3201df280" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000280" [app_public_inputs.historical_header.state.partial.nullifier_tree] -root = "0x0a639c242b766d8bd94d437483546e33c4a8c27feadf50bc4ef523e9f191e927" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000500" +root = "0x0d8cfcd6ecef742ecda848c0db79ef7d0fe639b7b69564d103f788d530832eba" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" [app_public_inputs.historical_header.state.partial.public_data_tree] -root = "0x2528ba08e1171e992f4744a8d8761bbe5611447c52d673882bde6a9e3b716e1a" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [app_public_inputs.historical_header.global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000009" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000016" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2eae" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000005" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000009" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a8e5" [app_public_inputs.historical_header.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [app_public_inputs.historical_header.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [app_public_inputs.historical_header.global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9c6e14ac" [app_public_inputs.tx_context] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" @@ -1548,4 +1552,8 @@ l2_gas = "0x00000000000000000000000000000000000000000000000000000000005b8d80" [app_public_inputs.tx_context.gas_settings.max_fees_per_gas] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" -fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" + +[app_public_inputs.tx_context.gas_settings.max_priority_fees_per_gas] +fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-inner/Prover.toml b/noir-projects/noir-protocol-circuits/crates/private-kernel-inner/Prover.toml index 491eb826213..6d4dbc04951 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-inner/Prover.toml +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-inner/Prover.toml @@ -1,19 +1,19 @@ [previous_kernel] vk_index = "0x0000000000000000000000000000000000000000000000000000000000000002" vk_path = [ - "0x0a889b72ac9f79e9a8c4c5934e62f265fe1b862799220c8fef796558ef921a6f", - "0x2788666fcc1fce27d0ac10e13716483d548ddc3411f466e5caef85cea2384902", - "0x281a8c9b2c044cffa01e5f56858d1d71aa11c4b28a1e90407565ca646ea0ee5d", - "0x25e71fd64ecaa6b98ef492c6d93da8164a259284041220c258edb94fe47706ab", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x0ce61ee2dcb1ec74887ccf2406de83c0aa8b61c744505f859b5387ecb59c1978", + "0x14aac9fb9c0804b14d039ca6cafd96319eaf9ed3adc7d948c2a87c8d8f459704", + "0x2443f5b9301a30050fe915e054a69535a34cb245002e6ab2ca38071d7e8e9326", + "0x07204dd4c0b5e97ed0e01d06354130938eb17178be6bacafbdee48057e59aa79", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] [previous_kernel.vk] key = [ "0x0000000000000000000000000000000000000000000000000000000000100000", "0x0000000000000000000000000000000000000000000000000000000000000020", - "0x0000000000000000000000000000000000000000000000000000000000000401", + "0x00000000000000000000000000000000000000000000000000000000000328b1", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000010", "0x0000000000000000000000000000000000000000000000000000000000000011", @@ -34,183 +34,183 @@ vk_path = [ "0x0000000000000000000000000000000000000000000000000000000000000008", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x000000000000000000000000000000bdb8660741b22e5395cf00707303a0e4c8", - "0x00000000000000000000000000000000002266b354cecbdcd902681044894a40", - "0x00000000000000000000000000000091dbe6a75026367f305570bb6d89ffd01a", - "0x00000000000000000000000000000000002df3821751607e164aac7a0f1e988a", - "0x000000000000000000000000000000a0d7c77a0348ffd2a3d7d0581e1f6e135b", - "0x00000000000000000000000000000000002f036e9b41e66011a655a1c7d2311d", - "0x0000000000000000000000000000007403d15119a43b300f9c2ac0cd70e3ca32", - "0x00000000000000000000000000000000000b0dab18c4ab6483313257848783af", - "0x0000000000000000000000000000000d54a8d88b562565d66de776cdf643c0f0", - "0x0000000000000000000000000000000000130261a5af72d3f78c0d3010922443", - "0x000000000000000000000000000000e14e72474d15d503b27bb52fa006c3f695", - "0x00000000000000000000000000000000000d296a70c531e671c30c89a0385998", - "0x000000000000000000000000000000138d63a21f7617000e69d553510dbf0732", - "0x00000000000000000000000000000000002652790fab7c8c9fb84430f9dabf4b", - "0x0000000000000000000000000000009c5b9cb7588749b754a396655371eeb5b6", - "0x00000000000000000000000000000000001f54ffb7a5861a48cfd0eb06d2e7ed", - "0x00000000000000000000000000000055d8a96d4c53a2e49482208646aeea7d48", - "0x00000000000000000000000000000000000e859d51221c006931b23eff9e41eb", - "0x0000000000000000000000000000006187dc541ee307c50471c643b69c48655d", - "0x00000000000000000000000000000000001ef8708f693f87ad5c769966aa5d2c", - "0x00000000000000000000000000000026afb3476659464895e3958e99f1c96f3e", - "0x00000000000000000000000000000000001003d236df13109f69e5197c80fa40", - "0x000000000000000000000000000000db97c1d2a0b2dac79c02cc8a2a78241c9f", - "0x000000000000000000000000000000000005b0d5a1f330ed1b52bfa4f60c6a70", - "0x000000000000000000000000000000370e33673be61a8764bbf6146285166ec0", - "0x000000000000000000000000000000000019852450b5c11f8a30a211ef326032", - "0x0000000000000000000000000000005a23caff4441e0422506d8e723b8a7df0c", - "0x000000000000000000000000000000000007dfb5c3da9c3785a97694a386d52b", - "0x000000000000000000000000000000163ab938fa99acf8fb18a3932ac86c0ab9", - "0x00000000000000000000000000000000000bc533f878640075d319513683e78b", - "0x0000000000000000000000000000000c0d9e5d79b2e1ec0fa93e17248d6996a7", - "0x00000000000000000000000000000000001aacf7a929cbaf57bcaae75a2fda0d", - "0x000000000000000000000000000000f012ee85ba4f7291ae8d67836381c52de0", - "0x0000000000000000000000000000000000302ae5d46e8b8dd08c8eb9f2efbff9", - "0x000000000000000000000000000000c3585cbfb93c8c90bdae7692f2636e42ba", - "0x0000000000000000000000000000000000098b254b6c438b1e6a0c872a21a3db", - "0x0000000000000000000000000000008283e6ad48f41eeadadeae2c02f4fadf44", - "0x00000000000000000000000000000000001cb3cdb38a62d0033d2afd233b8940", - "0x000000000000000000000000000000bb5e9a1635fe20062208fa2a10999a62ee", - "0x0000000000000000000000000000000000169029b757a992e183a19bbf71ba26", - "0x00000000000000000000000000000074a419c349bdc6348b0b9adcc827856d09", - "0x0000000000000000000000000000000000295b0410acc9ae763804d3a5435a8c", - "0x00000000000000000000000000000085a05861f709d5eddef694cea642ffbbd2", - "0x00000000000000000000000000000000000054f63cbfb675285771f5cee257db", - "0x00000000000000000000000000000032ae6474dfe95e5012c2153ddd686f5f9e", - "0x000000000000000000000000000000000004f2f7ac11ee3e22d13dfe52157e39", - "0x000000000000000000000000000000f4e53bd173ab4dcc66ec752d663fd3e088", - "0x00000000000000000000000000000000001fee153e7e029bae80a357547d36ec", - "0x000000000000000000000000000000bbe500b1fdd6f919a3d086eeabb7274fa0", - "0x000000000000000000000000000000000004195cb88ad976cb0be546ccc955b9", - "0x000000000000000000000000000000767a7a1e09af613c44cb79195452540e2b", - "0x00000000000000000000000000000000002c66c96813190de991b3d56b1389c3", - "0x000000000000000000000000000000d24f0a0cf38ca9316be400c743bbbb3bec", - "0x000000000000000000000000000000000027822ff7bb9483b29df97785ee5f9d", - "0x000000000000000000000000000000468d47d31fb480e2c192ddb6673e5cbea8", - "0x000000000000000000000000000000000001d6ab1aaf7944c2be04aea4060d71", - "0x000000000000000000000000000000df89af614d1302d28d8f2f6e77e629dae3", - "0x00000000000000000000000000000000000c614fd715cadfbe1020a2c51a0e36", - "0x0000000000000000000000000000007544d6bb83b52ab4563d3065283da2dd82", - "0x00000000000000000000000000000000001e0f70f9633083be89ddad18d65bec", - "0x0000000000000000000000000000006d4bb2fac93fe99fd8ecb5dd6c084683d0", - "0x00000000000000000000000000000000002a549eeb5211fbb0e1eba68b77f250", - "0x0000000000000000000000000000001a7dc8d0631a266642a2f6568f1ab25039", - "0x00000000000000000000000000000000002ceb12947ea1786013a46163d60f9d", - "0x000000000000000000000000000000bb181c2111d296ec712e24876a9e17b290", - "0x0000000000000000000000000000000000031ae8eff97ebe7a6137ae4f19cb92", - "0x0000000000000000000000000000000074f9eebc9b8da31320f7b65bebfb5b16", - "0x000000000000000000000000000000000007164f19e5c047c1f1df60850b8851", - "0x0000000000000000000000000000008c20f837c5b831a4e4cca2e5e3797628d5", - "0x00000000000000000000000000000000001bec99c63538ce35dd4d9a702db5fd", - "0x0000000000000000000000000000007900304a2c97c080d35843a6fe3bffc41d", - "0x0000000000000000000000000000000000115df5e5cd01f3cd8447ac1a8abc9b", - "0x000000000000000000000000000000ad0e4d84f585e1887c7aad232fd3060eab", - "0x000000000000000000000000000000000006ca86ad7d5f868b9ffba04f9201db", - "0x000000000000000000000000000000fb3976491af8495625d43818e7bae726ed", - "0x0000000000000000000000000000000000067b3d5dace1ea73eac1d3af2a6ebb", - "0x000000000000000000000000000000a68ed47659e767bb5c822514b9f439085a", - "0x00000000000000000000000000000000000511a4b4410521c27534b4aea4a451", - "0x0000000000000000000000000000003f7d9f327f15b00f8ede106392fe793a85", - "0x000000000000000000000000000000000024c5dfa3f030bdcf2c11320c0a222e", - "0x00000000000000000000000000000034e161a6743254fa3244d07d1930d1e1c9", - "0x0000000000000000000000000000000000095840cec5bec315796d34281c391e", - "0x000000000000000000000000000000346d4b8700fb7fb7f109dc4ad34d181502", - "0x00000000000000000000000000000000001d42289e290e17dae176e4db0cfdee", - "0x000000000000000000000000000000b97b4d7fbcfcc599dea5de717113099c41", - "0x000000000000000000000000000000000008c140ddf2bcdc25c47a7e0a1f775d", - "0x000000000000000000000000000000e6b230b09e3803ef5860b718006873291b", - "0x0000000000000000000000000000000000285cb5b457d1e20dea2f9863ee5245", - "0x0000000000000000000000000000003acc6def4164d878b56e5b2fe2bfa52199", - "0x000000000000000000000000000000000022cf69996ae471056bcae7b3c38cbc", - "0x000000000000000000000000000000239623839c51be6ffe83c77c80b8f94ad5", - "0x0000000000000000000000000000000000075cc2c3c9e3079bec86764aa5cfd0", - "0x0000000000000000000000000000008c88b485298919bf7164440942d6f6c5ad", - "0x00000000000000000000000000000000000c5dd6e29eac9076cc2f5995fcf27c", - "0x0000000000000000000000000000005b7ac436f888999a48f79ef212e6483f14", - "0x000000000000000000000000000000000009fc56f5a2122d1ed9353860ba68ab", - "0x000000000000000000000000000000dace4e23bf41b55e3098bd8e82e74b1c1e", - "0x00000000000000000000000000000000000883499c226658d83b4d0cc7b08c15", - "0x0000000000000000000000000000005c0373d8b286bf727301571a54e1636e77", - "0x00000000000000000000000000000000001f268c0945bdea494fbfc52e8581c1", - "0x000000000000000000000000000000c6b7e770c1e62e2504ce986f21324ff939", - "0x000000000000000000000000000000000001b92f92042ae2556e31cf72cc3990", - "0x0000000000000000000000000000007007220c2c02f4ec2c1c5fada9056b8c37", - "0x00000000000000000000000000000000003038ffe6284e174445a0eb11a63e0b", + "0x00000000000000000000000000000008e7d4090fe1b03bcf550959c99799139b", + "0x0000000000000000000000000000000000088aa786da9dc2a41ca5099a6e80ca", + "0x00000000000000000000000000000046eeffc45db052c4d1bdf6c7dc525c0bdf", + "0x0000000000000000000000000000000000152da573c87280836bcaca9dc4df3f", + "0x000000000000000000000000000000712f5e8ad99ee018b7f0a793f37925d3b8", + "0x00000000000000000000000000000000000f3706899be0ef5913132bf5f4d951", + "0x000000000000000000000000000000422e8d906c60168c0be9f5a426f48952d5", + "0x0000000000000000000000000000000000058a22d8e370676a6ff18365997985", + "0x00000000000000000000000000000049131fc550ae760a6c82e62ac79afc33c3", + "0x0000000000000000000000000000000000284748c61bfc04464a70a5a89c964b", + "0x0000000000000000000000000000009498fe80df0a34dacd50b4caeb43db411b", + "0x00000000000000000000000000000000000382573fe4ed920030d18612fef5c0", + "0x000000000000000000000000000000a04bfe32d94b08453992a5fcb1376d5b2a", + "0x000000000000000000000000000000000003f5a2b96519c290b85e3b4eea537d", + "0x0000000000000000000000000000004f7390273a8edb178a56040acc799fa262", + "0x00000000000000000000000000000000000511db16ad03700e6f5603ac4803c5", + "0x0000000000000000000000000000005578be7571824b0e28e4567ce20e577e16", + "0x00000000000000000000000000000000000bb588368a6d9f13ab43f74863c783", + "0x000000000000000000000000000000f26d7183d44a24465a57b817ca7d71a2ac", + "0x000000000000000000000000000000000010f829c89ca2bb8ada98ab0bbc6ce6", + "0x000000000000000000000000000000dbccb4e6119d17ba7f6e21b80ae999c93f", + "0x000000000000000000000000000000000013d7fcd231fec46500aba2d5d6e161", + "0x00000000000000000000000000000085ae4c83ef8028042d9af6fda3fd8c7d3f", + "0x00000000000000000000000000000000002612f38f10de0ef90b0d11382031a9", + "0x000000000000000000000000000000860ecf905609eaf6c22c7dbdd68c479317", + "0x00000000000000000000000000000000000d01000ddfa98166c5d1b6bfd73355", + "0x0000000000000000000000000000009acc767c780db6e6aaa25ba0b06eba7083", + "0x000000000000000000000000000000000006504ac42a7d41d84c7f9b3cc10003", + "0x00000000000000000000000000000090d53c6a3b26339cda6b73df9208314159", + "0x0000000000000000000000000000000000298c3311fc9170f92de940b042aab9", + "0x000000000000000000000000000000bf37537eb196b05c1d98fa51016a9bacbb", + "0x000000000000000000000000000000000007b05f408a612847259016b9204ae4", + "0x0000000000000000000000000000005c79ac1179711322a3faabd18c294454ab", + "0x000000000000000000000000000000000004dd6e834173c31a395361b65813b2", + "0x0000000000000000000000000000009784392d9c0bd9f276f0aa761658646e69", + "0x000000000000000000000000000000000020ca1db0173d36601907cf2aadb603", + "0x00000000000000000000000000000000be5db8f7006d01ebccc9f7e646c74fb5", + "0x00000000000000000000000000000000000c641d7549aa8dd8975df30d662f32", + "0x00000000000000000000000000000090f01ac3c448a1c9856bcae9d90c606927", + "0x000000000000000000000000000000000026b019bd89b26eb965abb874aeaa2a", + "0x0000000000000000000000000000000e75a6786e8558d0e5985e07c16475b3b9", + "0x00000000000000000000000000000000001b1c4d1037b3922bd24c003b78e703", + "0x00000000000000000000000000000004dadf650da58289a087e179a695f2ab42", + "0x00000000000000000000000000000000001dfdd05fff37808b6f82a8ab154467", + "0x00000000000000000000000000000026a0352c25cccd1aea682fc8e975804a3e", + "0x0000000000000000000000000000000000172c855547ef1cf358b1193059ab94", + "0x000000000000000000000000000000c746ba121a8412b23d1a54c2679b7fcb42", + "0x0000000000000000000000000000000000188578f3213bb6dba81fc0826a77f1", + "0x00000000000000000000000000000017f1ad5a36d1d27be395a245b27103333d", + "0x000000000000000000000000000000000004aaea2a12bbe7658d9ebb39bcc49c", + "0x0000000000000000000000000000003d5674ba283399f8ff8e9a4a54ef04f90b", + "0x0000000000000000000000000000000000085ced78b3c248687e55753187ae1a", + "0x000000000000000000000000000000c3f69116b99bc6ffe2ea33348aedab107f", + "0x00000000000000000000000000000000002ac3afb3486a8008fe304176553b8f", + "0x0000000000000000000000000000002b2112dd48e799d1264079e8ef0d1bcaa9", + "0x00000000000000000000000000000000002c9560a53e0bded7eeda7efc3128ce", + "0x0000000000000000000000000000000e3fe7898593b80b35cd98e0ff8c02bb2b", + "0x00000000000000000000000000000000000c66cc6ac267b3a4c572d67dc8ac27", + "0x000000000000000000000000000000c47b62087e0dd0ddc91603f102f54d0171", + "0x00000000000000000000000000000000001c9648d80485a3e43a227e6629c25a", + "0x000000000000000000000000000000214b2f3eb099f4bfafb1a63f2432e8dcd1", + "0x000000000000000000000000000000000021eb1fb2496250bc33d04feef11b9f", + "0x00000000000000000000000000000087bb913c8ab457382b4885b1549b649680", + "0x00000000000000000000000000000000001c802ee78f0837e23a64fa2391a093", + "0x0000000000000000000000000000000d10830dd858f4805d37243f97c5f559da", + "0x0000000000000000000000000000000000273d9c7944b0c92df89fd28da7c666", + "0x00000000000000000000000000000089e2448d63ed1f84f8cecb18ad20633ae8", + "0x000000000000000000000000000000000008e02fd63dc9caf25847f31224cdfd", + "0x000000000000000000000000000000dc6ba3a1213dda9b61a3d18939f9f3c10b", + "0x00000000000000000000000000000000001661f68c161d87c1767ed0edd9cf30", + "0x00000000000000000000000000000083adb271c2e7df75561aa1f6e011ba2946", + "0x000000000000000000000000000000000021c2b90e7392f5c53cd72cdc3a8285", + "0x00000000000000000000000000000021babb5c272ea6ce467363b4f16ea037f0", + "0x000000000000000000000000000000000015c1fce69c7cd7d3f59d237552ebb6", + "0x0000000000000000000000000000001d2cc883c52a5f7afa2535f68e83f9189e", + "0x00000000000000000000000000000000000c8f881a97a9525dd7746214cbfe93", + "0x000000000000000000000000000000791e9a8be962e8c8f27f666b24c2abbc90", + "0x00000000000000000000000000000000002fad9971af750a3860c6d49295778a", + "0x000000000000000000000000000000131ff05b1c1ea1461ce91c58b9a20a532c", + "0x00000000000000000000000000000000000af03ded4dc393cd9ac3839040964f", + "0x000000000000000000000000000000eb6f8a370d1a3a8b3c0986487ca5b4a605", + "0x00000000000000000000000000000000000ef440ec41a10d0a00fee7fb295ef3", + "0x00000000000000000000000000000051a3368773137c41162f63d21d3aef9edb", + "0x00000000000000000000000000000000001955a635a95150b41ef2fe8814e101", + "0x00000000000000000000000000000085866306b45c95c394062c243642ec4c2c", + "0x00000000000000000000000000000000002d7d6f5ca3bc5678ce72e8814d69af", + "0x0000000000000000000000000000009ff72bb4ca23e2c2f7b1e74d6c3993b942", + "0x00000000000000000000000000000000002ef2d071d120a5d2cbdc65a86e3bd6", + "0x000000000000000000000000000000f6f4596202301b6ae4eb0ebbeadd203340", + "0x00000000000000000000000000000000000adc89c48d75b571636f5bbeb4a806", + "0x00000000000000000000000000000000034e3e27454ef992b4bf84b97baa7471", + "0x0000000000000000000000000000000000066f28135748f119631c3fe07fa9d7", + "0x0000000000000000000000000000003b64a66f2ac4979b65e56568c5a31b14ed", + "0x00000000000000000000000000000000002e25783551df50c004ec7cd1f4dd8b", + "0x000000000000000000000000000000e8258f84477c1b62565a559ba7bb38832e", + "0x000000000000000000000000000000000018f76cf0ceeccb4798de741ae89b64", + "0x0000000000000000000000000000001583b176f599e192d7119354034419e8f9", + "0x000000000000000000000000000000000004706a0e23ac32a3566907fb872362", + "0x000000000000000000000000000000d1b9992279342fce9a883849693fcda22a", + "0x000000000000000000000000000000000029046b299293cb09c593372eb6b3e6", + "0x000000000000000000000000000000469680c270e551515344592f59188fa765", + "0x00000000000000000000000000000000002d38d6d4ba1e4763a74ecdb11ca1f3", + "0x000000000000000000000000000000fce917c0d5dca019477c52f6075332b612", + "0x000000000000000000000000000000000012db39e892826b32610ee08251e005", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000008344e7cd358bb008fa2594f42e2058a4da", - "0x000000000000000000000000000000000028d98153e26aa139c5f995a12d6b82", - "0x000000000000000000000000000000ebbd996ba82dd482c0cd9f93dba5c948f1", - "0x00000000000000000000000000000000000abbbdb042fe5de7714689b4b198cb", + "0x000000000000000000000000000000c77bfd4e323bf4b587a765f94fd95a8b79", + "0x000000000000000000000000000000000024009f6e07ac7a3b6be0bb489fbecc", + "0x00000000000000000000000000000057a8b3aca5f0c3ee69ebb7065f7ad49d24", + "0x00000000000000000000000000000000001cbb1e4420739c580a8ddde8b93cf6", "0x0000000000000000000000000000006241ca0c75be2d15e6b9188983d6b41e2d", "0x00000000000000000000000000000000001a71ab9767b295f9337074850d2d40", "0x000000000000000000000000000000ec7f970d2da2ca7f41836eb044f5a75b01", "0x00000000000000000000000000000000001a9a63c00430414d47f85b2352b1d7", - "0x0000000000000000000000000000004264681c9136a2fde7137335ef716fecde", - "0x000000000000000000000000000000000027ca9ccf01429923a61d872c7c224c", - "0x0000000000000000000000000000006df5ee4c1358443f5a14086b5196e13e46", - "0x0000000000000000000000000000000000192b1a6d3b14dfe5a9ad63951d2d76" + "0x000000000000000000000000000000e55ba19751adfe6c36324d3fb6c2da0989", + "0x00000000000000000000000000000000001d58aa61c64ad522043d79c4802219", + "0x00000000000000000000000000000078f4b3bc61f19d6e7069359bbf47e7f907", + "0x00000000000000000000000000000000002d7c18a93c3dae58809faaeec6a86a" ] - hash = "0x0adf52c61cdf9eff768b463c554a67f3cac73b0c1cea2d3fcee90db3d7fccc20" + hash = "0x17f3e7d2936ffd8ff10f6e7df75f8ee328a19aeae4567176d6d81bb8a1e0a605" [previous_kernel_public_inputs] min_revertible_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000003" is_private_only = true [previous_kernel_public_inputs.constants] - vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" - protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" + vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" + protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [previous_kernel_public_inputs.constants.historical_header] - total_fees = "0x0000000000000000000000000000000000000000000000000011b417896f129a" - total_mana_used = "0x0000000000000000000000000000000000000000000000000000000000016771" + total_fees = "0x00000000000000000000000000000000000000000000000000f3d59e049eb1ac" + total_mana_used = "0x00000000000000000000000000000000000000000000000000000000001355c1" [previous_kernel_public_inputs.constants.historical_header.last_archive] - root = "0x0781b1cc32dbe21aba1e27519e765bd44222b52ef464c6b63dfa97b399376c2e" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000009" + root = "0x2686a574dfb90890de58e447bcd7f12504950a18bbe781d95758161ca30dcf66" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000005" [previous_kernel_public_inputs.constants.historical_header.content_commitment] num_txs = "0x0000000000000000000000000000000000000000000000000000000000000002" - blobs_hash = "0x0008822f60476d6dc34ec6109d3ad69dd1747a9484777021d8e717166bc7d5e6" + blobs_hash = "0x002ee5246d9ece5e2f64027ac8216616887df1da344019d0e0f0cfd1c2483af7" in_hash = "0x00089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c" out_hash = "0x00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb" [previous_kernel_public_inputs.constants.historical_header.state.l1_to_l2_message_tree] root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000090" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050" [previous_kernel_public_inputs.constants.historical_header.state.partial.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000480" +root = "0x265f2fb8ecbd96d51d74d79901934e60af982af7b6caa46153eafcf3201df280" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000280" [previous_kernel_public_inputs.constants.historical_header.state.partial.nullifier_tree] -root = "0x0a639c242b766d8bd94d437483546e33c4a8c27feadf50bc4ef523e9f191e927" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000500" +root = "0x0d8cfcd6ecef742ecda848c0db79ef7d0fe639b7b69564d103f788d530832eba" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" [previous_kernel_public_inputs.constants.historical_header.state.partial.public_data_tree] -root = "0x2528ba08e1171e992f4744a8d8761bbe5611447c52d673882bde6a9e3b716e1a" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [previous_kernel_public_inputs.constants.historical_header.global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000009" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000016" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2eae" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000005" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000009" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a8e5" [previous_kernel_public_inputs.constants.historical_header.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [previous_kernel_public_inputs.constants.historical_header.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.constants.historical_header.global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9c6e14ac" [previous_kernel_public_inputs.constants.tx_context] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" @@ -226,7 +226,11 @@ l2_gas = "0x00000000000000000000000000000000000000000000000000000000005b8d80" [previous_kernel_public_inputs.constants.tx_context.gas_settings.max_fees_per_gas] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" -fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" + +[previous_kernel_public_inputs.constants.tx_context.gas_settings.max_priority_fees_per_gas] +fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.validation_requests.for_rollup.max_block_number._opt] _is_some = false @@ -234,11 +238,11 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.validation_requests.note_hash_read_requests]] [previous_kernel_public_inputs.validation_requests.note_hash_read_requests.read_request] -value = "0x1808fa11f6b6ffdbd9f9e94a8f4c91aa954111d43f44544ed0ffbbf73ccf9a63" +value = "0x0671d5c4778f2ccff0b927cf2f5f89b768a9e969755a61a825b1334b13142927" counter = "0x0000000000000000000000000000000000000000000000000000000000000002" [previous_kernel_public_inputs.validation_requests.note_hash_read_requests.contract_address] -inner = "0x30021904ae3832fa38613650b957c74abcc7ae86fda9e53bcd89e7b638cf9d67" +inner = "0x17e5c98d998228e7de3dbb6c01ae1fd3aaf868bd45946d300e4c36f6d396dea0" [[previous_kernel_public_inputs.validation_requests.note_hash_read_requests]] [previous_kernel_public_inputs.validation_requests.note_hash_read_requests.read_request] @@ -2734,7 +2738,7 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.nullifiers]] [previous_kernel_public_inputs.end.nullifiers.nullifier] -value = "0x1e4c23d7a900532cdb5687c5806be8da481285afb0abbbe8a3801d71451d08d8" +value = "0x1c092e50dfdc08e3bbe145aa1ffcc554d22937b7e1dab9d4b30d59368634d28d" counter = "0x0000000000000000000000000000000000000000000000000000000000000000" note_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -4878,7 +4882,7 @@ counter = "0x0000000000000000000000000000000000000000000000000000000000000000" inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.private_call_stack]] -args_hash = "0x0af1e29b064dedd2a9cf35f6bd87361362530e6618692827c46333566e356220" +args_hash = "0x10ac1bbe59651ca3ad20a2c5f1504b3d6690dc8a4ff173cb3f370ba4965d0168" returns_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" start_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000003" end_side_effect_counter = "0x000000000000000000000000000000000000000000000000000000000000000c" @@ -4887,10 +4891,10 @@ end_side_effect_counter = "0x000000000000000000000000000000000000000000000000000 is_static_call = false [previous_kernel_public_inputs.end.private_call_stack.call_context.msg_sender] - inner = "0x30021904ae3832fa38613650b957c74abcc7ae86fda9e53bcd89e7b638cf9d67" + inner = "0x17e5c98d998228e7de3dbb6c01ae1fd3aaf868bd45946d300e4c36f6d396dea0" [previous_kernel_public_inputs.end.private_call_stack.call_context.contract_address] - inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" + inner = "0x0a762f2c969988845e3f2ec70b07cda6dadd97cc3542c63c3658211d44d09709" [previous_kernel_public_inputs.end.private_call_stack.call_context.function_selector] inner = "0x000000000000000000000000000000000000000000000000000000009462d279" @@ -5038,8 +5042,8 @@ end_side_effect_counter = "0x000000000000000000000000000000000000000000000000000 inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [private_call] -contract_class_artifact_hash = "0x0424707a0cdc4d897d1b49d429215da2458ac13b12eff665fb9257768657cad1" -contract_class_public_bytecode_commitment = "0x21ccd598b3f1e106121adb5c23e2a6013bf5f8fa6e4f8711c540bd350971ce83" +contract_class_artifact_hash = "0x1bbc0db2edc9255a01326f1c9ff53adeb157452de87e6fc020dbc7ec8286cabd" +contract_class_public_bytecode_commitment = "0x1794f3b0730c201372606fcd2ca7175fa7e02210531dab8e93e9b9e487cd35eb" protocol_contract_sibling_path = [ "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -5051,7 +5055,7 @@ acir_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" key = [ "0x0000000000000000000000000000000000000000000000000000000000100000", "0x0000000000000000000000000000000000000000000000000000000000000010", - "0x0000000000000000000000000000000000000000000000000000000000000401", + "0x00000000000000000000000000000000000000000000000000000000000328b1", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", @@ -5072,136 +5076,136 @@ acir_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000004ffc4a8fec69c23c38b2709c7b6596e906", - "0x00000000000000000000000000000000000d2d9137618e1ee3157b4f582d82fb", - "0x000000000000000000000000000000fdfcb8f2423374357b71251f3baab6646a", - "0x00000000000000000000000000000000000dc11bdb9429fd416ada9bfcf7c008", - "0x000000000000000000000000000000e6f92df2eae6c429d871a74e6ce13bca01", - "0x00000000000000000000000000000000002e7d850bb9772b539e5a9989233475", - "0x000000000000000000000000000000c82aa7857704c6feaaf887f272e0b86af6", - "0x0000000000000000000000000000000000005af1f32b671a0be86ab2928fd5a2", - "0x000000000000000000000000000000dbe05cd162d37468ab4bd7f15fa9eec485", - "0x0000000000000000000000000000000000221b13ed2e24aaa5d67acda629a6e8", - "0x000000000000000000000000000000f29192b4d57f19687137c5c71418f87cba", - "0x000000000000000000000000000000000021ed4ad98cf96edd0c3450346edcf7", - "0x000000000000000000000000000000c9df496ed2620244e8e6680b9d0bbeb4f2", - "0x00000000000000000000000000000000000fc5f41c89ce12e8ab9ca2cfe1966b", - "0x000000000000000000000000000000c7fbc2691a9a59c886c2596219a50ffbaf", - "0x00000000000000000000000000000000001cc74b638831fc664d582756258eeb", - "0x0000000000000000000000000000008f7a10c5f1056a1afee5670894cb5c2caf", - "0x00000000000000000000000000000000002181f0f88062817a52355af62397e1", - "0x000000000000000000000000000000ba1fa5a75c07ddbc190e8fe4fab17b237e", - "0x0000000000000000000000000000000000159bd289c66f6a122c603c353f9200", - "0x00000000000000000000000000000099bbbf1206b7ae8ee533f37ba1237b839b", - "0x00000000000000000000000000000000001537d9f1b14a261e8a4c1b2b77e34d", - "0x00000000000000000000000000000053dc7a561f4c8aa59aa0a220717421e33c", - "0x00000000000000000000000000000000001172fc73409bddb5ffeb01d1b68447", - "0x00000000000000000000000000000017030219502b29b77d6087584f63e1f50b", - "0x00000000000000000000000000000000002a8710ad87a3c05ed5cacf8d4108d1", - "0x00000000000000000000000000000018ca9f36f974fea905e3f37e91ea88aaf5", - "0x000000000000000000000000000000000016471423bfd9ec69b6a0a90225b0c1", - "0x0000000000000000000000000000003e97384c4ad27f230d62c9797654f9ad3a", - "0x000000000000000000000000000000000016a6824fd8fc1bfd86ccab1274d579", - "0x000000000000000000000000000000a82adcb400ab2be7bda2d637a74090f482", - "0x0000000000000000000000000000000000132650fd94352eafae0c32736bd391", - "0x000000000000000000000000000000e3dac4b9f849a77ae2890c3a54cb495f4b", - "0x0000000000000000000000000000000000152bada98ff08b61d95b6b3f7c2a7f", - "0x000000000000000000000000000000a1be3a1d0b0d05f23606940078f33d522c", - "0x00000000000000000000000000000000000ab759acc3f8bd536118dc91f070a2", - "0x000000000000000000000000000000a4131ae0e0c6afa7749209320bbf516d20", - "0x0000000000000000000000000000000000169b0d745bd756995cdb871880cbdb", - "0x000000000000000000000000000000f7dca26dd4087f0023c8bae4c36a397389", - "0x000000000000000000000000000000000018773e0f6134ea2caf74aa1fd0d585", - "0x000000000000000000000000000000f0498abb5caa5d6b440d52ef999c6f16b1", - "0x000000000000000000000000000000000023e17cbecef250daa9999f85d11976", - "0x0000000000000000000000000000004f9c8b5a5b7b6d85331ad304163d451fb0", - "0x00000000000000000000000000000000000a085224e337a4c86ef0b5ae8ff6ed", - "0x000000000000000000000000000000df165d33587d261f4b35bd0f74858eaa7b", - "0x00000000000000000000000000000000002fc49ae5b0e2996586ba3cf3401a8c", - "0x00000000000000000000000000000042f10b486a2e880591bd780636316e87b3", - "0x000000000000000000000000000000000023fdb65abe577aba416f4a34ad7259", - "0x000000000000000000000000000000c36279dcffdfb2365944fbb00509e3e3d2", - "0x00000000000000000000000000000000001cc3e6c6789c5dc08b0d04bccb45cd", - "0x0000000000000000000000000000004c07257aa5e2105352a59d954b0bd6ba73", - "0x00000000000000000000000000000000002dc50309a5ef86cd90dbb6c7a30bbb", - "0x000000000000000000000000000000d24f0a0cf38ca9316be400c743bbbb3bec", - "0x000000000000000000000000000000000027822ff7bb9483b29df97785ee5f9d", - "0x000000000000000000000000000000468d47d31fb480e2c192ddb6673e5cbea8", - "0x000000000000000000000000000000000001d6ab1aaf7944c2be04aea4060d71", - "0x000000000000000000000000000000acd6e1ecb360a2b22fb49c7766e97f5d69", - "0x000000000000000000000000000000000022aaedd8191a5ec18c5118eeb69b57", - "0x00000000000000000000000000000093470cf48813d1a18e21d6e95aa50b7c7b", - "0x00000000000000000000000000000000000da822dc968e65bb2c22570c142a32", - "0x00000000000000000000000000000086c58f4fff2784632dbcd99a232c84f225", - "0x00000000000000000000000000000000002b88e4f102a1274a8a494cb8f25102", - "0x0000000000000000000000000000009c59213866e8541a3d0ecd0de9e57a9650", - "0x00000000000000000000000000000000001cceb595e765064fa0ef13dac07acc", - "0x0000000000000000000000000000002467a62e4b37330d4dc4feec06fdd80fa6", - "0x00000000000000000000000000000000002087474e690c59d77ae0d6239b5897", - "0x000000000000000000000000000000c255ce3660b905dcbeaf219c0a3e54950e", - "0x0000000000000000000000000000000000210cabca81c99532b9dbd55d00b499", - "0x000000000000000000000000000000e70d7d72c617fafed3122e114a215e55fc", - "0x000000000000000000000000000000000023afe52923d3bf10819581adbb4813", - "0x00000000000000000000000000000097419920a9d12da73bead6ce1f0ff5da80", - "0x000000000000000000000000000000000002ee216992dcd8c715b8266ca7cce5", - "0x000000000000000000000000000000f4cb33d7153848f34cb1fbf1189e9bd4ca", - "0x00000000000000000000000000000000000df3b7b6a86a5b7b969e131814252c", - "0x000000000000000000000000000000da4c1c6c9a655fc71b463159dd36cabb0e", - "0x00000000000000000000000000000000002b5005b6035cbd01df0e077e742f64", - "0x00000000000000000000000000000031351d32d261212126098628328a5faa9c", - "0x000000000000000000000000000000000021dcce6f03155af52cb0f960089a1f", - "0x000000000000000000000000000000fea34958e93eeb2655c5ea625202c85d92", - "0x0000000000000000000000000000000000181643d812babe4a2bd9d0cde9bf5a", - "0x0000000000000000000000000000001d2cfe12f41c43843aa42384cff8d79c7e", - "0x000000000000000000000000000000000012dd5b3437eb0c7bc707c438424b53", - "0x0000000000000000000000000000008bbb3e4557582389e92ff21b40fd47a504", - "0x00000000000000000000000000000000001c3a9dcc9599ac268f52209071590e", - "0x000000000000000000000000000000c48c6be8596355abde35aba01e747f1fcd", - "0x0000000000000000000000000000000000177ff828c89347b6ff04b7d456298c", - "0x0000000000000000000000000000000d68b89f5f5b74f182ff5c96f6e1fed030", - "0x00000000000000000000000000000000002cf5efa1ff0a0774a9e1fb6873d85a", - "0x0000000000000000000000000000003acc6def4164d878b56e5b2fe2bfa52199", - "0x000000000000000000000000000000000022cf69996ae471056bcae7b3c38cbc", - "0x000000000000000000000000000000239623839c51be6ffe83c77c80b8f94ad5", - "0x0000000000000000000000000000000000075cc2c3c9e3079bec86764aa5cfd0", - "0x0000000000000000000000000000008c88b485298919bf7164440942d6f6c5ad", - "0x00000000000000000000000000000000000c5dd6e29eac9076cc2f5995fcf27c", - "0x0000000000000000000000000000005b7ac436f888999a48f79ef212e6483f14", - "0x000000000000000000000000000000000009fc56f5a2122d1ed9353860ba68ab", - "0x000000000000000000000000000000dace4e23bf41b55e3098bd8e82e74b1c1e", - "0x00000000000000000000000000000000000883499c226658d83b4d0cc7b08c15", - "0x0000000000000000000000000000005c0373d8b286bf727301571a54e1636e77", - "0x00000000000000000000000000000000001f268c0945bdea494fbfc52e8581c1", - "0x000000000000000000000000000000c6b7e770c1e62e2504ce986f21324ff939", - "0x000000000000000000000000000000000001b92f92042ae2556e31cf72cc3990", - "0x0000000000000000000000000000007007220c2c02f4ec2c1c5fada9056b8c37", - "0x00000000000000000000000000000000003038ffe6284e174445a0eb11a63e0b", + "0x0000000000000000000000000000003811cf4277efe18cdd60df9a056d416692", + "0x000000000000000000000000000000000028ef5e2152803a0dfb5d137b1c91c0", + "0x00000000000000000000000000000083f17a152cdfb9a16e6791ecdf6872c1c3", + "0x0000000000000000000000000000000000159f06ee0978c789b250465efb23d9", + "0x00000000000000000000000000000015c95b19cfec0657bc373b38a5ede09294", + "0x00000000000000000000000000000000001e576c5cf3cff0d9435c173222a535", + "0x00000000000000000000000000000061642c6a884feb9da8b6c1af06e193cb94", + "0x00000000000000000000000000000000000e59f8b6824ca914a3d680287c38af", + "0x0000000000000000000000000000007c74037a697ac5facb728543dca0b9b86c", + "0x0000000000000000000000000000000000118d97c9f8e33c708b512ec0ae616d", + "0x000000000000000000000000000000fff7f2ff3aa62b7b145f2b1c7fd144a1ce", + "0x00000000000000000000000000000000000b78f177ceb3e97d4d074c21b84361", + "0x000000000000000000000000000000f05a00b347ebfab22156570ccb8cd7ec4a", + "0x00000000000000000000000000000000002435b4d4cff87b9abd759024118282", + "0x0000000000000000000000000000006a86513957c2b9c082d3e40a6be1b000f0", + "0x00000000000000000000000000000000001fccbb4b23244e4243650fa93c00c4", + "0x000000000000000000000000000000325a35319a7892e2a154f499846da82208", + "0x00000000000000000000000000000000000a8c3eba9ca43cc1c2f9952f4f15f1", + "0x0000000000000000000000000000000d8b72c680299be7bed8461b592e0e8413", + "0x00000000000000000000000000000000002743f3ba60b20ed4e1ae8720df93c8", + "0x00000000000000000000000000000098d3a96067800e8d29c4dc4590f493cdbf", + "0x0000000000000000000000000000000000080677581c4c2a3a342ccd662e7847", + "0x000000000000000000000000000000f2dad00dfe89c231297f50e71c38caaac4", + "0x000000000000000000000000000000000024f3886b0c7eacfe98d7c91e1ca705", + "0x000000000000000000000000000000552393d09533e1b2004bd84e9f8a53a88f", + "0x00000000000000000000000000000000000456bb701b5b0b463bbcf0c4fe7190", + "0x00000000000000000000000000000074156481e9a3f8f091d30db1003a6daab4", + "0x00000000000000000000000000000000000380f4e6bb304776bfd4fb22e20987", + "0x00000000000000000000000000000090d53c6a3b26339cda6b73df9208314159", + "0x0000000000000000000000000000000000298c3311fc9170f92de940b042aab9", + "0x000000000000000000000000000000bf37537eb196b05c1d98fa51016a9bacbb", + "0x000000000000000000000000000000000007b05f408a612847259016b9204ae4", + "0x00000000000000000000000000000098520e62bba4ba1b71ae8a5ad7d71a68db", + "0x000000000000000000000000000000000002db81d8f8656a4cf697bbcf894789", + "0x00000000000000000000000000000008b67b98ad28ff036c39ad8b94ce5c7e75", + "0x000000000000000000000000000000000028b7e7e3c1f96d4e5182479da84933", + "0x000000000000000000000000000000787b6ef681db4fe54d416fb42580d9baa3", + "0x0000000000000000000000000000000000092f71ed9aa33a77496f00024ef6f4", + "0x00000000000000000000000000000004e3744e445f189e3d91517b301962180f", + "0x000000000000000000000000000000000011091727393139ce893fab0dc160d2", + "0x00000000000000000000000000000020040679dfc8aaad48bdd88372847ff94e", + "0x0000000000000000000000000000000000218eb185e78577c76b89b50a37431e", + "0x00000000000000000000000000000062a0c89b4cb9102d070d9dac553d3782f3", + "0x0000000000000000000000000000000000116e06b8f482bbff0d4bc57a3ff4fe", + "0x00000000000000000000000000000094cbf780f4134b698bf7f5b1fcdcad4218", + "0x0000000000000000000000000000000000113ca8d354541fa79cad64fcedbc88", + "0x000000000000000000000000000000df5a0e52dee5b07510fef30dc58ecacf15", + "0x000000000000000000000000000000000006c8fa942e2eec5728e8ff33fff291", + "0x0000000000000000000000000000001a11657db53c31cd6a8fcec994a3158927", + "0x00000000000000000000000000000000002613389312f17bf8200d7417eaf411", + "0x000000000000000000000000000000c15d6ac79bcca289a93da1a9ac6fdb27ea", + "0x000000000000000000000000000000000012e0eb64e8ecd9386e72ff809830cf", + "0x000000000000000000000000000000c99eaa58fe0c7882af7a4362d48b1f38ae", + "0x000000000000000000000000000000000007b22301f910a411020601992dd510", + "0x0000000000000000000000000000005a902f70f203e3f78a3d386e76063e9342", + "0x00000000000000000000000000000000002c5386267d0dc48fde623519d73f6f", + "0x0000000000000000000000000000003722557ba1e5a5536b39020362afef7473", + "0x000000000000000000000000000000000020e19c63dcd8784f6980ecfcbafaab", + "0x00000000000000000000000000000090bd728dfa075950de159c253cbeeaf5d5", + "0x000000000000000000000000000000000018b4555dc143fe62d033c28b716b0c", + "0x0000000000000000000000000000002aaebe1c64d15549e355d2e1defb742535", + "0x00000000000000000000000000000000001c002941c4142683baa620f3a911ca", + "0x0000000000000000000000000000003fa89677339dec49a9d9089d9b5c2a4002", + "0x00000000000000000000000000000000000d70f35e16e154690e2d69562fd21c", + "0x000000000000000000000000000000489c8db6916311851b56b81de1c85f7581", + "0x00000000000000000000000000000000002a35842c99ca6e596adb74f4765a25", + "0x0000000000000000000000000000005acc87d330e91c244be7fbc3c0cb8b20c6", + "0x00000000000000000000000000000000002e9f6fa2bcdc33be4ebd9fd1dbf56b", + "0x000000000000000000000000000000fbdf4ee9e6a3a9f083bea39c733e1fde45", + "0x00000000000000000000000000000000001053f4c428f0aa1b62cb76fc57031e", + "0x000000000000000000000000000000726f4aa565a89a3302bfd54230da7b863f", + "0x000000000000000000000000000000000005794818f7ed6ba65adef0e5e0a665", + "0x0000000000000000000000000000009207ebd04197f75df3ef4e16997939b882", + "0x0000000000000000000000000000000000254d2d2d68eba95f3c42ca85cb3f32", + "0x000000000000000000000000000000f59cf24368fb749d31241eebe348de1885", + "0x000000000000000000000000000000000001c9c97b79b573bb5fd2de2f1b65dd", + "0x000000000000000000000000000000ab97c06503215c4c5e72c2bc85c5b30152", + "0x0000000000000000000000000000000000117bc2984425f7d125b37c130b0ff2", + "0x000000000000000000000000000000f749c68a3a7cd20f234e24933cb3ed6a27", + "0x00000000000000000000000000000000002a16ef86ac097fb24dc860a3c183af", + "0x00000000000000000000000000000068ed7bcfbbad402d747057913890682f38", + "0x000000000000000000000000000000000019a95bf603825ac2518f0ad3a1a86f", + "0x000000000000000000000000000000d2fdf815f0c6981803f3940441a6ee705a", + "0x0000000000000000000000000000000000166baa8962a4d541c12f4ef1dc04c6", + "0x0000000000000000000000000000007ed2a647b604a1c1eb75a6ab261de8e44e", + "0x000000000000000000000000000000000024baf6507e899a3b8a4adea6f80630", + "0x00000000000000000000000000000093de4b733caf34547e534e31a27bfd2b1d", + "0x00000000000000000000000000000000001d828e7ac56858b4a25c3da8d581f2", + "0x000000000000000000000000000000f6f4596202301b6ae4eb0ebbeadd203340", + "0x00000000000000000000000000000000000adc89c48d75b571636f5bbeb4a806", + "0x00000000000000000000000000000000034e3e27454ef992b4bf84b97baa7471", + "0x0000000000000000000000000000000000066f28135748f119631c3fe07fa9d7", + "0x0000000000000000000000000000003b64a66f2ac4979b65e56568c5a31b14ed", + "0x00000000000000000000000000000000002e25783551df50c004ec7cd1f4dd8b", + "0x000000000000000000000000000000e8258f84477c1b62565a559ba7bb38832e", + "0x000000000000000000000000000000000018f76cf0ceeccb4798de741ae89b64", + "0x0000000000000000000000000000001583b176f599e192d7119354034419e8f9", + "0x000000000000000000000000000000000004706a0e23ac32a3566907fb872362", + "0x000000000000000000000000000000d1b9992279342fce9a883849693fcda22a", + "0x000000000000000000000000000000000029046b299293cb09c593372eb6b3e6", + "0x000000000000000000000000000000469680c270e551515344592f59188fa765", + "0x00000000000000000000000000000000002d38d6d4ba1e4763a74ecdb11ca1f3", + "0x000000000000000000000000000000fce917c0d5dca019477c52f6075332b612", + "0x000000000000000000000000000000000012db39e892826b32610ee08251e005", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000008344e7cd358bb008fa2594f42e2058a4da", - "0x000000000000000000000000000000000028d98153e26aa139c5f995a12d6b82", - "0x000000000000000000000000000000ebbd996ba82dd482c0cd9f93dba5c948f1", - "0x00000000000000000000000000000000000abbbdb042fe5de7714689b4b198cb", + "0x00000000000000000000000000000075f2056228f93bf0d873a60a684060bac7", + "0x00000000000000000000000000000000000ed6a9d48ed84a9718a64975641bc6", + "0x0000000000000000000000000000009698bf13611dd2109f6494f3e1a33c6383", + "0x0000000000000000000000000000000000116b3f49fd12a2708f94254c90529e", "0x000000000000000000000000000000b5c1eac95b264c302dc854e6f22d7330df", "0x00000000000000000000000000000000000fcbbf9d3cf402baa3eeda5f0a9e49", "0x000000000000000000000000000000def9d58fc2920836194261f7b163fefbaf", "0x0000000000000000000000000000000000283edfda89c9480597f0b3442e9752", - "0x0000000000000000000000000000004264681c9136a2fde7137335ef716fecde", - "0x000000000000000000000000000000000027ca9ccf01429923a61d872c7c224c", - "0x0000000000000000000000000000006df5ee4c1358443f5a14086b5196e13e46", - "0x0000000000000000000000000000000000192b1a6d3b14dfe5a9ad63951d2d76" + "0x000000000000000000000000000000e55ba19751adfe6c36324d3fb6c2da0989", + "0x00000000000000000000000000000000001d58aa61c64ad522043d79c4802219", + "0x00000000000000000000000000000078f4b3bc61f19d6e7069359bbf47e7f907", + "0x00000000000000000000000000000000002d7c18a93c3dae58809faaeec6a86a" ] - hash = "0x2da9a2696ba9c946d2944aa5c3a2dce8b694eb53b8f9e2070f94b7d7bfdba5df" + hash = "0x045d9ab6b3629d63edb0bf8600b36a376ebec5dbb750cf16293c0e9445d50ca2" [private_call.function_leaf_membership_witness] - leaf_index = "7" + leaf_index = "6" sibling_path = [ - "0x1895598e097615ceb187eeb360e0e2644bbb63fd37fcdc05eea0680c9303853f", - "0x25b93bbfa26d245fcc662c969e0cb8838f4a2d3636c2d87aef792014741e9b59", - "0x0173b6277638068ad3e9a1597860070f0bd6b16dcb2c5ecde6bd733ef75b2de1", - "0x050f0ce64bdfcba5470ecd90e35d5d622a1bd2c4457e7a39f0eb60323bdb2d3a", + "0x0e23d0be684c90c7e5c320aa033d4cb104ba232ffa42036aaccab2f1aef66b2b", + "0x162c80e5cd2ed81d680c9819cb7f7bf9e4b3deb7830cfef4058780147b24e3ed", + "0x1ef309737edc7675eadedf18aafd068841281dda8f250e605c136720e8547763", + "0x1d615af41e712b8d10b0409a17f431c00c4bfb42fe08bc9b559c665e4b9985f1", "0x2a6595890719fef7967c209488728aa5342438ba52058a3c770202f55acf6854" ] @@ -5226,10 +5230,10 @@ y = "0x2039907fe37f08d10739255141bb066c506a12f7d1e8dfec21abc58494705b6f" is_infinite = false [private_call.salted_initialization_hash] - inner = "0x2c7c17507841a9554cc2aee348b1e0277d59cc584e77c6af36e1091ebad92211" + inner = "0x264f9aa6d1988b988a04f93fea877e061eeceed248bab92abad8ab440c77f354" [app_public_inputs] -args_hash = "0x0af1e29b064dedd2a9cf35f6bd87361362530e6618692827c46333566e356220" +args_hash = "0x10ac1bbe59651ca3ad20a2c5f1504b3d6690dc8a4ff173cb3f370ba4965d0168" returns_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" start_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000003" end_side_effect_counter = "0x000000000000000000000000000000000000000000000000000000000000000c" @@ -5244,16 +5248,16 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" is_static_call = false [app_public_inputs.call_context.msg_sender] - inner = "0x30021904ae3832fa38613650b957c74abcc7ae86fda9e53bcd89e7b638cf9d67" + inner = "0x17e5c98d998228e7de3dbb6c01ae1fd3aaf868bd45946d300e4c36f6d396dea0" [app_public_inputs.call_context.contract_address] - inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" + inner = "0x0a762f2c969988845e3f2ec70b07cda6dadd97cc3542c63c3658211d44d09709" [app_public_inputs.call_context.function_selector] inner = "0x000000000000000000000000000000000000000000000000000000009462d279" [[app_public_inputs.note_hash_read_requests]] - value = "0x1eeef2e1c70a7794a3586b4cf25058ac1b892b7d874294bf7dc5d1282591e04b" + value = "0x2a9db042c573eb6c67fcf5253465931de5697763ba48544ed800cbf02f403a14" counter = "0x0000000000000000000000000000000000000000000000000000000000000005" [[app_public_inputs.note_hash_read_requests]] @@ -5317,7 +5321,7 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" counter = "0x0000000000000000000000000000000000000000000000000000000000000000" [[app_public_inputs.nullifier_read_requests]] - value = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" + value = "0x0a762f2c969988845e3f2ec70b07cda6dadd97cc3542c63c3658211d44d09709" counter = "0x0000000000000000000000000000000000000000000000000000000000000004" [[app_public_inputs.nullifier_read_requests]] @@ -5384,11 +5388,11 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" sk_app_generator = "0x0000000000000000000000000000000000000000000000000000000000000030" [app_public_inputs.key_validation_requests_and_generators.request] - sk_app = "0x0d6dd1f75adac84b209ad26497e2f6796dc1d1a99a694303a18319a2d475df33" + sk_app = "0x07b2b207ab30c15d0a8278223d5bd79a1433a9a3682fa3375623afae0b84ba07" [app_public_inputs.key_validation_requests_and_generators.request.pk_m] - x = "0x175d325f91f136d09f7b5b30ee6e82a8720dcd4fadd87e9828a989461ffe5828" - y = "0x161bf54b24e177c5cbb154fc01a12732e92c21c5a04985cea5374033ed510b4c" + x = "0x1f255bbf4e02d3902299100f9b7ed75f058ec137f091c64c566fb1b64b9bb300" + y = "0x2aee0a244040faa91d2a3ab045f8212d59f509529c0ec5baf6329abc8b61a11b" is_infinite = false [[app_public_inputs.key_validation_requests_and_generators]] @@ -5557,11 +5561,11 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" is_infinite = false [[app_public_inputs.note_hashes]] - value = "0x250eff94c845907e4b441ec3e2ab9c7f96c90b19c35d98298903720596c8ae96" + value = "0x24f628244044a2fcd5508a3ce830dd0586fdb555a43e12907fecbe92bc3c369a" counter = "0x0000000000000000000000000000000000000000000000000000000000000007" [[app_public_inputs.note_hashes]] - value = "0x080d7e517a580a3e7e87d11e50504e3931844836624eef2031f2c29d27fcec98" + value = "0x26a7a7a906e25c5180fed10079e4a0ece99673c6d51f76ef183d300b5fe19b6a" counter = "0x0000000000000000000000000000000000000000000000000000000000000009" [[app_public_inputs.note_hashes]] @@ -5621,7 +5625,7 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" counter = "0x0000000000000000000000000000000000000000000000000000000000000000" [[app_public_inputs.nullifiers]] - value = "0x08b671e5822c135c559a7b5a7ef58783ef97faed29ca80ac2d28bc1c77fbbbd2" + value = "0x2a0170ab55bcc945ad41ae7048a57a5227aba08d4f91ce25ce8dc4e0c2d46849" counter = "0x0000000000000000000000000000000000000000000000000000000000000006" note_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -6079,24 +6083,24 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" [app_public_inputs.private_logs.log] fields = [ - "0x2d79cc0637eb70f6c46f8680291f1401502fe4d39564606106584b776d308ecf", - "0x00961dca5785af4bf09cf75a77cdfcfa8fa41413b16bee86604c1826795edeec", - "0x00f7933d99a2ac43f613e021cc11c6200bdf7d703ba411bfda70998dbbe91d18", - "0x005c34531ec16f9cba02c2f74e5b68f53ec6bc00000000000000000000000000", - "0x000000343ccbf71927c63534206273c8611b72a04d4db62e0d1e7a1f358dbfe9", - "0x00bbb6167707e40e023148c03968226c73db4574f5991f9d06194dd1782e9d92", - "0x00c2cfe592e585e6319b54b39631393055f7ff2e2fab8ed76f5ca49bc3e7c83b", - "0x0036f9cd24f2727bc025371ca810245a9267c936e7edf92bd90a302d44b9a6ff", - "0x00dabe139092b735a4288ee4a9379e4afdfa51708650fe26e91e239fa23f9375", - "0x00eae9418604595e2d9a6ad7d46b2fc1967d2d7da56c4072a76bb3f709982f49", - "0x00989ffa26ac3a205dc0b99de3a6507411d11fdba8c61d3c81aabed1f119dd27", - "0x008ee4cadeaf75aa216d88a2a3aad40ba71c9ca39176a9ac78da77e47cab5caa", - "0x009927c6b18981dfcabf0a63dfd61d0491d8ee2c893844bb2ca602012783d756", - "0x00a18c50eb974c9146d791e09d883b3ad300430e1bac3f225b96041bcee15fce", - "0x00d527b9e3f664614bdf0f851d75ac6acaf59d4dbbe565a36424dee99bbf878d", - "0x00ae2f375a95ac5c40bf04f2c3f117c27132f413368d5d56edc746174594f8ca", - "0x004ff8ae2b0b2ae2b61a01a94b966654d26714edd486f5acacb2feb360f09059", - "0x00fb3c03d810569bdb758dbcb063020c6119ae59bd66308035a17f93ec1a8e98" + "0x056b7ce9340b3d0bd0f025be5a49276630ff5ad804af8a5dd32e3362d83f3446", + "0x000bc558b3eef99be45bddc263bc31cbbb17a7ffa1d815c6921ec80c8b1c0523", + "0x003eb458eaa8db4858c9db7789e9ad41710bb3e5502ab85cc0ad8d4bc8eb52ce", + "0x00ff08a9664c256053396edfeda7c8f0cc5d8d00000000000000000000000000", + "0x0000005a12365b2a7eeae19796d04db3d06e2d30ae9d74c27f1d44a55d329c4a", + "0x008b547e32e13b40a76dde1047d859c8ec42862d7f81ee223a57ff73a4547266", + "0x00443f4f8a52ad47628d5ecdb5a2365220e979f5d41aec99c080bc4b061bf2c8", + "0x00d457726247f55680896963585b2a9e4a3e6b54135dd7649359b58ad3716582", + "0x002faf3f16beaa6682cc90c3251ffc910f535b03004b2016863173b7ac40d117", + "0x00cbcf8860bfedb383d3c728b374de8b059699d3fee06f3a34c74bf1b3cfd6d2", + "0x002026f90e50a32bfed5b79cf380be00990bcbfba3b91de691b5b0fad72200c4", + "0x00a5ca52258750ac51c0eb3dedca43f651a835e4322f6b0aa44f60b40415d943", + "0x00c03f53a8b0448582cc95aa8c3acbf1b7ecc0c182235b8a495c7250df8fb093", + "0x0099c0c6a4ffaa80a9faa80d9c514d79b0a52ff15ca75387bd591042eb9f8a9d", + "0x002ba5de9cab52824a8261bca9e0101cdbcc2f035985baeb1a24dc6d68968cb1", + "0x00d749741c1d63d56a16c937f747b0763afde032947cb672867532a14dd9cf92", + "0x00abd177c77edf0ba47f8c56e263ffbd8d3e1819fc0dada3ed74c61dc1afdf07", + "0x005df82a4ae3ab7ab59a2ad4aaff615b4bf3409fcaa06c8d115b90a6827c7282" ] [[app_public_inputs.private_logs]] @@ -6105,24 +6109,24 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" [app_public_inputs.private_logs.log] fields = [ - "0x08f720b2dc01d9f869376d21c019e00d91ba4a2df4c411b8351967bc22f30833", - "0x0082d4f053d20f9e5d0133a2279d7e5e1edcee80e8ae64e2b31759ea2c9d8357", - "0x00b4293fe37ff8a12620c49682fe04fc280a5808fc52884c40905c8a9fd12c22", - "0x00a08522ae6abbcca7fa0574ba7dc99f9f881c00000000000000000000000000", - "0x000000b32f2e9c3feb52a65be2321e91560925b83d0be9ea0c8e41c5e71c4df1", - "0x00fa5845ce219f1a7dd626caa3c96b536a79a3a65b1e184bda69fbc6eb61bdfc", - "0x0028181637f8949f88e4a53422f95c86122248723091b21e8f469fc86b3f7bf6", - "0x00c45756c940e72b7532073a35d77febff4f9d61a7f15706ba058f552c4c4dec", - "0x00ff7429d367c5fb82596c900dae746bd4988941db33121f03a8d01d92646560", - "0x004ca4b6be792d1c2167e998174d676e6462d0995063cd2d28bed4a7a0205ee0", - "0x0075c3cbed81825b7d47fe05ffa7446ee7b637ead0b04f1fb74e5d5d8f6a2b61", - "0x0036e4ebe9d34f8cf36254dc26d3b8c4829781d742edd48bd4babc79d4f8e019", - "0x001e85147052819f92807729600faf577839327b3c9d6ddada8869a19fdc2f7c", - "0x00062d400f543f81e1379c1e275b50e2bd025e4adc8111ae7ee30615c4733c58", - "0x0036d19ebc307f6a255369bb16287ec77fe0671c2dc6b3151ffa75e99a560d55", - "0x00250cf6a0581f297c606cde1b35e500648010bd4e9bda5b8a98a5824e0ee3bd", - "0x00b16603236f00e2f4263ecb587c0bb087fdcfa9075b3dde4501dff76177d091", - "0x0046729300d452d6dfe8200e1958ea4c78b2ddb8108a5c9b11fe2f61ca2c092b" + "0x000e8fc58608e21386f5ab0969d0253bc5f3eda2bfda5e3901c906734f2bbaab", + "0x009ab44c19d12bebb91d93f52d01179f33873667ca688633a20bf58942d641f5", + "0x004640cf4a0d35a53cb5107f7887ce2eb59320dc3692c761e70688b1c75c9d6e", + "0x0006e1c046e924a7e9be8a462e45c05c27347200000000000000000000000000", + "0x0000003131993bbab963d3bbcfaea2ad4ce93d7f187b4678592ebeff1969c0f7", + "0x007d15be7812b7d4f039bcadecbdbd5a764af23bdec8a0780a62bd836598cf8f", + "0x001373dbaa94dbf7f1c6e5841a6ca7c338319a3efcd25c2502b7675cfd4b9c73", + "0x006d865887d564824338a227fb1a94e367dc7671755d2a7749ea47ed531bc671", + "0x00604c0d1e54498cf3cb6c56af2c321f6660e185e8caf7b0a8199e5f16157ce0", + "0x00bb93fae1b7266c7b7c691b329def0e589c12ff05a63a86f4e0addf52403859", + "0x006a11b63046badb3b3af5d46e798bcda1bbe4bfa1d9389fa0cfb0d6983465c5", + "0x0036063476ff230f0204e873cfd653b5b6d9767101d51e6c741be7fb84e06512", + "0x00c3bfe9bc1085e587a2f5fb826fd619c4ec62403c50395bf2e092e04f4a34af", + "0x001f21d3ee5a5faaa44c0575b66754315810c83b2cc6f28054cc06cdd882a8e7", + "0x009f2dfb20248037ef311445c5d691a39c0b621681280ae03e42aa6fddcea432", + "0x00260e97d44f0896e42991e0cb2ac86cb0caaca5a6ec1c96cb9b2f13d0d351ea", + "0x0024b676f2f447f84a1db4f1a1976ecfb01ccd564aed18db57ac6da3dfa5d414", + "0x009454ddc2c942b5ecd157fbcd9733f1cb7bd438b3ed29742b083952bc8292de" ] [[app_public_inputs.private_logs]] @@ -6131,24 +6135,24 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" [app_public_inputs.private_logs.log] fields = [ - "0x2d24207cbf1dc0a827042e09794dba8765971047eb2f6890b2ba4c398ba95b1f", - "0x002fe17d85df96d8b9bc15c91d0d62b0173174cda5d991cd73e9b9da65e2956b", - "0x00da7b08beac5d98c229d91728587646f72777453b785d0624e59f0a8075661d", - "0x0089323120a21d889aee547c21faa1c03a1ead00000000000000000000000000", - "0x0000001a851e3ed1265dde6b01175571a83d0777b0c17791db74cd2b33589139", - "0x00d1f4a53e67b2221c1ce7bd6d5dc105b0b3a086dcabd173b2b874f6f13fa338", - "0x002ccc3ee9f522a252f7523703c162fb8807c24eb052d2871609e249c67bd5bb", - "0x006e1fd58f3479bb18d1abd812bef996dfc0a36d72d1472a930e77805f243952", - "0x007043fae6b109a981b1e34acf7281480b879f280fd607fa1df718c9a31acaf2", - "0x008c4f91880f265b065cea8a705bc508875182fe5a3837e2b5b8a14e231cbd59", - "0x0071c17f4d52aecdfb4d8c6b1e764ae137c836c0672bf3cc589a45878f2686a8", - "0x00c95d01a6e57b41af4f265b2c88f6ff3de54aa5c895ca6faa21e26a8d6134a5", - "0x00a54c12af2499afd7651644686c671c3d77ff4af32a6b181646c976329a0063", - "0x004567a7724f750c4b0c9c205f35f4a175ea93015792fc78fbd985e7c751cc1b", - "0x001b0870e32b1c3c28116435e5132496bdeb8a1d3b9acc62b7d57d82f230bdaf", - "0x0058272cd1119bc153b18b3a3c896138be6f5b9144f216cd6e6f1b5db7d8ef08", - "0x00c1c848fc01d649f264a3cf8ba8cade698e2c1dbd14f7a0077356f8381de748", - "0x00328549fac9e2e1ff6fc6aaef17fbb1fd5c973e01df61985fe056548fd4b5df" + "0x128284e15449fe0b0f73f28a798529680cebff5dcfa777180df5732a7c726aa2", + "0x0000c9e7f1229c5a696998191774658a0ec879295a48b67de81c9bd51d416639", + "0x00fb7c81593791e34ed0115550ef6c73f371943860c12f6ea38a0305ca2da541", + "0x00182db292d67aeddce921ec21a07d74be11de00000000000000000000000000", + "0x000000ff556505d358d4d47b910cdf40859434df3e7447db66cf2dae1483c17b", + "0x00aa01d114b32832bbc33a6d980d4e4a69a4e2612197f7d06b3c39baf657d863", + "0x00166c91e4709fb7600be1cc08622cfc70977233656f98bc03b4154ad07d765e", + "0x00f4967c08a2c14d543feaf59f6ec51725c4a77a5733ddbec4e0fa981c2c4a05", + "0x00e4226df458c612e0d5883566e139f3f6fd528dcbd2c663965bf3d0acd92977", + "0x001d8bae2045a25b4fc298ee092508ba91ef5869e555bef5439a429a81fc0966", + "0x004591f96d04aa30636f077d598d2005bcd02def8fe097d39935f6e9be3f59a6", + "0x0048bfa7037e177ee29bb000841b65a50a3988782addcdb99af5774c67470c27", + "0x00fd50b1ed92b18e50534745e847804ce0f06e640dadb08bbb0e91c7a45d1967", + "0x00b149957c7c683a66c3128a39c1d2c40b95e54988254916600ae30a14d51b3c", + "0x005d73b57f9a10b757da69f8e437c0ce806ba23eff9f7e88f38121a5b3c97095", + "0x00c83ff06632c1f9f512b72972547a5d53d80f942575567a9159472b497a015d", + "0x00cf1422a25529918047a95cfb4067cebc5f376df3194405b1f7ce2e1cde4944", + "0x00458caecbf2fabacbb7cd4d72ca1f62588a1e41b8831d8f74b3f09fd683b102" ] [[app_public_inputs.private_logs]] @@ -6495,51 +6499,51 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" length = "0x0000000000000000000000000000000000000000000000000000000000000000" [app_public_inputs.historical_header] - total_fees = "0x0000000000000000000000000000000000000000000000000011b417896f129a" - total_mana_used = "0x0000000000000000000000000000000000000000000000000000000000016771" + total_fees = "0x00000000000000000000000000000000000000000000000000f3d59e049eb1ac" + total_mana_used = "0x00000000000000000000000000000000000000000000000000000000001355c1" [app_public_inputs.historical_header.last_archive] - root = "0x0781b1cc32dbe21aba1e27519e765bd44222b52ef464c6b63dfa97b399376c2e" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000009" + root = "0x2686a574dfb90890de58e447bcd7f12504950a18bbe781d95758161ca30dcf66" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000005" [app_public_inputs.historical_header.content_commitment] num_txs = "0x0000000000000000000000000000000000000000000000000000000000000002" - blobs_hash = "0x0008822f60476d6dc34ec6109d3ad69dd1747a9484777021d8e717166bc7d5e6" + blobs_hash = "0x002ee5246d9ece5e2f64027ac8216616887df1da344019d0e0f0cfd1c2483af7" in_hash = "0x00089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c" out_hash = "0x00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb" [app_public_inputs.historical_header.state.l1_to_l2_message_tree] root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000090" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050" [app_public_inputs.historical_header.state.partial.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000480" +root = "0x265f2fb8ecbd96d51d74d79901934e60af982af7b6caa46153eafcf3201df280" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000280" [app_public_inputs.historical_header.state.partial.nullifier_tree] -root = "0x0a639c242b766d8bd94d437483546e33c4a8c27feadf50bc4ef523e9f191e927" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000500" +root = "0x0d8cfcd6ecef742ecda848c0db79ef7d0fe639b7b69564d103f788d530832eba" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" [app_public_inputs.historical_header.state.partial.public_data_tree] -root = "0x2528ba08e1171e992f4744a8d8761bbe5611447c52d673882bde6a9e3b716e1a" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [app_public_inputs.historical_header.global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000009" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000016" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2eae" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000005" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000009" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a8e5" [app_public_inputs.historical_header.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [app_public_inputs.historical_header.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [app_public_inputs.historical_header.global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9c6e14ac" [app_public_inputs.tx_context] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" @@ -6555,4 +6559,8 @@ l2_gas = "0x00000000000000000000000000000000000000000000000000000000005b8d80" [app_public_inputs.tx_context.gas_settings.max_fees_per_gas] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" -fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" + +[app_public_inputs.tx_context.gas_settings.max_priority_fees_per_gas] +fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/Prover.toml b/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/Prover.toml index 014404d3e37..f079edcf34b 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/Prover.toml +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/Prover.toml @@ -1,19 +1,19 @@ [previous_kernel] -vk_index = "0x0000000000000000000000000000000000000000000000000000000000000003" +vk_index = "0x0000000000000000000000000000000000000000000000000000000000000002" vk_path = [ - "0x0adf52c61cdf9eff768b463c554a67f3cac73b0c1cea2d3fcee90db3d7fccc20", - "0x2788666fcc1fce27d0ac10e13716483d548ddc3411f466e5caef85cea2384902", - "0x281a8c9b2c044cffa01e5f56858d1d71aa11c4b28a1e90407565ca646ea0ee5d", - "0x25e71fd64ecaa6b98ef492c6d93da8164a259284041220c258edb94fe47706ab", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x0ce61ee2dcb1ec74887ccf2406de83c0aa8b61c744505f859b5387ecb59c1978", + "0x14aac9fb9c0804b14d039ca6cafd96319eaf9ed3adc7d948c2a87c8d8f459704", + "0x2443f5b9301a30050fe915e054a69535a34cb245002e6ab2ca38071d7e8e9326", + "0x07204dd4c0b5e97ed0e01d06354130938eb17178be6bacafbdee48057e59aa79", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] [previous_kernel.vk] key = [ "0x0000000000000000000000000000000000000000000000000000000000100000", "0x0000000000000000000000000000000000000000000000000000000000000020", - "0x0000000000000000000000000000000000000000000000000000000000000401", + "0x00000000000000000000000000000000000000000000000000000000000328b1", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000010", "0x0000000000000000000000000000000000000000000000000000000000000011", @@ -34,183 +34,183 @@ vk_path = [ "0x0000000000000000000000000000000000000000000000000000000000000008", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x0000000000000000000000000000009684c4ae9fe82713e3a8eea60d3c922fc9", - "0x00000000000000000000000000000000002200dda0dd6e67887e87dc8a8baed1", - "0x000000000000000000000000000000978d7bed9447855574ffcdb0d427640e74", - "0x0000000000000000000000000000000000130900428fccae8619c304961d2ab8", - "0x0000000000000000000000000000008f5d78eac245f24be1f1c35bcdffbb02f1", - "0x0000000000000000000000000000000000244072d67bf7f88a81d7c42ed506cd", - "0x0000000000000000000000000000001e2b25afb1eaff68309bbf6d0541e1765f", - "0x000000000000000000000000000000000026aaef79836ac6d9353c15fdc3d891", - "0x0000000000000000000000000000009299e3410bbc560396f32dc6f6eeaa68a0", - "0x0000000000000000000000000000000000179f5bb2e51449740274e9f9314d55", - "0x0000000000000000000000000000008b0e3b331bd5b80e6c1acc13c828f74d24", - "0x000000000000000000000000000000000007cb7696845757843ce9f1310efc92", - "0x000000000000000000000000000000eecc82922d49e9ac4932c91bf0f4d2e296", - "0x00000000000000000000000000000000002a4c4068f2cf06ac38db246df53067", - "0x00000000000000000000000000000044e020bcdd66ebd04570373bb18b0afc29", - "0x0000000000000000000000000000000000006922fdaa63918e64274d7f2f08ff", - "0x000000000000000000000000000000ac4ffa7d0e0489bd543204fcb8d5f490f3", - "0x0000000000000000000000000000000000246504badbfd2f04128d8a38182d16", - "0x00000000000000000000000000000078f915207cac9102f739c0d4e9b2ef7f35", - "0x00000000000000000000000000000000002d1d9f61a48a0cc1e932048f293e79", - "0x000000000000000000000000000000781cce35230238001a9124d65570d66cd0", - "0x00000000000000000000000000000000000a238a917967b7a390b395eab5a277", - "0x000000000000000000000000000000b517a64c56e67d4ed15901642ac2005f8c", - "0x000000000000000000000000000000000017688b33eb1a0b39547a17250aa2d2", - "0x000000000000000000000000000000fcf716ca9b2f777751df2a339a6ed69e0c", - "0x000000000000000000000000000000000024ddb4dd78bd8b18179c69efa2c73c", - "0x0000000000000000000000000000002d5fa8ac91e41a8f17d6bce5166bdf7f27", - "0x0000000000000000000000000000000000228f4a2b555cea5235e25e037135db", - "0x00000000000000000000000000000065ba05104dc21c3d6d986ed80d332c155d", - "0x00000000000000000000000000000000001579bf3418bf598eb69cfdb4b72f3c", - "0x000000000000000000000000000000bbccb29ad8caedd39ceb51b581522b92be", - "0x00000000000000000000000000000000002d375a0cb7863f71f059cf3c2dd966", - "0x0000000000000000000000000000004c34ea8547375e7795bb3beba7caa35e3a", - "0x00000000000000000000000000000000002b32c570a22732f30f06dd9fd4dcbf", - "0x00000000000000000000000000000088c5549f44ac0b2a05666c05f0071d14b9", - "0x00000000000000000000000000000000001c7a1568edd62fce047c0c7204ff52", - "0x0000000000000000000000000000008283e6ad48f41eeadadeae2c02f4fadf44", - "0x00000000000000000000000000000000001cb3cdb38a62d0033d2afd233b8940", - "0x000000000000000000000000000000bb5e9a1635fe20062208fa2a10999a62ee", - "0x0000000000000000000000000000000000169029b757a992e183a19bbf71ba26", - "0x0000000000000000000000000000002607173eefef8bd097b55ca7d21bb56902", - "0x00000000000000000000000000000000002bd04414a7a10f42826c1175f6b33b", - "0x0000000000000000000000000000001fe1da1a19100e2630c67ede5a97c0c96b", - "0x000000000000000000000000000000000011f88b7e597282bf11163d156f9aa3", - "0x000000000000000000000000000000aa209f011ce13ef1085635ab23eb66ed51", - "0x000000000000000000000000000000000025ebd54362b7760a60ad40905fec62", - "0x00000000000000000000000000000070633515d456282fd993ce44f4cabe2fc8", - "0x00000000000000000000000000000000000ce13df53e45761d5ca123593f51e8", - "0x00000000000000000000000000000076cfc7160e0914e9ac8c6eee0ab5849fb1", - "0x00000000000000000000000000000000002360b1c0221f9ec4e6def11e95e272", - "0x0000000000000000000000000000000044107195b405f828ae4099c3e2cf9e9c", - "0x00000000000000000000000000000000002ff5986cad78f0c745b4328a21f32c", - "0x000000000000000000000000000000d24f0a0cf38ca9316be400c743bbbb3bec", - "0x000000000000000000000000000000000027822ff7bb9483b29df97785ee5f9d", - "0x000000000000000000000000000000468d47d31fb480e2c192ddb6673e5cbea8", - "0x000000000000000000000000000000000001d6ab1aaf7944c2be04aea4060d71", - "0x000000000000000000000000000000352186c0ac198fcc43c147882dc38791ea", - "0x000000000000000000000000000000000026beb91f1a840b0027108fabff0526", - "0x000000000000000000000000000000984b3c4c7a109a6ba0eff050bc6352df53", - "0x00000000000000000000000000000000002351567eebd7207c2e3be8959f6f99", - "0x0000000000000000000000000000006feb796c33f7353b4e86be299ad338aafa", - "0x00000000000000000000000000000000001534436809cc52d83079a54e8b0c0f", - "0x000000000000000000000000000000f11b5463e81dac230c23b794cccb5531e9", - "0x00000000000000000000000000000000000ba332ef495a65ba8ed7ae9565dff7", - "0x00000000000000000000000000000037dfee070ea527ac5b0e30a795f9e92c50", - "0x0000000000000000000000000000000000141383125e1a3a4d9db9eb76c6d379", - "0x0000000000000000000000000000007b7bc3dd2e73a977ddb1c5f3a24c4c2cb0", - "0x000000000000000000000000000000000008bb35d27b1697fb726fa96565cf7e", - "0x0000000000000000000000000000005ceae614147425f8862ea29e131bdb1c22", - "0x0000000000000000000000000000000000238c39a25e7801303bf2b783cbca1a", - "0x00000000000000000000000000000058e2a565b371b2fb67d963bfa3fd24f260", - "0x00000000000000000000000000000000000430cca2ea66e13847c9eca22e3d50", - "0x00000000000000000000000000000023329893dcb782ff96ec94332b3be42781", - "0x000000000000000000000000000000000027d8e1c6ab2755ddfac71af70042ea", - "0x00000000000000000000000000000060e31e36a7177c94f13116e322e94f6c17", - "0x0000000000000000000000000000000000150a041538553900f4fcef7d7412fa", - "0x0000000000000000000000000000009cd8490bd0731d1977420e0ceb62fe14ea", - "0x00000000000000000000000000000000000133a20b88cf37e3a954be40b1efc7", - "0x0000000000000000000000000000002cbac70f6fcc2727b6a02ad66a3cf92665", - "0x00000000000000000000000000000000000172934f5f81cef8e4abc61d5e5f6d", - "0x000000000000000000000000000000f7d03783cdfa0502b891d7a7ad2ee5d20c", - "0x00000000000000000000000000000000002e09a8f26c5a2c086b0de83d5cab77", - "0x00000000000000000000000000000009281fb84ee048857c9f2067b045520cc7", - "0x00000000000000000000000000000000001e63cdca7c3207312fc760d45ab3f6", - "0x000000000000000000000000000000d0250f372687da1b79cda4f648582a76c8", - "0x00000000000000000000000000000000000f7628cb1a63b8357eb8bcc6f63c40", - "0x000000000000000000000000000000b79e44954dd5aee1fed23c97db5faf3aae", - "0x0000000000000000000000000000000000087e6b3370846649ec0a03cfc881ea", - "0x0000000000000000000000000000003acc6def4164d878b56e5b2fe2bfa52199", - "0x000000000000000000000000000000000022cf69996ae471056bcae7b3c38cbc", - "0x000000000000000000000000000000239623839c51be6ffe83c77c80b8f94ad5", - "0x0000000000000000000000000000000000075cc2c3c9e3079bec86764aa5cfd0", - "0x0000000000000000000000000000008c88b485298919bf7164440942d6f6c5ad", - "0x00000000000000000000000000000000000c5dd6e29eac9076cc2f5995fcf27c", - "0x0000000000000000000000000000005b7ac436f888999a48f79ef212e6483f14", - "0x000000000000000000000000000000000009fc56f5a2122d1ed9353860ba68ab", - "0x000000000000000000000000000000dace4e23bf41b55e3098bd8e82e74b1c1e", - "0x00000000000000000000000000000000000883499c226658d83b4d0cc7b08c15", - "0x0000000000000000000000000000005c0373d8b286bf727301571a54e1636e77", - "0x00000000000000000000000000000000001f268c0945bdea494fbfc52e8581c1", - "0x000000000000000000000000000000c6b7e770c1e62e2504ce986f21324ff939", - "0x000000000000000000000000000000000001b92f92042ae2556e31cf72cc3990", - "0x0000000000000000000000000000007007220c2c02f4ec2c1c5fada9056b8c37", - "0x00000000000000000000000000000000003038ffe6284e174445a0eb11a63e0b", + "0x00000000000000000000000000000008e7d4090fe1b03bcf550959c99799139b", + "0x0000000000000000000000000000000000088aa786da9dc2a41ca5099a6e80ca", + "0x00000000000000000000000000000046eeffc45db052c4d1bdf6c7dc525c0bdf", + "0x0000000000000000000000000000000000152da573c87280836bcaca9dc4df3f", + "0x000000000000000000000000000000712f5e8ad99ee018b7f0a793f37925d3b8", + "0x00000000000000000000000000000000000f3706899be0ef5913132bf5f4d951", + "0x000000000000000000000000000000422e8d906c60168c0be9f5a426f48952d5", + "0x0000000000000000000000000000000000058a22d8e370676a6ff18365997985", + "0x00000000000000000000000000000049131fc550ae760a6c82e62ac79afc33c3", + "0x0000000000000000000000000000000000284748c61bfc04464a70a5a89c964b", + "0x0000000000000000000000000000009498fe80df0a34dacd50b4caeb43db411b", + "0x00000000000000000000000000000000000382573fe4ed920030d18612fef5c0", + "0x000000000000000000000000000000a04bfe32d94b08453992a5fcb1376d5b2a", + "0x000000000000000000000000000000000003f5a2b96519c290b85e3b4eea537d", + "0x0000000000000000000000000000004f7390273a8edb178a56040acc799fa262", + "0x00000000000000000000000000000000000511db16ad03700e6f5603ac4803c5", + "0x0000000000000000000000000000005578be7571824b0e28e4567ce20e577e16", + "0x00000000000000000000000000000000000bb588368a6d9f13ab43f74863c783", + "0x000000000000000000000000000000f26d7183d44a24465a57b817ca7d71a2ac", + "0x000000000000000000000000000000000010f829c89ca2bb8ada98ab0bbc6ce6", + "0x000000000000000000000000000000dbccb4e6119d17ba7f6e21b80ae999c93f", + "0x000000000000000000000000000000000013d7fcd231fec46500aba2d5d6e161", + "0x00000000000000000000000000000085ae4c83ef8028042d9af6fda3fd8c7d3f", + "0x00000000000000000000000000000000002612f38f10de0ef90b0d11382031a9", + "0x000000000000000000000000000000860ecf905609eaf6c22c7dbdd68c479317", + "0x00000000000000000000000000000000000d01000ddfa98166c5d1b6bfd73355", + "0x0000000000000000000000000000009acc767c780db6e6aaa25ba0b06eba7083", + "0x000000000000000000000000000000000006504ac42a7d41d84c7f9b3cc10003", + "0x00000000000000000000000000000090d53c6a3b26339cda6b73df9208314159", + "0x0000000000000000000000000000000000298c3311fc9170f92de940b042aab9", + "0x000000000000000000000000000000bf37537eb196b05c1d98fa51016a9bacbb", + "0x000000000000000000000000000000000007b05f408a612847259016b9204ae4", + "0x0000000000000000000000000000005c79ac1179711322a3faabd18c294454ab", + "0x000000000000000000000000000000000004dd6e834173c31a395361b65813b2", + "0x0000000000000000000000000000009784392d9c0bd9f276f0aa761658646e69", + "0x000000000000000000000000000000000020ca1db0173d36601907cf2aadb603", + "0x00000000000000000000000000000000be5db8f7006d01ebccc9f7e646c74fb5", + "0x00000000000000000000000000000000000c641d7549aa8dd8975df30d662f32", + "0x00000000000000000000000000000090f01ac3c448a1c9856bcae9d90c606927", + "0x000000000000000000000000000000000026b019bd89b26eb965abb874aeaa2a", + "0x0000000000000000000000000000000e75a6786e8558d0e5985e07c16475b3b9", + "0x00000000000000000000000000000000001b1c4d1037b3922bd24c003b78e703", + "0x00000000000000000000000000000004dadf650da58289a087e179a695f2ab42", + "0x00000000000000000000000000000000001dfdd05fff37808b6f82a8ab154467", + "0x00000000000000000000000000000026a0352c25cccd1aea682fc8e975804a3e", + "0x0000000000000000000000000000000000172c855547ef1cf358b1193059ab94", + "0x000000000000000000000000000000c746ba121a8412b23d1a54c2679b7fcb42", + "0x0000000000000000000000000000000000188578f3213bb6dba81fc0826a77f1", + "0x00000000000000000000000000000017f1ad5a36d1d27be395a245b27103333d", + "0x000000000000000000000000000000000004aaea2a12bbe7658d9ebb39bcc49c", + "0x0000000000000000000000000000003d5674ba283399f8ff8e9a4a54ef04f90b", + "0x0000000000000000000000000000000000085ced78b3c248687e55753187ae1a", + "0x000000000000000000000000000000c3f69116b99bc6ffe2ea33348aedab107f", + "0x00000000000000000000000000000000002ac3afb3486a8008fe304176553b8f", + "0x0000000000000000000000000000002b2112dd48e799d1264079e8ef0d1bcaa9", + "0x00000000000000000000000000000000002c9560a53e0bded7eeda7efc3128ce", + "0x0000000000000000000000000000000e3fe7898593b80b35cd98e0ff8c02bb2b", + "0x00000000000000000000000000000000000c66cc6ac267b3a4c572d67dc8ac27", + "0x000000000000000000000000000000c47b62087e0dd0ddc91603f102f54d0171", + "0x00000000000000000000000000000000001c9648d80485a3e43a227e6629c25a", + "0x000000000000000000000000000000214b2f3eb099f4bfafb1a63f2432e8dcd1", + "0x000000000000000000000000000000000021eb1fb2496250bc33d04feef11b9f", + "0x00000000000000000000000000000087bb913c8ab457382b4885b1549b649680", + "0x00000000000000000000000000000000001c802ee78f0837e23a64fa2391a093", + "0x0000000000000000000000000000000d10830dd858f4805d37243f97c5f559da", + "0x0000000000000000000000000000000000273d9c7944b0c92df89fd28da7c666", + "0x00000000000000000000000000000089e2448d63ed1f84f8cecb18ad20633ae8", + "0x000000000000000000000000000000000008e02fd63dc9caf25847f31224cdfd", + "0x000000000000000000000000000000dc6ba3a1213dda9b61a3d18939f9f3c10b", + "0x00000000000000000000000000000000001661f68c161d87c1767ed0edd9cf30", + "0x00000000000000000000000000000083adb271c2e7df75561aa1f6e011ba2946", + "0x000000000000000000000000000000000021c2b90e7392f5c53cd72cdc3a8285", + "0x00000000000000000000000000000021babb5c272ea6ce467363b4f16ea037f0", + "0x000000000000000000000000000000000015c1fce69c7cd7d3f59d237552ebb6", + "0x0000000000000000000000000000001d2cc883c52a5f7afa2535f68e83f9189e", + "0x00000000000000000000000000000000000c8f881a97a9525dd7746214cbfe93", + "0x000000000000000000000000000000791e9a8be962e8c8f27f666b24c2abbc90", + "0x00000000000000000000000000000000002fad9971af750a3860c6d49295778a", + "0x000000000000000000000000000000131ff05b1c1ea1461ce91c58b9a20a532c", + "0x00000000000000000000000000000000000af03ded4dc393cd9ac3839040964f", + "0x000000000000000000000000000000eb6f8a370d1a3a8b3c0986487ca5b4a605", + "0x00000000000000000000000000000000000ef440ec41a10d0a00fee7fb295ef3", + "0x00000000000000000000000000000051a3368773137c41162f63d21d3aef9edb", + "0x00000000000000000000000000000000001955a635a95150b41ef2fe8814e101", + "0x00000000000000000000000000000085866306b45c95c394062c243642ec4c2c", + "0x00000000000000000000000000000000002d7d6f5ca3bc5678ce72e8814d69af", + "0x0000000000000000000000000000009ff72bb4ca23e2c2f7b1e74d6c3993b942", + "0x00000000000000000000000000000000002ef2d071d120a5d2cbdc65a86e3bd6", + "0x000000000000000000000000000000f6f4596202301b6ae4eb0ebbeadd203340", + "0x00000000000000000000000000000000000adc89c48d75b571636f5bbeb4a806", + "0x00000000000000000000000000000000034e3e27454ef992b4bf84b97baa7471", + "0x0000000000000000000000000000000000066f28135748f119631c3fe07fa9d7", + "0x0000000000000000000000000000003b64a66f2ac4979b65e56568c5a31b14ed", + "0x00000000000000000000000000000000002e25783551df50c004ec7cd1f4dd8b", + "0x000000000000000000000000000000e8258f84477c1b62565a559ba7bb38832e", + "0x000000000000000000000000000000000018f76cf0ceeccb4798de741ae89b64", + "0x0000000000000000000000000000001583b176f599e192d7119354034419e8f9", + "0x000000000000000000000000000000000004706a0e23ac32a3566907fb872362", + "0x000000000000000000000000000000d1b9992279342fce9a883849693fcda22a", + "0x000000000000000000000000000000000029046b299293cb09c593372eb6b3e6", + "0x000000000000000000000000000000469680c270e551515344592f59188fa765", + "0x00000000000000000000000000000000002d38d6d4ba1e4763a74ecdb11ca1f3", + "0x000000000000000000000000000000fce917c0d5dca019477c52f6075332b612", + "0x000000000000000000000000000000000012db39e892826b32610ee08251e005", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000008344e7cd358bb008fa2594f42e2058a4da", - "0x000000000000000000000000000000000028d98153e26aa139c5f995a12d6b82", - "0x000000000000000000000000000000ebbd996ba82dd482c0cd9f93dba5c948f1", - "0x00000000000000000000000000000000000abbbdb042fe5de7714689b4b198cb", - "0x000000000000000000000000000000f9e0b46413eb2fb09802dc6381d0c758d0", - "0x00000000000000000000000000000000000b7903a56c4534697c4609a32a627d", - "0x0000000000000000000000000000002047c7fa5c47cce84d3a096aece17ad007", - "0x0000000000000000000000000000000000103798affda545f221f27292077e83", - "0x0000000000000000000000000000004264681c9136a2fde7137335ef716fecde", - "0x000000000000000000000000000000000027ca9ccf01429923a61d872c7c224c", - "0x0000000000000000000000000000006df5ee4c1358443f5a14086b5196e13e46", - "0x0000000000000000000000000000000000192b1a6d3b14dfe5a9ad63951d2d76" -] - hash = "0x0a889b72ac9f79e9a8c4c5934e62f265fe1b862799220c8fef796558ef921a6f" + "0x000000000000000000000000000000c77bfd4e323bf4b587a765f94fd95a8b79", + "0x000000000000000000000000000000000024009f6e07ac7a3b6be0bb489fbecc", + "0x00000000000000000000000000000057a8b3aca5f0c3ee69ebb7065f7ad49d24", + "0x00000000000000000000000000000000001cbb1e4420739c580a8ddde8b93cf6", + "0x0000000000000000000000000000006241ca0c75be2d15e6b9188983d6b41e2d", + "0x00000000000000000000000000000000001a71ab9767b295f9337074850d2d40", + "0x000000000000000000000000000000ec7f970d2da2ca7f41836eb044f5a75b01", + "0x00000000000000000000000000000000001a9a63c00430414d47f85b2352b1d7", + "0x000000000000000000000000000000e55ba19751adfe6c36324d3fb6c2da0989", + "0x00000000000000000000000000000000001d58aa61c64ad522043d79c4802219", + "0x00000000000000000000000000000078f4b3bc61f19d6e7069359bbf47e7f907", + "0x00000000000000000000000000000000002d7c18a93c3dae58809faaeec6a86a" +] + hash = "0x17f3e7d2936ffd8ff10f6e7df75f8ee328a19aeae4567176d6d81bb8a1e0a605" [previous_kernel_public_inputs] min_revertible_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000003" -is_private_only = true +is_private_only = false [previous_kernel_public_inputs.constants] - vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" - protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" + vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" + protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [previous_kernel_public_inputs.constants.historical_header] - total_fees = "0x0000000000000000000000000000000000000000000000000011b417896f129a" - total_mana_used = "0x0000000000000000000000000000000000000000000000000000000000016771" + total_fees = "0x00000000000000000000000000000000000000000000000000f3d59e049eb1ac" + total_mana_used = "0x00000000000000000000000000000000000000000000000000000000001355c1" [previous_kernel_public_inputs.constants.historical_header.last_archive] - root = "0x0781b1cc32dbe21aba1e27519e765bd44222b52ef464c6b63dfa97b399376c2e" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000009" + root = "0x2686a574dfb90890de58e447bcd7f12504950a18bbe781d95758161ca30dcf66" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000005" [previous_kernel_public_inputs.constants.historical_header.content_commitment] num_txs = "0x0000000000000000000000000000000000000000000000000000000000000002" - blobs_hash = "0x0008822f60476d6dc34ec6109d3ad69dd1747a9484777021d8e717166bc7d5e6" + blobs_hash = "0x002ee5246d9ece5e2f64027ac8216616887df1da344019d0e0f0cfd1c2483af7" in_hash = "0x00089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c" out_hash = "0x00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb" [previous_kernel_public_inputs.constants.historical_header.state.l1_to_l2_message_tree] root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000090" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050" [previous_kernel_public_inputs.constants.historical_header.state.partial.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000480" +root = "0x265f2fb8ecbd96d51d74d79901934e60af982af7b6caa46153eafcf3201df280" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000280" [previous_kernel_public_inputs.constants.historical_header.state.partial.nullifier_tree] -root = "0x0a639c242b766d8bd94d437483546e33c4a8c27feadf50bc4ef523e9f191e927" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000500" +root = "0x0d8cfcd6ecef742ecda848c0db79ef7d0fe639b7b69564d103f788d530832eba" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" [previous_kernel_public_inputs.constants.historical_header.state.partial.public_data_tree] -root = "0x2528ba08e1171e992f4744a8d8761bbe5611447c52d673882bde6a9e3b716e1a" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [previous_kernel_public_inputs.constants.historical_header.global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000009" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000016" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2eae" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000005" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000009" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a8e5" [previous_kernel_public_inputs.constants.historical_header.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [previous_kernel_public_inputs.constants.historical_header.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.constants.historical_header.global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9c6e14ac" [previous_kernel_public_inputs.constants.tx_context] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" @@ -226,7 +226,11 @@ l2_gas = "0x00000000000000000000000000000000000000000000000000000000005b8d80" [previous_kernel_public_inputs.constants.tx_context.gas_settings.max_fees_per_gas] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" -fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" + +[previous_kernel_public_inputs.constants.tx_context.gas_settings.max_priority_fees_per_gas] +fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.validation_requests.for_rollup.max_block_number._opt] _is_some = false @@ -234,19 +238,19 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.validation_requests.note_hash_read_requests]] [previous_kernel_public_inputs.validation_requests.note_hash_read_requests.read_request] -value = "0x1808fa11f6b6ffdbd9f9e94a8f4c91aa954111d43f44544ed0ffbbf73ccf9a63" +value = "0x0671d5c4778f2ccff0b927cf2f5f89b768a9e969755a61a825b1334b13142927" counter = "0x0000000000000000000000000000000000000000000000000000000000000002" [previous_kernel_public_inputs.validation_requests.note_hash_read_requests.contract_address] -inner = "0x30021904ae3832fa38613650b957c74abcc7ae86fda9e53bcd89e7b638cf9d67" +inner = "0x17e5c98d998228e7de3dbb6c01ae1fd3aaf868bd45946d300e4c36f6d396dea0" [[previous_kernel_public_inputs.validation_requests.note_hash_read_requests]] [previous_kernel_public_inputs.validation_requests.note_hash_read_requests.read_request] -value = "0x1eeef2e1c70a7794a3586b4cf25058ac1b892b7d874294bf7dc5d1282591e04b" -counter = "0x0000000000000000000000000000000000000000000000000000000000000005" +value = "0x0000000000000000000000000000000000000000000000000000000000000000" +counter = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.validation_requests.note_hash_read_requests.contract_address] -inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" +inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.validation_requests.note_hash_read_requests]] [previous_kernel_public_inputs.validation_requests.note_hash_read_requests.read_request] @@ -746,11 +750,11 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.validation_requests.nullifier_read_requests]] [previous_kernel_public_inputs.validation_requests.nullifier_read_requests.read_request] -value = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" -counter = "0x0000000000000000000000000000000000000000000000000000000000000004" +value = "0x0000000000000000000000000000000000000000000000000000000000000000" +counter = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.validation_requests.nullifier_read_requests.contract_address] -inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" +inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.validation_requests.nullifier_read_requests]] [previous_kernel_public_inputs.validation_requests.nullifier_read_requests.read_request] @@ -1258,18 +1262,18 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.validation_requests.scoped_key_validation_requests_and_generators]] [previous_kernel_public_inputs.validation_requests.scoped_key_validation_requests_and_generators.request] -sk_app_generator = "0x0000000000000000000000000000000000000000000000000000000000000030" +sk_app_generator = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.validation_requests.scoped_key_validation_requests_and_generators.request.request] - sk_app = "0x0d6dd1f75adac84b209ad26497e2f6796dc1d1a99a694303a18319a2d475df33" + sk_app = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.validation_requests.scoped_key_validation_requests_and_generators.request.request.pk_m] - x = "0x175d325f91f136d09f7b5b30ee6e82a8720dcd4fadd87e9828a989461ffe5828" - y = "0x161bf54b24e177c5cbb154fc01a12732e92c21c5a04985cea5374033ed510b4c" + x = "0x0000000000000000000000000000000000000000000000000000000000000000" + y = "0x0000000000000000000000000000000000000000000000000000000000000000" is_infinite = false [previous_kernel_public_inputs.validation_requests.scoped_key_validation_requests_and_generators.contract_address] -inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" +inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.validation_requests.scoped_key_validation_requests_and_generators]] [previous_kernel_public_inputs.validation_requests.scoped_key_validation_requests_and_generators.request] @@ -2222,19 +2226,19 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.note_hashes]] [previous_kernel_public_inputs.end.note_hashes.note_hash] -value = "0x250eff94c845907e4b441ec3e2ab9c7f96c90b19c35d98298903720596c8ae96" -counter = "0x0000000000000000000000000000000000000000000000000000000000000007" +value = "0x0000000000000000000000000000000000000000000000000000000000000000" +counter = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.end.note_hashes.contract_address] -inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" +inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.note_hashes]] [previous_kernel_public_inputs.end.note_hashes.note_hash] -value = "0x080d7e517a580a3e7e87d11e50504e3931844836624eef2031f2c29d27fcec98" -counter = "0x0000000000000000000000000000000000000000000000000000000000000009" +value = "0x0000000000000000000000000000000000000000000000000000000000000000" +counter = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.end.note_hashes.contract_address] -inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" +inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.note_hashes]] [previous_kernel_public_inputs.end.note_hashes.note_hash] @@ -2734,7 +2738,7 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.nullifiers]] [previous_kernel_public_inputs.end.nullifiers.nullifier] -value = "0x1e4c23d7a900532cdb5687c5806be8da481285afb0abbbe8a3801d71451d08d8" +value = "0x2dae308391cc3f88798b70c30faa9513e35aa507d5eb2da273c7cc2637009e1e" counter = "0x0000000000000000000000000000000000000000000000000000000000000000" note_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -2743,12 +2747,12 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.nullifiers]] [previous_kernel_public_inputs.end.nullifiers.nullifier] -value = "0x08b671e5822c135c559a7b5a7ef58783ef97faed29ca80ac2d28bc1c77fbbbd2" -counter = "0x0000000000000000000000000000000000000000000000000000000000000006" +value = "0x0000000000000000000000000000000000000000000000000000000000000000" +counter = "0x0000000000000000000000000000000000000000000000000000000000000000" note_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.end.nullifiers.contract_address] -inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" +inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.nullifiers]] [previous_kernel_public_inputs.end.nullifiers.nullifier] @@ -3398,93 +3402,93 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.private_logs]] [previous_kernel_public_inputs.end.private_logs.inner] -note_hash_counter = "0x0000000000000000000000000000000000000000000000000000000000000007" -counter = "0x0000000000000000000000000000000000000000000000000000000000000008" +note_hash_counter = "0x0000000000000000000000000000000000000000000000000000000000000000" +counter = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.end.private_logs.inner.log] fields = [ - "0x2d79cc0637eb70f6c46f8680291f1401502fe4d39564606106584b776d308ecf", - "0x00961dca5785af4bf09cf75a77cdfcfa8fa41413b16bee86604c1826795edeec", - "0x00f7933d99a2ac43f613e021cc11c6200bdf7d703ba411bfda70998dbbe91d18", - "0x005c34531ec16f9cba02c2f74e5b68f53ec6bc00000000000000000000000000", - "0x000000343ccbf71927c63534206273c8611b72a04d4db62e0d1e7a1f358dbfe9", - "0x00bbb6167707e40e023148c03968226c73db4574f5991f9d06194dd1782e9d92", - "0x00c2cfe592e585e6319b54b39631393055f7ff2e2fab8ed76f5ca49bc3e7c83b", - "0x0036f9cd24f2727bc025371ca810245a9267c936e7edf92bd90a302d44b9a6ff", - "0x00dabe139092b735a4288ee4a9379e4afdfa51708650fe26e91e239fa23f9375", - "0x00eae9418604595e2d9a6ad7d46b2fc1967d2d7da56c4072a76bb3f709982f49", - "0x00989ffa26ac3a205dc0b99de3a6507411d11fdba8c61d3c81aabed1f119dd27", - "0x008ee4cadeaf75aa216d88a2a3aad40ba71c9ca39176a9ac78da77e47cab5caa", - "0x009927c6b18981dfcabf0a63dfd61d0491d8ee2c893844bb2ca602012783d756", - "0x00a18c50eb974c9146d791e09d883b3ad300430e1bac3f225b96041bcee15fce", - "0x00d527b9e3f664614bdf0f851d75ac6acaf59d4dbbe565a36424dee99bbf878d", - "0x00ae2f375a95ac5c40bf04f2c3f117c27132f413368d5d56edc746174594f8ca", - "0x004ff8ae2b0b2ae2b61a01a94b966654d26714edd486f5acacb2feb360f09059", - "0x00fb3c03d810569bdb758dbcb063020c6119ae59bd66308035a17f93ec1a8e98" + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" ] [previous_kernel_public_inputs.end.private_logs.contract_address] -inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" +inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.private_logs]] [previous_kernel_public_inputs.end.private_logs.inner] -note_hash_counter = "0x0000000000000000000000000000000000000000000000000000000000000009" -counter = "0x000000000000000000000000000000000000000000000000000000000000000a" +note_hash_counter = "0x0000000000000000000000000000000000000000000000000000000000000000" +counter = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.end.private_logs.inner.log] fields = [ - "0x08f720b2dc01d9f869376d21c019e00d91ba4a2df4c411b8351967bc22f30833", - "0x0082d4f053d20f9e5d0133a2279d7e5e1edcee80e8ae64e2b31759ea2c9d8357", - "0x00b4293fe37ff8a12620c49682fe04fc280a5808fc52884c40905c8a9fd12c22", - "0x00a08522ae6abbcca7fa0574ba7dc99f9f881c00000000000000000000000000", - "0x000000b32f2e9c3feb52a65be2321e91560925b83d0be9ea0c8e41c5e71c4df1", - "0x00fa5845ce219f1a7dd626caa3c96b536a79a3a65b1e184bda69fbc6eb61bdfc", - "0x0028181637f8949f88e4a53422f95c86122248723091b21e8f469fc86b3f7bf6", - "0x00c45756c940e72b7532073a35d77febff4f9d61a7f15706ba058f552c4c4dec", - "0x00ff7429d367c5fb82596c900dae746bd4988941db33121f03a8d01d92646560", - "0x004ca4b6be792d1c2167e998174d676e6462d0995063cd2d28bed4a7a0205ee0", - "0x0075c3cbed81825b7d47fe05ffa7446ee7b637ead0b04f1fb74e5d5d8f6a2b61", - "0x0036e4ebe9d34f8cf36254dc26d3b8c4829781d742edd48bd4babc79d4f8e019", - "0x001e85147052819f92807729600faf577839327b3c9d6ddada8869a19fdc2f7c", - "0x00062d400f543f81e1379c1e275b50e2bd025e4adc8111ae7ee30615c4733c58", - "0x0036d19ebc307f6a255369bb16287ec77fe0671c2dc6b3151ffa75e99a560d55", - "0x00250cf6a0581f297c606cde1b35e500648010bd4e9bda5b8a98a5824e0ee3bd", - "0x00b16603236f00e2f4263ecb587c0bb087fdcfa9075b3dde4501dff76177d091", - "0x0046729300d452d6dfe8200e1958ea4c78b2ddb8108a5c9b11fe2f61ca2c092b" + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" ] [previous_kernel_public_inputs.end.private_logs.contract_address] -inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" +inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.private_logs]] [previous_kernel_public_inputs.end.private_logs.inner] note_hash_counter = "0x0000000000000000000000000000000000000000000000000000000000000000" -counter = "0x000000000000000000000000000000000000000000000000000000000000000b" +counter = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.end.private_logs.inner.log] fields = [ - "0x2d24207cbf1dc0a827042e09794dba8765971047eb2f6890b2ba4c398ba95b1f", - "0x002fe17d85df96d8b9bc15c91d0d62b0173174cda5d991cd73e9b9da65e2956b", - "0x00da7b08beac5d98c229d91728587646f72777453b785d0624e59f0a8075661d", - "0x0089323120a21d889aee547c21faa1c03a1ead00000000000000000000000000", - "0x0000001a851e3ed1265dde6b01175571a83d0777b0c17791db74cd2b33589139", - "0x00d1f4a53e67b2221c1ce7bd6d5dc105b0b3a086dcabd173b2b874f6f13fa338", - "0x002ccc3ee9f522a252f7523703c162fb8807c24eb052d2871609e249c67bd5bb", - "0x006e1fd58f3479bb18d1abd812bef996dfc0a36d72d1472a930e77805f243952", - "0x007043fae6b109a981b1e34acf7281480b879f280fd607fa1df718c9a31acaf2", - "0x008c4f91880f265b065cea8a705bc508875182fe5a3837e2b5b8a14e231cbd59", - "0x0071c17f4d52aecdfb4d8c6b1e764ae137c836c0672bf3cc589a45878f2686a8", - "0x00c95d01a6e57b41af4f265b2c88f6ff3de54aa5c895ca6faa21e26a8d6134a5", - "0x00a54c12af2499afd7651644686c671c3d77ff4af32a6b181646c976329a0063", - "0x004567a7724f750c4b0c9c205f35f4a175ea93015792fc78fbd985e7c751cc1b", - "0x001b0870e32b1c3c28116435e5132496bdeb8a1d3b9acc62b7d57d82f230bdaf", - "0x0058272cd1119bc153b18b3a3c896138be6f5b9144f216cd6e6f1b5db7d8ef08", - "0x00c1c848fc01d649f264a3cf8ba8cade698e2c1dbd14f7a0077356f8381de748", - "0x00328549fac9e2e1ff6fc6aaef17fbb1fd5c973e01df61985fe056548fd4b5df" + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" ] [previous_kernel_public_inputs.end.private_logs.contract_address] -inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" +inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.private_logs]] [previous_kernel_public_inputs.end.private_logs.inner] @@ -4366,20 +4370,20 @@ length = "0x0000000000000000000000000000000000000000000000000000000000000000" inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.public_call_requests]] -counter = "0x0000000000000000000000000000000000000000000000000000000000000000" +counter = "0x0000000000000000000000000000000000000000000000000000000000000003" [previous_kernel_public_inputs.end.public_call_requests.inner] - is_static_call = false - args_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" + is_static_call = true + args_hash = "0x2d8b7f64cd689f5fdc2633f57f8eda15aff596cb11b1f76612eca8304c90fdfb" [previous_kernel_public_inputs.end.public_call_requests.inner.msg_sender] - inner = "0x0000000000000000000000000000000000000000000000000000000000000000" + inner = "0x17e5c98d998228e7de3dbb6c01ae1fd3aaf868bd45946d300e4c36f6d396dea0" [previous_kernel_public_inputs.end.public_call_requests.inner.contract_address] - inner = "0x0000000000000000000000000000000000000000000000000000000000000000" + inner = "0x0a762f2c969988845e3f2ec70b07cda6dadd97cc3542c63c3658211d44d09709" [previous_kernel_public_inputs.end.public_call_requests.inner.function_selector] - inner = "0x0000000000000000000000000000000000000000000000000000000000000000" + inner = "0x00000000000000000000000000000000000000000000000000000000d5441b0d" [[previous_kernel_public_inputs.end.public_call_requests]] counter = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -5038,15 +5042,15 @@ end_side_effect_counter = "0x000000000000000000000000000000000000000000000000000 inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [hints] -validation_requests_split_counter = "0x0000000000000000000000000000000000000000000000000000000000000000" +validation_requests_split_counter = "0x0000000000000000000000000000000000000000000000000000000000000003" [[hints.note_hash_read_request_hints.read_request_statuses]] state = "0x0000000000000000000000000000000000000000000000000000000000000002" hint_index = "0x0000000000000000000000000000000000000000000000000000000000000000" [[hints.note_hash_read_request_hints.read_request_statuses]] -state = "0x0000000000000000000000000000000000000000000000000000000000000002" -hint_index = "0x0000000000000000000000000000000000000000000000000000000000000001" +state = "0x0000000000000000000000000000000000000000000000000000000000000000" +hint_index = "0x0000000000000000000000000000000000000000000000000000000000000000" [[hints.note_hash_read_request_hints.read_request_statuses]] state = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -5564,10 +5568,10 @@ read_request_index = "0x00000000000000000000000000000000000000000000000000000000 "0x21f9172d72fdcdafc312eee05cf5092980dda821da5b760a9fb8dbdf607c8a20", "0x2373ea368857ec7af97e7b470d705848e2bf93ed7bef142a490f2119bcf82d8e", "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", - "0x18674fb10d20d823d1f6662ba72e75b0aec3c96597a26926faff64809b606464", + "0x0b031fdf9b442bafc40643e229dbc03193c53ab41f40b5ef714d43acb3b127a8", "0x2d78ed82f93b61ba718b17c2dfe5b52375b4d37cbbed6f1fc98b47614b0cf21b", "0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1", - "0x1352219a7f38a59a1ced55b5de4127dc73ae6e324e82a430ef1e8d49dd0678f9", + "0x0a9b75d98cc729de5d56e9f4f918686d5b07e9fcdd7525d1c570d82b82311c8b", "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", @@ -5601,58 +5605,58 @@ read_request_index = "0x00000000000000000000000000000000000000000000000000000000 ] [hints.note_hash_read_request_hints.settled_read_hints.leaf_preimage] - value = "0x1808fa11f6b6ffdbd9f9e94a8f4c91aa954111d43f44544ed0ffbbf73ccf9a63" + value = "0x0671d5c4778f2ccff0b927cf2f5f89b768a9e969755a61a825b1334b13142927" [[hints.note_hash_read_request_hints.settled_read_hints]] -read_request_index = "0x0000000000000000000000000000000000000000000000000000000000000001" +read_request_index = "0x0000000000000000000000000000000000000000000000000000000000000040" [hints.note_hash_read_request_hints.settled_read_hints.membership_witness] - leaf_index = "768" + leaf_index = "0" sibling_path = [ - "0x020fcd2bb8110357719fd398580862c643fe2c0bccfef7c2c43d27d72aabc12f", - "0x0b63a53787021a4a962a452c2921b3663aff1ffd8d5510540f8e659e782956f1", - "0x0e34ac2c09f45a503d2908bcb12f1cbae5fa4065759c88d501c097506a8b2290", - "0x21f9172d72fdcdafc312eee05cf5092980dda821da5b760a9fb8dbdf607c8a20", - "0x2373ea368857ec7af97e7b470d705848e2bf93ed7bef142a490f2119bcf82d8e", - "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", - "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", - "0x2d78ed82f93b61ba718b17c2dfe5b52375b4d37cbbed6f1fc98b47614b0cf21b", - "0x246218a1d11c91124c20e3394600ad16e5036e2b84aa6afcc8cf3422fd29b02c", - "0x1196b37a9f45bda9848dd661f2df18622a6b4efed01b1cb9eae812f3bf0bc0de", - "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", - "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", - "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", - "0x1c4954081e324939350febc2b918a293ebcdaead01be95ec02fcbe8d2c1635d1", - "0x0197f2171ef99c2d053ee1fb5ff5ab288d56b9b41b4716c9214a4d97facc4c4a", - "0x2b9cdd484c5ba1e4d6efcc3f18734b5ac4c4a0b9102e2aeb48521a661d3feee9", - "0x14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3", - "0x071d7627ae3b2eabda8a810227bf04206370ac78dbf6c372380182dbd3711fe3", - "0x2fdc08d9fe075ac58cb8c00f98697861a13b3ab6f9d41a4e768f75e477475bf5", - "0x20165fe405652104dceaeeca92950aa5adc571b8cafe192878cba58ff1be49c5", - "0x1c8c3ca0b3a3d75850fcd4dc7bf1e3445cd0cfff3ca510630fd90b47e8a24755", - "0x1f0c1a8fb16b0d2ac9a146d7ae20d8d179695a92a79ed66fc45d9da4532459b3", - "0x038146ec5a2573e1c30d2fb32c66c8440f426fbd108082df41c7bebd1d521c30", - "0x17d3d12b17fe762de4b835b2180b012e808816a7f2ff69ecb9d65188235d8fd4", - "0x0e1a6b7d63a6e5a9e54e8f391dd4e9d49cdfedcbc87f02cd34d4641d2eb30491", - "0x09244eec34977ff795fc41036996ce974136377f521ac8eb9e04642d204783d2", - "0x1646d6f544ec36df9dc41f778a7ef1690a53c730b501471b6acd202194a7e8e9", - "0x064769603ba3f6c41f664d266ecb9a3a0f6567cd3e48b40f34d4894ee4c361b3", - "0x1595bb3cd19f84619dc2e368175a88d8627a7439eda9397202cdb1167531fd3f", - "0x2a529be462b81ca30265b558763b1498289c9d88277ab14f0838cb1fce4b472c", - "0x0c08da612363088ad0bbc78abd233e8ace4c05a56fdabdd5e5e9b05e428bdaee", - "0x14748d0241710ef47f54b931ac5a58082b1d56b0f0c30d55fb71a6e8c9a6be14", - "0x0b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d", - "0x2c45bb0c3d5bc1dc98e0baef09ff46d18c1a451e724f41c2b675549bb5c80e59", - "0x121468e6710bf1ffec6d0f26743afe6f88ef55dab40b83ca0a39bc44b196374c", - "0x2042c32c823a7440ceb6c342f9125f1fe426b02c527cd8fb28c85d02b705e759", - "0x0d582c10ff8115413aa5b70564fdd2f3cefe1f33a1e43a47bc495081e91e73e5", - "0x0f55a0d491a9da093eb999fa0dffaf904620cbc78d07e63c6f795c5c7512b523", - "0x21849764e1aa64b83a69e39d27eedaec2a8f97066e5ddb74634ffdb11388dd9a", - "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" ] [hints.note_hash_read_request_hints.settled_read_hints.leaf_preimage] - value = "0x1eeef2e1c70a7794a3586b4cf25058ac1b892b7d874294bf7dc5d1282591e04b" + value = "0x0000000000000000000000000000000000000000000000000000000000000000" [[hints.note_hash_read_request_hints.settled_read_hints]] read_request_index = "0x0000000000000000000000000000000000000000000000000000000000000040" @@ -8817,7 +8821,7 @@ read_request_index = "0x00000000000000000000000000000000000000000000000000000000 value = "0x0000000000000000000000000000000000000000000000000000000000000000" [[hints.nullifier_read_request_hints.read_request_statuses]] -state = "0x0000000000000000000000000000000000000000000000000000000000000002" +state = "0x0000000000000000000000000000000000000000000000000000000000000000" hint_index = "0x0000000000000000000000000000000000000000000000000000000000000000" [[hints.nullifier_read_request_hints.read_request_statuses]] @@ -9329,57 +9333,57 @@ read_request_index = "0x00000000000000000000000000000000000000000000000000000000 pending_value_index = "0x0000000000000000000000000000000000000000000000000000000000000000" [[hints.nullifier_read_request_hints.settled_read_hints]] -read_request_index = "0x0000000000000000000000000000000000000000000000000000000000000000" +read_request_index = "0x0000000000000000000000000000000000000000000000000000000000000040" [hints.nullifier_read_request_hints.settled_read_hints.membership_witness] - leaf_index = "386" + leaf_index = "0" sibling_path = [ "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x2400ff8fd292af7aef7aa4ad3a089eab0db06c2efa5f5ca6acdf437576a0803e", - "0x0e34ac2c09f45a503d2908bcb12f1cbae5fa4065759c88d501c097506a8b2290", - "0x21f9172d72fdcdafc312eee05cf5092980dda821da5b760a9fb8dbdf607c8a20", - "0x2373ea368857ec7af97e7b470d705848e2bf93ed7bef142a490f2119bcf82d8e", - "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", - "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", - "0x09c6c7fb7da021c7ffc8fe8192bd4803953f2a6d084ef6255ecdd71b36d8921f", - "0x17fceab5e6d15d0f76dd258329b0369a8c603e977a7b900046d484c9e616cca1", - "0x0424880a586d1288a51e34a5fccc9eff170c3280b8cee33ab0c8f091f2ed02bc", - "0x2bcbc5bc40a0f255336281e2157c74b9a9363f02e7f13782b63b3b79ee590c6f", - "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", - "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", - "0x1c4954081e324939350febc2b918a293ebcdaead01be95ec02fcbe8d2c1635d1", - "0x0197f2171ef99c2d053ee1fb5ff5ab288d56b9b41b4716c9214a4d97facc4c4a", - "0x2b9cdd484c5ba1e4d6efcc3f18734b5ac4c4a0b9102e2aeb48521a661d3feee9", - "0x14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3", - "0x071d7627ae3b2eabda8a810227bf04206370ac78dbf6c372380182dbd3711fe3", - "0x2fdc08d9fe075ac58cb8c00f98697861a13b3ab6f9d41a4e768f75e477475bf5", - "0x20165fe405652104dceaeeca92950aa5adc571b8cafe192878cba58ff1be49c5", - "0x1c8c3ca0b3a3d75850fcd4dc7bf1e3445cd0cfff3ca510630fd90b47e8a24755", - "0x1f0c1a8fb16b0d2ac9a146d7ae20d8d179695a92a79ed66fc45d9da4532459b3", - "0x038146ec5a2573e1c30d2fb32c66c8440f426fbd108082df41c7bebd1d521c30", - "0x17d3d12b17fe762de4b835b2180b012e808816a7f2ff69ecb9d65188235d8fd4", - "0x0e1a6b7d63a6e5a9e54e8f391dd4e9d49cdfedcbc87f02cd34d4641d2eb30491", - "0x09244eec34977ff795fc41036996ce974136377f521ac8eb9e04642d204783d2", - "0x1646d6f544ec36df9dc41f778a7ef1690a53c730b501471b6acd202194a7e8e9", - "0x064769603ba3f6c41f664d266ecb9a3a0f6567cd3e48b40f34d4894ee4c361b3", - "0x1595bb3cd19f84619dc2e368175a88d8627a7439eda9397202cdb1167531fd3f", - "0x2a529be462b81ca30265b558763b1498289c9d88277ab14f0838cb1fce4b472c", - "0x0c08da612363088ad0bbc78abd233e8ace4c05a56fdabdd5e5e9b05e428bdaee", - "0x14748d0241710ef47f54b931ac5a58082b1d56b0f0c30d55fb71a6e8c9a6be14", - "0x0b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d", - "0x2c45bb0c3d5bc1dc98e0baef09ff46d18c1a451e724f41c2b675549bb5c80e59", - "0x121468e6710bf1ffec6d0f26743afe6f88ef55dab40b83ca0a39bc44b196374c", - "0x2042c32c823a7440ceb6c342f9125f1fe426b02c527cd8fb28c85d02b705e759", - "0x0d582c10ff8115413aa5b70564fdd2f3cefe1f33a1e43a47bc495081e91e73e5", - "0x0f55a0d491a9da093eb999fa0dffaf904620cbc78d07e63c6f795c5c7512b523", - "0x21849764e1aa64b83a69e39d27eedaec2a8f97066e5ddb74634ffdb11388dd9a", - "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" ] [hints.nullifier_read_request_hints.settled_read_hints.leaf_preimage] - nullifier = "0x144b73a1024ae49e8ba90c78acd884b038f1cbac5d4965c204d3b6db530de253" - next_nullifier = "0x163b0c52a7ec2a810b89962e6fc8a54e02d1cd8317f488801da02ae34733cd72" - next_index = "0x00000000000000000000000000000000000000000000000000000000000000c0" + nullifier = "0x0000000000000000000000000000000000000000000000000000000000000000" + next_nullifier = "0x0000000000000000000000000000000000000000000000000000000000000000" + next_index = "0x0000000000000000000000000000000000000000000000000000000000000000" [[hints.nullifier_read_request_hints.settled_read_hints]] read_request_index = "0x0000000000000000000000000000000000000000000000000000000000000040" @@ -12721,11 +12725,11 @@ read_request_index = "0x00000000000000000000000000000000000000000000000000000000 next_index = "0x0000000000000000000000000000000000000000000000000000000000000000" [[hints.key_validation_hints]] - request_index = "0x0000000000000000000000000000000000000000000000000000000000000000" + request_index = "0x0000000000000000000000000000000000000000000000000000000000000040" [hints.key_validation_hints.sk_m] - hi = "0x000000000000000000000000000000001e44dbeede1e4c222b3b4c6fba97d4a2" - lo = "0x00000000000000000000000000000000345451835f952283fbb1498e21e4a0b0" + hi = "0x0000000000000000000000000000000000000000000000000000000000000000" + lo = "0x0000000000000000000000000000000000000000000000000000000000000000" [[hints.key_validation_hints]] request_index = "0x0000000000000000000000000000000000000000000000000000000000000040" diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-tail-to-public/Prover.toml b/noir-projects/noir-protocol-circuits/crates/private-kernel-tail-to-public/Prover.toml index 56906ee628b..c34415f2db2 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-tail-to-public/Prover.toml +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-tail-to-public/Prover.toml @@ -1,19 +1,19 @@ [previous_kernel] vk_index = "0x000000000000000000000000000000000000000000000000000000000000003d" vk_path = [ - "0x1244c900aaf510c80550db2a0494d131a07ec2684800cffed8ec133263b15333", + "0x07b8da2bf0617d7589e1dbfcdd442ec79a3871e3f8df3cbfcc3cba11c8edec30", "0x0b63a53787021a4a962a452c2921b3663aff1ffd8d5510540f8e659e782956f1", - "0x088119e5ec3f249a7b799bddbe34331cf82f90c8906784d2e0968310179c7939", - "0x294627428812b68807885920cba841ce2106a57cecb487a57a2060f95d29d796", - "0x02dfdf8f45633da47ab6f47c909baf455131cf789f5ae4288ced1a5e0d09f031", - "0x0e65c2546de09afcb529706bce25d0237508d40bb8b24d173aef1d00e33cca8f" + "0x19124d7162485ca2b32223990bc2800174d7d6f02665db0a350fc3b71ccf6d57", + "0x1dcc0a822ea0c07d721900aa6e3df2cc9b88a70f7a3bb13a7db2ce8bbd3a0cd5", + "0x12efca1f6450177ba4d5d5ce5a2b87983a5a841d9720c6268768000cf7b8c8c8", + "0x134c4518d0202411981003c3506f11f05103c1cc64e058b47430aa442a303fd1" ] [previous_kernel.vk] key = [ "0x0000000000000000000000000000000000000000000000000000000000100000", "0x0000000000000000000000000000000000000000000000000000000000000020", - "0x0000000000000000000000000000000000000000000000000000000000000401", + "0x00000000000000000000000000000000000000000000000000000000000328b1", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000010", "0x0000000000000000000000000000000000000000000000000000000000000011", @@ -34,110 +34,110 @@ vk_path = [ "0x0000000000000000000000000000000000000000000000000000000000000008", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x000000000000000000000000000000130e31704c2a47c1ee874b4cb721378539", - "0x00000000000000000000000000000000000c9bed5bed24c7cf91b75add97667c", - "0x0000000000000000000000000000006d0c7b8a7e421a1d6fb4f0506191159235", - "0x00000000000000000000000000000000000f2f1ba5ea0f3fad9af83840641021", - "0x00000000000000000000000000000075d2e1456fd08b8262c065954705847bb6", - "0x000000000000000000000000000000000028cc4e2095c2f5be8892d6dfba12e2", - "0x000000000000000000000000000000c34ac67056ccf87063339d1b0547b63037", - "0x00000000000000000000000000000000002104b51ca6a099e636b699e1f67d17", - "0x000000000000000000000000000000a56d3a40330acf7753554b4a0f423603de", - "0x0000000000000000000000000000000000288522a920f094ee2d2913115da69c", - "0x00000000000000000000000000000056e1174c0590dab5bd6ad41fba9622f099", - "0x00000000000000000000000000000000002101d4b2c0e86465881ff4a8eb68b0", - "0x000000000000000000000000000000b007f81970c6b9b5cfc1988f2af3e99082", - "0x00000000000000000000000000000000002227acd63272bcca1f87f53f25d107", - "0x000000000000000000000000000000728c951f74970e271d8baa3223e716814f", - "0x000000000000000000000000000000000003b1cb0551acd15baf3c5d519a548b", - "0x0000000000000000000000000000007ff9b5f797f4bc111132082e8f0993a774", - "0x000000000000000000000000000000000011ebb008b9f86edb39fe78a8a30b62", - "0x00000000000000000000000000000031892fd9fee47feb62de04f53a6019312c", - "0x00000000000000000000000000000000000c52342158bc6c4c6833b7f3d10e95", - "0x000000000000000000000000000000534821a37a5502a894f8e1ae499247c01d", - "0x000000000000000000000000000000000026c72000b86ef2ab367d07e08258e6", - "0x000000000000000000000000000000ff71dfca639d961652a70ff2c34951f97c", - "0x00000000000000000000000000000000000b249e7aa928eb7421ebe24ab7c7af", - "0x000000000000000000000000000000c5179cf7905a3b1f8d13c2a33617842ee3", - "0x0000000000000000000000000000000000145fccea7ff9b82a928819c82c36b5", - "0x00000000000000000000000000000088515ac576f48533495fee4d5d45f52f3f", - "0x00000000000000000000000000000000000b03cbac09e93bb52c04998b623ab1", - "0x0000000000000000000000000000001c0d89b7a23cdb3dfb3f796ad4d0042197", - "0x0000000000000000000000000000000000274e9eca3597c398a96fb8d3571327", - "0x000000000000000000000000000000875c2c60275064f7b194db45605f0f4296", - "0x0000000000000000000000000000000000122ec45d4235d2fe842973d6395d01", - "0x0000000000000000000000000000007f70171a761bac2f981dea063cedefc89c", - "0x000000000000000000000000000000000026cc06929618062e91765d2cd3e2a5", - "0x0000000000000000000000000000002725a9fca6eda440225bc2b1f6becd3313", - "0x000000000000000000000000000000000029a50332d67ad87a38d6e9dada0a6e", - "0x00000000000000000000000000000002bffa645fa2ddb84fc1f68c0eea0ff803", - "0x00000000000000000000000000000000002954a19cb0a188f4985be16203fb20", - "0x0000000000000000000000000000003948a12dc7d00190bae742460672bc1342", - "0x000000000000000000000000000000000006c3854ddae1b71dfc0d6fa20903ae", - "0x000000000000000000000000000000041f9bb7b06e543ffebeef2ffbce5553e3", - "0x0000000000000000000000000000000000078e7238d47fc00e2a1035b6c437f7", - "0x00000000000000000000000000000046644183098c51ccba33ad162d5515eab2", - "0x000000000000000000000000000000000019c5de425de37aa5ed4f18648edaf6", - "0x000000000000000000000000000000bfcc620070b10aa1b12915947dcb5a3f59", - "0x00000000000000000000000000000000001e7db7cb61f327fad3629608f671ec", - "0x00000000000000000000000000000037f6f9701daa047d5e658fd2de13d9c597", - "0x0000000000000000000000000000000000102c1703968f83f81c928cc4b7b2f8", - "0x000000000000000000000000000000acdd55eb177713ab172f975de7ab09d9fb", - "0x0000000000000000000000000000000000289143fbb21dd6261204446c3bb0b4", - "0x0000000000000000000000000000007233e128a5c5a00e40d5dc965f39805459", - "0x00000000000000000000000000000000001d6b1c72220e545662046d1ee93511", - "0x000000000000000000000000000000d24f0a0cf38ca9316be400c743bbbb3bec", - "0x000000000000000000000000000000000027822ff7bb9483b29df97785ee5f9d", - "0x000000000000000000000000000000468d47d31fb480e2c192ddb6673e5cbea8", - "0x000000000000000000000000000000000001d6ab1aaf7944c2be04aea4060d71", - "0x00000000000000000000000000000020ab6e18f40a7bf9ece2bfbd0a97abf5bb", - "0x00000000000000000000000000000000000a20b21648fdc847474f5d2818cf35", - "0x00000000000000000000000000000044dc86f177e1cbe3e841b683edf98f5e9f", - "0x00000000000000000000000000000000002f29add3293aa01415fcc8461b9c64", - "0x000000000000000000000000000000c0571dde036ceb0ae6e3738ae8dc6632f4", - "0x00000000000000000000000000000000001f883cee5e1ba1ce860782200386e8", - "0x000000000000000000000000000000da46a2dac6c82a0cb40d8dfefffd938b46", - "0x00000000000000000000000000000000000446f1ba13688a0f3b8bbf80607b58", - "0x000000000000000000000000000000ea51a707c02eb96579a3c792d23700972a", - "0x0000000000000000000000000000000000142d2ec5c800975448fcd61248a07c", - "0x000000000000000000000000000000ce8085ec44fdb639e426700edc2806ca20", - "0x0000000000000000000000000000000000013db816525ecd000ad4fc896410b0", - "0x00000000000000000000000000000068c1ccd2e5e937c4d67d45dcfd3e24ca5e", - "0x00000000000000000000000000000000000f9027ed9ee43a98a5798620c606a2", - "0x00000000000000000000000000000026bfe1e8280a21f35f424a5ef0aad97b87", - "0x000000000000000000000000000000000027ed1fbeef1043de6dfbbe2771e8bf", - "0x000000000000000000000000000000e88498d17df4e8fdcd7dd31f96055ea909", - "0x000000000000000000000000000000000024c02a3f689f9c7f00364247e72974", - "0x000000000000000000000000000000ef3300456167f78bef88d1c5d26a33d9c8", - "0x000000000000000000000000000000000002ddedaaa3d15fc4fbd4d3cb8b32fa", - "0x0000000000000000000000000000005fa233019988e8cd73cff686a5a089e753", - "0x00000000000000000000000000000000000548f450d1dec70918b516866c0cac", - "0x000000000000000000000000000000231a42d1bd55ead600686a7668cb0ae9f4", - "0x000000000000000000000000000000000017ebebf4ad7003ecd61e5da419499d", - "0x000000000000000000000000000000b348f3ea80255b656d72d398f11330d373", - "0x00000000000000000000000000000000002e79c4774370efb865f0a53fd7a1da", - "0x0000000000000000000000000000005f286832a1e94e23822b70380f7c11cf74", - "0x00000000000000000000000000000000000206c01a6cd3c0a48e7d83e62e3bda", - "0x000000000000000000000000000000603001b971ca6ae5337182969ec5c94780", - "0x0000000000000000000000000000000000233b83cbaf3a81f077345387ebed21", - "0x00000000000000000000000000000008f1d7f84761094fd902826b323e760375", - "0x0000000000000000000000000000000000228bfc02f04e4b94ee542b76609d00", - "0x0000000000000000000000000000003acc6def4164d878b56e5b2fe2bfa52199", - "0x000000000000000000000000000000000022cf69996ae471056bcae7b3c38cbc", - "0x000000000000000000000000000000239623839c51be6ffe83c77c80b8f94ad5", - "0x0000000000000000000000000000000000075cc2c3c9e3079bec86764aa5cfd0", - "0x0000000000000000000000000000008c88b485298919bf7164440942d6f6c5ad", - "0x00000000000000000000000000000000000c5dd6e29eac9076cc2f5995fcf27c", - "0x0000000000000000000000000000005b7ac436f888999a48f79ef212e6483f14", - "0x000000000000000000000000000000000009fc56f5a2122d1ed9353860ba68ab", - "0x000000000000000000000000000000dace4e23bf41b55e3098bd8e82e74b1c1e", - "0x00000000000000000000000000000000000883499c226658d83b4d0cc7b08c15", - "0x0000000000000000000000000000005c0373d8b286bf727301571a54e1636e77", - "0x00000000000000000000000000000000001f268c0945bdea494fbfc52e8581c1", - "0x000000000000000000000000000000c6b7e770c1e62e2504ce986f21324ff939", - "0x000000000000000000000000000000000001b92f92042ae2556e31cf72cc3990", - "0x0000000000000000000000000000007007220c2c02f4ec2c1c5fada9056b8c37", - "0x00000000000000000000000000000000003038ffe6284e174445a0eb11a63e0b", + "0x00000000000000000000000000000010391ac2f9f0d34e4b1ad8824c1a879276", + "0x00000000000000000000000000000000000046a3467b8b2a04395775c5369420", + "0x00000000000000000000000000000047f3bdcde15bd42c0189d541a788b639ce", + "0x000000000000000000000000000000000019efe36c79aac1596fd2838e503b2a", + "0x0000000000000000000000000000008dbdba0f0a76ba23ea5ec443bee99c1df3", + "0x000000000000000000000000000000000008724ac6210bd8565dbc7becb76f65", + "0x000000000000000000000000000000a37a0cdb2b099ae8150225b7e5f7f36be6", + "0x00000000000000000000000000000000000dc701fa4e3c2ee332aadbd2ab66c8", + "0x0000000000000000000000000000004bf4804252501fb914350aab81b46151c0", + "0x0000000000000000000000000000000000096ea53ab60a7fe8e85cb2fc83149a", + "0x0000000000000000000000000000003851ab76f9f3e44731887d770d2d61c94a", + "0x0000000000000000000000000000000000077efbb32b5cb41fc8160c80f32790", + "0x000000000000000000000000000000b037bd56f5a04da4e0403e3b371bfa99df", + "0x000000000000000000000000000000000012e66a7b9d3fbea4d942b0bfae85b5", + "0x0000000000000000000000000000004c564e0d2934e3debf8b19f2cf3552c217", + "0x000000000000000000000000000000000009557de77fac9e288a2674b7c48e88", + "0x0000000000000000000000000000002d2d276fd001b460497bf32a16892a05e2", + "0x00000000000000000000000000000000002e47e1ee390cf92e0bed1c26105023", + "0x0000000000000000000000000000000443058a76ecdbbd4c7782e5a81cee79b4", + "0x000000000000000000000000000000000010adfc1d70e4f79ef0e7fcdc540ff2", + "0x000000000000000000000000000000634b38e0ef30093cd859de7530db3c9718", + "0x000000000000000000000000000000000021ef3dd28dcd7a90765c7b937b5689", + "0x000000000000000000000000000000445e8e94c1ae23072e4257d7bb587ebb38", + "0x000000000000000000000000000000000017d103074eea26df9d1b6c2d8f6e75", + "0x000000000000000000000000000000dcb8d54f91020e075669782604751a5ff1", + "0x0000000000000000000000000000000000218bcaa4ca9684a846e54adfa8d5c2", + "0x00000000000000000000000000000083397e52e4e2532c628f83fa543283d6a8", + "0x00000000000000000000000000000000001b0bd6cf3efa94bf28e679b2e422fc", + "0x00000000000000000000000000000090d53c6a3b26339cda6b73df9208314159", + "0x0000000000000000000000000000000000298c3311fc9170f92de940b042aab9", + "0x000000000000000000000000000000bf37537eb196b05c1d98fa51016a9bacbb", + "0x000000000000000000000000000000000007b05f408a612847259016b9204ae4", + "0x000000000000000000000000000000aa1e42aeaef2c9839f8060e1eeca74ffef", + "0x00000000000000000000000000000000001880d49deaf71459cdfc460aa1a363", + "0x000000000000000000000000000000e320c4bea28f5ce67a845271f511309e44", + "0x00000000000000000000000000000000001c9fdad7d26a0a6f8f1a791d054ffa", + "0x0000000000000000000000000000007a9eabdd414f071785c436a787f066be92", + "0x00000000000000000000000000000000002161c1fc41758e52f4a6c0101ee4af", + "0x00000000000000000000000000000066065151b634fadc6f0d657b14e80801b1", + "0x00000000000000000000000000000000001182ba57b08e7a299d2001c0865f06", + "0x000000000000000000000000000000a57aeac4555af243ef61c454922cabb6da", + "0x00000000000000000000000000000000002ec4aca71789a55d8c94c5ac5d1cc5", + "0x000000000000000000000000000000d213468692e0e6795dc477b987ee97e348", + "0x0000000000000000000000000000000000052147164af376e1907d5f43eae4fd", + "0x000000000000000000000000000000d47ae2d7ec8f1a44bcb83685e4feafcdf6", + "0x000000000000000000000000000000000023629b622a00a852a1c153bf6de893", + "0x0000000000000000000000000000005018f74f48ff6afc256aca9f4180cb6196", + "0x000000000000000000000000000000000018f8dd3c1e3d71f85778ba58989448", + "0x000000000000000000000000000000b951ea1ca989c6bebcba71e26afed15269", + "0x00000000000000000000000000000000002571b65d031446cb7b1cae4ee69aff", + "0x000000000000000000000000000000c8ee99fb1b91f20376fc2e392ce52612c9", + "0x000000000000000000000000000000000023a8c38e1590f8b010ac908a110698", + "0x00000000000000000000000000000023ecc30a8e12be977c2ff62e854145cbe4", + "0x0000000000000000000000000000000000057dcc3566f24e9b83a51548cefad4", + "0x00000000000000000000000000000030c95ec063a5e02802fafda4b296d8658c", + "0x00000000000000000000000000000000002ae2a67d9e2fb132cfb4191440eddd", + "0x000000000000000000000000000000e03a7cfd7304f5b2421bbd72e267228f77", + "0x000000000000000000000000000000000024cc89b8889fbb61232865cf66d9d7", + "0x0000000000000000000000000000000788f2eaff9b1e73ed543514f5b9cad20e", + "0x00000000000000000000000000000000001abde98a14417cc19fb333410c4ad3", + "0x00000000000000000000000000000004b9c090087dd6a49d3fc4f225e5d6d67a", + "0x000000000000000000000000000000000002835980a2795591890b20c042a92f", + "0x000000000000000000000000000000c3139db096f86b41041e48a70940ef94a6", + "0x00000000000000000000000000000000002ddc8506fa8eafc6a73594d688b389", + "0x000000000000000000000000000000b24006a736c2e0fbe730125be4cf2de96d", + "0x00000000000000000000000000000000000752b6bf41cc3478231419ccaa3acf", + "0x000000000000000000000000000000b25817748eca1a4cacdc9916f4c297967a", + "0x000000000000000000000000000000000003ba5843c3c8a154fd8e176e2144b9", + "0x000000000000000000000000000000c864b99ea2db19cbf6c8c5376f3a82fafe", + "0x0000000000000000000000000000000000305e0adce0497f06a389a68f385566", + "0x00000000000000000000000000000002d5561a161f0723cadfce851e9d99742a", + "0x000000000000000000000000000000000029c204157e889f9043e61c607c2007", + "0x000000000000000000000000000000cbc4b2a4625d9f4636ce8f71a0a0d844ca", + "0x00000000000000000000000000000000002ff1dacc8f8c79fff071dd0bc6f014", + "0x000000000000000000000000000000e3a178f757db63e0a24f105c669cdec63c", + "0x0000000000000000000000000000000000061d665b9930587f33749d55af9e13", + "0x0000000000000000000000000000008dac514da9d0516f52fd0d29eec46586be", + "0x0000000000000000000000000000000000101865069261844695fafcf121ac09", + "0x0000000000000000000000000000000b1866480e2d4d17c869a9671f9e59c887", + "0x00000000000000000000000000000000000243b9328b12365d14e747b0bc2aa6", + "0x000000000000000000000000000000c481bcda930f4b3fc24a5ad21c65ad9655", + "0x00000000000000000000000000000000002891253d4c7d254a7434153351fdcf", + "0x0000000000000000000000000000000136a29096d3ee85c9077c9d49ae758256", + "0x0000000000000000000000000000000000039c0c370e432f85f1adaa56121e01", + "0x000000000000000000000000000000d68c47afce521fffd1d9968958444f55c4", + "0x0000000000000000000000000000000000251718f52b611ab48c996d392f535a", + "0x000000000000000000000000000000504382549a7f8d12757080c1168e272246", + "0x000000000000000000000000000000000022a8769dafd9c20aa6f23c484c9bab", + "0x000000000000000000000000000000f6f4596202301b6ae4eb0ebbeadd203340", + "0x00000000000000000000000000000000000adc89c48d75b571636f5bbeb4a806", + "0x00000000000000000000000000000000034e3e27454ef992b4bf84b97baa7471", + "0x0000000000000000000000000000000000066f28135748f119631c3fe07fa9d7", + "0x0000000000000000000000000000003b64a66f2ac4979b65e56568c5a31b14ed", + "0x00000000000000000000000000000000002e25783551df50c004ec7cd1f4dd8b", + "0x000000000000000000000000000000e8258f84477c1b62565a559ba7bb38832e", + "0x000000000000000000000000000000000018f76cf0ceeccb4798de741ae89b64", + "0x0000000000000000000000000000001583b176f599e192d7119354034419e8f9", + "0x000000000000000000000000000000000004706a0e23ac32a3566907fb872362", + "0x000000000000000000000000000000d1b9992279342fce9a883849693fcda22a", + "0x000000000000000000000000000000000029046b299293cb09c593372eb6b3e6", + "0x000000000000000000000000000000469680c270e551515344592f59188fa765", + "0x00000000000000000000000000000000002d38d6d4ba1e4763a74ecdb11ca1f3", + "0x000000000000000000000000000000fce917c0d5dca019477c52f6075332b612", + "0x000000000000000000000000000000000012db39e892826b32610ee08251e005", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", @@ -155,27 +155,27 @@ vk_path = [ "0x0000000000000000000000000000006df5ee4c1358443f5a14086b5196e13e46", "0x0000000000000000000000000000000000192b1a6d3b14dfe5a9ad63951d2d76" ] - hash = "0x1f6c06063226ba7edac4c5c7dce6272b5f5ea00eec55ad78e1ef4125504f5f87" + hash = "0x2d4e96e47d6cd513bb8666db31c63e7c570e0264124c14237efa25193239f870" [previous_kernel_public_inputs] min_revertible_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000003" is_private_only = false [previous_kernel_public_inputs.constants] - vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" - protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" + vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" + protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [previous_kernel_public_inputs.constants.historical_header] - total_fees = "0x00000000000000000000000000000000000000000000000000f63927a6ad1e54" - total_mana_used = "0x000000000000000000000000000000000000000000000000000000000013863f" + total_fees = "0x00000000000000000000000000000000000000000000000000f3d59e049eb1ac" + total_mana_used = "0x00000000000000000000000000000000000000000000000000000000001355c1" [previous_kernel_public_inputs.constants.historical_header.last_archive] - root = "0x29cbab120d0f56c90cfefc66cafa9f932f596a2f907016ea04bf3116054d024d" + root = "0x2686a574dfb90890de58e447bcd7f12504950a18bbe781d95758161ca30dcf66" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000005" [previous_kernel_public_inputs.constants.historical_header.content_commitment] num_txs = "0x0000000000000000000000000000000000000000000000000000000000000002" - blobs_hash = "0x0016c800a29df6af7f3e2e6e39d4f4f716a304cd602bbac9e33d67814d8c8b48" + blobs_hash = "0x002ee5246d9ece5e2f64027ac8216616887df1da344019d0e0f0cfd1c2483af7" in_hash = "0x00089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c" out_hash = "0x00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb" @@ -184,15 +184,15 @@ root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050" [previous_kernel_public_inputs.constants.historical_header.state.partial.note_hash_tree] -root = "0x04e8c491dbfeddc60045ecb277c87006799f491a47d6a32361cdabc1b964f153" +root = "0x265f2fb8ecbd96d51d74d79901934e60af982af7b6caa46153eafcf3201df280" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000280" [previous_kernel_public_inputs.constants.historical_header.state.partial.nullifier_tree] -root = "0x00ae279a916dc04b41f94ee1ed6ae6cd35e37a06787bd36a0af77db9bba8a126" +root = "0x0d8cfcd6ecef742ecda848c0db79ef7d0fe639b7b69564d103f788d530832eba" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" [previous_kernel_public_inputs.constants.historical_header.state.partial.public_data_tree] -root = "0x0ff17010ab909b4a0c9581a9c33cf0af93280c6fcd6664cf27270b8762a9e418" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [previous_kernel_public_inputs.constants.historical_header.global_variables] @@ -200,10 +200,10 @@ next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000 version = "0x0000000000000000000000000000000000000000000000000000000000000001" block_number = "0x0000000000000000000000000000000000000000000000000000000000000005" slot_number = "0x0000000000000000000000000000000000000000000000000000000000000009" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2d76" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a8e5" [previous_kernel_public_inputs.constants.historical_header.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [previous_kernel_public_inputs.constants.historical_header.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -228,6 +228,10 @@ l2_gas = "0x00000000000000000000000000000000000000000000000000000000005b8d80" fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" +[previous_kernel_public_inputs.constants.tx_context.gas_settings.max_priority_fees_per_gas] +fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" + [previous_kernel_public_inputs.validation_requests.for_rollup.max_block_number._opt] _is_some = false _value = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -2734,7 +2738,7 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.nullifiers]] [previous_kernel_public_inputs.end.nullifiers.nullifier] -value = "0x25ce2d71f7bbf18a1b3f947a879d8ab49914830266b484af969296ea60af8ffd" +value = "0x2dae308391cc3f88798b70c30faa9513e35aa507d5eb2da273c7cc2637009e1e" counter = "0x0000000000000000000000000000000000000000000000000000000000000000" note_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -4369,14 +4373,14 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" counter = "0x0000000000000000000000000000000000000000000000000000000000000003" [previous_kernel_public_inputs.end.public_call_requests.inner] - is_static_call = false - args_hash = "0x2667c69b043c8cc69b895e85758e845921c5626cc2cf2008614c131569b83949" + is_static_call = true + args_hash = "0x2d8b7f64cd689f5fdc2633f57f8eda15aff596cb11b1f76612eca8304c90fdfb" [previous_kernel_public_inputs.end.public_call_requests.inner.msg_sender] - inner = "0x30021904ae3832fa38613650b957c74abcc7ae86fda9e53bcd89e7b638cf9d67" + inner = "0x17e5c98d998228e7de3dbb6c01ae1fd3aaf868bd45946d300e4c36f6d396dea0" [previous_kernel_public_inputs.end.public_call_requests.inner.contract_address] - inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" + inner = "0x0a762f2c969988845e3f2ec70b07cda6dadd97cc3542c63c3658211d44d09709" [previous_kernel_public_inputs.end.public_call_requests.inner.function_selector] inner = "0x00000000000000000000000000000000000000000000000000000000d5441b0d" diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-tail/Prover.toml b/noir-projects/noir-protocol-circuits/crates/private-kernel-tail/Prover.toml index 718a890b871..24062af8010 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-tail/Prover.toml +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-tail/Prover.toml @@ -1,19 +1,19 @@ [previous_kernel] vk_index = "0x000000000000000000000000000000000000000000000000000000000000003d" vk_path = [ - "0x1244c900aaf510c80550db2a0494d131a07ec2684800cffed8ec133263b15333", + "0x07b8da2bf0617d7589e1dbfcdd442ec79a3871e3f8df3cbfcc3cba11c8edec30", "0x0b63a53787021a4a962a452c2921b3663aff1ffd8d5510540f8e659e782956f1", - "0x088119e5ec3f249a7b799bddbe34331cf82f90c8906784d2e0968310179c7939", - "0x294627428812b68807885920cba841ce2106a57cecb487a57a2060f95d29d796", - "0x02dfdf8f45633da47ab6f47c909baf455131cf789f5ae4288ced1a5e0d09f031", - "0x0e65c2546de09afcb529706bce25d0237508d40bb8b24d173aef1d00e33cca8f" + "0x19124d7162485ca2b32223990bc2800174d7d6f02665db0a350fc3b71ccf6d57", + "0x1dcc0a822ea0c07d721900aa6e3df2cc9b88a70f7a3bb13a7db2ce8bbd3a0cd5", + "0x12efca1f6450177ba4d5d5ce5a2b87983a5a841d9720c6268768000cf7b8c8c8", + "0x134c4518d0202411981003c3506f11f05103c1cc64e058b47430aa442a303fd1" ] [previous_kernel.vk] key = [ "0x0000000000000000000000000000000000000000000000000000000000100000", "0x0000000000000000000000000000000000000000000000000000000000000020", - "0x0000000000000000000000000000000000000000000000000000000000000401", + "0x00000000000000000000000000000000000000000000000000000000000328b1", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000010", "0x0000000000000000000000000000000000000000000000000000000000000011", @@ -34,110 +34,110 @@ vk_path = [ "0x0000000000000000000000000000000000000000000000000000000000000008", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x000000000000000000000000000000130e31704c2a47c1ee874b4cb721378539", - "0x00000000000000000000000000000000000c9bed5bed24c7cf91b75add97667c", - "0x0000000000000000000000000000006d0c7b8a7e421a1d6fb4f0506191159235", - "0x00000000000000000000000000000000000f2f1ba5ea0f3fad9af83840641021", - "0x00000000000000000000000000000075d2e1456fd08b8262c065954705847bb6", - "0x000000000000000000000000000000000028cc4e2095c2f5be8892d6dfba12e2", - "0x000000000000000000000000000000c34ac67056ccf87063339d1b0547b63037", - "0x00000000000000000000000000000000002104b51ca6a099e636b699e1f67d17", - "0x000000000000000000000000000000a56d3a40330acf7753554b4a0f423603de", - "0x0000000000000000000000000000000000288522a920f094ee2d2913115da69c", - "0x00000000000000000000000000000056e1174c0590dab5bd6ad41fba9622f099", - "0x00000000000000000000000000000000002101d4b2c0e86465881ff4a8eb68b0", - "0x000000000000000000000000000000b007f81970c6b9b5cfc1988f2af3e99082", - "0x00000000000000000000000000000000002227acd63272bcca1f87f53f25d107", - "0x000000000000000000000000000000728c951f74970e271d8baa3223e716814f", - "0x000000000000000000000000000000000003b1cb0551acd15baf3c5d519a548b", - "0x0000000000000000000000000000007ff9b5f797f4bc111132082e8f0993a774", - "0x000000000000000000000000000000000011ebb008b9f86edb39fe78a8a30b62", - "0x00000000000000000000000000000031892fd9fee47feb62de04f53a6019312c", - "0x00000000000000000000000000000000000c52342158bc6c4c6833b7f3d10e95", - "0x000000000000000000000000000000534821a37a5502a894f8e1ae499247c01d", - "0x000000000000000000000000000000000026c72000b86ef2ab367d07e08258e6", - "0x000000000000000000000000000000ff71dfca639d961652a70ff2c34951f97c", - "0x00000000000000000000000000000000000b249e7aa928eb7421ebe24ab7c7af", - "0x000000000000000000000000000000c5179cf7905a3b1f8d13c2a33617842ee3", - "0x0000000000000000000000000000000000145fccea7ff9b82a928819c82c36b5", - "0x00000000000000000000000000000088515ac576f48533495fee4d5d45f52f3f", - "0x00000000000000000000000000000000000b03cbac09e93bb52c04998b623ab1", - "0x0000000000000000000000000000001c0d89b7a23cdb3dfb3f796ad4d0042197", - "0x0000000000000000000000000000000000274e9eca3597c398a96fb8d3571327", - "0x000000000000000000000000000000875c2c60275064f7b194db45605f0f4296", - "0x0000000000000000000000000000000000122ec45d4235d2fe842973d6395d01", - "0x0000000000000000000000000000007f70171a761bac2f981dea063cedefc89c", - "0x000000000000000000000000000000000026cc06929618062e91765d2cd3e2a5", - "0x0000000000000000000000000000002725a9fca6eda440225bc2b1f6becd3313", - "0x000000000000000000000000000000000029a50332d67ad87a38d6e9dada0a6e", - "0x00000000000000000000000000000002bffa645fa2ddb84fc1f68c0eea0ff803", - "0x00000000000000000000000000000000002954a19cb0a188f4985be16203fb20", - "0x0000000000000000000000000000003948a12dc7d00190bae742460672bc1342", - "0x000000000000000000000000000000000006c3854ddae1b71dfc0d6fa20903ae", - "0x000000000000000000000000000000041f9bb7b06e543ffebeef2ffbce5553e3", - "0x0000000000000000000000000000000000078e7238d47fc00e2a1035b6c437f7", - "0x00000000000000000000000000000046644183098c51ccba33ad162d5515eab2", - "0x000000000000000000000000000000000019c5de425de37aa5ed4f18648edaf6", - "0x000000000000000000000000000000bfcc620070b10aa1b12915947dcb5a3f59", - "0x00000000000000000000000000000000001e7db7cb61f327fad3629608f671ec", - "0x00000000000000000000000000000037f6f9701daa047d5e658fd2de13d9c597", - "0x0000000000000000000000000000000000102c1703968f83f81c928cc4b7b2f8", - "0x000000000000000000000000000000acdd55eb177713ab172f975de7ab09d9fb", - "0x0000000000000000000000000000000000289143fbb21dd6261204446c3bb0b4", - "0x0000000000000000000000000000007233e128a5c5a00e40d5dc965f39805459", - "0x00000000000000000000000000000000001d6b1c72220e545662046d1ee93511", - "0x000000000000000000000000000000d24f0a0cf38ca9316be400c743bbbb3bec", - "0x000000000000000000000000000000000027822ff7bb9483b29df97785ee5f9d", - "0x000000000000000000000000000000468d47d31fb480e2c192ddb6673e5cbea8", - "0x000000000000000000000000000000000001d6ab1aaf7944c2be04aea4060d71", - "0x00000000000000000000000000000020ab6e18f40a7bf9ece2bfbd0a97abf5bb", - "0x00000000000000000000000000000000000a20b21648fdc847474f5d2818cf35", - "0x00000000000000000000000000000044dc86f177e1cbe3e841b683edf98f5e9f", - "0x00000000000000000000000000000000002f29add3293aa01415fcc8461b9c64", - "0x000000000000000000000000000000c0571dde036ceb0ae6e3738ae8dc6632f4", - "0x00000000000000000000000000000000001f883cee5e1ba1ce860782200386e8", - "0x000000000000000000000000000000da46a2dac6c82a0cb40d8dfefffd938b46", - "0x00000000000000000000000000000000000446f1ba13688a0f3b8bbf80607b58", - "0x000000000000000000000000000000ea51a707c02eb96579a3c792d23700972a", - "0x0000000000000000000000000000000000142d2ec5c800975448fcd61248a07c", - "0x000000000000000000000000000000ce8085ec44fdb639e426700edc2806ca20", - "0x0000000000000000000000000000000000013db816525ecd000ad4fc896410b0", - "0x00000000000000000000000000000068c1ccd2e5e937c4d67d45dcfd3e24ca5e", - "0x00000000000000000000000000000000000f9027ed9ee43a98a5798620c606a2", - "0x00000000000000000000000000000026bfe1e8280a21f35f424a5ef0aad97b87", - "0x000000000000000000000000000000000027ed1fbeef1043de6dfbbe2771e8bf", - "0x000000000000000000000000000000e88498d17df4e8fdcd7dd31f96055ea909", - "0x000000000000000000000000000000000024c02a3f689f9c7f00364247e72974", - "0x000000000000000000000000000000ef3300456167f78bef88d1c5d26a33d9c8", - "0x000000000000000000000000000000000002ddedaaa3d15fc4fbd4d3cb8b32fa", - "0x0000000000000000000000000000005fa233019988e8cd73cff686a5a089e753", - "0x00000000000000000000000000000000000548f450d1dec70918b516866c0cac", - "0x000000000000000000000000000000231a42d1bd55ead600686a7668cb0ae9f4", - "0x000000000000000000000000000000000017ebebf4ad7003ecd61e5da419499d", - "0x000000000000000000000000000000b348f3ea80255b656d72d398f11330d373", - "0x00000000000000000000000000000000002e79c4774370efb865f0a53fd7a1da", - "0x0000000000000000000000000000005f286832a1e94e23822b70380f7c11cf74", - "0x00000000000000000000000000000000000206c01a6cd3c0a48e7d83e62e3bda", - "0x000000000000000000000000000000603001b971ca6ae5337182969ec5c94780", - "0x0000000000000000000000000000000000233b83cbaf3a81f077345387ebed21", - "0x00000000000000000000000000000008f1d7f84761094fd902826b323e760375", - "0x0000000000000000000000000000000000228bfc02f04e4b94ee542b76609d00", - "0x0000000000000000000000000000003acc6def4164d878b56e5b2fe2bfa52199", - "0x000000000000000000000000000000000022cf69996ae471056bcae7b3c38cbc", - "0x000000000000000000000000000000239623839c51be6ffe83c77c80b8f94ad5", - "0x0000000000000000000000000000000000075cc2c3c9e3079bec86764aa5cfd0", - "0x0000000000000000000000000000008c88b485298919bf7164440942d6f6c5ad", - "0x00000000000000000000000000000000000c5dd6e29eac9076cc2f5995fcf27c", - "0x0000000000000000000000000000005b7ac436f888999a48f79ef212e6483f14", - "0x000000000000000000000000000000000009fc56f5a2122d1ed9353860ba68ab", - "0x000000000000000000000000000000dace4e23bf41b55e3098bd8e82e74b1c1e", - "0x00000000000000000000000000000000000883499c226658d83b4d0cc7b08c15", - "0x0000000000000000000000000000005c0373d8b286bf727301571a54e1636e77", - "0x00000000000000000000000000000000001f268c0945bdea494fbfc52e8581c1", - "0x000000000000000000000000000000c6b7e770c1e62e2504ce986f21324ff939", - "0x000000000000000000000000000000000001b92f92042ae2556e31cf72cc3990", - "0x0000000000000000000000000000007007220c2c02f4ec2c1c5fada9056b8c37", - "0x00000000000000000000000000000000003038ffe6284e174445a0eb11a63e0b", + "0x00000000000000000000000000000010391ac2f9f0d34e4b1ad8824c1a879276", + "0x00000000000000000000000000000000000046a3467b8b2a04395775c5369420", + "0x00000000000000000000000000000047f3bdcde15bd42c0189d541a788b639ce", + "0x000000000000000000000000000000000019efe36c79aac1596fd2838e503b2a", + "0x0000000000000000000000000000008dbdba0f0a76ba23ea5ec443bee99c1df3", + "0x000000000000000000000000000000000008724ac6210bd8565dbc7becb76f65", + "0x000000000000000000000000000000a37a0cdb2b099ae8150225b7e5f7f36be6", + "0x00000000000000000000000000000000000dc701fa4e3c2ee332aadbd2ab66c8", + "0x0000000000000000000000000000004bf4804252501fb914350aab81b46151c0", + "0x0000000000000000000000000000000000096ea53ab60a7fe8e85cb2fc83149a", + "0x0000000000000000000000000000003851ab76f9f3e44731887d770d2d61c94a", + "0x0000000000000000000000000000000000077efbb32b5cb41fc8160c80f32790", + "0x000000000000000000000000000000b037bd56f5a04da4e0403e3b371bfa99df", + "0x000000000000000000000000000000000012e66a7b9d3fbea4d942b0bfae85b5", + "0x0000000000000000000000000000004c564e0d2934e3debf8b19f2cf3552c217", + "0x000000000000000000000000000000000009557de77fac9e288a2674b7c48e88", + "0x0000000000000000000000000000002d2d276fd001b460497bf32a16892a05e2", + "0x00000000000000000000000000000000002e47e1ee390cf92e0bed1c26105023", + "0x0000000000000000000000000000000443058a76ecdbbd4c7782e5a81cee79b4", + "0x000000000000000000000000000000000010adfc1d70e4f79ef0e7fcdc540ff2", + "0x000000000000000000000000000000634b38e0ef30093cd859de7530db3c9718", + "0x000000000000000000000000000000000021ef3dd28dcd7a90765c7b937b5689", + "0x000000000000000000000000000000445e8e94c1ae23072e4257d7bb587ebb38", + "0x000000000000000000000000000000000017d103074eea26df9d1b6c2d8f6e75", + "0x000000000000000000000000000000dcb8d54f91020e075669782604751a5ff1", + "0x0000000000000000000000000000000000218bcaa4ca9684a846e54adfa8d5c2", + "0x00000000000000000000000000000083397e52e4e2532c628f83fa543283d6a8", + "0x00000000000000000000000000000000001b0bd6cf3efa94bf28e679b2e422fc", + "0x00000000000000000000000000000090d53c6a3b26339cda6b73df9208314159", + "0x0000000000000000000000000000000000298c3311fc9170f92de940b042aab9", + "0x000000000000000000000000000000bf37537eb196b05c1d98fa51016a9bacbb", + "0x000000000000000000000000000000000007b05f408a612847259016b9204ae4", + "0x000000000000000000000000000000aa1e42aeaef2c9839f8060e1eeca74ffef", + "0x00000000000000000000000000000000001880d49deaf71459cdfc460aa1a363", + "0x000000000000000000000000000000e320c4bea28f5ce67a845271f511309e44", + "0x00000000000000000000000000000000001c9fdad7d26a0a6f8f1a791d054ffa", + "0x0000000000000000000000000000007a9eabdd414f071785c436a787f066be92", + "0x00000000000000000000000000000000002161c1fc41758e52f4a6c0101ee4af", + "0x00000000000000000000000000000066065151b634fadc6f0d657b14e80801b1", + "0x00000000000000000000000000000000001182ba57b08e7a299d2001c0865f06", + "0x000000000000000000000000000000a57aeac4555af243ef61c454922cabb6da", + "0x00000000000000000000000000000000002ec4aca71789a55d8c94c5ac5d1cc5", + "0x000000000000000000000000000000d213468692e0e6795dc477b987ee97e348", + "0x0000000000000000000000000000000000052147164af376e1907d5f43eae4fd", + "0x000000000000000000000000000000d47ae2d7ec8f1a44bcb83685e4feafcdf6", + "0x000000000000000000000000000000000023629b622a00a852a1c153bf6de893", + "0x0000000000000000000000000000005018f74f48ff6afc256aca9f4180cb6196", + "0x000000000000000000000000000000000018f8dd3c1e3d71f85778ba58989448", + "0x000000000000000000000000000000b951ea1ca989c6bebcba71e26afed15269", + "0x00000000000000000000000000000000002571b65d031446cb7b1cae4ee69aff", + "0x000000000000000000000000000000c8ee99fb1b91f20376fc2e392ce52612c9", + "0x000000000000000000000000000000000023a8c38e1590f8b010ac908a110698", + "0x00000000000000000000000000000023ecc30a8e12be977c2ff62e854145cbe4", + "0x0000000000000000000000000000000000057dcc3566f24e9b83a51548cefad4", + "0x00000000000000000000000000000030c95ec063a5e02802fafda4b296d8658c", + "0x00000000000000000000000000000000002ae2a67d9e2fb132cfb4191440eddd", + "0x000000000000000000000000000000e03a7cfd7304f5b2421bbd72e267228f77", + "0x000000000000000000000000000000000024cc89b8889fbb61232865cf66d9d7", + "0x0000000000000000000000000000000788f2eaff9b1e73ed543514f5b9cad20e", + "0x00000000000000000000000000000000001abde98a14417cc19fb333410c4ad3", + "0x00000000000000000000000000000004b9c090087dd6a49d3fc4f225e5d6d67a", + "0x000000000000000000000000000000000002835980a2795591890b20c042a92f", + "0x000000000000000000000000000000c3139db096f86b41041e48a70940ef94a6", + "0x00000000000000000000000000000000002ddc8506fa8eafc6a73594d688b389", + "0x000000000000000000000000000000b24006a736c2e0fbe730125be4cf2de96d", + "0x00000000000000000000000000000000000752b6bf41cc3478231419ccaa3acf", + "0x000000000000000000000000000000b25817748eca1a4cacdc9916f4c297967a", + "0x000000000000000000000000000000000003ba5843c3c8a154fd8e176e2144b9", + "0x000000000000000000000000000000c864b99ea2db19cbf6c8c5376f3a82fafe", + "0x0000000000000000000000000000000000305e0adce0497f06a389a68f385566", + "0x00000000000000000000000000000002d5561a161f0723cadfce851e9d99742a", + "0x000000000000000000000000000000000029c204157e889f9043e61c607c2007", + "0x000000000000000000000000000000cbc4b2a4625d9f4636ce8f71a0a0d844ca", + "0x00000000000000000000000000000000002ff1dacc8f8c79fff071dd0bc6f014", + "0x000000000000000000000000000000e3a178f757db63e0a24f105c669cdec63c", + "0x0000000000000000000000000000000000061d665b9930587f33749d55af9e13", + "0x0000000000000000000000000000008dac514da9d0516f52fd0d29eec46586be", + "0x0000000000000000000000000000000000101865069261844695fafcf121ac09", + "0x0000000000000000000000000000000b1866480e2d4d17c869a9671f9e59c887", + "0x00000000000000000000000000000000000243b9328b12365d14e747b0bc2aa6", + "0x000000000000000000000000000000c481bcda930f4b3fc24a5ad21c65ad9655", + "0x00000000000000000000000000000000002891253d4c7d254a7434153351fdcf", + "0x0000000000000000000000000000000136a29096d3ee85c9077c9d49ae758256", + "0x0000000000000000000000000000000000039c0c370e432f85f1adaa56121e01", + "0x000000000000000000000000000000d68c47afce521fffd1d9968958444f55c4", + "0x0000000000000000000000000000000000251718f52b611ab48c996d392f535a", + "0x000000000000000000000000000000504382549a7f8d12757080c1168e272246", + "0x000000000000000000000000000000000022a8769dafd9c20aa6f23c484c9bab", + "0x000000000000000000000000000000f6f4596202301b6ae4eb0ebbeadd203340", + "0x00000000000000000000000000000000000adc89c48d75b571636f5bbeb4a806", + "0x00000000000000000000000000000000034e3e27454ef992b4bf84b97baa7471", + "0x0000000000000000000000000000000000066f28135748f119631c3fe07fa9d7", + "0x0000000000000000000000000000003b64a66f2ac4979b65e56568c5a31b14ed", + "0x00000000000000000000000000000000002e25783551df50c004ec7cd1f4dd8b", + "0x000000000000000000000000000000e8258f84477c1b62565a559ba7bb38832e", + "0x000000000000000000000000000000000018f76cf0ceeccb4798de741ae89b64", + "0x0000000000000000000000000000001583b176f599e192d7119354034419e8f9", + "0x000000000000000000000000000000000004706a0e23ac32a3566907fb872362", + "0x000000000000000000000000000000d1b9992279342fce9a883849693fcda22a", + "0x000000000000000000000000000000000029046b299293cb09c593372eb6b3e6", + "0x000000000000000000000000000000469680c270e551515344592f59188fa765", + "0x00000000000000000000000000000000002d38d6d4ba1e4763a74ecdb11ca1f3", + "0x000000000000000000000000000000fce917c0d5dca019477c52f6075332b612", + "0x000000000000000000000000000000000012db39e892826b32610ee08251e005", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", @@ -155,62 +155,62 @@ vk_path = [ "0x0000000000000000000000000000006df5ee4c1358443f5a14086b5196e13e46", "0x0000000000000000000000000000000000192b1a6d3b14dfe5a9ad63951d2d76" ] - hash = "0x1f6c06063226ba7edac4c5c7dce6272b5f5ea00eec55ad78e1ef4125504f5f87" + hash = "0x2d4e96e47d6cd513bb8666db31c63e7c570e0264124c14237efa25193239f870" [previous_kernel_public_inputs] min_revertible_side_effect_counter = "0x0000000000000000000000000000000000000000000000000000000000000003" is_private_only = true [previous_kernel_public_inputs.constants] - vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" - protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" + vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" + protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [previous_kernel_public_inputs.constants.historical_header] - total_fees = "0x0000000000000000000000000000000000000000000000000011b417896f129a" - total_mana_used = "0x0000000000000000000000000000000000000000000000000000000000016771" + total_fees = "0x00000000000000000000000000000000000000000000000000f3d59e049eb1ac" + total_mana_used = "0x00000000000000000000000000000000000000000000000000000000001355c1" [previous_kernel_public_inputs.constants.historical_header.last_archive] - root = "0x0781b1cc32dbe21aba1e27519e765bd44222b52ef464c6b63dfa97b399376c2e" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000009" + root = "0x2686a574dfb90890de58e447bcd7f12504950a18bbe781d95758161ca30dcf66" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000005" [previous_kernel_public_inputs.constants.historical_header.content_commitment] num_txs = "0x0000000000000000000000000000000000000000000000000000000000000002" - blobs_hash = "0x0008822f60476d6dc34ec6109d3ad69dd1747a9484777021d8e717166bc7d5e6" + blobs_hash = "0x002ee5246d9ece5e2f64027ac8216616887df1da344019d0e0f0cfd1c2483af7" in_hash = "0x00089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c" out_hash = "0x00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb" [previous_kernel_public_inputs.constants.historical_header.state.l1_to_l2_message_tree] root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000090" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050" [previous_kernel_public_inputs.constants.historical_header.state.partial.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000480" +root = "0x265f2fb8ecbd96d51d74d79901934e60af982af7b6caa46153eafcf3201df280" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000280" [previous_kernel_public_inputs.constants.historical_header.state.partial.nullifier_tree] -root = "0x0a639c242b766d8bd94d437483546e33c4a8c27feadf50bc4ef523e9f191e927" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000500" +root = "0x0d8cfcd6ecef742ecda848c0db79ef7d0fe639b7b69564d103f788d530832eba" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" [previous_kernel_public_inputs.constants.historical_header.state.partial.public_data_tree] -root = "0x2528ba08e1171e992f4744a8d8761bbe5611447c52d673882bde6a9e3b716e1a" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [previous_kernel_public_inputs.constants.historical_header.global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000009" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000016" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2eae" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000005" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000009" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a8e5" [previous_kernel_public_inputs.constants.historical_header.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [previous_kernel_public_inputs.constants.historical_header.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.constants.historical_header.global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9c6e14ac" [previous_kernel_public_inputs.constants.tx_context] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" @@ -226,7 +226,11 @@ l2_gas = "0x00000000000000000000000000000000000000000000000000000000005b8d80" [previous_kernel_public_inputs.constants.tx_context.gas_settings.max_fees_per_gas] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" -fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" + +[previous_kernel_public_inputs.constants.tx_context.gas_settings.max_priority_fees_per_gas] +fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" [previous_kernel_public_inputs.validation_requests.for_rollup.max_block_number._opt] _is_some = false @@ -2222,7 +2226,7 @@ _value = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.note_hashes]] [previous_kernel_public_inputs.end.note_hashes.note_hash] -value = "0x2a71725fe2200c633f538557e5ec1e8274322449e1d37aa4de1428609fe0bae0" +value = "0x203d415d2bbd43b332fcc6fbdbf24a3df7d8f403b2b2a4051d6a8c8a9e913486" counter = "0x0000000000000000000000000000000000000000000000000000000000000007" [previous_kernel_public_inputs.end.note_hashes.contract_address] @@ -2230,7 +2234,7 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.note_hashes]] [previous_kernel_public_inputs.end.note_hashes.note_hash] -value = "0x0aa7177f2bd22dae7aea8ed1d2cee170870bb79f57b21ce5c54ea47a7fdb5af8" +value = "0x1f80d1990c62befb84e60cbfe6475483bdb3b1b860156d84ec55b561a1e963f7" counter = "0x0000000000000000000000000000000000000000000000000000000000000009" [previous_kernel_public_inputs.end.note_hashes.contract_address] @@ -2734,7 +2738,7 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.nullifiers]] [previous_kernel_public_inputs.end.nullifiers.nullifier] -value = "0x1e4c23d7a900532cdb5687c5806be8da481285afb0abbbe8a3801d71451d08d8" +value = "0x1c092e50dfdc08e3bbe145aa1ffcc554d22937b7e1dab9d4b30d59368634d28d" counter = "0x0000000000000000000000000000000000000000000000000000000000000000" note_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -2743,7 +2747,7 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[previous_kernel_public_inputs.end.nullifiers]] [previous_kernel_public_inputs.end.nullifiers.nullifier] -value = "0x07f80d2d42c91e838c0d22a45ac6c20db72a3a7507951a54491f2740d5a00b25" +value = "0x1e5500b16b3acfb338162c1db2abca255b4c3aa696dc43669bdbc802110d48f2" counter = "0x0000000000000000000000000000000000000000000000000000000000000006" note_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -3403,24 +3407,24 @@ counter = "0x0000000000000000000000000000000000000000000000000000000000000008" [previous_kernel_public_inputs.end.private_logs.inner.log] fields = [ - "0x00a117133196dd4df85556e6527de2b0f07d12da194c4c63f8658b39b42329c0", - "0x00961dca5785af4bf09cf75a77cdfcfa8fa41413b16bee86604c1826795edeec", - "0x00f7933d99a2ac43f613e021cc11c6200bdf7d703ba411bfda70998dbbe91d18", - "0x005c34531ec16f9cba02c2f74e5b68f53ec6bc00000000000000000000000000", - "0x000000343ccbf71927c63534206273c8611b72a04d4db62e0d1e7a1f358dbfe9", - "0x00bbb6167707e40e023148c03968226c73db4574f5991f9d06194dd1782e9d92", - "0x00c2cfe592e585e6319b54b39631393055f7ff2e2fab8ed76f5ca49bc3e7c83b", - "0x0036f9cd24f2727bc025371ca810245a9267c936e7edf92bd90a302d44b9a6ff", - "0x00dabe139092b735a4288ee4a9379e4afdfa51708650fe26e91e239fa23f9375", - "0x00eae9418604595e2d9a6ad7d46b2fc1967d2d7da56c4072a76bb3f709982f49", - "0x00989ffa26ac3a205dc0b99de3a6507411d11fdba8c61d3c81aabed1f119dd27", - "0x008ee4cadeaf75aa216d88a2a3aad40ba71c9ca39176a9ac78da77e47cab5caa", - "0x009927c6b18981dfcabf0a63dfd61d0491d8ee2c893844bb2ca602012783d756", - "0x00a18c50eb974c9146d791e09d883b3ad300430e1bac3f225b96041bcee15fce", - "0x00d527b9e3f664614bdf0f851d75ac6acaf59d4dbbe565a36424dee99bbf878d", - "0x00ae2f375a95ac5c40bf04f2c3f117c27132f413368d5d56edc746174594f8ca", - "0x004ff8ae2b0b2ae2b61a01a94b966654d26714edd486f5acacb2feb360f09059", - "0x00fb3c03d810569bdb758dbcb063020c6119ae59bd66308035a17f93ec1a8e98" + "0x2325620ddd257cf7f2641a085b45be26f2fcfde718824c457fdaebabbb46a172", + "0x000bc558b3eef99be45bddc263bc31cbbb17a7ffa1d815c6921ec80c8b1c0523", + "0x003eb458eaa8db4858c9db7789e9ad41710bb3e5502ab85cc0ad8d4bc8eb52ce", + "0x00ff08a9664c256053396edfeda7c8f0cc5d8d00000000000000000000000000", + "0x0000005a12365b2a7eeae19796d04db3d06e2d30ae9d74c27f1d44a55d329c4a", + "0x008b547e32e13b40a76dde1047d859c8ec42862d7f81ee223a57ff73a4547266", + "0x00443f4f8a52ad47628d5ecdb5a2365220e979f5d41aec99c080bc4b061bf2c8", + "0x00d457726247f55680896963585b2a9e4a3e6b54135dd7649359b58ad3716582", + "0x002faf3f16beaa6682cc90c3251ffc910f535b03004b2016863173b7ac40d117", + "0x00cbcf8860bfedb383d3c728b374de8b059699d3fee06f3a34c74bf1b3cfd6d2", + "0x002026f90e50a32bfed5b79cf380be00990bcbfba3b91de691b5b0fad72200c4", + "0x00a5ca52258750ac51c0eb3dedca43f651a835e4322f6b0aa44f60b40415d943", + "0x00c03f53a8b0448582cc95aa8c3acbf1b7ecc0c182235b8a495c7250df8fb093", + "0x0099c0c6a4ffaa80a9faa80d9c514d79b0a52ff15ca75387bd591042eb9f8a9d", + "0x002ba5de9cab52824a8261bca9e0101cdbcc2f035985baeb1a24dc6d68968cb1", + "0x00d749741c1d63d56a16c937f747b0763afde032947cb672867532a14dd9cf92", + "0x00abd177c77edf0ba47f8c56e263ffbd8d3e1819fc0dada3ed74c61dc1afdf07", + "0x005df82a4ae3ab7ab59a2ad4aaff615b4bf3409fcaa06c8d115b90a6827c7282" ] [previous_kernel_public_inputs.end.private_logs.contract_address] @@ -3433,24 +3437,24 @@ counter = "0x000000000000000000000000000000000000000000000000000000000000000a" [previous_kernel_public_inputs.end.private_logs.inner.log] fields = [ - "0x11326925f87bb7838ce97a37e1153690b7d7be43e3aba260312e9b49e3a2e952", - "0x0082d4f053d20f9e5d0133a2279d7e5e1edcee80e8ae64e2b31759ea2c9d8357", - "0x00b4293fe37ff8a12620c49682fe04fc280a5808fc52884c40905c8a9fd12c22", - "0x00a08522ae6abbcca7fa0574ba7dc99f9f881c00000000000000000000000000", - "0x000000b32f2e9c3feb52a65be2321e91560925b83d0be9ea0c8e41c5e71c4df1", - "0x00fa5845ce219f1a7dd626caa3c96b536a79a3a65b1e184bda69fbc6eb61bdfc", - "0x0028181637f8949f88e4a53422f95c86122248723091b21e8f469fc86b3f7bf6", - "0x00c45756c940e72b7532073a35d77febff4f9d61a7f15706ba058f552c4c4dec", - "0x00ff7429d367c5fb82596c900dae746bd4988941db33121f03a8d01d92646560", - "0x004ca4b6be792d1c2167e998174d676e6462d0995063cd2d28bed4a7a0205ee0", - "0x0075c3cbed81825b7d47fe05ffa7446ee7b637ead0b04f1fb74e5d5d8f6a2b61", - "0x0036e4ebe9d34f8cf36254dc26d3b8c4829781d742edd48bd4babc79d4f8e019", - "0x001e85147052819f92807729600faf577839327b3c9d6ddada8869a19fdc2f7c", - "0x00062d400f543f81e1379c1e275b50e2bd025e4adc8111ae7ee30615c4733c58", - "0x0036d19ebc307f6a255369bb16287ec77fe0671c2dc6b3151ffa75e99a560d55", - "0x00250cf6a0581f297c606cde1b35e500648010bd4e9bda5b8a98a5824e0ee3bd", - "0x00b16603236f00e2f4263ecb587c0bb087fdcfa9075b3dde4501dff76177d091", - "0x0046729300d452d6dfe8200e1958ea4c78b2ddb8108a5c9b11fe2f61ca2c092b" + "0x1c14ed2b8419855659fd5853c36fae0ad535319646889d630a2ecdc70975ee7d", + "0x009ab44c19d12bebb91d93f52d01179f33873667ca688633a20bf58942d641f5", + "0x004640cf4a0d35a53cb5107f7887ce2eb59320dc3692c761e70688b1c75c9d6e", + "0x0006e1c046e924a7e9be8a462e45c05c27347200000000000000000000000000", + "0x0000003131993bbab963d3bbcfaea2ad4ce93d7f187b4678592ebeff1969c0f7", + "0x007d15be7812b7d4f039bcadecbdbd5a764af23bdec8a0780a62bd836598cf8f", + "0x001373dbaa94dbf7f1c6e5841a6ca7c338319a3efcd25c2502b7675cfd4b9c73", + "0x006d865887d564824338a227fb1a94e367dc7671755d2a7749ea47ed531bc671", + "0x00604c0d1e54498cf3cb6c56af2c321f6660e185e8caf7b0a8199e5f16157ce0", + "0x00bb93fae1b7266c7b7c691b329def0e589c12ff05a63a86f4e0addf52403859", + "0x006a11b63046badb3b3af5d46e798bcda1bbe4bfa1d9389fa0cfb0d6983465c5", + "0x0036063476ff230f0204e873cfd653b5b6d9767101d51e6c741be7fb84e06512", + "0x00c3bfe9bc1085e587a2f5fb826fd619c4ec62403c50395bf2e092e04f4a34af", + "0x001f21d3ee5a5faaa44c0575b66754315810c83b2cc6f28054cc06cdd882a8e7", + "0x009f2dfb20248037ef311445c5d691a39c0b621681280ae03e42aa6fddcea432", + "0x00260e97d44f0896e42991e0cb2ac86cb0caaca5a6ec1c96cb9b2f13d0d351ea", + "0x0024b676f2f447f84a1db4f1a1976ecfb01ccd564aed18db57ac6da3dfa5d414", + "0x009454ddc2c942b5ecd157fbcd9733f1cb7bd438b3ed29742b083952bc8292de" ] [previous_kernel_public_inputs.end.private_logs.contract_address] @@ -3463,24 +3467,24 @@ counter = "0x000000000000000000000000000000000000000000000000000000000000000b" [previous_kernel_public_inputs.end.private_logs.inner.log] fields = [ - "0x178dae7ea42c364f14500f4738db39475c916d0b506fc353245a8d558b551d5f", - "0x002fe17d85df96d8b9bc15c91d0d62b0173174cda5d991cd73e9b9da65e2956b", - "0x00da7b08beac5d98c229d91728587646f72777453b785d0624e59f0a8075661d", - "0x0089323120a21d889aee547c21faa1c03a1ead00000000000000000000000000", - "0x0000001a851e3ed1265dde6b01175571a83d0777b0c17791db74cd2b33589139", - "0x00d1f4a53e67b2221c1ce7bd6d5dc105b0b3a086dcabd173b2b874f6f13fa338", - "0x002ccc3ee9f522a252f7523703c162fb8807c24eb052d2871609e249c67bd5bb", - "0x006e1fd58f3479bb18d1abd812bef996dfc0a36d72d1472a930e77805f243952", - "0x007043fae6b109a981b1e34acf7281480b879f280fd607fa1df718c9a31acaf2", - "0x008c4f91880f265b065cea8a705bc508875182fe5a3837e2b5b8a14e231cbd59", - "0x0071c17f4d52aecdfb4d8c6b1e764ae137c836c0672bf3cc589a45878f2686a8", - "0x00c95d01a6e57b41af4f265b2c88f6ff3de54aa5c895ca6faa21e26a8d6134a5", - "0x00a54c12af2499afd7651644686c671c3d77ff4af32a6b181646c976329a0063", - "0x004567a7724f750c4b0c9c205f35f4a175ea93015792fc78fbd985e7c751cc1b", - "0x001b0870e32b1c3c28116435e5132496bdeb8a1d3b9acc62b7d57d82f230bdaf", - "0x0058272cd1119bc153b18b3a3c896138be6f5b9144f216cd6e6f1b5db7d8ef08", - "0x00c1c848fc01d649f264a3cf8ba8cade698e2c1dbd14f7a0077356f8381de748", - "0x00328549fac9e2e1ff6fc6aaef17fbb1fd5c973e01df61985fe056548fd4b5df" + "0x1941848b9f4dbf4fbf4fd476af5d8db2b634f2abca61f23dc0befa41d5aae324", + "0x0000c9e7f1229c5a696998191774658a0ec879295a48b67de81c9bd51d416639", + "0x00fb7c81593791e34ed0115550ef6c73f371943860c12f6ea38a0305ca2da541", + "0x00182db292d67aeddce921ec21a07d74be11de00000000000000000000000000", + "0x000000ff556505d358d4d47b910cdf40859434df3e7447db66cf2dae1483c17b", + "0x00aa01d114b32832bbc33a6d980d4e4a69a4e2612197f7d06b3c39baf657d863", + "0x00166c91e4709fb7600be1cc08622cfc70977233656f98bc03b4154ad07d765e", + "0x00f4967c08a2c14d543feaf59f6ec51725c4a77a5733ddbec4e0fa981c2c4a05", + "0x00e4226df458c612e0d5883566e139f3f6fd528dcbd2c663965bf3d0acd92977", + "0x001d8bae2045a25b4fc298ee092508ba91ef5869e555bef5439a429a81fc0966", + "0x004591f96d04aa30636f077d598d2005bcd02def8fe097d39935f6e9be3f59a6", + "0x0048bfa7037e177ee29bb000841b65a50a3988782addcdb99af5774c67470c27", + "0x00fd50b1ed92b18e50534745e847804ce0f06e640dadb08bbb0e91c7a45d1967", + "0x00b149957c7c683a66c3128a39c1d2c40b95e54988254916600ae30a14d51b3c", + "0x005d73b57f9a10b757da69f8e437c0ce806ba23eff9f7e88f38121a5b3c97095", + "0x00c83ff06632c1f9f512b72972547a5d53d80f942575567a9159472b497a015d", + "0x00cf1422a25529918047a95cfb4067cebc5f376df3194405b1f7ce2e1cde4944", + "0x00458caecbf2fabacbb7cd4d72ca1f62588a1e41b8831d8f74b3f09fd683b102" ] [previous_kernel_public_inputs.end.private_logs.contract_address] diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-base-private/Prover.toml b/noir-projects/noir-protocol-circuits/crates/rollup-base-private/Prover.toml index 7a70e53d040..6cbe242a0b5 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-base-private/Prover.toml +++ b/noir-projects/noir-protocol-circuits/crates/rollup-base-private/Prover.toml @@ -6,70 +6,74 @@ _is_some = false _value = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.tube_data.public_inputs.constants] - vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" - protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" + vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" + protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [inputs.tube_data.public_inputs.constants.historical_header] - total_fees = "0x0000000000000000000000000000000000000000000000000000000000000000" - total_mana_used = "0x0000000000000000000000000000000000000000000000000000000000000000" + total_fees = "0x00000000000000000000000000000000000000000000000000f3d59e049eb1ac" + total_mana_used = "0x00000000000000000000000000000000000000000000000000000000001355c1" [inputs.tube_data.public_inputs.constants.historical_header.last_archive] - root = "0x0000000000000000000000000000000000000000000000000000000000000000" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000000" + root = "0x2686a574dfb90890de58e447bcd7f12504950a18bbe781d95758161ca30dcf66" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000005" [inputs.tube_data.public_inputs.constants.historical_header.content_commitment] - num_txs = "0x0000000000000000000000000000000000000000000000000000000000000000" - blobs_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" - in_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" - out_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" + num_txs = "0x0000000000000000000000000000000000000000000000000000000000000002" + blobs_hash = "0x002ee5246d9ece5e2f64027ac8216616887df1da344019d0e0f0cfd1c2483af7" + in_hash = "0x00089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c" + out_hash = "0x00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb" [inputs.tube_data.public_inputs.constants.historical_header.state.l1_to_l2_message_tree] root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000000" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050" [inputs.tube_data.public_inputs.constants.historical_header.state.partial.note_hash_tree] -root = "0x1fd848aa69e1633722fe249a5b7f53b094f1c9cef9f5c694b073fd1cc5850dfb" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000000" +root = "0x265f2fb8ecbd96d51d74d79901934e60af982af7b6caa46153eafcf3201df280" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000280" [inputs.tube_data.public_inputs.constants.historical_header.state.partial.nullifier_tree] -root = "0x0c499b373a1f0fe1b510a63563546d2d39e206895056a5af0143c5f30d639073" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000080" +root = "0x0d8cfcd6ecef742ecda848c0db79ef7d0fe639b7b69564d103f788d530832eba" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" [inputs.tube_data.public_inputs.constants.historical_header.state.partial.public_data_tree] -root = "0x23c08a6b1297210c5e24c76b9a936250a1ce2721576c26ea797c7ec35f9e46a9" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000080" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [inputs.tube_data.public_inputs.constants.historical_header.global_variables] - chain_id = "0x0000000000000000000000000000000000000000000000000000000000000000" - version = "0x0000000000000000000000000000000000000000000000000000000000000000" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000000" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000000" - timestamp = "0x0000000000000000000000000000000000000000000000000000000000000000" + chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" + version = "0x0000000000000000000000000000000000000000000000000000000000000001" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000005" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000009" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a8e5" [inputs.tube_data.public_inputs.constants.historical_header.global_variables.coinbase] - inner = "0x0000000000000000000000000000000000000000000000000000000000000000" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.tube_data.public_inputs.constants.historical_header.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.tube_data.public_inputs.constants.historical_header.global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9c6e14ac" [inputs.tube_data.public_inputs.constants.tx_context] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" [inputs.tube_data.public_inputs.constants.tx_context.gas_settings.gas_limits] -da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" -l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +da_gas = "0x000000000000000000000000000000000000000000000000000000003b9aca00" +l2_gas = "0x000000000000000000000000000000000000000000000000000000003b9aca00" [inputs.tube_data.public_inputs.constants.tx_context.gas_settings.teardown_gas_limits] -da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" -l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +da_gas = "0x00000000000000000000000000000000000000000000000000000000005b8d80" +l2_gas = "0x00000000000000000000000000000000000000000000000000000000005b8d80" [inputs.tube_data.public_inputs.constants.tx_context.gas_settings.max_fees_per_gas] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" + +[inputs.tube_data.public_inputs.constants.tx_context.gas_settings.max_priority_fees_per_gas] +fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.tube_data.public_inputs.constants.global_variables] @@ -91,8 +95,8 @@ fee_per_l2_gas = "0x000000000000000000000000000000000000000000000000000000000000 [inputs.tube_data.public_inputs.end] note_hashes = [ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x203d415d2bbd43b332fcc6fbdbf24a3df7d8f403b2b2a4051d6a8c8a9e913486", + "0x1f80d1990c62befb84e60cbfe6475483bdb3b1b860156d84ec55b561a1e963f7", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -157,8 +161,8 @@ fee_per_l2_gas = "0x000000000000000000000000000000000000000000000000000000000000 "0x0000000000000000000000000000000000000000000000000000000000000000" ] nullifiers = [ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x1c092e50dfdc08e3bbe145aa1ffcc554d22937b7e1dab9d4b30d59368634d28d", + "0x1e5500b16b3acfb338162c1db2abca255b4c3aa696dc43669bdbc802110d48f2", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -315,68 +319,68 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[inputs.tube_data.public_inputs.end.private_logs]] fields = [ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000" + "0x2325620ddd257cf7f2641a085b45be26f2fcfde718824c457fdaebabbb46a172", + "0x000bc558b3eef99be45bddc263bc31cbbb17a7ffa1d815c6921ec80c8b1c0523", + "0x003eb458eaa8db4858c9db7789e9ad41710bb3e5502ab85cc0ad8d4bc8eb52ce", + "0x00ff08a9664c256053396edfeda7c8f0cc5d8d00000000000000000000000000", + "0x0000005a12365b2a7eeae19796d04db3d06e2d30ae9d74c27f1d44a55d329c4a", + "0x008b547e32e13b40a76dde1047d859c8ec42862d7f81ee223a57ff73a4547266", + "0x00443f4f8a52ad47628d5ecdb5a2365220e979f5d41aec99c080bc4b061bf2c8", + "0x00d457726247f55680896963585b2a9e4a3e6b54135dd7649359b58ad3716582", + "0x002faf3f16beaa6682cc90c3251ffc910f535b03004b2016863173b7ac40d117", + "0x00cbcf8860bfedb383d3c728b374de8b059699d3fee06f3a34c74bf1b3cfd6d2", + "0x002026f90e50a32bfed5b79cf380be00990bcbfba3b91de691b5b0fad72200c4", + "0x00a5ca52258750ac51c0eb3dedca43f651a835e4322f6b0aa44f60b40415d943", + "0x00c03f53a8b0448582cc95aa8c3acbf1b7ecc0c182235b8a495c7250df8fb093", + "0x0099c0c6a4ffaa80a9faa80d9c514d79b0a52ff15ca75387bd591042eb9f8a9d", + "0x002ba5de9cab52824a8261bca9e0101cdbcc2f035985baeb1a24dc6d68968cb1", + "0x00d749741c1d63d56a16c937f747b0763afde032947cb672867532a14dd9cf92", + "0x00abd177c77edf0ba47f8c56e263ffbd8d3e1819fc0dada3ed74c61dc1afdf07", + "0x005df82a4ae3ab7ab59a2ad4aaff615b4bf3409fcaa06c8d115b90a6827c7282" ] [[inputs.tube_data.public_inputs.end.private_logs]] fields = [ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000" + "0x1c14ed2b8419855659fd5853c36fae0ad535319646889d630a2ecdc70975ee7d", + "0x009ab44c19d12bebb91d93f52d01179f33873667ca688633a20bf58942d641f5", + "0x004640cf4a0d35a53cb5107f7887ce2eb59320dc3692c761e70688b1c75c9d6e", + "0x0006e1c046e924a7e9be8a462e45c05c27347200000000000000000000000000", + "0x0000003131993bbab963d3bbcfaea2ad4ce93d7f187b4678592ebeff1969c0f7", + "0x007d15be7812b7d4f039bcadecbdbd5a764af23bdec8a0780a62bd836598cf8f", + "0x001373dbaa94dbf7f1c6e5841a6ca7c338319a3efcd25c2502b7675cfd4b9c73", + "0x006d865887d564824338a227fb1a94e367dc7671755d2a7749ea47ed531bc671", + "0x00604c0d1e54498cf3cb6c56af2c321f6660e185e8caf7b0a8199e5f16157ce0", + "0x00bb93fae1b7266c7b7c691b329def0e589c12ff05a63a86f4e0addf52403859", + "0x006a11b63046badb3b3af5d46e798bcda1bbe4bfa1d9389fa0cfb0d6983465c5", + "0x0036063476ff230f0204e873cfd653b5b6d9767101d51e6c741be7fb84e06512", + "0x00c3bfe9bc1085e587a2f5fb826fd619c4ec62403c50395bf2e092e04f4a34af", + "0x001f21d3ee5a5faaa44c0575b66754315810c83b2cc6f28054cc06cdd882a8e7", + "0x009f2dfb20248037ef311445c5d691a39c0b621681280ae03e42aa6fddcea432", + "0x00260e97d44f0896e42991e0cb2ac86cb0caaca5a6ec1c96cb9b2f13d0d351ea", + "0x0024b676f2f447f84a1db4f1a1976ecfb01ccd564aed18db57ac6da3dfa5d414", + "0x009454ddc2c942b5ecd157fbcd9733f1cb7bd438b3ed29742b083952bc8292de" ] [[inputs.tube_data.public_inputs.end.private_logs]] fields = [ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000" + "0x1941848b9f4dbf4fbf4fd476af5d8db2b634f2abca61f23dc0befa41d5aae324", + "0x0000c9e7f1229c5a696998191774658a0ec879295a48b67de81c9bd51d416639", + "0x00fb7c81593791e34ed0115550ef6c73f371943860c12f6ea38a0305ca2da541", + "0x00182db292d67aeddce921ec21a07d74be11de00000000000000000000000000", + "0x000000ff556505d358d4d47b910cdf40859434df3e7447db66cf2dae1483c17b", + "0x00aa01d114b32832bbc33a6d980d4e4a69a4e2612197f7d06b3c39baf657d863", + "0x00166c91e4709fb7600be1cc08622cfc70977233656f98bc03b4154ad07d765e", + "0x00f4967c08a2c14d543feaf59f6ec51725c4a77a5733ddbec4e0fa981c2c4a05", + "0x00e4226df458c612e0d5883566e139f3f6fd528dcbd2c663965bf3d0acd92977", + "0x001d8bae2045a25b4fc298ee092508ba91ef5869e555bef5439a429a81fc0966", + "0x004591f96d04aa30636f077d598d2005bcd02def8fe097d39935f6e9be3f59a6", + "0x0048bfa7037e177ee29bb000841b65a50a3988782addcdb99af5774c67470c27", + "0x00fd50b1ed92b18e50534745e847804ce0f06e640dadb08bbb0e91c7a45d1967", + "0x00b149957c7c683a66c3128a39c1d2c40b95e54988254916600ae30a14d51b3c", + "0x005d73b57f9a10b757da69f8e437c0ce806ba23eff9f7e88f38121a5b3c97095", + "0x00c83ff06632c1f9f512b72972547a5d53d80f942575567a9159472b497a015d", + "0x00cf1422a25529918047a95cfb4067cebc5f376df3194405b1f7ce2e1cde4944", + "0x00458caecbf2fabacbb7cd4d72ca1f62588a1e41b8831d8f74b3f09fd683b102" ] [[inputs.tube_data.public_inputs.end.private_logs]] @@ -1367,656 +1371,16 @@ root = "0x0000000000000000000000000000000000000000000000000000000000000000" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.tube_data.public_inputs.gas_used] - da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" + da_gas = "0x0000000000000000000000000000000000000000000000000000000000007600" + l2_gas = "0x0000000000000000000000000000000000000000000000000000000000004a40" [inputs.tube_data.public_inputs.fee_payer] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.tube_data.proof] fields = [ - "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x0000000000000000000000000000000000000000000000000000000000000002", - "0x0000000000000000000000000000000000000000000000000000000000000003", - "0x0000000000000000000000000000000000000000000000000000000000000004", - "0x0000000000000000000000000000000000000000000000000000000000000005", - "0x0000000000000000000000000000000000000000000000000000000000000006", - "0x0000000000000000000000000000000000000000000000000000000000000007", - "0x0000000000000000000000000000000000000000000000000000000000000008", - "0x0000000000000000000000000000000000000000000000000000000000000009", - "0x000000000000000000000000000000000000000000000000000000000000000a", - "0x000000000000000000000000000000000000000000000000000000000000000b", - "0x000000000000000000000000000000000000000000000000000000000000000c", - "0x000000000000000000000000000000000000000000000000000000000000000d", - "0x000000000000000000000000000000000000000000000000000000000000000e", - "0x000000000000000000000000000000000000000000000000000000000000000f", - "0x0000000000000000000000000000000000000000000000000000000000000010", - "0x0000000000000000000000000000000000000000000000000000000000000011", - "0x0000000000000000000000000000000000000000000000000000000000000012", - "0x0000000000000000000000000000000000000000000000000000000000000013", - "0x0000000000000000000000000000000000000000000000000000000000000014", - "0x0000000000000000000000000000000000000000000000000000000000000015", - "0x0000000000000000000000000000000000000000000000000000000000000016", - "0x0000000000000000000000000000000000000000000000000000000000000017", - "0x0000000000000000000000000000000000000000000000000000000000000018", - "0x0000000000000000000000000000000000000000000000000000000000000019", - "0x000000000000000000000000000000000000000000000000000000000000001a", - "0x000000000000000000000000000000000000000000000000000000000000001b", - "0x000000000000000000000000000000000000000000000000000000000000001c", - "0x000000000000000000000000000000000000000000000000000000000000001d", - "0x000000000000000000000000000000000000000000000000000000000000001e", - "0x000000000000000000000000000000000000000000000000000000000000001f", - "0x0000000000000000000000000000000000000000000000000000000000000020", - "0x0000000000000000000000000000000000000000000000000000000000000021", - "0x0000000000000000000000000000000000000000000000000000000000000022", - "0x0000000000000000000000000000000000000000000000000000000000000023", - "0x0000000000000000000000000000000000000000000000000000000000000024", - "0x0000000000000000000000000000000000000000000000000000000000000025", - "0x0000000000000000000000000000000000000000000000000000000000000026", - "0x0000000000000000000000000000000000000000000000000000000000000027", - "0x0000000000000000000000000000000000000000000000000000000000000028", - "0x0000000000000000000000000000000000000000000000000000000000000029", - "0x000000000000000000000000000000000000000000000000000000000000002a", - "0x000000000000000000000000000000000000000000000000000000000000002b", - "0x000000000000000000000000000000000000000000000000000000000000002c", - "0x000000000000000000000000000000000000000000000000000000000000002d", - "0x000000000000000000000000000000000000000000000000000000000000002e", - "0x000000000000000000000000000000000000000000000000000000000000002f", - "0x0000000000000000000000000000000000000000000000000000000000000030", - "0x0000000000000000000000000000000000000000000000000000000000000031", - "0x0000000000000000000000000000000000000000000000000000000000000032", - "0x0000000000000000000000000000000000000000000000000000000000000033", - "0x0000000000000000000000000000000000000000000000000000000000000034", - "0x0000000000000000000000000000000000000000000000000000000000000035", - "0x0000000000000000000000000000000000000000000000000000000000000036", - "0x0000000000000000000000000000000000000000000000000000000000000037", - "0x0000000000000000000000000000000000000000000000000000000000000038", - "0x0000000000000000000000000000000000000000000000000000000000000039", - "0x000000000000000000000000000000000000000000000000000000000000003a", - "0x000000000000000000000000000000000000000000000000000000000000003b", - "0x000000000000000000000000000000000000000000000000000000000000003c", - "0x000000000000000000000000000000000000000000000000000000000000003d", - "0x000000000000000000000000000000000000000000000000000000000000003e", - "0x000000000000000000000000000000000000000000000000000000000000003f", - "0x0000000000000000000000000000000000000000000000000000000000000040", - "0x0000000000000000000000000000000000000000000000000000000000000041", - "0x0000000000000000000000000000000000000000000000000000000000000042", - "0x0000000000000000000000000000000000000000000000000000000000000043", - "0x0000000000000000000000000000000000000000000000000000000000000044", - "0x0000000000000000000000000000000000000000000000000000000000000045", - "0x0000000000000000000000000000000000000000000000000000000000000046", - "0x0000000000000000000000000000000000000000000000000000000000000047", - "0x0000000000000000000000000000000000000000000000000000000000000048", - "0x0000000000000000000000000000000000000000000000000000000000000049", - "0x000000000000000000000000000000000000000000000000000000000000004a", - "0x000000000000000000000000000000000000000000000000000000000000004b", - "0x000000000000000000000000000000000000000000000000000000000000004c", - "0x000000000000000000000000000000000000000000000000000000000000004d", - "0x000000000000000000000000000000000000000000000000000000000000004e", - "0x000000000000000000000000000000000000000000000000000000000000004f", - "0x0000000000000000000000000000000000000000000000000000000000000050", - "0x0000000000000000000000000000000000000000000000000000000000000051", - "0x0000000000000000000000000000000000000000000000000000000000000052", - "0x0000000000000000000000000000000000000000000000000000000000000053", - "0x0000000000000000000000000000000000000000000000000000000000000054", - "0x0000000000000000000000000000000000000000000000000000000000000055", - "0x0000000000000000000000000000000000000000000000000000000000000056", - "0x0000000000000000000000000000000000000000000000000000000000000057", - "0x0000000000000000000000000000000000000000000000000000000000000058", - "0x0000000000000000000000000000000000000000000000000000000000000059", - "0x000000000000000000000000000000000000000000000000000000000000005a", - "0x000000000000000000000000000000000000000000000000000000000000005b", - "0x000000000000000000000000000000000000000000000000000000000000005c", - "0x000000000000000000000000000000000000000000000000000000000000005d", - "0x000000000000000000000000000000000000000000000000000000000000005e", - "0x000000000000000000000000000000000000000000000000000000000000005f", - "0x0000000000000000000000000000000000000000000000000000000000000060", - "0x0000000000000000000000000000000000000000000000000000000000000061", - "0x0000000000000000000000000000000000000000000000000000000000000062", - "0x0000000000000000000000000000000000000000000000000000000000000063", - "0x0000000000000000000000000000000000000000000000000000000000000064", - "0x0000000000000000000000000000000000000000000000000000000000000065", - "0x0000000000000000000000000000000000000000000000000000000000000066", - "0x0000000000000000000000000000000000000000000000000000000000000067", - "0x0000000000000000000000000000000000000000000000000000000000000068", - "0x0000000000000000000000000000000000000000000000000000000000000069", - "0x000000000000000000000000000000000000000000000000000000000000006a", - "0x000000000000000000000000000000000000000000000000000000000000006b", - "0x000000000000000000000000000000000000000000000000000000000000006c", - "0x000000000000000000000000000000000000000000000000000000000000006d", - "0x000000000000000000000000000000000000000000000000000000000000006e", - "0x000000000000000000000000000000000000000000000000000000000000006f", - "0x0000000000000000000000000000000000000000000000000000000000000070", - "0x0000000000000000000000000000000000000000000000000000000000000071", - "0x0000000000000000000000000000000000000000000000000000000000000072", - "0x0000000000000000000000000000000000000000000000000000000000000073", - "0x0000000000000000000000000000000000000000000000000000000000000074", - "0x0000000000000000000000000000000000000000000000000000000000000075", - "0x0000000000000000000000000000000000000000000000000000000000000076", - "0x0000000000000000000000000000000000000000000000000000000000000077", - "0x0000000000000000000000000000000000000000000000000000000000000078", - "0x0000000000000000000000000000000000000000000000000000000000000079", - "0x000000000000000000000000000000000000000000000000000000000000007a", - "0x000000000000000000000000000000000000000000000000000000000000007b", - "0x000000000000000000000000000000000000000000000000000000000000007c", - "0x000000000000000000000000000000000000000000000000000000000000007d", - "0x000000000000000000000000000000000000000000000000000000000000007e", - "0x000000000000000000000000000000000000000000000000000000000000007f", - "0x0000000000000000000000000000000000000000000000000000000000000080", - "0x0000000000000000000000000000000000000000000000000000000000000081", - "0x0000000000000000000000000000000000000000000000000000000000000082", - "0x0000000000000000000000000000000000000000000000000000000000000083", - "0x0000000000000000000000000000000000000000000000000000000000000084", - "0x0000000000000000000000000000000000000000000000000000000000000085", - "0x0000000000000000000000000000000000000000000000000000000000000086", - "0x0000000000000000000000000000000000000000000000000000000000000087", - "0x0000000000000000000000000000000000000000000000000000000000000088", - "0x0000000000000000000000000000000000000000000000000000000000000089", - "0x000000000000000000000000000000000000000000000000000000000000008a", - "0x000000000000000000000000000000000000000000000000000000000000008b", - "0x000000000000000000000000000000000000000000000000000000000000008c", - "0x000000000000000000000000000000000000000000000000000000000000008d", - "0x000000000000000000000000000000000000000000000000000000000000008e", - "0x000000000000000000000000000000000000000000000000000000000000008f", - "0x0000000000000000000000000000000000000000000000000000000000000090", - "0x0000000000000000000000000000000000000000000000000000000000000091", - "0x0000000000000000000000000000000000000000000000000000000000000092", - "0x0000000000000000000000000000000000000000000000000000000000000093", - "0x0000000000000000000000000000000000000000000000000000000000000094", - "0x0000000000000000000000000000000000000000000000000000000000000095", - "0x0000000000000000000000000000000000000000000000000000000000000096", - "0x0000000000000000000000000000000000000000000000000000000000000097", - "0x0000000000000000000000000000000000000000000000000000000000000098", - "0x0000000000000000000000000000000000000000000000000000000000000099", - "0x000000000000000000000000000000000000000000000000000000000000009a", - "0x000000000000000000000000000000000000000000000000000000000000009b", - "0x000000000000000000000000000000000000000000000000000000000000009c", - "0x000000000000000000000000000000000000000000000000000000000000009d", - "0x000000000000000000000000000000000000000000000000000000000000009e", - "0x000000000000000000000000000000000000000000000000000000000000009f", - "0x00000000000000000000000000000000000000000000000000000000000000a0", - "0x00000000000000000000000000000000000000000000000000000000000000a1", - "0x00000000000000000000000000000000000000000000000000000000000000a2", - "0x00000000000000000000000000000000000000000000000000000000000000a3", - "0x00000000000000000000000000000000000000000000000000000000000000a4", - "0x00000000000000000000000000000000000000000000000000000000000000a5", - "0x00000000000000000000000000000000000000000000000000000000000000a6", - "0x00000000000000000000000000000000000000000000000000000000000000a7", - "0x00000000000000000000000000000000000000000000000000000000000000a8", - "0x00000000000000000000000000000000000000000000000000000000000000a9", - "0x00000000000000000000000000000000000000000000000000000000000000aa", - "0x00000000000000000000000000000000000000000000000000000000000000ab", - "0x00000000000000000000000000000000000000000000000000000000000000ac", - "0x00000000000000000000000000000000000000000000000000000000000000ad", - "0x00000000000000000000000000000000000000000000000000000000000000ae", - "0x00000000000000000000000000000000000000000000000000000000000000af", - "0x00000000000000000000000000000000000000000000000000000000000000b0", - "0x00000000000000000000000000000000000000000000000000000000000000b1", - "0x00000000000000000000000000000000000000000000000000000000000000b2", - "0x00000000000000000000000000000000000000000000000000000000000000b3", - "0x00000000000000000000000000000000000000000000000000000000000000b4", - "0x00000000000000000000000000000000000000000000000000000000000000b5", - "0x00000000000000000000000000000000000000000000000000000000000000b6", - "0x00000000000000000000000000000000000000000000000000000000000000b7", - "0x00000000000000000000000000000000000000000000000000000000000000b8", - "0x00000000000000000000000000000000000000000000000000000000000000b9", - "0x00000000000000000000000000000000000000000000000000000000000000ba", - "0x00000000000000000000000000000000000000000000000000000000000000bb", - "0x00000000000000000000000000000000000000000000000000000000000000bc", - "0x00000000000000000000000000000000000000000000000000000000000000bd", - "0x00000000000000000000000000000000000000000000000000000000000000be", - "0x00000000000000000000000000000000000000000000000000000000000000bf", - "0x00000000000000000000000000000000000000000000000000000000000000c0", - "0x00000000000000000000000000000000000000000000000000000000000000c1", - "0x00000000000000000000000000000000000000000000000000000000000000c2", - "0x00000000000000000000000000000000000000000000000000000000000000c3", - "0x00000000000000000000000000000000000000000000000000000000000000c4", - "0x00000000000000000000000000000000000000000000000000000000000000c5", - "0x00000000000000000000000000000000000000000000000000000000000000c6", - "0x00000000000000000000000000000000000000000000000000000000000000c7", - "0x00000000000000000000000000000000000000000000000000000000000000c8", - "0x00000000000000000000000000000000000000000000000000000000000000c9", - "0x00000000000000000000000000000000000000000000000000000000000000ca", - "0x00000000000000000000000000000000000000000000000000000000000000cb", - "0x00000000000000000000000000000000000000000000000000000000000000cc", - "0x00000000000000000000000000000000000000000000000000000000000000cd", - "0x00000000000000000000000000000000000000000000000000000000000000ce", - "0x00000000000000000000000000000000000000000000000000000000000000cf", - "0x00000000000000000000000000000000000000000000000000000000000000d0", - "0x00000000000000000000000000000000000000000000000000000000000000d1", - "0x00000000000000000000000000000000000000000000000000000000000000d2", - "0x00000000000000000000000000000000000000000000000000000000000000d3", - "0x00000000000000000000000000000000000000000000000000000000000000d4", - "0x00000000000000000000000000000000000000000000000000000000000000d5", - "0x00000000000000000000000000000000000000000000000000000000000000d6", - "0x00000000000000000000000000000000000000000000000000000000000000d7", - "0x00000000000000000000000000000000000000000000000000000000000000d8", - "0x00000000000000000000000000000000000000000000000000000000000000d9", - "0x00000000000000000000000000000000000000000000000000000000000000da", - "0x00000000000000000000000000000000000000000000000000000000000000db", - "0x00000000000000000000000000000000000000000000000000000000000000dc", - "0x00000000000000000000000000000000000000000000000000000000000000dd", - "0x00000000000000000000000000000000000000000000000000000000000000de", - "0x00000000000000000000000000000000000000000000000000000000000000df", - "0x00000000000000000000000000000000000000000000000000000000000000e0", - "0x00000000000000000000000000000000000000000000000000000000000000e1", - "0x00000000000000000000000000000000000000000000000000000000000000e2", - "0x00000000000000000000000000000000000000000000000000000000000000e3", - "0x00000000000000000000000000000000000000000000000000000000000000e4", - "0x00000000000000000000000000000000000000000000000000000000000000e5", - "0x00000000000000000000000000000000000000000000000000000000000000e6", - "0x00000000000000000000000000000000000000000000000000000000000000e7", - "0x00000000000000000000000000000000000000000000000000000000000000e8", - "0x00000000000000000000000000000000000000000000000000000000000000e9", - "0x00000000000000000000000000000000000000000000000000000000000000ea", - "0x00000000000000000000000000000000000000000000000000000000000000eb", - "0x00000000000000000000000000000000000000000000000000000000000000ec", - "0x00000000000000000000000000000000000000000000000000000000000000ed", - "0x00000000000000000000000000000000000000000000000000000000000000ee", - "0x00000000000000000000000000000000000000000000000000000000000000ef", - "0x00000000000000000000000000000000000000000000000000000000000000f0", - "0x00000000000000000000000000000000000000000000000000000000000000f1", - "0x00000000000000000000000000000000000000000000000000000000000000f2", - "0x00000000000000000000000000000000000000000000000000000000000000f3", - "0x00000000000000000000000000000000000000000000000000000000000000f4", - "0x00000000000000000000000000000000000000000000000000000000000000f5", - "0x00000000000000000000000000000000000000000000000000000000000000f6", - "0x00000000000000000000000000000000000000000000000000000000000000f7", - "0x00000000000000000000000000000000000000000000000000000000000000f8", - "0x00000000000000000000000000000000000000000000000000000000000000f9", - "0x00000000000000000000000000000000000000000000000000000000000000fa", - "0x00000000000000000000000000000000000000000000000000000000000000fb", - "0x00000000000000000000000000000000000000000000000000000000000000fc", - "0x00000000000000000000000000000000000000000000000000000000000000fd", - "0x00000000000000000000000000000000000000000000000000000000000000fe", - "0x00000000000000000000000000000000000000000000000000000000000000ff", - "0x0000000000000000000000000000000000000000000000000000000000000100", - "0x0000000000000000000000000000000000000000000000000000000000000101", - "0x0000000000000000000000000000000000000000000000000000000000000102", - "0x0000000000000000000000000000000000000000000000000000000000000103", - "0x0000000000000000000000000000000000000000000000000000000000000104", - "0x0000000000000000000000000000000000000000000000000000000000000105", - "0x0000000000000000000000000000000000000000000000000000000000000106", - "0x0000000000000000000000000000000000000000000000000000000000000107", - "0x0000000000000000000000000000000000000000000000000000000000000108", - "0x0000000000000000000000000000000000000000000000000000000000000109", - "0x000000000000000000000000000000000000000000000000000000000000010a", - "0x000000000000000000000000000000000000000000000000000000000000010b", - "0x000000000000000000000000000000000000000000000000000000000000010c", - "0x000000000000000000000000000000000000000000000000000000000000010d", - "0x000000000000000000000000000000000000000000000000000000000000010e", - "0x000000000000000000000000000000000000000000000000000000000000010f", - "0x0000000000000000000000000000000000000000000000000000000000000110", - "0x0000000000000000000000000000000000000000000000000000000000000111", - "0x0000000000000000000000000000000000000000000000000000000000000112", - "0x0000000000000000000000000000000000000000000000000000000000000113", - "0x0000000000000000000000000000000000000000000000000000000000000114", - "0x0000000000000000000000000000000000000000000000000000000000000115", - "0x0000000000000000000000000000000000000000000000000000000000000116", - "0x0000000000000000000000000000000000000000000000000000000000000117", - "0x0000000000000000000000000000000000000000000000000000000000000118", - "0x0000000000000000000000000000000000000000000000000000000000000119", - "0x000000000000000000000000000000000000000000000000000000000000011a", - "0x000000000000000000000000000000000000000000000000000000000000011b", - "0x000000000000000000000000000000000000000000000000000000000000011c", - "0x000000000000000000000000000000000000000000000000000000000000011d", - "0x000000000000000000000000000000000000000000000000000000000000011e", - "0x000000000000000000000000000000000000000000000000000000000000011f", - "0x0000000000000000000000000000000000000000000000000000000000000120", - "0x0000000000000000000000000000000000000000000000000000000000000121", - "0x0000000000000000000000000000000000000000000000000000000000000122", - "0x0000000000000000000000000000000000000000000000000000000000000123", - "0x0000000000000000000000000000000000000000000000000000000000000124", - "0x0000000000000000000000000000000000000000000000000000000000000125", - "0x0000000000000000000000000000000000000000000000000000000000000126", - "0x0000000000000000000000000000000000000000000000000000000000000127", - "0x0000000000000000000000000000000000000000000000000000000000000128", - "0x0000000000000000000000000000000000000000000000000000000000000129", - "0x000000000000000000000000000000000000000000000000000000000000012a", - "0x000000000000000000000000000000000000000000000000000000000000012b", - "0x000000000000000000000000000000000000000000000000000000000000012c", - "0x000000000000000000000000000000000000000000000000000000000000012d", - "0x000000000000000000000000000000000000000000000000000000000000012e", - "0x000000000000000000000000000000000000000000000000000000000000012f", - "0x0000000000000000000000000000000000000000000000000000000000000130", - "0x0000000000000000000000000000000000000000000000000000000000000131", - "0x0000000000000000000000000000000000000000000000000000000000000132", - "0x0000000000000000000000000000000000000000000000000000000000000133", - "0x0000000000000000000000000000000000000000000000000000000000000134", - "0x0000000000000000000000000000000000000000000000000000000000000135", - "0x0000000000000000000000000000000000000000000000000000000000000136", - "0x0000000000000000000000000000000000000000000000000000000000000137", - "0x0000000000000000000000000000000000000000000000000000000000000138", - "0x0000000000000000000000000000000000000000000000000000000000000139", - "0x000000000000000000000000000000000000000000000000000000000000013a", - "0x000000000000000000000000000000000000000000000000000000000000013b", - "0x000000000000000000000000000000000000000000000000000000000000013c", - "0x000000000000000000000000000000000000000000000000000000000000013d", - "0x000000000000000000000000000000000000000000000000000000000000013e", - "0x000000000000000000000000000000000000000000000000000000000000013f", - "0x0000000000000000000000000000000000000000000000000000000000000140", - "0x0000000000000000000000000000000000000000000000000000000000000141", - "0x0000000000000000000000000000000000000000000000000000000000000142", - "0x0000000000000000000000000000000000000000000000000000000000000143", - "0x0000000000000000000000000000000000000000000000000000000000000144", - "0x0000000000000000000000000000000000000000000000000000000000000145", - "0x0000000000000000000000000000000000000000000000000000000000000146", - "0x0000000000000000000000000000000000000000000000000000000000000147", - "0x0000000000000000000000000000000000000000000000000000000000000148", - "0x0000000000000000000000000000000000000000000000000000000000000149", - "0x000000000000000000000000000000000000000000000000000000000000014a", - "0x000000000000000000000000000000000000000000000000000000000000014b", - "0x000000000000000000000000000000000000000000000000000000000000014c", - "0x000000000000000000000000000000000000000000000000000000000000014d", - "0x000000000000000000000000000000000000000000000000000000000000014e", - "0x000000000000000000000000000000000000000000000000000000000000014f", - "0x0000000000000000000000000000000000000000000000000000000000000150", - "0x0000000000000000000000000000000000000000000000000000000000000151", - "0x0000000000000000000000000000000000000000000000000000000000000152", - "0x0000000000000000000000000000000000000000000000000000000000000153", - "0x0000000000000000000000000000000000000000000000000000000000000154", - "0x0000000000000000000000000000000000000000000000000000000000000155", - "0x0000000000000000000000000000000000000000000000000000000000000156", - "0x0000000000000000000000000000000000000000000000000000000000000157", - "0x0000000000000000000000000000000000000000000000000000000000000158", - "0x0000000000000000000000000000000000000000000000000000000000000159", - "0x000000000000000000000000000000000000000000000000000000000000015a", - "0x000000000000000000000000000000000000000000000000000000000000015b", - "0x000000000000000000000000000000000000000000000000000000000000015c", - "0x000000000000000000000000000000000000000000000000000000000000015d", - "0x000000000000000000000000000000000000000000000000000000000000015e", - "0x000000000000000000000000000000000000000000000000000000000000015f", - "0x0000000000000000000000000000000000000000000000000000000000000160", - "0x0000000000000000000000000000000000000000000000000000000000000161", - "0x0000000000000000000000000000000000000000000000000000000000000162", - "0x0000000000000000000000000000000000000000000000000000000000000163", - "0x0000000000000000000000000000000000000000000000000000000000000164", - "0x0000000000000000000000000000000000000000000000000000000000000165", - "0x0000000000000000000000000000000000000000000000000000000000000166", - "0x0000000000000000000000000000000000000000000000000000000000000167", - "0x0000000000000000000000000000000000000000000000000000000000000168", - "0x0000000000000000000000000000000000000000000000000000000000000169", - "0x000000000000000000000000000000000000000000000000000000000000016a", - "0x000000000000000000000000000000000000000000000000000000000000016b", - "0x000000000000000000000000000000000000000000000000000000000000016c", - "0x000000000000000000000000000000000000000000000000000000000000016d", - "0x000000000000000000000000000000000000000000000000000000000000016e", - "0x000000000000000000000000000000000000000000000000000000000000016f", - "0x0000000000000000000000000000000000000000000000000000000000000170", - "0x0000000000000000000000000000000000000000000000000000000000000171", - "0x0000000000000000000000000000000000000000000000000000000000000172", - "0x0000000000000000000000000000000000000000000000000000000000000173", - "0x0000000000000000000000000000000000000000000000000000000000000174", - "0x0000000000000000000000000000000000000000000000000000000000000175", - "0x0000000000000000000000000000000000000000000000000000000000000176", - "0x0000000000000000000000000000000000000000000000000000000000000177", - "0x0000000000000000000000000000000000000000000000000000000000000178", - "0x0000000000000000000000000000000000000000000000000000000000000179", - "0x000000000000000000000000000000000000000000000000000000000000017a", - "0x000000000000000000000000000000000000000000000000000000000000017b", - "0x000000000000000000000000000000000000000000000000000000000000017c", - "0x000000000000000000000000000000000000000000000000000000000000017d", - "0x000000000000000000000000000000000000000000000000000000000000017e", - "0x000000000000000000000000000000000000000000000000000000000000017f", - "0x0000000000000000000000000000000000000000000000000000000000000180", - "0x0000000000000000000000000000000000000000000000000000000000000181", - "0x0000000000000000000000000000000000000000000000000000000000000182", - "0x0000000000000000000000000000000000000000000000000000000000000183", - "0x0000000000000000000000000000000000000000000000000000000000000184", - "0x0000000000000000000000000000000000000000000000000000000000000185", - "0x0000000000000000000000000000000000000000000000000000000000000186", - "0x0000000000000000000000000000000000000000000000000000000000000187", - "0x0000000000000000000000000000000000000000000000000000000000000188", - "0x0000000000000000000000000000000000000000000000000000000000000189", - "0x000000000000000000000000000000000000000000000000000000000000018a", - "0x000000000000000000000000000000000000000000000000000000000000018b", - "0x000000000000000000000000000000000000000000000000000000000000018c", - "0x000000000000000000000000000000000000000000000000000000000000018d", - "0x000000000000000000000000000000000000000000000000000000000000018e", - "0x000000000000000000000000000000000000000000000000000000000000018f", - "0x0000000000000000000000000000000000000000000000000000000000000190", - "0x0000000000000000000000000000000000000000000000000000000000000191", - "0x0000000000000000000000000000000000000000000000000000000000000192", - "0x0000000000000000000000000000000000000000000000000000000000000193", - "0x0000000000000000000000000000000000000000000000000000000000000194", - "0x0000000000000000000000000000000000000000000000000000000000000195", - "0x0000000000000000000000000000000000000000000000000000000000000196", - "0x0000000000000000000000000000000000000000000000000000000000000197", - "0x0000000000000000000000000000000000000000000000000000000000000198", - "0x0000000000000000000000000000000000000000000000000000000000000199", - "0x000000000000000000000000000000000000000000000000000000000000019a", - "0x000000000000000000000000000000000000000000000000000000000000019b", - "0x000000000000000000000000000000000000000000000000000000000000019c", - "0x000000000000000000000000000000000000000000000000000000000000019d", - "0x000000000000000000000000000000000000000000000000000000000000019e", - "0x000000000000000000000000000000000000000000000000000000000000019f", - "0x00000000000000000000000000000000000000000000000000000000000001a0", - "0x00000000000000000000000000000000000000000000000000000000000001a1", - "0x00000000000000000000000000000000000000000000000000000000000001a2", - "0x00000000000000000000000000000000000000000000000000000000000001a3", - "0x00000000000000000000000000000000000000000000000000000000000001a4", - "0x00000000000000000000000000000000000000000000000000000000000001a5", - "0x00000000000000000000000000000000000000000000000000000000000001a6", - "0x00000000000000000000000000000000000000000000000000000000000001a7", - "0x00000000000000000000000000000000000000000000000000000000000001a8", - "0x00000000000000000000000000000000000000000000000000000000000001a9", - "0x00000000000000000000000000000000000000000000000000000000000001aa", - "0x00000000000000000000000000000000000000000000000000000000000001ab", - "0x00000000000000000000000000000000000000000000000000000000000001ac", - "0x00000000000000000000000000000000000000000000000000000000000001ad", - "0x00000000000000000000000000000000000000000000000000000000000001ae", - "0x00000000000000000000000000000000000000000000000000000000000001af", - "0x00000000000000000000000000000000000000000000000000000000000001b0", - "0x00000000000000000000000000000000000000000000000000000000000001b1", - "0x00000000000000000000000000000000000000000000000000000000000001b2", - "0x00000000000000000000000000000000000000000000000000000000000001b3", - "0x00000000000000000000000000000000000000000000000000000000000001b4", - "0x00000000000000000000000000000000000000000000000000000000000001b5", - "0x00000000000000000000000000000000000000000000000000000000000001b6", - "0x00000000000000000000000000000000000000000000000000000000000001b7", - "0x00000000000000000000000000000000000000000000000000000000000001b8", - "0x00000000000000000000000000000000000000000000000000000000000001b9", - "0x00000000000000000000000000000000000000000000000000000000000001ba", - "0x00000000000000000000000000000000000000000000000000000000000001bb", - "0x00000000000000000000000000000000000000000000000000000000000001bc", - "0x00000000000000000000000000000000000000000000000000000000000001bd", - "0x00000000000000000000000000000000000000000000000000000000000001be", - "0x00000000000000000000000000000000000000000000000000000000000001bf", - "0x00000000000000000000000000000000000000000000000000000000000001c0", - "0x00000000000000000000000000000000000000000000000000000000000001c1", - "0x00000000000000000000000000000000000000000000000000000000000001c2", - "0x00000000000000000000000000000000000000000000000000000000000001c3", - "0x00000000000000000000000000000000000000000000000000000000000001c4", - "0x00000000000000000000000000000000000000000000000000000000000001c5", - "0x00000000000000000000000000000000000000000000000000000000000001c6", - "0x00000000000000000000000000000000000000000000000000000000000001c7", - "0x00000000000000000000000000000000000000000000000000000000000001c8", - "0x00000000000000000000000000000000000000000000000000000000000001c9", - "0x00000000000000000000000000000000000000000000000000000000000001ca", - "0x00000000000000000000000000000000000000000000000000000000000001cb", - "0x00000000000000000000000000000000000000000000000000000000000001cc", - "0x00000000000000000000000000000000000000000000000000000000000001cd", - "0x00000000000000000000000000000000000000000000000000000000000001ce", - "0x00000000000000000000000000000000000000000000000000000000000001cf" -] - -[inputs.tube_data.vk_data] -vk_index = "0x0000000000000000000000000000000000000000000000000000000000000001" -vk_path = [ - "0x1bac5dbe94e5f6fc3f2438c62bf353f447f595aabb7415e3f6777d02259c8f6b", - "0x0c33ab6b1652829a9204dcabd2c6570028acf35ec4ceb6e9723ed19e1452a2a0", - "0x281a8c9b2c044cffa01e5f56858d1d71aa11c4b28a1e90407565ca646ea0ee5d", - "0x25e71fd64ecaa6b98ef492c6d93da8164a259284041220c258edb94fe47706ab", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" -] - - [inputs.tube_data.vk_data.vk] - key = [ - "0x0000000000000000000000000000000000000000000000000000000000100000", - "0x00000000000000000000000000000000000000000000000000000000000003ce", - "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x00000000000000000000000000000000000000000000000000000000000003be", - "0x00000000000000000000000000000000000000000000000000000000000003bf", - "0x00000000000000000000000000000000000000000000000000000000000003c0", - "0x00000000000000000000000000000000000000000000000000000000000003c1", - "0x00000000000000000000000000000000000000000000000000000000000003c2", - "0x00000000000000000000000000000000000000000000000000000000000003c3", - "0x00000000000000000000000000000000000000000000000000000000000003c4", - "0x00000000000000000000000000000000000000000000000000000000000003c5", - "0x00000000000000000000000000000000000000000000000000000000000003c6", - "0x00000000000000000000000000000000000000000000000000000000000003c7", - "0x00000000000000000000000000000000000000000000000000000000000003c8", - "0x00000000000000000000000000000000000000000000000000000000000003c9", - "0x00000000000000000000000000000000000000000000000000000000000003ca", - "0x00000000000000000000000000000000000000000000000000000000000003cb", - "0x00000000000000000000000000000000000000000000000000000000000003cc", - "0x00000000000000000000000000000000000000000000000000000000000003cd", - "0x000000000000000000000000000000b01dcdd818b763ddcc3196110183a863ad", - "0x000000000000000000000000000000000010b97a764d80459e3ea66267e0ec36", - "0x0000000000000000000000000000008c61789e067608f101e4ad14836c35dd63", - "0x0000000000000000000000000000000000227f916198d023441650b4a171c625", - "0x000000000000000000000000000000a2c75ff34d33e05c2c38d10f31ca1ad0c3", - "0x00000000000000000000000000000000001469af5b6c7838ca13fef70f2d222d", - "0x000000000000000000000000000000baadbbfd0cd9fdb166aa4e338c754b11fa", - "0x000000000000000000000000000000000010763d0ffe3ae2563345dca1cc04f3", - "0x00000000000000000000000000000065871376c3131bc6ff1aba50b6a258367e", - "0x000000000000000000000000000000000008b7fffd65adaa37074ecee1e82c6b", - "0x000000000000000000000000000000eb8b40d304da7733050a325c3deb27c652", - "0x0000000000000000000000000000000000004de03f8cc6ebbab9c70b77d0bb25", - "0x00000000000000000000000000000098b5b1ecaf37e67200ee9edda87c3e7335", - "0x00000000000000000000000000000000002386a233bf3ae8bd12a3fb57674b5a", - "0x000000000000000000000000000000cb463c2eba7cf854a63069062aa2a62588", - "0x000000000000000000000000000000000010ff82136ecdcd03ed27a9e8f2740a", - "0x000000000000000000000000000000cc627c788b4e0dd3fb9e81b62d265b5a1e", - "0x00000000000000000000000000000000001af01d596c61d5a3b920612c9085ba", - "0x00000000000000000000000000000096dc86a247fbbd8fd491bfd38f9bfc4142", - "0x000000000000000000000000000000000011d5502d5f9cc7ada270a21bc9fea8", - "0x0000000000000000000000000000004d8b49b50e2b236f193e973eafda523e38", - "0x000000000000000000000000000000000029e00babe75c3ec5d10b71a513b01b", - "0x0000000000000000000000000000001ca9a40123edf4279d59f9ef93d1397432", - "0x000000000000000000000000000000000024847cd54688ae0389adc483207897", - "0x000000000000000000000000000000d031997148e9e5d9022fe85126410f1428", - "0x0000000000000000000000000000000000028aef4a4f12d9d720d12385338b61", - "0x0000000000000000000000000000006021bd4e397a73cf5e07ac343e6e58e923", - "0x0000000000000000000000000000000000203ea6ba299d820149e54a5fb96bab", - "0x00000000000000000000000000000012649851fa6159e2451485d8ce7217cc5b", - "0x00000000000000000000000000000000000e7ea0fe745b3ad0375ae52079f4d4", - "0x00000000000000000000000000000058fd78cbf8405da74ffac0a2165eda05a7", - "0x000000000000000000000000000000000022ba81404ecca56aab20f89eead81e", - "0x000000000000000000000000000000580b0dfe44ea39b59123690be70554d96f", - "0x00000000000000000000000000000000001ff008a106b062de32007e3719f210", - "0x0000000000000000000000000000005f4201182fe261eae2baa6152aa24d649e", - "0x00000000000000000000000000000000001ed1f024199f1541085a1c3d642c12", - "0x0000000000000000000000000000003d116b22e867bf7b3fa9e5521ec58ad780", - "0x00000000000000000000000000000000001c164e2fa54d93ecb0bb1179e406a5", - "0x000000000000000000000000000000bfa5aac725260e40cd531cee9bfd77b2bb", - "0x0000000000000000000000000000000000064f96893967ece029e28c9efd861b", - "0x000000000000000000000000000000c58e8afe82ddc1a87c3dde063cb807c6e5", - "0x00000000000000000000000000000000001252c9710709ad673d407fde40a8bc", - "0x000000000000000000000000000000e1f1a0e392f383423fb8e32b15df04e55e", - "0x00000000000000000000000000000000001b5e13b229f319c3bb56717fc6477a", - "0x000000000000000000000000000000508999c14ea9e5e289dffc4f1ce703ffef", - "0x000000000000000000000000000000000010315af4ce040653c21dd54ac79254", - "0x000000000000000000000000000000fbc8d0c00c5d9df5afd861045d1903fda1", - "0x0000000000000000000000000000000000225de32517a409ba15496cd71d8d0f", - "0x000000000000000000000000000000c63969628c3acb2027a741f317240ccec8", - "0x00000000000000000000000000000000002062a1ff9ff1a28d73a6103e6bce6e", - "0x0000000000000000000000000000005cd3c19234d72722e75312aab9c4a407dc", - "0x00000000000000000000000000000000000b08752fc23489958af833ac7ee92a", - "0x0000000000000000000000000000000bfb29ccebc4a214fa3ddbec2146241dbe", - "0x00000000000000000000000000000000000c9aae439752005c92fe04c18b5ec7", - "0x0000000000000000000000000000007884b5096d6f3013fb4820dfa036d30606", - "0x0000000000000000000000000000000000027e338f01ad196b0796ab610e100f", - "0x000000000000000000000000000000406aad63a9adba49deffe530927f701ec5", - "0x00000000000000000000000000000000001b5de9a425ec1f3d7e73b2c6831fea", - "0x000000000000000000000000000000926608961986848d4220f4875316e5f43a", - "0x00000000000000000000000000000000000444cf15b0338d65c8217b4cc732e7", - "0x0000000000000000000000000000007fced189975af80b95ef39c49cd997d4ed", - "0x00000000000000000000000000000000002ef7c1afef3dd70f5e42428207fdb2", - "0x000000000000000000000000000000e363eced2728878262866034dc93ca7fa5", - "0x00000000000000000000000000000000000554cc00deacbb487ae19c82ba133c", - "0x0000000000000000000000000000003ca6cadeacebd46bbb63fdd13153a3e5e7", - "0x000000000000000000000000000000000000466f33f3446469b690403adeb4ce", - "0x0000000000000000000000000000009092fc698f08280c87f30de9d5e07af47d", - "0x000000000000000000000000000000000014e7f3c4745fbc3c1f3be44f88589e", - "0x0000000000000000000000000000005eeb50188b2c9c0a6477ac2f528abab6c0", - "0x00000000000000000000000000000000000f617b59f7e11dc456b9c588203145", - "0x000000000000000000000000000000363328b414ac171f809b938ad6f32f8d5c", - "0x00000000000000000000000000000000000418c1e289821bbcdcb347244e16c4", - "0x0000000000000000000000000000005932073632f82445bb5dcc9615e9ca0445", - "0x00000000000000000000000000000000001de0c9779664b0de7084b26b602cbb", - "0x000000000000000000000000000000ee7cf83eb7b2fdb0f9007ee18d1be0c4c3", - "0x00000000000000000000000000000000002f7698d8b16391e521ff45d438bcca", - "0x000000000000000000000000000000a07dc87bae19be6e5b8b4c34b1113741e6", - "0x0000000000000000000000000000000000008b68fc95ddbf53703df928289dbf", - "0x00000000000000000000000000000086520d3ff63025666b56669a9fc2210d1b", - "0x00000000000000000000000000000000002017458a1b67a1603bdb18fb79e9d7", - "0x000000000000000000000000000000fd4db5556deebccf57f38ac9e2abda9b45", - "0x000000000000000000000000000000000026499030b0d739964d1e2e58b7bcc2", - "0x0000000000000000000000000000001eebba2c4c3142468f0e5af8665863c9a5", - "0x00000000000000000000000000000000000d5bf766f3c6153003528b7a498188", - "0x0000000000000000000000000000003acc6def4164d878b56e5b2fe2bfa52199", - "0x000000000000000000000000000000000022cf69996ae471056bcae7b3c38cbc", - "0x000000000000000000000000000000239623839c51be6ffe83c77c80b8f94ad5", - "0x0000000000000000000000000000000000075cc2c3c9e3079bec86764aa5cfd0", - "0x0000000000000000000000000000008c88b485298919bf7164440942d6f6c5ad", - "0x00000000000000000000000000000000000c5dd6e29eac9076cc2f5995fcf27c", - "0x0000000000000000000000000000005b7ac436f888999a48f79ef212e6483f14", - "0x000000000000000000000000000000000009fc56f5a2122d1ed9353860ba68ab", - "0x000000000000000000000000000000dace4e23bf41b55e3098bd8e82e74b1c1e", - "0x00000000000000000000000000000000000883499c226658d83b4d0cc7b08c15", - "0x0000000000000000000000000000005c0373d8b286bf727301571a54e1636e77", - "0x00000000000000000000000000000000001f268c0945bdea494fbfc52e8581c1", - "0x000000000000000000000000000000c6b7e770c1e62e2504ce986f21324ff939", - "0x000000000000000000000000000000000001b92f92042ae2556e31cf72cc3990", - "0x0000000000000000000000000000007007220c2c02f4ec2c1c5fada9056b8c37", - "0x00000000000000000000000000000000003038ffe6284e174445a0eb11a63e0b", - "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000006157c1b0c396d9b2499334bd0eeecc05b1", - "0x0000000000000000000000000000000000116a8f041212e254f46df65af74a8e", - "0x000000000000000000000000000000bcb599d3a4a974f4a27a331cf552a4a444", - "0x00000000000000000000000000000000000818aec4979cfbad995d06cd63c7cb" -] - hash = "0x25788ad2f257dc7828abc3b3b93cd571a106a13f64ad6bfe0f715238a9593318" - -[inputs.start.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x00000000000000000000000000000000000000000000000000000000000003c0" - -[inputs.start.nullifier_tree] -root = "0x0b3cd059f3a14d1fc149e845404ee3733e58010456792a3f61c3803f4ddd1248" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000440" - -[inputs.start.public_data_tree] -root = "0x28b5d86e557e528de4452115c3b6ca2b8075465411e73f310c843fa8d2b5faad" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" - -[inputs.start_sponge_blob] -fields = "0x0000000000000000000000000000000000000000000000000000000000000009" -expected_fields = "0x0000000000000000000000000000000000000000000000000000000000000009" - - [inputs.start_sponge_blob.sponge] - cache = [ - "0x0000000000000000000000000000000000000000000000000000000000002328", - "0x0d38d167da0ccd3ba447ce36953062d88783b02447d5af2bd09519bcd2a928f4", - "0x00000000000000000000000000000000000000000000000000000000000003e8" -] - state = [ - "0x05dc8cfb21681a19bd8e67518d2b9e22d31ba0380ecbb3653e00daa9dabe7e56", - "0x0ebafbb8e482cfd14bfe06b18ba8ef29493892e5c55e9b5ed16ede0e4cfe7562", - "0x22fa4ea0b8f5633a4701f717c52914a96bc5be0e69d2e84d86b4a1a717dfac6d", - "0x0991732e4b69f8065c9beb388f953e963baab29beb67084560f6116c9fdec042" -] - cache_size = "0x0000000000000000000000000000000000000000000000000000000000000003" - squeeze_mode = false - -[inputs.state_diff_hints] -sorted_nullifiers = [ "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -2080,116 +1444,838 @@ sorted_nullifiers = [ "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000" -] -sorted_nullifier_indexes = [ "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000001", - "0x0000000000000000000000000000000000000000000000000000000000000002", - "0x0000000000000000000000000000000000000000000000000000000000000003", - "0x0000000000000000000000000000000000000000000000000000000000000004", - "0x0000000000000000000000000000000000000000000000000000000000000005", - "0x0000000000000000000000000000000000000000000000000000000000000006", - "0x0000000000000000000000000000000000000000000000000000000000000007", - "0x0000000000000000000000000000000000000000000000000000000000000008", - "0x0000000000000000000000000000000000000000000000000000000000000009", - "0x000000000000000000000000000000000000000000000000000000000000000a", - "0x000000000000000000000000000000000000000000000000000000000000000b", - "0x000000000000000000000000000000000000000000000000000000000000000c", - "0x000000000000000000000000000000000000000000000000000000000000000d", - "0x000000000000000000000000000000000000000000000000000000000000000e", - "0x000000000000000000000000000000000000000000000000000000000000000f", - "0x0000000000000000000000000000000000000000000000000000000000000010", - "0x0000000000000000000000000000000000000000000000000000000000000011", - "0x0000000000000000000000000000000000000000000000000000000000000012", - "0x0000000000000000000000000000000000000000000000000000000000000013", - "0x0000000000000000000000000000000000000000000000000000000000000014", - "0x0000000000000000000000000000000000000000000000000000000000000015", - "0x0000000000000000000000000000000000000000000000000000000000000016", - "0x0000000000000000000000000000000000000000000000000000000000000017", - "0x0000000000000000000000000000000000000000000000000000000000000018", - "0x0000000000000000000000000000000000000000000000000000000000000019", - "0x000000000000000000000000000000000000000000000000000000000000001a", - "0x000000000000000000000000000000000000000000000000000000000000001b", - "0x000000000000000000000000000000000000000000000000000000000000001c", - "0x000000000000000000000000000000000000000000000000000000000000001d", - "0x000000000000000000000000000000000000000000000000000000000000001e", - "0x000000000000000000000000000000000000000000000000000000000000001f", - "0x0000000000000000000000000000000000000000000000000000000000000020", - "0x0000000000000000000000000000000000000000000000000000000000000021", - "0x0000000000000000000000000000000000000000000000000000000000000022", - "0x0000000000000000000000000000000000000000000000000000000000000023", - "0x0000000000000000000000000000000000000000000000000000000000000024", - "0x0000000000000000000000000000000000000000000000000000000000000025", - "0x0000000000000000000000000000000000000000000000000000000000000026", - "0x0000000000000000000000000000000000000000000000000000000000000027", - "0x0000000000000000000000000000000000000000000000000000000000000028", - "0x0000000000000000000000000000000000000000000000000000000000000029", - "0x000000000000000000000000000000000000000000000000000000000000002a", - "0x000000000000000000000000000000000000000000000000000000000000002b", - "0x000000000000000000000000000000000000000000000000000000000000002c", - "0x000000000000000000000000000000000000000000000000000000000000002d", - "0x000000000000000000000000000000000000000000000000000000000000002e", - "0x000000000000000000000000000000000000000000000000000000000000002f", - "0x0000000000000000000000000000000000000000000000000000000000000030", - "0x0000000000000000000000000000000000000000000000000000000000000031", - "0x0000000000000000000000000000000000000000000000000000000000000032", - "0x0000000000000000000000000000000000000000000000000000000000000033", - "0x0000000000000000000000000000000000000000000000000000000000000034", - "0x0000000000000000000000000000000000000000000000000000000000000035", - "0x0000000000000000000000000000000000000000000000000000000000000036", - "0x0000000000000000000000000000000000000000000000000000000000000037", - "0x0000000000000000000000000000000000000000000000000000000000000038", - "0x0000000000000000000000000000000000000000000000000000000000000039", - "0x000000000000000000000000000000000000000000000000000000000000003a", - "0x000000000000000000000000000000000000000000000000000000000000003b", - "0x000000000000000000000000000000000000000000000000000000000000003c", - "0x000000000000000000000000000000000000000000000000000000000000003d", - "0x000000000000000000000000000000000000000000000000000000000000003e", - "0x000000000000000000000000000000000000000000000000000000000000003f" -] -note_hash_subtree_sibling_path = [ - "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", - "0x0af87d98c040dfadabf7ef27165e88560ef39d0c923b6534466a98f672ed8c88", - "0x246218a1d11c91124c20e3394600ad16e5036e2b84aa6afcc8cf3422fd29b02c", - "0x1196b37a9f45bda9848dd661f2df18622a6b4efed01b1cb9eae812f3bf0bc0de", - "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", - "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", - "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", - "0x1c4954081e324939350febc2b918a293ebcdaead01be95ec02fcbe8d2c1635d1", - "0x0197f2171ef99c2d053ee1fb5ff5ab288d56b9b41b4716c9214a4d97facc4c4a", - "0x2b9cdd484c5ba1e4d6efcc3f18734b5ac4c4a0b9102e2aeb48521a661d3feee9", - "0x14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3", - "0x071d7627ae3b2eabda8a810227bf04206370ac78dbf6c372380182dbd3711fe3", - "0x2fdc08d9fe075ac58cb8c00f98697861a13b3ab6f9d41a4e768f75e477475bf5", - "0x20165fe405652104dceaeeca92950aa5adc571b8cafe192878cba58ff1be49c5", - "0x1c8c3ca0b3a3d75850fcd4dc7bf1e3445cd0cfff3ca510630fd90b47e8a24755", - "0x1f0c1a8fb16b0d2ac9a146d7ae20d8d179695a92a79ed66fc45d9da4532459b3", - "0x038146ec5a2573e1c30d2fb32c66c8440f426fbd108082df41c7bebd1d521c30", - "0x17d3d12b17fe762de4b835b2180b012e808816a7f2ff69ecb9d65188235d8fd4", - "0x0e1a6b7d63a6e5a9e54e8f391dd4e9d49cdfedcbc87f02cd34d4641d2eb30491", - "0x09244eec34977ff795fc41036996ce974136377f521ac8eb9e04642d204783d2", - "0x1646d6f544ec36df9dc41f778a7ef1690a53c730b501471b6acd202194a7e8e9", - "0x064769603ba3f6c41f664d266ecb9a3a0f6567cd3e48b40f34d4894ee4c361b3", - "0x1595bb3cd19f84619dc2e368175a88d8627a7439eda9397202cdb1167531fd3f", - "0x2a529be462b81ca30265b558763b1498289c9d88277ab14f0838cb1fce4b472c", - "0x0c08da612363088ad0bbc78abd233e8ace4c05a56fdabdd5e5e9b05e428bdaee", - "0x14748d0241710ef47f54b931ac5a58082b1d56b0f0c30d55fb71a6e8c9a6be14", - "0x0b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d", - "0x2c45bb0c3d5bc1dc98e0baef09ff46d18c1a451e724f41c2b675549bb5c80e59", - "0x121468e6710bf1ffec6d0f26743afe6f88ef55dab40b83ca0a39bc44b196374c", - "0x2042c32c823a7440ceb6c342f9125f1fe426b02c527cd8fb28c85d02b705e759", - "0x0d582c10ff8115413aa5b70564fdd2f3cefe1f33a1e43a47bc495081e91e73e5", - "0x0f55a0d491a9da093eb999fa0dffaf904620cbc78d07e63c6f795c5c7512b523", - "0x21849764e1aa64b83a69e39d27eedaec2a8f97066e5ddb74634ffdb11388dd9a", - "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" -] + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" +] + +[inputs.tube_data.vk_data] +vk_index = "0x0000000000000000000000000000000000000000000000000000000000000006" +vk_path = [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x1c5ee2f1a829cd797ee1a70819607cd863a39f3e5db2eee9e376943cadbe7c29", + "0x28271f3452f86971e3afd061cca5657de83a4edca8c368a11542927f5ac1aee6", + "0x07204dd4c0b5e97ed0e01d06354130938eb17178be6bacafbdee48057e59aa79", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" +] + + [inputs.tube_data.vk_data.vk] + key = [ + "0x057a636dd04fe2f697786c255ad641fb3af13f7aa945c82bad69b9bb798b8305", + "0x1d9c0eb06c0363c32e0d3c4cb46b5816cf54adae885e304b095a80afdb37184b", + "0x25599c4900fdd87a98f2dde8812af6afdd93a066f9185b286b52ab76b9f9236a", + "0x1b14a1f0d98e7c58a2de218f698e9e593ddeaa6e24570f56dbe51de0e560b67b", + "0x2feee9c11ac992c36d5cf1f47f218ba51648cf95e3c7277142d6aca62226caa1", + "0x1bd35610228aa64306844e20277fd205ba9b06771f1683849afeef5bfa1a05ae", + "0x2ff71fe100adf516407e99f13bb5632097361d8c4c3bf4307031a1796f93ea3e", + "0x301406a44928d74422d536cf6e29ea8eec2b292bedaf5b44561295e98c836453", + "0x16d2857563ac65f0c51defdedd5088d9e0033e295335476fde608e2681816dd1", + "0x168705ad6da4955062b2d9a75ffc8335274ea7a775d8b0bc6b47b9918ab5b3e6", + "0x28bff85ee618ef672473d7e7e904b8615a2931e0403f8d982f8c90f2d8b185b2", + "0x12b13b729c8a853f498c8fc475e1712ef8c3ebb7646b4a24e145c800152bf666", + "0x0fc9a2266a2145534220deea19017ed3759ac175b5053c15bcbfebc048afcfaf", + "0x1dbea6b06eceee5ce1f5d9164dca835ede521e1617e657180d6387f91edb3ca0", + "0x18a71947135c46b49a6c1b94f203fbbb130cacc7e3f1e6baba7b475e1a71bc6f", + "0x07a7674be05744b1cdcea87a596faf33e44a8d3dee64fb570e170c52d7a6bc17", + "0x2502c07a138b0c1dc94fc20d3fb756d97cdba352dd0fbf1adf0d754d07108f97", + "0x2e77ed53189a08c7127550d41a10ff5fd57becaa8a53e9ce8cf628f44428fdb2", + "0x2ae218d9bf9ea03723b5cd3c9148911d4aed205b26a05ee4bcb2fade50d23874", + "0x2d61abfb1633883a6cb2e1c7e168e7c19b418be8b8c0a71f7135c0178de9703a", + "0x1d4cdf488968b5935fdff9e96b246c563758dd5eb702df0b7f265de3e7038ec1", + "0x0c213e4cd587e6164eee84623cf60e18ba0afd19567b507dc279f33b53ae5c21", + "0x2e92a5005fcc6aa41eb6e0093c976ff06abe939bd038275b3757659b13bdae8d", + "0x24f5f13e3bfdec27e5be922d1bf4cd1ac8a67c51c490d7e0b59224f1188990fd", + "0x1745cc9a52aedee52d836dcdbb62fdf761a07110914e1de97b496289a3931da7", + "0x2a7b7048290c1221df3eb2621486dfeb1c761ffaafd20339a050e91d0977314c", + "0x106be76c9d09dbf181b62ca8deb1563d3f257a20335f8a1399bdcb0cd372a599", + "0x2292c3f58da67c55572165250d0f8bcfc69c84096a67345f3b969486301af5f6", + "0x02112adca89a9b37ddbed2aeaaac03470c45893a73a2f3626fdfc74546eac39e", + "0x0256d293abe3e6d002bc465f6ed018e345a99c2054f67a655b820389bae75f06", + "0x01649ceceb491c74680966a662df5e2b23b264b7b90090ca61d1341f85103739", + "0x1a2785c5d27fbdd1132efea3799053a933cfc9e42a8134fb6a93846bc3e380ca", + "0x15274b227d280b96d235b1f8976e9e0734e8f58d8ed7e225083b2cdcb6897bf3", + "0x0dcbae2693bfc9b539ee67ba8ed0618bc5ac2626ecb1f52203fddcb8e0743f71", + "0x1f473b47dae9618729bd38fb6c74de1ea112280ba385a46890625cad19bcef84", + "0x0ac03ae12a1c3d2a3ad87aff521b0cc564a2d82f402cfc6913cfe670b0db9356", + "0x033e7c61a4e691f2ebdfc87d3bea443e53aa0684f803f59ba06ade9fd8c30536", + "0x03b5b6a74d2c0267dffef16524b4341cee54d38335fcfff4be2c1bf161ad1b6a", + "0x2231d591188635c666387eb18ad1f6b3a51afe221da933cd551841cfdf2900ed", + "0x1d19a446a2efb359e90d955a5a9ea7e3bef7fe49a69eaabe4e7d30b327c468ce", + "0x05710d55f1630b0ebaa58c0090234bdbbc83c4a766b040554a2d70981347571e", + "0x1c10fbbf64ac153b88dc828468ff263e5bc09044287a11034de3815fa53b8ffc", + "0x07072401997ac30350cd4a424ddee23d0ef37ab145c11a3f6294337d00b92101", + "0x01d6a6804b3bfdd28a15e1f8d814356382985cf916b69cef49d7388f8b397509", + "0x05e8fea8e0631b97e1e0f631f82ecd58d394b0a07d062ae8afbb956ef4031d1d", + "0x289a207d4b6bcce0b47cbc2ef2253f679ccc78773e1048929779c3bf809189e9", + "0x1faca7c01971fd08485ecf638b702a861c243b0e2896f9a2a8a078362ae7d798", + "0x0168fc7551cf8c0c4bc424cc464b3307f9682a2e9b5e541bab8c6a5de8f77842", + "0x28333e668d794373eb971665f333c26494c481774055835b9519f9ea82f2d18c", + "0x305f0c192b1d2038331f230de2b4fcf8886439a6b474b5a14dad3c9a1e9281ce", + "0x07e221aabcb0c1916e40ec9033525beb709c89237262997836ef1ed1be97be25", + "0x013b903729a7508ceb8609a28a69d1d8672e7bcf29d2a1f9b4067acdea4d09c7", + "0x1fc1fd0cfd3e04409eadc851c51d68fd321fb54662d2ca5af56d9737de251ed6", + "0x0435b577b0b0e981cedb27a4d962094eadb66d003e90d2c66d1341ebb0b96ee6", + "0x298a29721e41cb787f3c762581f946ca1ebaea958c41521693ffcecaea580ef5", + "0x07dfb87f2ac7428bc2f953ae6aaccbd19cf0f1a461f89b1d33219c3b3bdd3e20", + "0x09cdac55de929ffc6e5d49cf8186f2d04c70712144102613b76bcd8a9d181c6f", + "0x0ef61ed8e9f64886396f8939aa45c2af4041fde1d19ca3e165d6ee53182248f6", + "0x0f96156076d1cf3a0e7f7f77d0203dd9ce70bc8f3cac46d140a985ea9564b2a5", + "0x21194f27c5c992f29a02ed27db67dca01bd13685d208a4f5e97ff61c230c52f2", + "0x0097f2aea69da653afbdef8e9c65b43f52f5af7e83e704eee950bbb68a406115", + "0x0154e8d04f302c9d2124fdd49452c9983c89f2228424373603b9bbe8eb2cbfed", + "0x223af0e366367948fb53912ea8cb3096d21e58bac0350a5c741b56d41b90b791", + "0x1b2978c6bbc6d4b89c57d22f7017c49caab6a4850f3bf7b1b9d16c9e337862e6", + "0x0148cb313359769d83045e4e53e914908e4edc8d3e24532684a316735bb85923", + "0x2d9992b103d94d6c513e87dacffb7c8423b69ea04b795cfb483ade13dfe970cc", + "0x2646c3659ccf7475dfa2cb259443b9d39d7650bffd485bcb14d5d5d7aefe3818", + "0x26dc239e5d79144be412a1b2db79da02b08603e7dcdedb58e8197c66f23a7928", + "0x156c12ec5190e37a00dfb8456a56df6e216e4628c2afc6d87871397165cc8905", + "0x0d1f5da07409cb1d3977a1ee586042156409ca7c0c9d29bff8fce48ad6c44685", + "0x1fa71e02b26b04177006eb7a3832d1fa0a1a1145657f5e392e1509a3f4331570", + "0x2d0a153c82007934393bca77b497d8c71201e909b25a20753debedc9b17178a0", + "0x0ea31805a350207a52be1a51ad30f75f8339e893622135003fb3382ca4645860", + "0x13ce7972a4a8b081e337dc73b58d387555ab857ee4cbe56163a754161d643a4e", + "0x0405c24d88cfabea2a2913809c4527a6595f87bd0fde4eac2909d7baf5ca5baf", + "0x144f207a53f07d126a2422aeac01127a947b683cf04d349c42773094b03d8398", + "0x19572fdb65aa04208c9b9990e5d9ad921e2b1f91bfcacc08522776a2006f2114", + "0x10ef387c7a4d86a92f48d40627dba97219732713bb66700aeef0b2181f82ce44", + "0x1a279510bbed5c55683401926a0d232da37339f8c173549a690ce9bd6af2392d", + "0x19c713f07f997faf09f7ea19caaf5e4eba7b35060826f1eb08c99a8c30477897", + "0x1487b11443d92cb17b8d1c31fa2442a5048278add728432dd32d32b665622529", + "0x19987e72b7c0beb3c36df15c6fb2f076505d9dc30e1c9832ee2e3afeb23f314b", + "0x2ecbbe1cc49803e81b8f668811dc8cdd18304bab1a78304edcc71ba8616fe275", + "0x00356bd2b28d6c90dba8f5c7504be16c63856a9423cda84a2375bad698503092", + "0x228a702d47d4f3d959cb512f10fb8e6685f601f4c6bef3659334e2568115ecc5", + "0x09dc0fb77f2f1c586f627cfb54df3d9fd1512d64c6f9400d612228cc5d54c112", + "0x05bcaf04d52e3ca6e0b174f2bc04645acf1dfb164595c4d8339ddbc6a9fd3354", + "0x1aab78bc56164e9266990723ae20f3870be692f223eea917f29fd67e75cc49fc", + "0x0516dd93c10d9856cf682fe474abb08619dc8d990c33267f79c944002213755e", + "0x18e3e2a3aef1cff30e7063b446619b6602efdfdef5f7951b28b45329788f23a9", + "0x1b168f19049ad41ce97f16368b2792324d62a9b1ee0212a00eadd4b60bca8fd8", + "0x0ee636ca5fc6c9153915afb1c8f84dd784a0f1b9c120e6ce9d9c78d21e4cc6a6", + "0x0d3329f754b77aea9a6dfda06071eb5e92abdb5ff8f3c450fa8bc58f89cc7cf9", + "0x23a25c5ada4dd1079740566901d5370ca2510fea4cf0aaa74f64d8ab1d1c6e7c", + "0x10d719faf9c6bef192be248ae959fc3d1177eee801d581d33072aadcad769656", + "0x043b5fb70a415453664415f6601cede6a80d0b22ea361fbbfc5e0670cb10cf7b", + "0x16166a3b88e4b0a425bfb67e4c3cc8a8b2c2150e0acae28ee4ab1caee4fd5e61", + "0x2c087c2602cf10ce53457b5dc953963b90857036027adde42e47d62ccada4651", + "0x1b23367e44927bcce69066b57abd7de36030af10689ef88eec5605464c825932", + "0x2126674b9aa8f19dee77d580d4d204288038227299d519e9ca422a0b2f9287d5", + "0x136fb5d5dd09ef7857213a2e9ce41cd1203908cef9830d7d94d6f1e4b1bb090e", + "0x0f62cbfb18900e9514b362e696288482c096d1da219c9083e574817355f97110", + "0x2695eba4494a5c0a86bb4447e68e5a7cf16bfd4c021edc981b35ebb9fbcdf6d1", + "0x2f969ce7ac17a16a7b53424c78314d5a5b23271f978d08bba7e5f7aa2e8b192f", + "0x26ead9bcfbdc2c5fa6bcc6fd42c24f48a46a7a31700ed935f0537adb16af6593", + "0x2deab703d22a5b7b23bad6e1f2069aaf18afb28673005ab2656388c81cc4c6ad", + "0x09582d760ede6940183c2bc1133f2037e20a9caf94f94f8358149871ae5f005a", + "0x268aea1e5f15fdfa4478f97cc2be25c1f55efc2d03ef79a4e2af7c794dc79a25", + "0x06062f382b684f6f68651b2aae29b593756da4e41c1c4c43a2987a963c918f4e", + "0x0cb1e45ca87ed5a9f274210b2f17a6caa75222c0e9c04b71f335f4a5d60ddcff", + "0x1a539dd5deb7afa05b95c2947ca22fe7536d22cab1168bc6534c6bbf812b64af", + "0x1c19b2ffb3a00ee96092f0505214869b4dc474330a1efddc92b4c2971f24ae92", + "0x0926e36aaa92518631e43de64873321882156c1978b07e439918628b61b004ee", + "0x0f40998b2236a9e4f26e8fa918c139c1c481cd6defe407f0be22ae6b6350cc07", + "0x225d69152dc60286ff3e8e16059e58d76fda4809dca44681c517438cf7714a33", + "0x015f024adef870a2b324aaaddd36bc972266627c53f4fdf53bc03d50a6c3e603", + "0x2018f33acf3cbd51005960f7bfff2c6c3eb3f9f74ad4f29d077a37e7ba049522", + "0x14a55e5de097be168e72198c9a7b982f1d1609de456d1af355ca06e927081d73", + "0x09046173ba9dae4eb1603662258982fc62e128927e8ceedbd6050982c429f68a", + "0x0ceb491a5839d275f92822fbb441d84d2846f935399f4be26391802397652153", + "0x011bd5b250cfe2a4f6de486ac19f8d7e93d122200cb54d3efdb15cb7beb2545a", + "0x2b3522da79e52f7de3f094dbf374feea71360585b291881e8d1cfb5b27dfad3f", + "0x21a8cd39cf69aefce9e6970ada5aaf54428bd7c53b2a5afab971c39a74a443f5", + "0x161a117e38ee1424e75657a86e9d5f125daab815dd5a9e43e404740377f8f486", + "0x1a25dc651f93857d3559b3fb483ed55f7a0d3fe8213742c8aa1c0725c9f193b2", + "0x207937c33e89899e13d396494ba7f9fc4e557e7b0432c7524a144636b4ae5f6a", + "0x1bbff6fea687199ea7655d2464049d0e7f8a6c34443888ae451ac775cd0bf771", + "0x2abe33f255ae08bd26a50fb8c0a255c5d9bc90a2aaa89356d9aa12ef1fb37177", + "0x10d4bbefdd1a8eb4d1609d415bcc355b9d2605e9ffe3514a8fdb52b98a466676", + "0x26d967340e43843301dae44e344232768f1d004b49895dadc097e1148cfb8524", + "0x070b82bc24e1ddd956e184d35b8c8c2afb14d0505cac23d6daca4372984a32f6", + "0x2959e5b9df027cc537c12737ab977acc4711bf76b7c069bf3beee33d428ec969", + "0x1b6581c4c35c2c8f26d98eb48c79cb7f888d8702a6ca958c643f2400bbb9c014", + "0x0c09b33fd933ca2812647fc20fee1d28fef4cc20049eff9f7beec76cd4a4d743", + "0x167fb0381e4d0e2a3ea501ebcf907a0895fc0d76b42c0ae72a0a00f805284625", + "0x0cae173441447648f921619ac12e78a2a3e6b76fdd4fc85ae72158f5804be9fc", + "0x1d671b93802beadaaef78948adab0266b3bff5c364795c7c0b5b1c23f8ce8b88", + "0x281d01599e67428147b57928f1f34400ec48c5bbafe84adab59db995489d6e95", + "0x26548c2c5142b6abd69be7b946435705c37d91ea55cdd116e92c4f1813a3ed7f" +] + hash = "0x2427173a3eee04644c8e0a770808ee42edd822c8c14af262571fb2efaeb1c580" + +[inputs.start.note_hash_tree] +root = "0x265f2fb8ecbd96d51d74d79901934e60af982af7b6caa46153eafcf3201df280" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000280" + +[inputs.start.nullifier_tree] +root = "0x0d8cfcd6ecef742ecda848c0db79ef7d0fe639b7b69564d103f788d530832eba" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" + +[inputs.start.public_data_tree] +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" + +[inputs.start_sponge_blob] +fields = "0x0000000000000000000000000000000000000000000000000000000000000000" +expected_fields = "0x000000000000000000000000000000000000000000000000000000000000003f" + + [inputs.start_sponge_blob.sponge] + cache = [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" +] + state = [ + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000000000000000000000000003f0000000000000000" +] + cache_size = "0x0000000000000000000000000000000000000000000000000000000000000000" + squeeze_mode = false + +[inputs.state_diff_hints] +sorted_nullifiers = [ + "0x1e5500b16b3acfb338162c1db2abca255b4c3aa696dc43669bdbc802110d48f2", + "0x1c092e50dfdc08e3bbe145aa1ffcc554d22937b7e1dab9d4b30d59368634d28d", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" +] +sorted_nullifier_indexes = [ + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000002", + "0x0000000000000000000000000000000000000000000000000000000000000003", + "0x0000000000000000000000000000000000000000000000000000000000000004", + "0x0000000000000000000000000000000000000000000000000000000000000005", + "0x0000000000000000000000000000000000000000000000000000000000000006", + "0x0000000000000000000000000000000000000000000000000000000000000007", + "0x0000000000000000000000000000000000000000000000000000000000000008", + "0x0000000000000000000000000000000000000000000000000000000000000009", + "0x000000000000000000000000000000000000000000000000000000000000000a", + "0x000000000000000000000000000000000000000000000000000000000000000b", + "0x000000000000000000000000000000000000000000000000000000000000000c", + "0x000000000000000000000000000000000000000000000000000000000000000d", + "0x000000000000000000000000000000000000000000000000000000000000000e", + "0x000000000000000000000000000000000000000000000000000000000000000f", + "0x0000000000000000000000000000000000000000000000000000000000000010", + "0x0000000000000000000000000000000000000000000000000000000000000011", + "0x0000000000000000000000000000000000000000000000000000000000000012", + "0x0000000000000000000000000000000000000000000000000000000000000013", + "0x0000000000000000000000000000000000000000000000000000000000000014", + "0x0000000000000000000000000000000000000000000000000000000000000015", + "0x0000000000000000000000000000000000000000000000000000000000000016", + "0x0000000000000000000000000000000000000000000000000000000000000017", + "0x0000000000000000000000000000000000000000000000000000000000000018", + "0x0000000000000000000000000000000000000000000000000000000000000019", + "0x000000000000000000000000000000000000000000000000000000000000001a", + "0x000000000000000000000000000000000000000000000000000000000000001b", + "0x000000000000000000000000000000000000000000000000000000000000001c", + "0x000000000000000000000000000000000000000000000000000000000000001d", + "0x000000000000000000000000000000000000000000000000000000000000001e", + "0x000000000000000000000000000000000000000000000000000000000000001f", + "0x0000000000000000000000000000000000000000000000000000000000000020", + "0x0000000000000000000000000000000000000000000000000000000000000021", + "0x0000000000000000000000000000000000000000000000000000000000000022", + "0x0000000000000000000000000000000000000000000000000000000000000023", + "0x0000000000000000000000000000000000000000000000000000000000000024", + "0x0000000000000000000000000000000000000000000000000000000000000025", + "0x0000000000000000000000000000000000000000000000000000000000000026", + "0x0000000000000000000000000000000000000000000000000000000000000027", + "0x0000000000000000000000000000000000000000000000000000000000000028", + "0x0000000000000000000000000000000000000000000000000000000000000029", + "0x000000000000000000000000000000000000000000000000000000000000002a", + "0x000000000000000000000000000000000000000000000000000000000000002b", + "0x000000000000000000000000000000000000000000000000000000000000002c", + "0x000000000000000000000000000000000000000000000000000000000000002d", + "0x000000000000000000000000000000000000000000000000000000000000002e", + "0x000000000000000000000000000000000000000000000000000000000000002f", + "0x0000000000000000000000000000000000000000000000000000000000000030", + "0x0000000000000000000000000000000000000000000000000000000000000031", + "0x0000000000000000000000000000000000000000000000000000000000000032", + "0x0000000000000000000000000000000000000000000000000000000000000033", + "0x0000000000000000000000000000000000000000000000000000000000000034", + "0x0000000000000000000000000000000000000000000000000000000000000035", + "0x0000000000000000000000000000000000000000000000000000000000000036", + "0x0000000000000000000000000000000000000000000000000000000000000037", + "0x0000000000000000000000000000000000000000000000000000000000000038", + "0x0000000000000000000000000000000000000000000000000000000000000039", + "0x000000000000000000000000000000000000000000000000000000000000003a", + "0x000000000000000000000000000000000000000000000000000000000000003b", + "0x000000000000000000000000000000000000000000000000000000000000003c", + "0x000000000000000000000000000000000000000000000000000000000000003d", + "0x000000000000000000000000000000000000000000000000000000000000003e", + "0x000000000000000000000000000000000000000000000000000000000000003f" +] +note_hash_subtree_sibling_path = [ + "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", + "0x137478b5b799d1ea72132a2e561f09e9313e1969ddc747329577bfea9df0a200", + "0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1", + "0x117d3e57050964d42014c095f7a71f3fc8e4d5b06c3a4869c6155f4060756b7d", + "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", + "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", + "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", + "0x1c4954081e324939350febc2b918a293ebcdaead01be95ec02fcbe8d2c1635d1", + "0x0197f2171ef99c2d053ee1fb5ff5ab288d56b9b41b4716c9214a4d97facc4c4a", + "0x2b9cdd484c5ba1e4d6efcc3f18734b5ac4c4a0b9102e2aeb48521a661d3feee9", + "0x14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3", + "0x071d7627ae3b2eabda8a810227bf04206370ac78dbf6c372380182dbd3711fe3", + "0x2fdc08d9fe075ac58cb8c00f98697861a13b3ab6f9d41a4e768f75e477475bf5", + "0x20165fe405652104dceaeeca92950aa5adc571b8cafe192878cba58ff1be49c5", + "0x1c8c3ca0b3a3d75850fcd4dc7bf1e3445cd0cfff3ca510630fd90b47e8a24755", + "0x1f0c1a8fb16b0d2ac9a146d7ae20d8d179695a92a79ed66fc45d9da4532459b3", + "0x038146ec5a2573e1c30d2fb32c66c8440f426fbd108082df41c7bebd1d521c30", + "0x17d3d12b17fe762de4b835b2180b012e808816a7f2ff69ecb9d65188235d8fd4", + "0x0e1a6b7d63a6e5a9e54e8f391dd4e9d49cdfedcbc87f02cd34d4641d2eb30491", + "0x09244eec34977ff795fc41036996ce974136377f521ac8eb9e04642d204783d2", + "0x1646d6f544ec36df9dc41f778a7ef1690a53c730b501471b6acd202194a7e8e9", + "0x064769603ba3f6c41f664d266ecb9a3a0f6567cd3e48b40f34d4894ee4c361b3", + "0x1595bb3cd19f84619dc2e368175a88d8627a7439eda9397202cdb1167531fd3f", + "0x2a529be462b81ca30265b558763b1498289c9d88277ab14f0838cb1fce4b472c", + "0x0c08da612363088ad0bbc78abd233e8ace4c05a56fdabdd5e5e9b05e428bdaee", + "0x14748d0241710ef47f54b931ac5a58082b1d56b0f0c30d55fb71a6e8c9a6be14", + "0x0b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d", + "0x2c45bb0c3d5bc1dc98e0baef09ff46d18c1a451e724f41c2b675549bb5c80e59", + "0x121468e6710bf1ffec6d0f26743afe6f88ef55dab40b83ca0a39bc44b196374c", + "0x2042c32c823a7440ceb6c342f9125f1fe426b02c527cd8fb28c85d02b705e759", + "0x0d582c10ff8115413aa5b70564fdd2f3cefe1f33a1e43a47bc495081e91e73e5", + "0x0f55a0d491a9da093eb999fa0dffaf904620cbc78d07e63c6f795c5c7512b523", + "0x21849764e1aa64b83a69e39d27eedaec2a8f97066e5ddb74634ffdb11388dd9a", + "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" +] nullifier_subtree_sibling_path = [ - "0x073e1f0a657436e06a1f70e48c6ebba9ec9c868f289dd2f36eb04fe3f5b849d8", + "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", "0x2d78ed82f93b61ba718b17c2dfe5b52375b4d37cbbed6f1fc98b47614b0cf21b", - "0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1", - "0x1849b85f3c693693e732dfc4577217acc18295193bede09ce8b97ad910310972", - "0x0a06b6b89781f620b504e94f41d028f37551b3ee799e27e4f53d77e2cc8dfe70", + "0x170542053ee18f83ce3409f95661af85fd336d1eed92e134b901b9e8b147186c", + "0x2a0b65299855e8146ba263ef2e335c06baaec2479c07f2c07e45785d47b3d5ec", + "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", "0x1c4954081e324939350febc2b918a293ebcdaead01be95ec02fcbe8d2c1635d1", @@ -2264,14 +2350,14 @@ fee_write_sibling_path = [ ] [[inputs.state_diff_hints.nullifier_predecessor_preimages]] - nullifier = "0x0000000000000000000000000000000000000000000000000000000000000000" - next_nullifier = "0x0000000000000000000000000000000000000000000000000000000000000000" - next_index = "0x0000000000000000000000000000000000000000000000000000000000000000" + nullifier = "0x1cb0752bf82fc44ddb7112736435c86898a5c7c7eeab8acbbeab96bb6e8360cb" + next_nullifier = "0x1f91ebbecaef9af0fb45318429c3ab82ef414cb1539728fce43c7cea7339b2ab" + next_index = "0x0000000000000000000000000000000000000000000000000000000000000101" [[inputs.state_diff_hints.nullifier_predecessor_preimages]] - nullifier = "0x0000000000000000000000000000000000000000000000000000000000000000" - next_nullifier = "0x0000000000000000000000000000000000000000000000000000000000000000" - next_index = "0x0000000000000000000000000000000000000000000000000000000000000000" + nullifier = "0x189a5d89cf9f7503d61ffff03dfe5279971ec5929cd5a10236266d080d62c66a" + next_nullifier = "0x1cb0752bf82fc44ddb7112736435c86898a5c7c7eeab8acbbeab96bb6e8360cb" + next_index = "0x00000000000000000000000000000000000000000000000000000000000000c2" [[inputs.state_diff_hints.nullifier_predecessor_preimages]] nullifier = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -2584,93 +2670,93 @@ fee_write_sibling_path = [ next_index = "0x0000000000000000000000000000000000000000000000000000000000000000" [[inputs.state_diff_hints.nullifier_predecessor_membership_witnesses]] - leaf_index = "0" + leaf_index = "194" sibling_path = [ "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000" + "0x055b5e5ebabb2ff9815270539e2ad914c641a4d2b92744967521cbf85448d597", + "0x0e34ac2c09f45a503d2908bcb12f1cbae5fa4065759c88d501c097506a8b2290", + "0x21f9172d72fdcdafc312eee05cf5092980dda821da5b760a9fb8dbdf607c8a20", + "0x2373ea368857ec7af97e7b470d705848e2bf93ed7bef142a490f2119bcf82d8e", + "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", + "0x0b1a1ada9c341ac8a4f812b9a06aa3abfed4bce8739f479300a91e5362f91744", + "0x06bc23c2cf136372072bb8d25c726228f684e6b9c35b6f6d2b84ab6e7d03211b", + "0x14d65141ca3b2cc4626053cc7961acf2212e3e85a13710aa922bba9ac7acdab1", + "0x26df5baca425d6e7d401aa6f558f3b5e68a38d4159e194203c7cdfe0fbcff163", + "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", + "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", + "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", + "0x1c4954081e324939350febc2b918a293ebcdaead01be95ec02fcbe8d2c1635d1", + "0x0197f2171ef99c2d053ee1fb5ff5ab288d56b9b41b4716c9214a4d97facc4c4a", + "0x2b9cdd484c5ba1e4d6efcc3f18734b5ac4c4a0b9102e2aeb48521a661d3feee9", + "0x14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3", + "0x071d7627ae3b2eabda8a810227bf04206370ac78dbf6c372380182dbd3711fe3", + "0x2fdc08d9fe075ac58cb8c00f98697861a13b3ab6f9d41a4e768f75e477475bf5", + "0x20165fe405652104dceaeeca92950aa5adc571b8cafe192878cba58ff1be49c5", + "0x1c8c3ca0b3a3d75850fcd4dc7bf1e3445cd0cfff3ca510630fd90b47e8a24755", + "0x1f0c1a8fb16b0d2ac9a146d7ae20d8d179695a92a79ed66fc45d9da4532459b3", + "0x038146ec5a2573e1c30d2fb32c66c8440f426fbd108082df41c7bebd1d521c30", + "0x17d3d12b17fe762de4b835b2180b012e808816a7f2ff69ecb9d65188235d8fd4", + "0x0e1a6b7d63a6e5a9e54e8f391dd4e9d49cdfedcbc87f02cd34d4641d2eb30491", + "0x09244eec34977ff795fc41036996ce974136377f521ac8eb9e04642d204783d2", + "0x1646d6f544ec36df9dc41f778a7ef1690a53c730b501471b6acd202194a7e8e9", + "0x064769603ba3f6c41f664d266ecb9a3a0f6567cd3e48b40f34d4894ee4c361b3", + "0x1595bb3cd19f84619dc2e368175a88d8627a7439eda9397202cdb1167531fd3f", + "0x2a529be462b81ca30265b558763b1498289c9d88277ab14f0838cb1fce4b472c", + "0x0c08da612363088ad0bbc78abd233e8ace4c05a56fdabdd5e5e9b05e428bdaee", + "0x14748d0241710ef47f54b931ac5a58082b1d56b0f0c30d55fb71a6e8c9a6be14", + "0x0b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d", + "0x2c45bb0c3d5bc1dc98e0baef09ff46d18c1a451e724f41c2b675549bb5c80e59", + "0x121468e6710bf1ffec6d0f26743afe6f88ef55dab40b83ca0a39bc44b196374c", + "0x2042c32c823a7440ceb6c342f9125f1fe426b02c527cd8fb28c85d02b705e759", + "0x0d582c10ff8115413aa5b70564fdd2f3cefe1f33a1e43a47bc495081e91e73e5", + "0x0f55a0d491a9da093eb999fa0dffaf904620cbc78d07e63c6f795c5c7512b523", + "0x21849764e1aa64b83a69e39d27eedaec2a8f97066e5ddb74634ffdb11388dd9a", + "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" ] [[inputs.state_diff_hints.nullifier_predecessor_membership_witnesses]] - leaf_index = "0" + leaf_index = "512" sibling_path = [ "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000" + "0x0b63a53787021a4a962a452c2921b3663aff1ffd8d5510540f8e659e782956f1", + "0x0e34ac2c09f45a503d2908bcb12f1cbae5fa4065759c88d501c097506a8b2290", + "0x21f9172d72fdcdafc312eee05cf5092980dda821da5b760a9fb8dbdf607c8a20", + "0x2373ea368857ec7af97e7b470d705848e2bf93ed7bef142a490f2119bcf82d8e", + "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", + "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", + "0x27b955ed3f963fcc030d42cbcd8697feeb71d542b78d350cce96cc433a90c03e", + "0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1", + "0x2a0b65299855e8146ba263ef2e335c06baaec2479c07f2c07e45785d47b3d5ec", + "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", + "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", + "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", + "0x1c4954081e324939350febc2b918a293ebcdaead01be95ec02fcbe8d2c1635d1", + "0x0197f2171ef99c2d053ee1fb5ff5ab288d56b9b41b4716c9214a4d97facc4c4a", + "0x2b9cdd484c5ba1e4d6efcc3f18734b5ac4c4a0b9102e2aeb48521a661d3feee9", + "0x14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3", + "0x071d7627ae3b2eabda8a810227bf04206370ac78dbf6c372380182dbd3711fe3", + "0x2fdc08d9fe075ac58cb8c00f98697861a13b3ab6f9d41a4e768f75e477475bf5", + "0x20165fe405652104dceaeeca92950aa5adc571b8cafe192878cba58ff1be49c5", + "0x1c8c3ca0b3a3d75850fcd4dc7bf1e3445cd0cfff3ca510630fd90b47e8a24755", + "0x1f0c1a8fb16b0d2ac9a146d7ae20d8d179695a92a79ed66fc45d9da4532459b3", + "0x038146ec5a2573e1c30d2fb32c66c8440f426fbd108082df41c7bebd1d521c30", + "0x17d3d12b17fe762de4b835b2180b012e808816a7f2ff69ecb9d65188235d8fd4", + "0x0e1a6b7d63a6e5a9e54e8f391dd4e9d49cdfedcbc87f02cd34d4641d2eb30491", + "0x09244eec34977ff795fc41036996ce974136377f521ac8eb9e04642d204783d2", + "0x1646d6f544ec36df9dc41f778a7ef1690a53c730b501471b6acd202194a7e8e9", + "0x064769603ba3f6c41f664d266ecb9a3a0f6567cd3e48b40f34d4894ee4c361b3", + "0x1595bb3cd19f84619dc2e368175a88d8627a7439eda9397202cdb1167531fd3f", + "0x2a529be462b81ca30265b558763b1498289c9d88277ab14f0838cb1fce4b472c", + "0x0c08da612363088ad0bbc78abd233e8ace4c05a56fdabdd5e5e9b05e428bdaee", + "0x14748d0241710ef47f54b931ac5a58082b1d56b0f0c30d55fb71a6e8c9a6be14", + "0x0b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d", + "0x2c45bb0c3d5bc1dc98e0baef09ff46d18c1a451e724f41c2b675549bb5c80e59", + "0x121468e6710bf1ffec6d0f26743afe6f88ef55dab40b83ca0a39bc44b196374c", + "0x2042c32c823a7440ceb6c342f9125f1fe426b02c527cd8fb28c85d02b705e759", + "0x0d582c10ff8115413aa5b70564fdd2f3cefe1f33a1e43a47bc495081e91e73e5", + "0x0f55a0d491a9da093eb999fa0dffaf904620cbc78d07e63c6f795c5c7512b523", + "0x21849764e1aa64b83a69e39d27eedaec2a8f97066e5ddb74634ffdb11388dd9a", + "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" ] [[inputs.state_diff_hints.nullifier_predecessor_membership_witnesses]] @@ -5515,11 +5601,11 @@ fee_write_sibling_path = [ ] [inputs.archive_root_membership_witness] -leaf_index = "0" +leaf_index = "5" sibling_path = [ - "0x1c7e3b9ffdf0b6a594a190917fadf9225865e3b7cf6a2a4dbe96192dbc75321e", - "0x027d9785407aca38bbb69f8a7eb032c44f468906876de817b8b38d2b9fd6c485", - "0x08feef9a1f8a52eb745cf4123253b4f9d98bc0d090fa1c1a07e34f2a0fcefd19", + "0x06eaff534194c3a625075b6df053058ef93bc24ae351fc133a2ac22efc075dea", + "0x0b63a53787021a4a962a452c2921b3663aff1ffd8d5510540f8e659e782956f1", + "0x1c32d9e59590c6d2e69edfeeeb19900697469ccdde47e3663a3f26c658cf2aa8", "0x21f9172d72fdcdafc312eee05cf5092980dda821da5b760a9fb8dbdf607c8a20", "0x2373ea368857ec7af97e7b470d705848e2bf93ed7bef142a490f2119bcf82d8e", "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", @@ -5549,29 +5635,29 @@ sibling_path = [ ] [inputs.constants] -vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" -protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" +vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" +protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [inputs.constants.last_archive] - root = "0x04b51aa5df89d177213335ca62dee74d15b920e231f5ea5198ed405967d188fd" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" + root = "0x026e8d4564303241e67610a78bc5a2cfbd383ef1673f9e2a00a226d6bb280d34" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000006" [inputs.constants.global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000008" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000015" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2e96" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000006" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000013" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a9d5" [inputs.constants.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.constants.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.constants.global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" [inputs.fee_payer_fee_juice_balance_read_hint] leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000" diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-base-public/Prover.toml b/noir-projects/noir-protocol-circuits/crates/rollup-base-public/Prover.toml index 285ddf132c7..00a73d4cb7c 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-base-public/Prover.toml +++ b/noir-projects/noir-protocol-circuits/crates/rollup-base-public/Prover.toml @@ -1,53 +1,53 @@ [inputs.tube_data.public_inputs.constants] -vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" -protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" +vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" +protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [inputs.tube_data.public_inputs.constants.historical_header] - total_fees = "0x0000000000000000000000000000000000000000000000000003a83680db4900" - total_mana_used = "0x0000000000000000000000000000000000000000000000000000000000004a40" + total_fees = "0x00000000000000000000000000000000000000000000000000f3d59e049eb1ac" + total_mana_used = "0x00000000000000000000000000000000000000000000000000000000001355c1" [inputs.tube_data.public_inputs.constants.historical_header.last_archive] - root = "0x12a67a275560c583960931231ad3a43c5446c4ecf990edce34f69e4a8924e2a6" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000006" + root = "0x2686a574dfb90890de58e447bcd7f12504950a18bbe781d95758161ca30dcf66" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000005" [inputs.tube_data.public_inputs.constants.historical_header.content_commitment] num_txs = "0x0000000000000000000000000000000000000000000000000000000000000002" - blobs_hash = "0x00537c616e473c341bec4ff523a3cb1047b172d24b3703433b40b75b61063994" + blobs_hash = "0x002ee5246d9ece5e2f64027ac8216616887df1da344019d0e0f0cfd1c2483af7" in_hash = "0x00089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c" out_hash = "0x00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb" [inputs.tube_data.public_inputs.constants.historical_header.state.l1_to_l2_message_tree] root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000060" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050" [inputs.tube_data.public_inputs.constants.historical_header.state.partial.note_hash_tree] -root = "0x1f1580bd0be976002f317f6c459793db2b87c64220c11f186943ae1b990bd520" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" +root = "0x265f2fb8ecbd96d51d74d79901934e60af982af7b6caa46153eafcf3201df280" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000280" [inputs.tube_data.public_inputs.constants.historical_header.state.partial.nullifier_tree] -root = "0x2ac6b844105b8bb164508a4e42d67903629a92272fc5fddf367e3aeaa7ed775a" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000380" +root = "0x0d8cfcd6ecef742ecda848c0db79ef7d0fe639b7b69564d103f788d530832eba" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" [inputs.tube_data.public_inputs.constants.historical_header.state.partial.public_data_tree] -root = "0x0ff17010ab909b4a0c9581a9c33cf0af93280c6fcd6664cf27270b8762a9e418" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [inputs.tube_data.public_inputs.constants.historical_header.global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000006" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000013" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2e66" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000005" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000009" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a8e5" [inputs.tube_data.public_inputs.constants.historical_header.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.tube_data.public_inputs.constants.historical_header.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.tube_data.public_inputs.constants.historical_header.global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9c6e14ac" [inputs.tube_data.public_inputs.constants.tx_context] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" @@ -65,6 +65,10 @@ l2_gas = "0x00000000000000000000000000000000000000000000000000000000005b8d80" fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" +[inputs.tube_data.public_inputs.constants.tx_context.gas_settings.max_priority_fees_per_gas] +fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" + [inputs.tube_data.public_inputs.rollup_validation_requests.max_block_number._opt] _is_some = false _value = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -137,7 +141,7 @@ note_hashes = [ "0x0000000000000000000000000000000000000000000000000000000000000000" ] nullifiers = [ - "0x1f402bc61864bc9d78571eb2ff08bd21be788986bfc07e9e7865cbe3dd0a905b", + "0x1784005ecb3066ffa7214623dd2fef7610be0325ac394b80a8c08d9872a01e1c", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -2357,13 +2361,13 @@ inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[inputs.tube_data.public_inputs.revertible_accumulated_data.public_call_requests]] is_static_call = false - args_hash = "0x280e22beb48c4b01ec87a57a5320613e8bc1d6a1f6eccdaeef5e7bd70bd6b649" + args_hash = "0x288a1db096c0841687a2c80a7a3215237b43edf1f43ee7ac219d272621cba661" [inputs.tube_data.public_inputs.revertible_accumulated_data.public_call_requests.msg_sender] - inner = "0x30021904ae3832fa38613650b957c74abcc7ae86fda9e53bcd89e7b638cf9d67" + inner = "0x17e5c98d998228e7de3dbb6c01ae1fd3aaf868bd45946d300e4c36f6d396dea0" [inputs.tube_data.public_inputs.revertible_accumulated_data.public_call_requests.contract_address] - inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" + inner = "0x0a762f2c969988845e3f2ec70b07cda6dadd97cc3542c63c3658211d44d09709" [inputs.tube_data.public_inputs.revertible_accumulated_data.public_call_requests.function_selector] inner = "0x00000000000000000000000000000000000000000000000000000000d5441b0d" @@ -3255,6 +3259,77 @@ fields = [ "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000" ] @@ -3262,148 +3337,159 @@ fields = [ vk_index = "0x0000000000000000000000000000000000000000000000000000000000000006" vk_path = [ "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x17ae608923d921cec098fa1fb04e11c0607e26cc76eeb692545e510f0a4a65cb", - "0x15ecc428fab93e00874151f32575661782fcb6438d7cf5c797dad068e4eed590", - "0x25e71fd64ecaa6b98ef492c6d93da8164a259284041220c258edb94fe47706ab", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x1c5ee2f1a829cd797ee1a70819607cd863a39f3e5db2eee9e376943cadbe7c29", + "0x28271f3452f86971e3afd061cca5657de83a4edca8c368a11542927f5ac1aee6", + "0x07204dd4c0b5e97ed0e01d06354130938eb17178be6bacafbdee48057e59aa79", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] [inputs.tube_data.vk_data.vk] key = [ - "0x1bfa44f2f20c04c211cf7626f15acbc2a367aa54b5b640d9853bd02042b7da37", - "0x143ba3a3a96ca51ef744edead75ae4ae51acc10f725789a14bad01f3e613c33b", - "0x2ed6d3b65a9f1e6279ecc5f48e9007425e5fd1f086879d029cfb4899fd1101f3", - "0x05328139f807dd4ee06f6aec2f2a481c61e3fa88373f573f6bcd5e4b272268f2", - "0x2a2158771f4c7cfdef039c333466495b029d6a17f5135ed629eb190ab9553833", - "0x22b00c839ee07a11fa2c60eca418bf8565e17c1b9e1dc3e512aa095b1ca6c431", - "0x0f2ba4928d2345bdcf7e84c98519a37f32fbd6b665eb59692e97afc2877639dc", - "0x15ecfd47994d230c490bd30c07830a658531d640504413d679b9d049a4833a91", - "0x2f7656a78e18d6bcfbfbeb2c2b8c1b259b6c9f00e5006d67e436ce6bc7dc78b3", - "0x16839047875d7003e3db5a06b7593807a49262e7e30209380c268e0daeb9ffb2", - "0x0012890b0d7f650ae68b7b6e607378dff5a966ca894be521971d2440b2b2112b", - "0x1203215d42762e87233fb464e2fd8597a916a59bdc04790a9e87ce5cf94fa201", - "0x2bc8c849a0849d132ad289388964c94b1195a9b08e8950dfd7e3ba399c62f80f", - "0x0e03d24b28d9d3899b34eafee1806fc9c26161bcbd1bab624d78088c9689a40a", - "0x12e75f437f428ed42d557b08992ecf13fbdf593b03da968e7fed7a9c5f09c919", - "0x062dd479c320a3b6e0c6aaae014cf5f1f912e35bdb362eddf0cd685dc5d346aa", - "0x2a0aef1ca28be42005a8a0e2d16a5d74fc57db026d7c9bbf9ef9417db500466f", - "0x2c7dac680bfeaccf991ad8952813bcaf64424202f68a2bf12cfe3f38fdad3257", - "0x0bde7a55f9f6c8389933fdb6a2b927aa7d5165f6c4c56d8bbcdaaafd5118b4f4", - "0x2bda2e0be0f51be81a867ecd54ada45677d74a34428f9210ae000f12da577bd1", - "0x28bd04d2d10479950f4632ece00144a2d1ab871a58f69673391ba1d5662a6cc4", - "0x0edb1b17d39016ebe4f6d8128ce3f84004d4d34d9d72d7d463d68961790622d6", - "0x14affee4e6d56ff596b93246ff0151c37b96ba14195a61ae03158081087f9e98", - "0x1f4407b4e5c8cd6f26bb115aec6a53c61bacf9cd22e7fd11ab37f6e63a403d2f", - "0x272ac9a2b4190e0fa9f67d0f08bd9db2e3052ce4c8666604f06572dcccb8b393", - "0x143e6c0e49356c95bcb62f98b300338d203ae832c46a137368e0a261f27601db", - "0x100601f67eb00d1db03bb753dfcf1665da009ec3f1f33716b74d72321725836a", - "0x274cd9ddf5e7828eded1fa24957ad66806ecd5c963fd9aff8ccc3f10569775d2", - "0x17c3285771175332941c66d716a13f13f988648859203f538be6dc250494c60d", - "0x2a9b1ed4c33b97e1c92cc700c4049a47e5b9edd384b31cbac9ffe0eb46ec3c02", - "0x0d832e6d39981c86353abf85e4c351dab9e60ca8c4016258c2963a235a840953", - "0x2045e9baa6f55ccd8c65e124c05bc6e4b0334223847ca1b6bfc4bca8afe5f612", - "0x0867082aba9af1eacb35b03904b532ab1aea1c35731d423f8339608bbed06283", - "0x1fb501c4a04a8bbe1b4d4222e7a833ea795f729fe26e9e5f18d6462a7588cb93", - "0x10a7b85e4ea34c0cde5cf51259a877c4cf70c7d203c90620c938c1840452e7a8", - "0x140607c05291dfde12216519435eecb83a743e0978e712a74352543af1edbcc1", - "0x0a013c4d75cb5af0c9e8258961419fae98d3de053da2d4d76d76aeb528d7b5ad", - "0x167e4236dfeeef6784674544ac7915908b7df162d9ce1863f8378e4f0d659d52", - "0x1cb318ae475604b565d5d479269136a20933bf5161217adb495e6b33e5cccb39", - "0x2526b6986d1315bd61d4669b4e31802e5283951244972032e945acabbbb9ee95", - "0x2c9b3b1acc537aecaba66b9cc1cafd93807c7468ec03dea3f1c5aceba878669c", - "0x1607c5011768c9baf11bbc71751a673c8c9ab940f2513a3f20ce0e01d9aab706", - "0x0ac418c24a52173efe17275d13100d007658f43253eb5115579ca8e604aa5535", - "0x0cecac75229351c5c18ca254328916896ad4f4d300d5759172f0d80058def78f", - "0x103159b6611fdcb61153038af6138d227d671720dd574613a3571b7b0f94ebcf", - "0x11e62d52049352fa56394820af2db6107023a7d2d063a8c402559a6ca2184377", - "0x13ee29727f3ac35e1f371f5b5e70f5addb4ff95c67811bd7c3a4420fe81127ca", - "0x0009476148f290db1e416c5bcea889cd4ad066eb7693699d458dbbfb6a1eb03e", - "0x17391a68c43569fe94ba12d097173c5b1912bb03fe0928e5717c4ebcc58be251", - "0x2add96e3c6ce33b0ecc9f2474feb159ea7900d2eddc9299bc434b9e82e77eb9a", - "0x23f7bc36aa3347b4801df208a081d8a8402ae932061d6d7fc0319b5e5604bf4b", - "0x102769e2c5aa79f846544584c282949226f1e5b31a04b72fda377e6c354dc005", - "0x27b6b053bc7f5e63b559f424184a8e136a8b48bfdedfabc54561191d509d279f", - "0x10f8aa1ac1025364d8ad0fdfa4ac023a1aa9af7dea939bbd2050fdc53d16a3c1", - "0x1e8a6f9d2c430f3afaee15f8d15ead974c7db2ab768575a908650ef3aa683f36", - "0x1b12bfba9249d88990ea5ddf35394086048b70cb5bfed55c4ccf06c29e65fb2c", - "0x174a138e164e4bdf00ed69d4fd3dd32a1784f634eff941b50cbffd0e24400768", - "0x0399de084d1726bad6a065698a987ad4997110e278bdb09318c562bfe05ba563", - "0x0b32893afa0eb1fceba7b4d215bb65b711d308be047577a144c39744d5ae3995", - "0x21cd0714212e232663c56f92a3f17e92e0da3ab2d6bbaef46ddeb050798d9b4a", - "0x1795d536cadbb08c6b91e036c895e091ea09981fbb69066ea5678a8fc63d8419", - "0x0636d428c27a9459ee23b13d50ef4bb20fddb57d875746bb91d298ec34e42ea3", - "0x2df36fa7c78cfe52686cad4bb8d3d38c8dd832543f5962028af449c751bfb211", - "0x07436d9cab818362931aea99596030d542824119eb3ecfecb9bbe5cfcebe7e47", - "0x0b7f6af7895aa4c5de67e75a720567c3f00386b8b73a929b187fcfc78bef8691", - "0x1ef006a7bcffb41819a2612edf3920de93f367c9811b4eac3867e524c5af287a", - "0x28e37a2ea5dcc7c44a53ac0e08a10f6c6ef537a6a395707a09c73d535eff7e2f", - "0x123b5656ca0872647debc465168577a36fb23c0dbde6412784184b10b96bcec0", - "0x0d6b03baf20cc22f046c3bbf40e2e8cfa952d3311d42d874649b05b8461077b7", - "0x121e9aaabc0e58f61c44e59fc73ec033db54d5310aebdcb903782f7ca57079ad", - "0x0bde5f62bf14b6387b6e5507ae381a26669fc7691fc139c1a321537735a94927", - "0x2839612303477b8dde27d8b3deb6950648edd235e9ee70c8b220b481b6caafb5", - "0x0c8e52f24016f43c233a0bac1c855ee131446f80095d007f6eec338e11b96854", - "0x29ad8b52faecf42ce230d9e9d42deca2227c2d294e872a27e40e124ff870032b", - "0x110724826589260fa30434de8a545c9eaa50d902a0014843bcdfe8f109d55f4c", - "0x15ef4bbf93a2f68cc4f250ea4e6c7966cba9c595aa37e2970cd3607b4ad69c88", - "0x22d9b073e01dba83b814d8348c6ac1957d80cd7e0fc6fd9a4efaa6d0462325cd", - "0x1152ceaf287a891beb53a2782010a3da4bda3344559e688d331a9afe19673969", - "0x20f1c2ebfc4eb797ebc1cf52f5dd0f44098f628f660e50e494da0914961d7346", - "0x201a62298b87227f306a93beda4ca8a38a9a55051e9e67f3c58c3af04beac565", - "0x1dc1546696189da5d8c8ae5db528af85971357b15383e1d2887323c741ecabb7", - "0x11ef64e3c8968143201d6a1120d5139f11401171959a746015152dd476bead25", - "0x03c09c508d63466363539de55c81ca6fcb46260364eaecd6a8e750d5154aa1e2", - "0x0282a96573afe35baa840f09cbdf9cd6f44eb67878351038f89a752324c91ee7", - "0x2a43b168334ee89f67e76faf49ee035d7ff778ea4d79420c8820e0b735679d78", - "0x11ed672bf231147011978ff01fb3901189392191a092476f118a71d2b851c24e", - "0x1845363d16d79c01c1c4ac3f896baef2c8a6d3db44d8701f54122a52cc6e6e64", - "0x1c25935b0d0867a1fed34eba8b6f6a1b652aebc0557765018671ba3e190548eb", - "0x150d3e82fcd9a280daf6c07db1667a61571fae6e40ce45b9d98af57161cbaf87", - "0x1b1e4f5d885b49cca8a246d98d0bf0155e15ca3b2798087a39dffa7e9555de25", - "0x1b6462b7f98e005ce77cfa53e7c3a21027951c594e0daa717790a3d43ed2e498", - "0x0f71ee59fbf70ad12b179b4b9b670f308800986f6dcdb34ae226bcbccfb6e5d7", - "0x0d2e2ba60c9e3155a7ab56f60ef65c4bbafe4fed7001aec0ffa6469ef818bf6d", - "0x23da423c893f95386865589fbde978ebfbfc66dd662de0a8658a3df7d007be0e", - "0x098a3186b1090123c5b851eb4076c284a2c6cd02b2fb28263b56977be746057b", - "0x24173add4aeed1e2f4b932801eec0bab1605eb123462d2a2da1d549b5d868cf3", - "0x27a1f109230062171ca702916926b8bf999c3f3df3f793fb20f107575b428f8c", - "0x03652bff5342c71639aff4cd16b1455685df1f941401132586e8ce65e4405e0b", - "0x27b565e407c8f2014b0ed7b79374c5fc4f9332c3e0950d02682742741bc86a66", - "0x2ceb40e1632f85dfe4033a17b0aa31e8568bd0861e1d032fba5164357ed08c4c", - "0x2e07c64d1e7d5be09473417fc582c43cd417abd19de4ccca5eafa604271113b2", - "0x15327662366516be153727a21890bb277c2c52386e8c6a4cffa0e13223e9c693", - "0x075de224ce418e9f116a3ace20a1cfb7c96a6596ba92f95c876b665ee229eac9", - "0x19dcda0666f09af378c56915d3e9ac8502182c38c267d401f2e8438d48bf05d1", - "0x144a2c515bd9003e000055d04be599c2e45b38caece41ff5183c1c9931555160", - "0x1d79b941ebbbaedeb4dae1541bf0af6a7811769acc172ed681450ee79d5e76dd", - "0x2c889cdbc0e0460a139612dbaea20f570fbdf128a3bd5a28e2329cec46a437ab", - "0x2d7d39573ff0479169c0ae552818f59bb434c4aee7495234056601a9977fbd9e", - "0x2b3bd2745a4d8987c71b5222abf0411fef35a847834e843ea8198612822879dd", - "0x1d1ea9db8eb76f88468464b685d607f805a1798c2f10cd7d688ef9ab2fc646f0", - "0x0e1956a0721dbff85e88dec712b75c3692de02a65ee93562a12d6b55341d00ad", - "0x1f28e97ca07aed66f25edceba51241261c126c6fe96f4f77a33c40ed61212c0b", - "0x208527aa8b9b0ce0e82c43382314429a84e15286218bb002af0262ff594dc42f", - "0x14df909c8fa0d0a15cd07363f48e4aba770612574f9f4c07132fc1e49e1272a6", - "0x1c05fb4c606ec8d46cc93c471c72a7396d98320c5acf005526d7d696b5a21f7a", - "0x239322e0b7372404a59979842d2e4abd97653bba3c7700b95e63dfb87761445f", - "0x2bd124577e51268259acdd0413da7a348e1de67caf5c4ddf549a0884f5ab767a", - "0x2cf12f77abae4cf611142349b8a24eb193af74138dd8635d18c6389583dbf14b", - "0x0bd29ad3efcb3d6f1e6ef4f43ecacb0718e8319e75bab92ad37a15b437d9611e", - "0x1307ff6546aeee08627e03ac79d75bc6cbd91e5a7dd946d08fca17ad0c7e9148", - "0x2afdb75a0b0f7d70825f9d2016774037b0933df20ce116b18e86f62e96801977", - "0x104d87f80aeb27e3710a3acc0f091a33625090dba11d6d7b37b49f70e83a5e7d", - "0x043f80b13a29d7867f495a19f5dca16f73f68d0229a5d2d4de07e5e416f2218f", - "0x05af6b2ca6b955c8039f507d2e5cbf06c76fbdd253ba32daf63ebb60fbf28165", - "0x1917ccfb7f3f2514b5c51ec604f3addf3b244dfb1eebe6e244c444459ea46b56", - "0x23c1cad21ba40c8c59df93b371b57e3e935fbd8bcfc814b2a5e727d1ac508d28", - "0x1de894d5450dc7299ea6290f89dbaf8837b9e011449072b20d7bc48b9d5a3e99", - "0x0b2d29b925eeec46af08b62bf1199811277ddd9ef33075f96faafdf9f2062d68" + "0x057a636dd04fe2f697786c255ad641fb3af13f7aa945c82bad69b9bb798b8305", + "0x1d9c0eb06c0363c32e0d3c4cb46b5816cf54adae885e304b095a80afdb37184b", + "0x25599c4900fdd87a98f2dde8812af6afdd93a066f9185b286b52ab76b9f9236a", + "0x1b14a1f0d98e7c58a2de218f698e9e593ddeaa6e24570f56dbe51de0e560b67b", + "0x2feee9c11ac992c36d5cf1f47f218ba51648cf95e3c7277142d6aca62226caa1", + "0x1bd35610228aa64306844e20277fd205ba9b06771f1683849afeef5bfa1a05ae", + "0x2ff71fe100adf516407e99f13bb5632097361d8c4c3bf4307031a1796f93ea3e", + "0x301406a44928d74422d536cf6e29ea8eec2b292bedaf5b44561295e98c836453", + "0x16d2857563ac65f0c51defdedd5088d9e0033e295335476fde608e2681816dd1", + "0x168705ad6da4955062b2d9a75ffc8335274ea7a775d8b0bc6b47b9918ab5b3e6", + "0x28bff85ee618ef672473d7e7e904b8615a2931e0403f8d982f8c90f2d8b185b2", + "0x12b13b729c8a853f498c8fc475e1712ef8c3ebb7646b4a24e145c800152bf666", + "0x0fc9a2266a2145534220deea19017ed3759ac175b5053c15bcbfebc048afcfaf", + "0x1dbea6b06eceee5ce1f5d9164dca835ede521e1617e657180d6387f91edb3ca0", + "0x18a71947135c46b49a6c1b94f203fbbb130cacc7e3f1e6baba7b475e1a71bc6f", + "0x07a7674be05744b1cdcea87a596faf33e44a8d3dee64fb570e170c52d7a6bc17", + "0x2502c07a138b0c1dc94fc20d3fb756d97cdba352dd0fbf1adf0d754d07108f97", + "0x2e77ed53189a08c7127550d41a10ff5fd57becaa8a53e9ce8cf628f44428fdb2", + "0x2ae218d9bf9ea03723b5cd3c9148911d4aed205b26a05ee4bcb2fade50d23874", + "0x2d61abfb1633883a6cb2e1c7e168e7c19b418be8b8c0a71f7135c0178de9703a", + "0x1d4cdf488968b5935fdff9e96b246c563758dd5eb702df0b7f265de3e7038ec1", + "0x0c213e4cd587e6164eee84623cf60e18ba0afd19567b507dc279f33b53ae5c21", + "0x2e92a5005fcc6aa41eb6e0093c976ff06abe939bd038275b3757659b13bdae8d", + "0x24f5f13e3bfdec27e5be922d1bf4cd1ac8a67c51c490d7e0b59224f1188990fd", + "0x1745cc9a52aedee52d836dcdbb62fdf761a07110914e1de97b496289a3931da7", + "0x2a7b7048290c1221df3eb2621486dfeb1c761ffaafd20339a050e91d0977314c", + "0x106be76c9d09dbf181b62ca8deb1563d3f257a20335f8a1399bdcb0cd372a599", + "0x2292c3f58da67c55572165250d0f8bcfc69c84096a67345f3b969486301af5f6", + "0x02112adca89a9b37ddbed2aeaaac03470c45893a73a2f3626fdfc74546eac39e", + "0x0256d293abe3e6d002bc465f6ed018e345a99c2054f67a655b820389bae75f06", + "0x01649ceceb491c74680966a662df5e2b23b264b7b90090ca61d1341f85103739", + "0x1a2785c5d27fbdd1132efea3799053a933cfc9e42a8134fb6a93846bc3e380ca", + "0x15274b227d280b96d235b1f8976e9e0734e8f58d8ed7e225083b2cdcb6897bf3", + "0x0dcbae2693bfc9b539ee67ba8ed0618bc5ac2626ecb1f52203fddcb8e0743f71", + "0x1f473b47dae9618729bd38fb6c74de1ea112280ba385a46890625cad19bcef84", + "0x0ac03ae12a1c3d2a3ad87aff521b0cc564a2d82f402cfc6913cfe670b0db9356", + "0x033e7c61a4e691f2ebdfc87d3bea443e53aa0684f803f59ba06ade9fd8c30536", + "0x03b5b6a74d2c0267dffef16524b4341cee54d38335fcfff4be2c1bf161ad1b6a", + "0x2231d591188635c666387eb18ad1f6b3a51afe221da933cd551841cfdf2900ed", + "0x1d19a446a2efb359e90d955a5a9ea7e3bef7fe49a69eaabe4e7d30b327c468ce", + "0x05710d55f1630b0ebaa58c0090234bdbbc83c4a766b040554a2d70981347571e", + "0x1c10fbbf64ac153b88dc828468ff263e5bc09044287a11034de3815fa53b8ffc", + "0x07072401997ac30350cd4a424ddee23d0ef37ab145c11a3f6294337d00b92101", + "0x01d6a6804b3bfdd28a15e1f8d814356382985cf916b69cef49d7388f8b397509", + "0x05e8fea8e0631b97e1e0f631f82ecd58d394b0a07d062ae8afbb956ef4031d1d", + "0x289a207d4b6bcce0b47cbc2ef2253f679ccc78773e1048929779c3bf809189e9", + "0x1faca7c01971fd08485ecf638b702a861c243b0e2896f9a2a8a078362ae7d798", + "0x0168fc7551cf8c0c4bc424cc464b3307f9682a2e9b5e541bab8c6a5de8f77842", + "0x28333e668d794373eb971665f333c26494c481774055835b9519f9ea82f2d18c", + "0x305f0c192b1d2038331f230de2b4fcf8886439a6b474b5a14dad3c9a1e9281ce", + "0x07e221aabcb0c1916e40ec9033525beb709c89237262997836ef1ed1be97be25", + "0x013b903729a7508ceb8609a28a69d1d8672e7bcf29d2a1f9b4067acdea4d09c7", + "0x1fc1fd0cfd3e04409eadc851c51d68fd321fb54662d2ca5af56d9737de251ed6", + "0x0435b577b0b0e981cedb27a4d962094eadb66d003e90d2c66d1341ebb0b96ee6", + "0x298a29721e41cb787f3c762581f946ca1ebaea958c41521693ffcecaea580ef5", + "0x07dfb87f2ac7428bc2f953ae6aaccbd19cf0f1a461f89b1d33219c3b3bdd3e20", + "0x09cdac55de929ffc6e5d49cf8186f2d04c70712144102613b76bcd8a9d181c6f", + "0x0ef61ed8e9f64886396f8939aa45c2af4041fde1d19ca3e165d6ee53182248f6", + "0x0f96156076d1cf3a0e7f7f77d0203dd9ce70bc8f3cac46d140a985ea9564b2a5", + "0x21194f27c5c992f29a02ed27db67dca01bd13685d208a4f5e97ff61c230c52f2", + "0x0097f2aea69da653afbdef8e9c65b43f52f5af7e83e704eee950bbb68a406115", + "0x0154e8d04f302c9d2124fdd49452c9983c89f2228424373603b9bbe8eb2cbfed", + "0x223af0e366367948fb53912ea8cb3096d21e58bac0350a5c741b56d41b90b791", + "0x1b2978c6bbc6d4b89c57d22f7017c49caab6a4850f3bf7b1b9d16c9e337862e6", + "0x0148cb313359769d83045e4e53e914908e4edc8d3e24532684a316735bb85923", + "0x2d9992b103d94d6c513e87dacffb7c8423b69ea04b795cfb483ade13dfe970cc", + "0x2646c3659ccf7475dfa2cb259443b9d39d7650bffd485bcb14d5d5d7aefe3818", + "0x26dc239e5d79144be412a1b2db79da02b08603e7dcdedb58e8197c66f23a7928", + "0x156c12ec5190e37a00dfb8456a56df6e216e4628c2afc6d87871397165cc8905", + "0x0d1f5da07409cb1d3977a1ee586042156409ca7c0c9d29bff8fce48ad6c44685", + "0x1fa71e02b26b04177006eb7a3832d1fa0a1a1145657f5e392e1509a3f4331570", + "0x2d0a153c82007934393bca77b497d8c71201e909b25a20753debedc9b17178a0", + "0x0ea31805a350207a52be1a51ad30f75f8339e893622135003fb3382ca4645860", + "0x13ce7972a4a8b081e337dc73b58d387555ab857ee4cbe56163a754161d643a4e", + "0x0405c24d88cfabea2a2913809c4527a6595f87bd0fde4eac2909d7baf5ca5baf", + "0x144f207a53f07d126a2422aeac01127a947b683cf04d349c42773094b03d8398", + "0x19572fdb65aa04208c9b9990e5d9ad921e2b1f91bfcacc08522776a2006f2114", + "0x10ef387c7a4d86a92f48d40627dba97219732713bb66700aeef0b2181f82ce44", + "0x1a279510bbed5c55683401926a0d232da37339f8c173549a690ce9bd6af2392d", + "0x19c713f07f997faf09f7ea19caaf5e4eba7b35060826f1eb08c99a8c30477897", + "0x1487b11443d92cb17b8d1c31fa2442a5048278add728432dd32d32b665622529", + "0x19987e72b7c0beb3c36df15c6fb2f076505d9dc30e1c9832ee2e3afeb23f314b", + "0x2ecbbe1cc49803e81b8f668811dc8cdd18304bab1a78304edcc71ba8616fe275", + "0x00356bd2b28d6c90dba8f5c7504be16c63856a9423cda84a2375bad698503092", + "0x228a702d47d4f3d959cb512f10fb8e6685f601f4c6bef3659334e2568115ecc5", + "0x09dc0fb77f2f1c586f627cfb54df3d9fd1512d64c6f9400d612228cc5d54c112", + "0x05bcaf04d52e3ca6e0b174f2bc04645acf1dfb164595c4d8339ddbc6a9fd3354", + "0x1aab78bc56164e9266990723ae20f3870be692f223eea917f29fd67e75cc49fc", + "0x0516dd93c10d9856cf682fe474abb08619dc8d990c33267f79c944002213755e", + "0x18e3e2a3aef1cff30e7063b446619b6602efdfdef5f7951b28b45329788f23a9", + "0x1b168f19049ad41ce97f16368b2792324d62a9b1ee0212a00eadd4b60bca8fd8", + "0x0ee636ca5fc6c9153915afb1c8f84dd784a0f1b9c120e6ce9d9c78d21e4cc6a6", + "0x0d3329f754b77aea9a6dfda06071eb5e92abdb5ff8f3c450fa8bc58f89cc7cf9", + "0x23a25c5ada4dd1079740566901d5370ca2510fea4cf0aaa74f64d8ab1d1c6e7c", + "0x10d719faf9c6bef192be248ae959fc3d1177eee801d581d33072aadcad769656", + "0x043b5fb70a415453664415f6601cede6a80d0b22ea361fbbfc5e0670cb10cf7b", + "0x16166a3b88e4b0a425bfb67e4c3cc8a8b2c2150e0acae28ee4ab1caee4fd5e61", + "0x2c087c2602cf10ce53457b5dc953963b90857036027adde42e47d62ccada4651", + "0x1b23367e44927bcce69066b57abd7de36030af10689ef88eec5605464c825932", + "0x2126674b9aa8f19dee77d580d4d204288038227299d519e9ca422a0b2f9287d5", + "0x136fb5d5dd09ef7857213a2e9ce41cd1203908cef9830d7d94d6f1e4b1bb090e", + "0x0f62cbfb18900e9514b362e696288482c096d1da219c9083e574817355f97110", + "0x2695eba4494a5c0a86bb4447e68e5a7cf16bfd4c021edc981b35ebb9fbcdf6d1", + "0x2f969ce7ac17a16a7b53424c78314d5a5b23271f978d08bba7e5f7aa2e8b192f", + "0x26ead9bcfbdc2c5fa6bcc6fd42c24f48a46a7a31700ed935f0537adb16af6593", + "0x2deab703d22a5b7b23bad6e1f2069aaf18afb28673005ab2656388c81cc4c6ad", + "0x09582d760ede6940183c2bc1133f2037e20a9caf94f94f8358149871ae5f005a", + "0x268aea1e5f15fdfa4478f97cc2be25c1f55efc2d03ef79a4e2af7c794dc79a25", + "0x06062f382b684f6f68651b2aae29b593756da4e41c1c4c43a2987a963c918f4e", + "0x0cb1e45ca87ed5a9f274210b2f17a6caa75222c0e9c04b71f335f4a5d60ddcff", + "0x1a539dd5deb7afa05b95c2947ca22fe7536d22cab1168bc6534c6bbf812b64af", + "0x1c19b2ffb3a00ee96092f0505214869b4dc474330a1efddc92b4c2971f24ae92", + "0x0926e36aaa92518631e43de64873321882156c1978b07e439918628b61b004ee", + "0x0f40998b2236a9e4f26e8fa918c139c1c481cd6defe407f0be22ae6b6350cc07", + "0x225d69152dc60286ff3e8e16059e58d76fda4809dca44681c517438cf7714a33", + "0x015f024adef870a2b324aaaddd36bc972266627c53f4fdf53bc03d50a6c3e603", + "0x2018f33acf3cbd51005960f7bfff2c6c3eb3f9f74ad4f29d077a37e7ba049522", + "0x14a55e5de097be168e72198c9a7b982f1d1609de456d1af355ca06e927081d73", + "0x09046173ba9dae4eb1603662258982fc62e128927e8ceedbd6050982c429f68a", + "0x0ceb491a5839d275f92822fbb441d84d2846f935399f4be26391802397652153", + "0x011bd5b250cfe2a4f6de486ac19f8d7e93d122200cb54d3efdb15cb7beb2545a", + "0x2b3522da79e52f7de3f094dbf374feea71360585b291881e8d1cfb5b27dfad3f", + "0x21a8cd39cf69aefce9e6970ada5aaf54428bd7c53b2a5afab971c39a74a443f5", + "0x161a117e38ee1424e75657a86e9d5f125daab815dd5a9e43e404740377f8f486", + "0x1a25dc651f93857d3559b3fb483ed55f7a0d3fe8213742c8aa1c0725c9f193b2", + "0x207937c33e89899e13d396494ba7f9fc4e557e7b0432c7524a144636b4ae5f6a", + "0x1bbff6fea687199ea7655d2464049d0e7f8a6c34443888ae451ac775cd0bf771", + "0x2abe33f255ae08bd26a50fb8c0a255c5d9bc90a2aaa89356d9aa12ef1fb37177", + "0x10d4bbefdd1a8eb4d1609d415bcc355b9d2605e9ffe3514a8fdb52b98a466676", + "0x26d967340e43843301dae44e344232768f1d004b49895dadc097e1148cfb8524", + "0x070b82bc24e1ddd956e184d35b8c8c2afb14d0505cac23d6daca4372984a32f6", + "0x2959e5b9df027cc537c12737ab977acc4711bf76b7c069bf3beee33d428ec969", + "0x1b6581c4c35c2c8f26d98eb48c79cb7f888d8702a6ca958c643f2400bbb9c014", + "0x0c09b33fd933ca2812647fc20fee1d28fef4cc20049eff9f7beec76cd4a4d743", + "0x167fb0381e4d0e2a3ea501ebcf907a0895fc0d76b42c0ae72a0a00f805284625", + "0x0cae173441447648f921619ac12e78a2a3e6b76fdd4fc85ae72158f5804be9fc", + "0x1d671b93802beadaaef78948adab0266b3bff5c364795c7c0b5b1c23f8ce8b88", + "0x281d01599e67428147b57928f1f34400ec48c5bbafe84adab59db995489d6e95", + "0x26548c2c5142b6abd69be7b946435705c37d91ea55cdd116e92c4f1813a3ed7f" ] - hash = "0x1aaed86df77de9a40ca890b6b82271a03456e45632a9f880fcfe4211352cf1bf" + hash = "0x2427173a3eee04644c8e0a770808ee42edd822c8c14af262571fb2efaeb1c580" [inputs.avm_proof_data.public_inputs] -transaction_fee = "0x0000000000000000000000000000000000000000000000000011b417896f129a" +transaction_fee = "0x00000000000000000000000000000000000000000000000000116fd3dde47a96" reverted = false [inputs.avm_proof_data.public_inputs.global_variables] @@ -3411,10 +3497,10 @@ reverted = false version = "0x0000000000000000000000000000000000000000000000000000000000000001" block_number = "0x0000000000000000000000000000000000000000000000000000000000000008" slot_number = "0x0000000000000000000000000000000000000000000000000000000000000015" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2e96" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776aa05" [inputs.avm_proof_data.public_inputs.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.avm_proof_data.public_inputs.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -3428,16 +3514,16 @@ root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000070" [inputs.avm_proof_data.public_inputs.start_tree_snapshots.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000380" +root = "0x20381eeb1906be36ee4380d9b60fb23f51d654299ef836579c56e2233d865f7e" +next_available_leaf_index = "0x00000000000000000000000000000000000000000000000000000000000003c0" [inputs.avm_proof_data.public_inputs.start_tree_snapshots.nullifier_tree] -root = "0x085a35f42d569f7aac0404ce29055696f738a6c798a32632d15a8453e59115ff" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000400" +root = "0x0d0cf8da2e7808e6b817da31c4c6c2b4a617859dcfd3ab9ab300acac80d7536a" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000440" [inputs.avm_proof_data.public_inputs.start_tree_snapshots.public_data_tree] -root = "0x0ff17010ab909b4a0c9581a9c33cf0af93280c6fcd6664cf27270b8762a9e418" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" +root = "0x2de06dc379678174b469169d016af35ce9abde298f45f74b251be83c61fbb9fb" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" [inputs.avm_proof_data.public_inputs.start_gas_used] da_gas = "0x0000000000000000000000000000000000000000000000000000000000000400" @@ -3455,6 +3541,10 @@ l2_gas = "0x00000000000000000000000000000000000000000000000000000000005b8d80" fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" +[inputs.avm_proof_data.public_inputs.gas_settings.max_priority_fees_per_gas] +fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" +fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" + [inputs.avm_proof_data.public_inputs.fee_payer] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -3876,13 +3966,13 @@ fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2 [[inputs.avm_proof_data.public_inputs.public_app_logic_call_requests]] is_static_call = false - args_hash = "0x280e22beb48c4b01ec87a57a5320613e8bc1d6a1f6eccdaeef5e7bd70bd6b649" + args_hash = "0x288a1db096c0841687a2c80a7a3215237b43edf1f43ee7ac219d272621cba661" [inputs.avm_proof_data.public_inputs.public_app_logic_call_requests.msg_sender] - inner = "0x30021904ae3832fa38613650b957c74abcc7ae86fda9e53bcd89e7b638cf9d67" + inner = "0x17e5c98d998228e7de3dbb6c01ae1fd3aaf868bd45946d300e4c36f6d396dea0" [inputs.avm_proof_data.public_inputs.public_app_logic_call_requests.contract_address] - inner = "0x1b5c85f852759a87b99af1b7a52bf7b9a1bda23e2792ad5384113b9c17cc4c50" + inner = "0x0a762f2c969988845e3f2ec70b07cda6dadd97cc3542c63c3658211d44d09709" [inputs.avm_proof_data.public_inputs.public_app_logic_call_requests.function_selector] inner = "0x00000000000000000000000000000000000000000000000000000000d5441b0d" @@ -4381,7 +4471,7 @@ fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2 "0x0000000000000000000000000000000000000000000000000000000000000000" ] nullifiers = [ - "0x1f402bc61864bc9d78571eb2ff08bd21be788986bfc07e9e7865cbe3dd0a905b", + "0x1784005ecb3066ffa7214623dd2fef7610be0325ac394b80a8c08d9872a01e1c", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -4762,20 +4852,20 @@ root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000070" [inputs.avm_proof_data.public_inputs.end_tree_snapshots.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000380" +root = "0x20381eeb1906be36ee4380d9b60fb23f51d654299ef836579c56e2233d865f7e" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000400" [inputs.avm_proof_data.public_inputs.end_tree_snapshots.nullifier_tree] -root = "0x0b3cd059f3a14d1fc149e845404ee3733e58010456792a3f61c3803f4ddd1248" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000401" +root = "0x21d8f8c0cfac8e519373fa7d2eef1422432b12078a3725b29f62b1a409f288b0" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000480" [inputs.avm_proof_data.public_inputs.end_tree_snapshots.public_data_tree] -root = "0x28b5d86e557e528de4452115c3b6ca2b8075465411e73f310c843fa8d2b5faad" +root = "0x0ef0a240646db2810efc5f64ece26767c3f2f79b74742eee561055887dfbbf82" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" [inputs.avm_proof_data.public_inputs.end_gas_used] da_gas = "0x0000000000000000000000000000000000000000000000000000000000000800" - l2_gas = "0x0000000000000000000000000000000000000000000000000000000000016771" + l2_gas = "0x0000000000000000000000000000000000000000000000000000000000016207" [inputs.avm_proof_data.public_inputs.accumulated_data] note_hashes = [ @@ -4845,7 +4935,7 @@ next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000 "0x0000000000000000000000000000000000000000000000000000000000000000" ] nullifiers = [ - "0x1f402bc61864bc9d78571eb2ff08bd21be788986bfc07e9e7865cbe3dd0a905b", + "0x1784005ecb3066ffa7214623dd2fef7610be0325ac394b80a8c08d9872a01e1c", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -5072,12 +5162,12 @@ length = "0x0000000000000000000000000000000000000000000000000000000000000000" inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[inputs.avm_proof_data.public_inputs.accumulated_data.public_data_writes]] - leaf_slot = "0x0384c877dba0f9d849d02e07dac0d3105f8e09b0959c5ee77843b8c037b195bc" - value = "0x0000000000000000000000000000000000000000000000000000000000002328" + leaf_slot = "0x28fca282ea49b7b97e5a726e0316dc4b86b4e35b8233618bcce3aa48989b3ab9" + value = "0x0000000000000000000000000000000000000000000000000000000000001f40" [[inputs.avm_proof_data.public_inputs.accumulated_data.public_data_writes]] - leaf_slot = "0x0d38d167da0ccd3ba447ce36953062d88783b02447d5af2bd09519bcd2a928f4" - value = "0x00000000000000000000000000000000000000000000000000000000000003e8" + leaf_slot = "0x0076ea2b6f0dd2bb00e6767f9150e6e0a13116ab0572f0ab7a55ca0bb6a99fef" + value = "0x00000000000000000000000000000000000000000000000000000000000007d0" [[inputs.avm_proof_data.public_inputs.accumulated_data.public_data_writes]] leaf_slot = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -9489,116 +9579,116 @@ fields = [ [inputs.avm_proof_data.vk_data] vk_index = "0x0000000000000000000000000000000000000000000000000000000000000007" vk_path = [ - "0x14844598b76623839d27d176f959eb56da12634178ad72ed46f9e3a546127473", - "0x17ae608923d921cec098fa1fb04e11c0607e26cc76eeb692545e510f0a4a65cb", - "0x15ecc428fab93e00874151f32575661782fcb6438d7cf5c797dad068e4eed590", - "0x25e71fd64ecaa6b98ef492c6d93da8164a259284041220c258edb94fe47706ab", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x2c3508e6c5fef3975d5368b7f4b3ecd9d28766ce3856e764851f8fb864fc66bb", + "0x1c5ee2f1a829cd797ee1a70819607cd863a39f3e5db2eee9e376943cadbe7c29", + "0x28271f3452f86971e3afd061cca5657de83a4edca8c368a11542927f5ac1aee6", + "0x07204dd4c0b5e97ed0e01d06354130938eb17178be6bacafbdee48057e59aa79", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] [inputs.avm_proof_data.vk_data.vk] key = [ - "0x2542f2992d506e12ef0f8fe9dc62b3a9f70df45faf909200550dd0b7819407ba", - "0x15dc4a1a9e4c3f1eb2b831329ede54c0bb84bfc80836da059340114bb20f57d8", - "0x1a98f13dc2699a9bdacc5ae5fcd9dd508d0bd29dc6d5936474b7854864992d12", - "0x19b89ad7d1ee8edf7cfa0664f0f300ed9b871824113007694b91f344321d3de1", - "0x2ab129e761bcf9caeda4346b5390cace660a21d1530d16dc4463bc05c0136bef", - "0x1d16b953bb4223322f6e1e6b290fc9d110e8bde329f9bb77075aaa9f1eafc7a8", - "0x2ff1224a3d41d05e9f2b9ed1e08df230e729208c1c8014e204d6723f8702c1fe", - "0x23af59b0930dd26505964d86b5b9603779f55e21512cf2c5b5bbf73804ad029d", - "0x27808e83dcaa2506507050ea2d38bdf163b180f01ff156ee4785822b90dfbea5", - "0x0e4d52e03c853b2cc548d9e0d49657394f4abc367c2c44ac0f1bf191385f6309", - "0x0d8d44133535778fb79c6cc8f3f5fd39cdbf2a0d725b7b1e722c70985eaeffab", - "0x1e0c3307bdf5f33a9488d241ac6fc58b25ca1d6717a21f17b6fb65688b726c2f", - "0x13a7985894e7b2c68919bea8ff3bde79f9512ab813a5e5794c87d33983d4b677", - "0x056deab53a7763b751eee43da6cbbc4187133002770e605df8998cb8d0c53bcf", - "0x0d691ec99aa93d04440524d2fd16e2097cf011034eb5005df403f2b1fcfcbdd4", - "0x031d01a98b79c169deebb5f3f0cd0c2cbc835920c07c3d9c74d2536142f4419a", - "0x17f64a1cc517ccd5c9271020bb7aa598835d129e3de23f3b07f16e5814cfe3c7", - "0x18b25d76ee3db7f70ee2f728c81b4a1c19bc71e5b3e3c50519c3f2d72680558b", - "0x259c5bb26f3e16bbc8e6226deb1afcacd6afff8b88f294c35edc38acc92fd2d9", - "0x266abd6bb752275dbf7c50db051c3263ddcc7fbb01875093bb74127575f9145e", - "0x2a5de2975bf32b7085ffb7c9bff08643950cad0328b8e7b608113550b5e604fa", - "0x056fbeeeb5a8322b51ab3012407a1dd2badd10f075daed861bbc1d9e7c8ed8e5", - "0x02869f97cab06b77299a592f70938dcf1a3281c818a56d15fb16f32c1fbf1cf4", - "0x0de79e96fbf768497877d90f5b1218f2eb276c1cc6d20b72caf5233869a6a141", - "0x24020b9ca12300e9dd8c30973769c932e2fa68aacfaccd9e07ae6f095a438599", - "0x173413a0605f5e04712e4d35c6d3cf0c9f71ec395808715737f0fbaa8ef3b964", - "0x27003c4fc15015cced89ddc4e6c52cd3a6618ebc7d43bbeb5abdff3877f82fdf", - "0x18d85a0a76a9d60e448cb7109cb783c76baf368fde35b8b3ac832790f04c984c", - "0x0842de1090525272f7075e0acf39aac06250bb5ed869aea55f258a9f628d150e", - "0x1b1dda176330cb9442257c0f440f57588b1b7b8ddaa3b7ce9c5a49a222581a42", - "0x12389f610f1966a8940182295263e4e895a4b26f243c1145f0c03252a4d90fa1", - "0x0e378ca610b337bf4651290c316f068ee6b2f400807a5a181806dcf3ce4f92f3", - "0x26af8b6bebe1a1382ec59ce4ad6692207864083e49826b0cd88870dbeb926877", - "0x0759e35fd99ae00da70ea8093366fe7bb3de61197be5b88c2395db2c7abaf9da", - "0x0ab9670b94d0b06cdb710a7d5ebf45c73b60feccda0ea729c416dfd043c6ddf2", - "0x25b2f253e1d151108f050c53960f5129a9e814786e3677341fc7f8749b405563", - "0x252a2d34d39bf2f00b866be0c327d85f18540004e5e857a1a3c3e9e5cc0df124", - "0x179c4693322ccf9b0664539d73c537d98da2b5438c2ba3fa23c39dd08ac8dfce", - "0x1503cb1d04a5c6b2968fb76a82600cd627f03b2f59477c709e223a51601c3a5b", - "0x2597582c96a91ecbd29cb204de2273ee3d14068c77f68913e724118d880d8585", - "0x203f46bac2a09e027dc56de3bd798052290459ba2cfcee42aade2c7779a642e8", - "0x0a8e05c58ead2cea70e968907877b1f4da1598ea4c5de7a9f66c9721dea72881", - "0x27988fd7315730880208d338dedda9573959a2a93a0a61afd337911335bfee22", - "0x2fce8116a83e248c31be64f8ec2623659968cc736fb78555d49fb69120ca0522", - "0x28d8855e157458dea1e61a9854a2779d2a442efaa0150c3c2732a83f660d3976", - "0x28ff84917b62a84c6d3dc0c16de2dc7e340cb04615baaf9c89a875096dd5491d", - "0x0d5b95a0b924e27759a5eae65775febb039b4f35a20298c9d258817ab2af8bde", - "0x282959756a8224c297da9456b46ba93dbbd857b388fe84508f07edf5a7719eb7", - "0x2d9d1858ba4419cc9c6ad979576ab51d829c13d281bf084b5f2640da3fc8e222", - "0x15026fa1c1b68694e5e929a28281d8407d31d18425c7347fe37984307da88249", - "0x159bc7a3a37363eb66d16be88378160e34a75707a5bf2aba439e7a1fe050169d", - "0x08ed7aba31debc48451fd97434e16f1a9e16df9da61a0ad53e9e1dd02e3c2065", - "0x01fe6919296e72cc2ceaa75467a94689fac5fe26595800d9a2b1a810ad8996dd", - "0x0ad776da8301a0e499e29e8df087872e578f884997361d9beff004f355d60f16", - "0x24d07f74b67935cc1112725ab139ca297e2af7281a86aed2ea41e3b3c7959904", - "0x12cbcfcc6454fbfc18a85a3b227d8577074ae281d2dd12d7974d3f4ab314405f", - "0x1bf02cfd70c2fd7e2ae910f8c5f3498222d76a663b84f54ce1cfe61be1b55b0f", - "0x03c0627976adf2d07579de88392bae8d36b61cfa978dc0ab0c4a58e4669f7ed7", - "0x18b18530ca1f021825873a676b279c3bf2fc3eb10b8150c6aefab58d2473f017", - "0x1013fec149896a43be3ff191f80a06290305ec2188748231088c2d935233ca25", - "0x2b89f5be6eba9c57095970360676a7d68ae08e2bd21793fd6826121c1ff16ee0", - "0x02cb71be5485b5e967ba3c68405ed637fc14e8004911659c518a566f119000e9", - "0x0f775f7e515eb52c8d4ac1eb31270582cd1a9f765d64eaa9001d99a81cff792b", - "0x12535f52e6b0788d540ff22161c394303d288bb894fb4f7c11be6c493c69e509", - "0x1b6033dea24a30cee4608d47b1f94c0951e2134bf94ef6497695cb599bb32158", - "0x2fb1342ae5ae45096efd7d22a17126a845b80a5f8abadd19def7e11af5718278", - "0x1c5abbe347dd6b25b2b0216c759eaa29d95b80053c0e5712b9181f6c19ad8312", - "0x0dde51d3892c03e398fbd85155a1e398671b191a7b6e2beeeaa24d4875991a1a", - "0x16396aa97472cf6d9c5dd2dc24840a57cd1fff93acaf58be91e9691aacbecf90", - "0x023354ccd43c876f19ef2c354b7808ccb46008fea59983246cece1fa4298ec9b", - "0x299408c3ee981fa5f97744e27a0c807535eb5ac0bcdf68f43c4e5b14e639c636", - "0x15d6cf26cd4d0a887c7aa0d0c230538e9f7d19511c61c8b398668c1471f46f85", - "0x1f0f66738101dd040298f8d9d512eef53c050fd54e3901f9fc2a0b9525d21a60", - "0x268dc88c19377b2e795701878ce05b16ce6a764dd601daca323bc5fba2af70e6", - "0x2107110b2661d3253e72c2e324268b3fdd0071cdfb59d5fdbe509b29e590113f", - "0x058055d7cb5b3ffca8d3a116c5f842d945af9a38ba03f194109c70b69779e77f", - "0x0d861fb26392acc1853467cc18cb197c3c78eb785bda5aba583f64fbf1ef0d43", - "0x21dcc20a99f0cf80f9a56eeedea5558bbefb3c2378468775466944fd09e89169", - "0x0787a1510f671802b2b9ac5c4866798d566efbdf38b8348db326426a1ab7808b", - "0x10e78a0cf104b2a13dc8952e6e24ea72817040311429d2145220b7e981ea1818", - "0x0c92147ed46f46b207a53f93101f05f62718763c01dc944f6552ba80fe2a6431", - "0x2e7a5bf84263a27da18da56558d203ec5385534de5ee81516c6dfcf960649dea", - "0x12953ab48651385f95e9d12672f5eb929d030da1fdb0ebc3e62783906acd28e8", - "0x0350a9ee3e3aff51266a71891d2ef06d708ffb98ab95c23493f086379907fe45", - "0x21f1cbf48e827bb6fa56049490cae0ffe89afe9bec1344a668b2a01d43e648a0", - "0x142c3af6e017b8b90fa6c01542ade7f52f9b9d8e657185b14627eb18c3c01539" + "0x0074ab02dc90e154ac2cbcdfc1a48341a39a81a5f55b089f9346f8a2527e86ae", + "0x1dfba0423e8eeaf196521740e65c505609f8394dae7f1abe8e8b958378816dba", + "0x25786990b9c4ea09fe4be6e4b02c5bbe5911f46f540c4e9b965a7653ae3ec3d9", + "0x0164d12915711d12c9c168dee6b2735dcb8ff1353fe3ecfa779af29f6275fc7e", + "0x10e86a0e6d4fea0076fc368d0ae10d5492fd4c0639ad91aef435e0575f12e49b", + "0x145e535f82ded50d4d2839d60b869c2ddaf8ed200d92198742144c75f60855b1", + "0x28b598a004b32ebce1bd0746a5d9479cf68aa707d925940e92580869c3091898", + "0x0698a8f7f2e4579fd9e2345e5db294fb4e01a66c78f162a9ee825c3ec8c5176c", + "0x25633719c85b2a15289ebfbb8f431ab5bac033a6cf41142851e3c78dea8aa481", + "0x1e803819ce0f5a08e9436e07b764e282ae476d89e6550e37d98f6a70172634bf", + "0x296a2863dbc7d1bb748e240fd0d59fcce065d052d8cda0da9a319371616a8955", + "0x29f93c54ef05e3c39b268e9315a07b88f58df6f3708f4ec92419c6cc2e4915c1", + "0x29ae10afe21e838c3a922da5939e9ad93458fa323f042514d57aeee6f03f988c", + "0x0a0aa7fa7c963323b0f7b1bf4480070ac86b87fcb5d91df402362a65b2b688a2", + "0x24543882912b9472f4334fc3cdd3bf1194363e2795d5477a66897417fbf28e25", + "0x1512787a083acc1fc85914e59d4e0e3b605d49f4dd41c151f0f82b113e10db11", + "0x1d1a2903fcc910e7d010181a7f5cf098d4a83f0d65900177fe30a895b64fcf21", + "0x2856a30774f8e51b531caaf21acf92f8a6f2654f7f64c56d6a5373cf797c42e0", + "0x0e437360d4be551a330618c2b5f6cbb22ca2daf7af8069cb763bbde1bffd0bb0", + "0x1dd177b898f152cfe8d7cb40f101d90be5f9de890ae375c1abb9d5a1790b55d4", + "0x278fec882fc948c0a740f1c47399c6c1dc760788d5ff222f2399eeff3759cfa0", + "0x146319da717a3e65cacc873a6a2c2fb5d895db62f7a7a18f9ea25d21cb03a374", + "0x0f78ad5039dc515f4c7ec7228a01dc5a8c59347d44c784928bde98aab60ec9e3", + "0x187cb4654e3dea8dcc76c635ae4e530bd9ffbe0b0877080cf59aab85586f08a3", + "0x1f614cef3de67eac7d4bd43e03513c6477a87fbd3f0bf72b90ee25d83fc53dca", + "0x27f3b3d60f4bb6513eb3ee5fd76af1249ec1034ab03a8623b4636dfc7f7ca236", + "0x1ec5d82717eed2bd7ac35fe18233827180c32e0db57361ca0f4446e31c8986a3", + "0x01f3a178e793752d80cbf0f79a730916de14255ee62264f79e88021134e59c44", + "0x080f45d627054c629ca4e0403def125a1b5f30b809292cab0d7ea446e88d38f6", + "0x188db34f552156931e4732632a2de54c3b28b4bf9b5ad121d694ca8ff47f09d0", + "0x288318c8aefb6862e7a62e98c8b655399964c4f112d47d8c0fdfc2438f6672ad", + "0x22949b0f749fdecf422a5427279886514d97aaaedc557da1955da7a320c5d6fe", + "0x09e379140c6a3cb3741e778ab64b2c9b677dd3fafbeeb70fbef43885473a1b65", + "0x170550fe9fb82409087f18a2fa0425cc7bf7df4eb0b3e7e5363d0d501e9815da", + "0x0139a03e7123d13d4491b001746fb5c3db1b2692aca170e3ed3d1dab69e1dce6", + "0x24f96e084d48683acdd35b09b39c8a5291d5b4e0cb23cf1dbb22fc1d5dacf9c3", + "0x094bfeeed64ff90a2f1ca79648847e9f319c7ffdc7fc9a4319a939489d156fa4", + "0x2552c6059bbcaa4177b7e50a40e2d22900c3b5098044ca466df7b56a3fa1b009", + "0x2b8ec701277b811f98da959fc8a37c34c7c9df9816bbf4e04685b46bd3ab88f7", + "0x0fb8c992d1f30c374c4aab5196dde1fb668655786fe4f19888ededfc63170d95", + "0x0558611ef748dcc8860e0db7f1c3c2d32c950bca49f24cd56b14eeee769bb62f", + "0x0e4525bdad95d14c87bc03703642a5d0de40e0cf6c1bdf9ab54e693db0315736", + "0x2157ad003b66d5a96942939a256356dff3a16abc743f48bb434897554c57ee36", + "0x2f0d3de0ecb4d180d75a48484fb28a57c93aff4685778ef2918c6d44044f9906", + "0x15d060b540bde312de54b6bc5f3df705fa9c97b154c50bb8fdf62d6d49f4ed6c", + "0x2a4ed8e6446aac641a74295ee3d0b42c5d5c89e1892014dcdc0e5176094563de", + "0x302f76f9193d149ce9904423b37162d5d73ac2e801646c2b203e63aaf8a400fc", + "0x1df88eb1e5778a51002d7163e11fc6689fcb9144837481e2ee8b83ef42e3eb55", + "0x1f0efbe4a53bc30f17ec1c5d880b273c2b552956574330de438a4df18890b62b", + "0x1bf3a6073517bab16c4d86987e0f5f4cb48f3a0738e05dc1635b8f3d3025d947", + "0x04ebbdf92388775db8ed4cc58521290fdda9fc37be15ccf1c66a95d4a4f93931", + "0x02b18e909a8d9b181b3fd78ffc5fe245123b0bfbf7a924380b66babc80c2a1ff", + "0x21e4664ca87d99c200349f5d54ea297711a9d442641d30a3fbe9fe87e27a283e", + "0x00130aadfe1385fb4c47906b85799d194dc8015b0363b0fe79d4848ffaeb2941", + "0x02209ead4b9b55255a88578d2a8bcf8b2dff10f935bf43c316a9b287f6f6eea6", + "0x1b0bbd877454ce6db3500aff123b465f6495a404a26b33af3961ac0731198781", + "0x2af8fede2c836c38b313d61ebb24480960d82f42f67fe437fdb6fee2aad608e1", + "0x2881fe3e1147c9fb79563a57b78894a8fd0629f3165d5cf786ef6ec6e59584ab", + "0x207c19f3a163c774d3ab7bbde0cd436fa0dfbe8276d169195e10b560d50f3d1e", + "0x10014281d4bd26790ce8507d5419fcb4edefb940a4658cfe8e0850dca47de0b6", + "0x0de5ed93694836d06a1665a7363e3fa7ab23f13b9157c4775b02c438ec9e6e8d", + "0x2657b8178c65f208b68bde0e8f9a61be8b8798a9896e0c26513c1c31cf6a0940", + "0x1fe10e3b0052b3e0a314829b6879f4d31bca964b88e2aa5ce140288b46f3dfaa", + "0x11f17d661b77eb9b857225d9f55891b2d21ebc570eb788f744ae34f71abbb7e2", + "0x0ef4b273d021b9a206a126ecf711be8a8bade56d7aca8e32bf6c17db85ff5989", + "0x2d209196cc553b22db4883b291647094b7427af6164c7432f2a5fb59e6b0ded9", + "0x12f5fe62653c3a45ed28dc4f5505f386b1ebb99a2653c643daa06a7e9b7e2289", + "0x1e4d58fddc82a3be51dff84f322d5bfc7f1bb59d84b72d239b2614abcd96b3a0", + "0x23f844adee3fc6b9a84702f4612ff5cc0999a9e296b96fc3aa30842c1ea8fe29", + "0x20ae97d32aa7be06f396605aa0f55fbbd5503f5abbbc7f44e816b5bbc9c318e4", + "0x0fce3b62c08ebbdc7e86e4e0b35e8e24040e529868494a9ac375a52b612da39e", + "0x27a8feb22046878dd3862600afd3f633fa0d74f1f8b895dad4542778ecc0ac0d", + "0x287da69fc93931e8f6203af3314834c0a54919ed24d238401f95e67b5c9dc1b1", + "0x1dcc9328b5cff297d6dac1f1c691e80a1ed6f9474b23c38d07260d2eb8d880a5", + "0x16eb21decfae9f45ab3b7a0384d6aac3194db44cd6ea93256c4e1fa17835c2e1", + "0x05226e72e31fc540b32b2a0b10983d4d3a503c072e80c9142efc68507d558a22", + "0x07269ea897bbd7c8d8b15a4efa94457e7870b91a38c36d964b026dfcaf6a30b6", + "0x2184ab3e5cd009479b155152673d359eb985b028a534e2db21e91938e7d58a2b", + "0x2daadab51ba01abaee7e13b473e6d8d0ddfced984b8f60124b191cc3b60a7fc0", + "0x2a708fd4eac66add09d1b7c456a2d4954ae4b26564053d9c1ffce70a5667b448", + "0x05923b6daab5f39c7d61928fb6d389f597194fcc43c4f43a119b8be0ea128484", + "0x226ea3c5826affc884f5f91f4a59960032617f43fee79f870a0c61d10952da2b", + "0x18e9f2b7c3c4ab4c171e149e67e9c68f1c784b7eb89bcb3e813fe3b0c81b4d6e", + "0x02027c2a38f25ed64de30e8a2fba89b42845ad4fb3bf6fdf6b255957714cab9d", + "0x1bf5b11d285b8a128aa50f69ca1a51a0b2d25f80f72383bcd36994e10e504edc", + "0x22d7e136ae10ce74f543f81b6d6651314e3928681c27539183ec5ff559a22716" ] - hash = "0x12fc95142d9b64d06f47211dc8362a877f9d287f2c7ddfb7bf89b37f2bfc6eee" + hash = "0x0a0c0523f7818e4eca847b6590298150ebda2d37be2055c0796e199bc4756c24" [inputs.start.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000380" +root = "0x20381eeb1906be36ee4380d9b60fb23f51d654299ef836579c56e2233d865f7e" +next_available_leaf_index = "0x00000000000000000000000000000000000000000000000000000000000003c0" [inputs.start.nullifier_tree] -root = "0x085a35f42d569f7aac0404ce29055696f738a6c798a32632d15a8453e59115ff" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000400" +root = "0x0d0cf8da2e7808e6b817da31c4c6c2b4a617859dcfd3ab9ab300acac80d7536a" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000440" [inputs.start.public_data_tree] -root = "0x0ff17010ab909b4a0c9581a9c33cf0af93280c6fcd6664cf27270b8762a9e418" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" +root = "0x2de06dc379678174b469169d016af35ce9abde298f45f74b251be83c61fbb9fb" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" [inputs.start_sponge_blob] fields = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -9621,7 +9711,7 @@ expected_fields = "0x00000000000000000000000000000000000000000000000000000000000 [inputs.state_diff_hints] sorted_nullifiers = [ - "0x1f402bc61864bc9d78571eb2ff08bd21be788986bfc07e9e7865cbe3dd0a905b", + "0x1784005ecb3066ffa7214623dd2fef7610be0325ac394b80a8c08d9872a01e1c", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -9754,9 +9844,9 @@ sorted_nullifier_indexes = [ ] note_hash_subtree_sibling_path = [ "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", - "0x0af87d98c040dfadabf7ef27165e88560ef39d0c923b6534466a98f672ed8c88", - "0x246218a1d11c91124c20e3394600ad16e5036e2b84aa6afcc8cf3422fd29b02c", - "0x1196b37a9f45bda9848dd661f2df18622a6b4efed01b1cb9eae812f3bf0bc0de", + "0x1dcd2438fd616213c0bd9b2502c3c9c23c3401bfb6a13e222cdbabfd2f116162", + "0x053bb2c694b0c468b16c0005162445cb7e1dc327e4a99e915542607d886d8c00", + "0x117d3e57050964d42014c095f7a71f3fc8e4d5b06c3a4869c6155f4060756b7d", "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", @@ -9789,11 +9879,11 @@ note_hash_subtree_sibling_path = [ "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" ] nullifier_subtree_sibling_path = [ - "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", + "0x0188f884ae5a8ca575f97a94f15dbee3736b428d72b5f3099cf63380a9de08dc", "0x2d78ed82f93b61ba718b17c2dfe5b52375b4d37cbbed6f1fc98b47614b0cf21b", "0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1", "0x1849b85f3c693693e732dfc4577217acc18295193bede09ce8b97ad910310972", - "0x0a06b6b89781f620b504e94f41d028f37551b3ee799e27e4f53d77e2cc8dfe70", + "0x2e51f926054ea29933150d59488334410910439bdde19dac3b3373cc0fa8d8de", "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", "0x1c4954081e324939350febc2b918a293ebcdaead01be95ec02fcbe8d2c1635d1", @@ -9869,45 +9959,45 @@ public_data_tree_sibling_paths = [ ], [ "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0bb3d8007a9c81e4a77ffbff57279f3aa0d79d8678f1814c30cb171dfda2559c", - "0x23cd912ef92df34fc8cc4a7ac3d8aa97957496a61f242fc5980c532e41d2450f", - "0x21f9172d72fdcdafc312eee05cf5092980dda821da5b760a9fb8dbdf607c8a20", - "0x2aa283f0f28968b543363d4318ba200eb9e61d8848211a240bc8672e5ced2241", - "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", - "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", - "0x1ca9e278adda9d761bf24db4e548d3c13a9a0bad6808b9cc4c7881a6f7cf812d", - "0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1", - "0x1849b85f3c693693e732dfc4577217acc18295193bede09ce8b97ad910310972", - "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", - "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", - "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", - "0x1c4954081e324939350febc2b918a293ebcdaead01be95ec02fcbe8d2c1635d1", - "0x0197f2171ef99c2d053ee1fb5ff5ab288d56b9b41b4716c9214a4d97facc4c4a", - "0x2b9cdd484c5ba1e4d6efcc3f18734b5ac4c4a0b9102e2aeb48521a661d3feee9", - "0x14f44d672eb357739e42463497f9fdac46623af863eea4d947ca00a497dcdeb3", - "0x071d7627ae3b2eabda8a810227bf04206370ac78dbf6c372380182dbd3711fe3", - "0x2fdc08d9fe075ac58cb8c00f98697861a13b3ab6f9d41a4e768f75e477475bf5", - "0x20165fe405652104dceaeeca92950aa5adc571b8cafe192878cba58ff1be49c5", - "0x1c8c3ca0b3a3d75850fcd4dc7bf1e3445cd0cfff3ca510630fd90b47e8a24755", - "0x1f0c1a8fb16b0d2ac9a146d7ae20d8d179695a92a79ed66fc45d9da4532459b3", - "0x038146ec5a2573e1c30d2fb32c66c8440f426fbd108082df41c7bebd1d521c30", - "0x17d3d12b17fe762de4b835b2180b012e808816a7f2ff69ecb9d65188235d8fd4", - "0x0e1a6b7d63a6e5a9e54e8f391dd4e9d49cdfedcbc87f02cd34d4641d2eb30491", - "0x09244eec34977ff795fc41036996ce974136377f521ac8eb9e04642d204783d2", - "0x1646d6f544ec36df9dc41f778a7ef1690a53c730b501471b6acd202194a7e8e9", - "0x064769603ba3f6c41f664d266ecb9a3a0f6567cd3e48b40f34d4894ee4c361b3", - "0x1595bb3cd19f84619dc2e368175a88d8627a7439eda9397202cdb1167531fd3f", - "0x2a529be462b81ca30265b558763b1498289c9d88277ab14f0838cb1fce4b472c", - "0x0c08da612363088ad0bbc78abd233e8ace4c05a56fdabdd5e5e9b05e428bdaee", - "0x14748d0241710ef47f54b931ac5a58082b1d56b0f0c30d55fb71a6e8c9a6be14", - "0x0b59baa35b9dc267744f0ccb4e3b0255c1fc512460d91130c6bc19fb2668568d", - "0x2c45bb0c3d5bc1dc98e0baef09ff46d18c1a451e724f41c2b675549bb5c80e59", - "0x121468e6710bf1ffec6d0f26743afe6f88ef55dab40b83ca0a39bc44b196374c", - "0x2042c32c823a7440ceb6c342f9125f1fe426b02c527cd8fb28c85d02b705e759", - "0x0d582c10ff8115413aa5b70564fdd2f3cefe1f33a1e43a47bc495081e91e73e5", - "0x0f55a0d491a9da093eb999fa0dffaf904620cbc78d07e63c6f795c5c7512b523", - "0x21849764e1aa64b83a69e39d27eedaec2a8f97066e5ddb74634ffdb11388dd9a", - "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" ], [ "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -12516,9 +12606,9 @@ public_data_tree_sibling_paths = [ ] [[inputs.state_diff_hints.nullifier_predecessor_preimages]] - nullifier = "0x1da4d5e505ca0e6d9e745c3dc9a68179e5051b2a4c1e3c1c57dda892cb50c07a" - next_nullifier = "0x229d31a8187ed8bc4771d63979f06412468caacbd5a1373a486cd15a9c107b75" - next_index = "0x0000000000000000000000000000000000000000000000000000000000000103" + nullifier = "0x16f56bfde1761a6df8b9cb05438c6fd924273ba221e7d7918b58db18e93f5875" + next_nullifier = "0x189a5d89cf9f7503d61ffff03dfe5279971ec5929cd5a10236266d080d62c66a" + next_index = "0x0000000000000000000000000000000000000000000000000000000000000200" [[inputs.state_diff_hints.nullifier_predecessor_preimages]] nullifier = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -12836,19 +12926,19 @@ public_data_tree_sibling_paths = [ next_index = "0x0000000000000000000000000000000000000000000000000000000000000000" [[inputs.state_diff_hints.nullifier_predecessor_membership_witnesses]] - leaf_index = "258" + leaf_index = "961" sibling_path = [ - "0x158597305275af15ab29181c87b7ace38630b9cbd269e6abfc2220a9da98a742", - "0x20c5bad6ccbe48150d90032dedfd2fd4dd71ee511cd6cd227127678b228651f1", + "0x189fd319066db281e04e1b3ead35708a4f931b6490c8b0e31fdb3f6e37abff50", + "0x0b63a53787021a4a962a452c2921b3663aff1ffd8d5510540f8e659e782956f1", "0x0e34ac2c09f45a503d2908bcb12f1cbae5fa4065759c88d501c097506a8b2290", "0x21f9172d72fdcdafc312eee05cf5092980dda821da5b760a9fb8dbdf607c8a20", "0x2373ea368857ec7af97e7b470d705848e2bf93ed7bef142a490f2119bcf82d8e", "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", - "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", - "0x156e9473a6806318d563f77f2b7ad410f0786969fb9804e80f09067deac9aa20", - "0x17fceab5e6d15d0f76dd258329b0369a8c603e977a7b900046d484c9e616cca1", - "0x0424880a586d1288a51e34a5fccc9eff170c3280b8cee33ab0c8f091f2ed02bc", - "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", + "0x3063eeb7ed1c64d6c1ad62388f51edec198dd49e05de5bac8a48e8cc0061bb34", + "0x2ead0bdba96a672e2d8830d9c03869d95c4684d51cda7169b4d54210e5312b07", + "0x1c7758a54b1c4b16ec7382d0724d9d6a691acaf765426e3a85b914fb6b3bcc18", + "0x058f7c310d704a9cdf6b7ca6b0df0ae5ddc3441f8eb7375fda8b4f3742417480", + "0x2dabddaba0e4df759abef20378ebe9e5d6d1973370306a36cf8a6cea13e64d6b", "0x0f320b0703439a8114f81593de99cd0b8f3b9bf854601abb5b2ea0e8a3dda4a7", "0x0d07f6e7a8a0e9199d6d92801fff867002ff5b4808962f9da2ba5ce1bdd26a73", "0x1c4954081e324939350febc2b918a293ebcdaead01be95ec02fcbe8d2c1635d1", @@ -15716,16 +15806,16 @@ public_data_tree_sibling_paths = [ ] [[inputs.state_diff_hints.low_public_data_writes_preimages]] - slot = "0x0384c877dba0f9d849d02e07dac0d3105f8e09b0959c5ee77843b8c037b195bc" - value = "0x0000000000000000000000000000000000000000000000000000000000002710" - next_slot = "0x0561cdb9d85d8b3ae33aff890d99288e470e182c3ae05e7c9be17a6951dfc6bc" - next_index = "0x0000000000000000000000000000000000000000000000000000000000000093" + slot = "0x28fca282ea49b7b97e5a726e0316dc4b86b4e35b8233618bcce3aa48989b3ab9" + value = "0x0000000000000000000000000000000000000000000000000000000000002328" + next_slot = "0x2a4a6fcff34dad4368423f3aa9ec0d9e9fc6b8e5c77c57792d5d1432da833a28" + next_index = "0x000000000000000000000000000000000000000000000000000000000000008b" [[inputs.state_diff_hints.low_public_data_writes_preimages]] - slot = "0x0a2bb0623b5676e4f6c3a348d5216f7399df6f70bc39b6215fc25c61b6a298cc" - value = "0x000000000000000000000000000000000000000000000000000000000000dead" - next_slot = "0x1235e8f0d07907deb94ddae02ffc6d866dad7bf5e772f11daae670de97e9e7ec" - next_index = "0x0000000000000000000000000000000000000000000000000000000000000092" + slot = "0x0076ea2b6f0dd2bb00e6767f9150e6e0a13116ab0572f0ab7a55ca0bb6a99fef" + value = "0x00000000000000000000000000000000000000000000000000000000000003e8" + next_slot = "0x05410088147a225519dc1f6d1a133ee9f887a941fa69b5bccc505defc9f34dce" + next_index = "0x000000000000000000000000000000000000000000000000000000000000008d" [[inputs.state_diff_hints.low_public_data_writes_preimages]] slot = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -16102,14 +16192,14 @@ public_data_tree_sibling_paths = [ [[inputs.state_diff_hints.low_public_data_writes_witnesses]] leaf_index = "136" sibling_path = [ - "0x1f44507bda987b03d4828bbeea80b3db6c5260b16befa7ea02a8e791d16edcb2", - "0x1cddbb72a31abd2933738763e7698ca38d44d44b6e4cc83e62b060f887d914f3", - "0x287643c15a8e932b1785e4716de672f715332d1b9501b839614a21e93027b2d2", - "0x1a9d534731724e33cd91247aaa1e2cfa7fd1262ecc547b362c9017dd511a9da0", - "0x2316385064e32aff8da30a269857d01aeaa14d6a45b61bd144c5d7a357e81304", + "0x2184cd12689cae6efe10945733f889c00ad6c70c9d0655224396dd2ea77dde75", + "0x15e718415e7ed4e2fe911918a3a28b2d997050ae28807327bd182598b2090da1", + "0x0fb311c780555b341ae5ea3a2c40ce79a98c800488d0b984fb3f82c22b02b6ff", + "0x174e69a359e8f66cbeaa14cf53829f868b6bb7e33a058ea12277764fb9085e88", + "0x1c79b929d2708f34e55c8d2db0aea56e46f4abad824e0f1cb0a21712423b968c", "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", - "0x1ca9e278adda9d761bf24db4e548d3c13a9a0bad6808b9cc4c7881a6f7cf812d", + "0x0ce1288a384eef40ae285803a29c2a8a819bce723aef7e0769c664deea24040a", "0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1", "0x1849b85f3c693693e732dfc4577217acc18295193bede09ce8b97ad910310972", "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", @@ -16145,16 +16235,16 @@ public_data_tree_sibling_paths = [ ] [[inputs.state_diff_hints.low_public_data_writes_witnesses]] - leaf_index = "132" + leaf_index = "150" sibling_path = [ - "0x183de73645b7162deaebf8b8448f694111b0f42ca72ae55de7887b12059fecfd", - "0x0be0821d05398e17224d93ea78ef03d123a58ba3900dae4e910ebfd245335938", - "0x08b82ce2fd75b88f3d00322d30db153f55d22b9ab764c80fa43edbec6441a15f", - "0x01bf9864040632b1050345bf85d0adf9ab3168bc1ea8a5dc506c9aa6e8a0e665", - "0x2316385064e32aff8da30a269857d01aeaa14d6a45b61bd144c5d7a357e81304", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x13dc8a9a4c885354095dbb6509f548ed29eb7216484b633b4189fed72bd0f509", + "0x2d115b38d118eccd54592396d685bb85f66e8cdd0ceb9b72d124dcb930d8ca82", + "0x21f9172d72fdcdafc312eee05cf5092980dda821da5b760a9fb8dbdf607c8a20", + "0x28f83adcc34614dd408cf8c2e046f120bd38a5de2f79d9633ee540bc566dee87", "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", - "0x1ca9e278adda9d761bf24db4e548d3c13a9a0bad6808b9cc4c7881a6f7cf812d", + "0x0ce1288a384eef40ae285803a29c2a8a819bce723aef7e0769c664deea24040a", "0x067243231eddf4222f3911defbba7705aff06ed45960b27f6f91319196ef97e1", "0x1849b85f3c693693e732dfc4577217acc18295193bede09ce8b97ad910310972", "0x2a775ea761d20435b31fa2c33ff07663e24542ffb9e7b293dfce3042eb104686", @@ -18980,11 +19070,11 @@ public_data_tree_sibling_paths = [ ] [inputs.archive_root_membership_witness] -leaf_index = "6" +leaf_index = "5" sibling_path = [ - "0x022087729c552378b2572eb9be555e7dff2161a22e9a1d5e175d3558163a615b", - "0x1392eef60465b19ad485b6de40faf2db67a3ba33bd6ab3db4229493361f1371b", - "0x2ec2b3b3c692503758a443640b3e5f20a818cd7b7d339956c2d923c9d02622cb", + "0x06eaff534194c3a625075b6df053058ef93bc24ae351fc133a2ac22efc075dea", + "0x205d411cf494e27f225e08fc3d40e9b6d960295e72e0bb64c47f8fb32338b7c0", + "0x1c32d9e59590c6d2e69edfeeeb19900697469ccdde47e3663a3f26c658cf2aa8", "0x21f9172d72fdcdafc312eee05cf5092980dda821da5b760a9fb8dbdf607c8a20", "0x2373ea368857ec7af97e7b470d705848e2bf93ed7bef142a490f2119bcf82d8e", "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", @@ -19014,11 +19104,11 @@ sibling_path = [ ] [inputs.constants] -vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" -protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" +vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" +protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [inputs.constants.last_archive] - root = "0x04b51aa5df89d177213335ca62dee74d15b920e231f5ea5198ed405967d188fd" + root = "0x148982e14549cad3887a3c4e0b93de0c350ba45bdd4af324913c50077fe63462" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" [inputs.constants.global_variables] @@ -19026,10 +19116,10 @@ protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182 version = "0x0000000000000000000000000000000000000000000000000000000000000001" block_number = "0x0000000000000000000000000000000000000000000000000000000000000008" slot_number = "0x0000000000000000000000000000000000000000000000000000000000000015" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2e96" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776aa05" [inputs.constants.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.constants.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-block-merge/Prover.toml b/noir-projects/noir-protocol-circuits/crates/rollup-block-merge/Prover.toml index ad739d8ea2a..fc19c673170 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-block-merge/Prover.toml +++ b/noir-projects/noir-protocol-circuits/crates/rollup-block-merge/Prover.toml @@ -1,59 +1,59 @@ [[inputs.previous_rollup_data]] [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs] -previous_block_hash = "0x022087729c552378b2572eb9be555e7dff2161a22e9a1d5e175d3558163a615b" -end_block_hash = "0x002618b2ab9d69c78576160e237eab9c7b0e42bea8e433224af2abb5aa0ea51f" +previous_block_hash = "0x0200b0dad256c4ca38d898520100fdc6b332166c4edbf55bd5ee569f1758f04d" +end_block_hash = "0x0c150ae62bbfe2aee5df3282e26a74765d1767fd8b71018b4dcd1e0bd40238b0" out_hash = "0x00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb" -vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" -protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" +vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" +protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.previous_archive] - root = "0x04b51aa5df89d177213335ca62dee74d15b920e231f5ea5198ed405967d188fd" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" + root = "0x026e8d4564303241e67610a78bc5a2cfbd383ef1673f9e2a00a226d6bb280d34" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000006" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.new_archive] - root = "0x0781b1cc32dbe21aba1e27519e765bd44222b52ef464c6b63dfa97b399376c2e" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000009" + root = "0x04f7f51d5b6e46fa9f34e4913304cd932bdd85edbc0ed0b8bf038c897440e6e6" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000007" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000008" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000015" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2e96" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000006" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000013" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a9d5" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000008" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000015" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2e96" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000006" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000013" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a9d5" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees]] - value = "0x0000000000000000000000000000000000000000000000000011b417896f129a" + value = "0x0000000000000000000000000000000000000000000000000003a83680db4900" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees.recipient] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees]] value = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -339,19 +339,19 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs]] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] -z = "0x05620cfa3125101fc126dcb1cd967ae0cda5bfbb0c413bb1ad570ede664953cf" +z = "0x00a12d93050ef5b515abd05a69966d0b2e704357e28ea2de1a87c881dd718dba" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.y] limbs = [ - "0x1965375f1fcd10c386e8da3da65bf4", - "0xb17c73370563522d2debdb7994b039", - "0x17f0" + "0xc5d2a26bf1faa20862a064ee702c88", + "0x62c837e30ff0b74f961b6048dadefa", + "0x2f63" ] [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.kzg_commitment] inner = [ - "0x00aae0654b3ba2a2f1e2fa2c7d23b35ab21cfba67951dcf917925cc2325eb866", - "0x0000000000000000000000000000001eea78b1856d5770ee11f410332f1be2af" + "0x009321642da96004c157e6e0bdd65edba0037caf61d44e41f27d8fac79ca5372", + "0x000000000000000000000000000000c807f24f1a9025eabd5db962279bc477d5" ] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] @@ -3153,13 +3153,84 @@ fields = [ "0x00000000000000000000000000000000000000000000000000000000000001cc", "0x00000000000000000000000000000000000000000000000000000000000001cd", "0x00000000000000000000000000000000000000000000000000000000000001ce", - "0x00000000000000000000000000000000000000000000000000000000000001cf" + "0x00000000000000000000000000000000000000000000000000000000000001cf", + "0x00000000000000000000000000000000000000000000000000000000000001d0", + "0x00000000000000000000000000000000000000000000000000000000000001d1", + "0x00000000000000000000000000000000000000000000000000000000000001d2", + "0x00000000000000000000000000000000000000000000000000000000000001d3", + "0x00000000000000000000000000000000000000000000000000000000000001d4", + "0x00000000000000000000000000000000000000000000000000000000000001d5", + "0x00000000000000000000000000000000000000000000000000000000000001d6", + "0x00000000000000000000000000000000000000000000000000000000000001d7", + "0x00000000000000000000000000000000000000000000000000000000000001d8", + "0x00000000000000000000000000000000000000000000000000000000000001d9", + "0x00000000000000000000000000000000000000000000000000000000000001da", + "0x00000000000000000000000000000000000000000000000000000000000001db", + "0x00000000000000000000000000000000000000000000000000000000000001dc", + "0x00000000000000000000000000000000000000000000000000000000000001dd", + "0x00000000000000000000000000000000000000000000000000000000000001de", + "0x00000000000000000000000000000000000000000000000000000000000001df", + "0x00000000000000000000000000000000000000000000000000000000000001e0", + "0x00000000000000000000000000000000000000000000000000000000000001e1", + "0x00000000000000000000000000000000000000000000000000000000000001e2", + "0x00000000000000000000000000000000000000000000000000000000000001e3", + "0x00000000000000000000000000000000000000000000000000000000000001e4", + "0x00000000000000000000000000000000000000000000000000000000000001e5", + "0x00000000000000000000000000000000000000000000000000000000000001e6", + "0x00000000000000000000000000000000000000000000000000000000000001e7", + "0x00000000000000000000000000000000000000000000000000000000000001e8", + "0x00000000000000000000000000000000000000000000000000000000000001e9", + "0x00000000000000000000000000000000000000000000000000000000000001ea", + "0x00000000000000000000000000000000000000000000000000000000000001eb", + "0x00000000000000000000000000000000000000000000000000000000000001ec", + "0x00000000000000000000000000000000000000000000000000000000000001ed", + "0x00000000000000000000000000000000000000000000000000000000000001ee", + "0x00000000000000000000000000000000000000000000000000000000000001ef", + "0x00000000000000000000000000000000000000000000000000000000000001f0", + "0x00000000000000000000000000000000000000000000000000000000000001f1", + "0x00000000000000000000000000000000000000000000000000000000000001f2", + "0x00000000000000000000000000000000000000000000000000000000000001f3", + "0x00000000000000000000000000000000000000000000000000000000000001f4", + "0x00000000000000000000000000000000000000000000000000000000000001f5", + "0x00000000000000000000000000000000000000000000000000000000000001f6", + "0x00000000000000000000000000000000000000000000000000000000000001f7", + "0x00000000000000000000000000000000000000000000000000000000000001f8", + "0x00000000000000000000000000000000000000000000000000000000000001f9", + "0x00000000000000000000000000000000000000000000000000000000000001fa", + "0x00000000000000000000000000000000000000000000000000000000000001fb", + "0x00000000000000000000000000000000000000000000000000000000000001fc", + "0x00000000000000000000000000000000000000000000000000000000000001fd", + "0x00000000000000000000000000000000000000000000000000000000000001fe", + "0x00000000000000000000000000000000000000000000000000000000000001ff", + "0x0000000000000000000000000000000000000000000000000000000000000200", + "0x0000000000000000000000000000000000000000000000000000000000000201", + "0x0000000000000000000000000000000000000000000000000000000000000202", + "0x0000000000000000000000000000000000000000000000000000000000000203", + "0x0000000000000000000000000000000000000000000000000000000000000204", + "0x0000000000000000000000000000000000000000000000000000000000000205", + "0x0000000000000000000000000000000000000000000000000000000000000206", + "0x0000000000000000000000000000000000000000000000000000000000000207", + "0x0000000000000000000000000000000000000000000000000000000000000208", + "0x0000000000000000000000000000000000000000000000000000000000000209", + "0x000000000000000000000000000000000000000000000000000000000000020a", + "0x000000000000000000000000000000000000000000000000000000000000020b", + "0x000000000000000000000000000000000000000000000000000000000000020c", + "0x000000000000000000000000000000000000000000000000000000000000020d", + "0x000000000000000000000000000000000000000000000000000000000000020e", + "0x000000000000000000000000000000000000000000000000000000000000020f", + "0x0000000000000000000000000000000000000000000000000000000000000210", + "0x0000000000000000000000000000000000000000000000000000000000000211", + "0x0000000000000000000000000000000000000000000000000000000000000212", + "0x0000000000000000000000000000000000000000000000000000000000000213", + "0x0000000000000000000000000000000000000000000000000000000000000214", + "0x0000000000000000000000000000000000000000000000000000000000000215", + "0x0000000000000000000000000000000000000000000000000000000000000216" ] [inputs.previous_rollup_data.vk] key = [ "0x0000000000000000000000000000000000000000000000000000000000800000", - "0x00000000000000000000000000000000000000000000000000000000000003ec", + "0x00000000000000000000000000000000000000000000000000000000000003f6", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x00000000000000000000000000000000000000000000000000000000000003dc", @@ -3178,184 +3249,195 @@ key = [ "0x00000000000000000000000000000000000000000000000000000000000003e9", "0x00000000000000000000000000000000000000000000000000000000000003ea", "0x00000000000000000000000000000000000000000000000000000000000003eb", - "0x000000000000000000000000000000e2a70abf2db5a56e3b80b735d8fe93844f", - "0x000000000000000000000000000000000007d5e763ad00e11b46ba2c01874266", - "0x000000000000000000000000000000717f06f4849fabc0eb379038c2787f4f0a", - "0x00000000000000000000000000000000002432b88686a770539feb7073936af2", - "0x000000000000000000000000000000241b31d36d4fa2d3d0b65b60a0b30fbe1f", - "0x00000000000000000000000000000000001647b3c906eea3d9a936ca32d1d2cc", - "0x000000000000000000000000000000bf5b7e0e7905e95b6dd16f1549320f091a", - "0x00000000000000000000000000000000001d761d19f3a363e0dfeb81bb9d7b17", - "0x0000000000000000000000000000002de78f3b7bf60a3dcaef2403e7a480f674", - "0x000000000000000000000000000000000027a6694dc12546d2169a7af214d7d9", - "0x00000000000000000000000000000084e5ac9a2a9c89b7ba303748f68920fd59", - "0x00000000000000000000000000000000001bcb1558f8a5f2a022f5b21bc84c4f", - "0x000000000000000000000000000000cff61694d99e06f2f6cea24184c6faff45", - "0x000000000000000000000000000000000026def465f5e787af29baad942d31c9", - "0x000000000000000000000000000000d22e435b810b60fdb70b693cd4e9b502a4", - "0x00000000000000000000000000000000000021c68681bd4b10fbf975192b50c9", - "0x000000000000000000000000000000de2b147b0aeeb897830ec93888b8df2dfa", - "0x00000000000000000000000000000000000786effde53516b0c48c462f99a595", - "0x0000000000000000000000000000007627848e3f39e8b9eb64ea954d26f14549", - "0x00000000000000000000000000000000002144cf1b643ca17330f7e84cd5a655", - "0x00000000000000000000000000000084c15b6e7545324c008347e91d3c485e2d", - "0x00000000000000000000000000000000002bda8532a1ddbb20ef1d06d16a559c", - "0x000000000000000000000000000000285cd754d96c51c5d82a3e96b49a4703a8", - "0x000000000000000000000000000000000028849510d5ecb9fec5e503a8643a64", - "0x00000000000000000000000000000026d90971e11e22590bd1d23c26c3e60643", - "0x00000000000000000000000000000000000ac0ff4f2e738321956625babc98a2", - "0x000000000000000000000000000000e23e99370dee05182b2a6e288a3f1dbe78", - "0x000000000000000000000000000000000026423ab2c1b6c27161c560409b49b2", - "0x000000000000000000000000000000f12699521992cd11507cc3d857f365bda3", - "0x0000000000000000000000000000000000015a68530ca40650b503a2e93f04e4", - "0x0000000000000000000000000000005e671e550d38f3437820a475d19b334a8d", - "0x00000000000000000000000000000000001c572e9a754b84ff4f93feb3419f94", - "0x00000000000000000000000000000001af74368cb4e6c463f81d68f73147a827", - "0x00000000000000000000000000000000002a166f4d388c12d05337733d06f0d4", - "0x000000000000000000000000000000034a2ffe8bc843f57d8769875413c5f1a1", - "0x00000000000000000000000000000000001ede2a33e28cab3b0b987e1e42b23c", - "0x0000000000000000000000000000003052f5dda64a52abe35257bc568f5a6890", - "0x00000000000000000000000000000000002819569643e54119f9cfe02eed2540", - "0x0000000000000000000000000000009f53577bb68e274ee47b6cbe60d5156e44", - "0x00000000000000000000000000000000000a8a3bb75a45fcb1a20cf8b8ea179e", - "0x0000000000000000000000000000005984c45840392053bafefa6c0381d8f3e7", - "0x00000000000000000000000000000000001c5edf25521f683b0f073678aeba28", - "0x0000000000000000000000000000005a03cab51ad1c2b4d7e0c5692d4761bffa", - "0x000000000000000000000000000000000022381d8ee1f8d2b626b4f24c0c5eab", - "0x000000000000000000000000000000b4d4c6827fb665f5f762bec8b5409feba0", - "0x000000000000000000000000000000000013cbf0363025690914296b298c4a34", - "0x000000000000000000000000000000ce0770aa5228294769532c04a9ed052b7e", - "0x00000000000000000000000000000000001cf2c5ff4797fb3fa2f1f4e44d7fff", - "0x000000000000000000000000000000e1333724197aac54787a168048b74fd8ff", - "0x00000000000000000000000000000000002292de33028268f14f0f45a17d1b1b", - "0x000000000000000000000000000000ac1f66a28d7f48bafac5ba6c9f912a007d", - "0x00000000000000000000000000000000000fc04990a04b4db2e4b6934201b2d4", - "0x00000000000000000000000000000082c892d466f77738a2218d9a84669bcf91", - "0x00000000000000000000000000000000000eb8975fa3133acdefe25319c313a9", - "0x000000000000000000000000000000b85d8e7ef7fd09ef6cf3336fbabc64a0b8", - "0x000000000000000000000000000000000015b5395c80352154ac5b0420929c7b", - "0x0000000000000000000000000000002c89b9bf9c26e42c912d240d995cd305e8", - "0x0000000000000000000000000000000000038a3059e3934a59df7f5e6affdb7c", - "0x000000000000000000000000000000353cc4fe06b285bcf7b0420a2f4808d481", - "0x00000000000000000000000000000000002d9098560c035657987a3f0b03aa9f", - "0x000000000000000000000000000000f55966792a244309f68913edafc1a0e283", - "0x00000000000000000000000000000000002cd001744329f9bb8dcf7f706b64d5", - "0x0000000000000000000000000000002e510b8812fe71e3447efb2a703ecf3bbb", - "0x000000000000000000000000000000000003919d6cd79b6b0d98933eee1deed8", - "0x000000000000000000000000000000deb4123671f3d3a36aaf79bf942110ed26", - "0x0000000000000000000000000000000000092e04fd33c62c5b4cde24ef2bd9af", - "0x00000000000000000000000000000017c72822051e3880df0896d457633bb8a8", - "0x00000000000000000000000000000000001b4155a75c956f0335205bb32bb281", - "0x00000000000000000000000000000001a5624432f3837cffa189dd0901903dd4", - "0x000000000000000000000000000000000010ca437fe4ed9cd31e0d885ee10f49", - "0x000000000000000000000000000000eff4e55e0657194f731217645db19db66f", - "0x00000000000000000000000000000000002207f65676e67cbaae6c720b900062", - "0x000000000000000000000000000000db14f5d3c0c91e328f5e9cdf987b3287a6", - "0x00000000000000000000000000000000000815fd61ec34584686d6a57dfe619c", - "0x000000000000000000000000000000e511dcf88b34b04b43d5ac4b5c26bb226c", - "0x00000000000000000000000000000000000517d7a24181453772a8c1c18776a1", - "0x000000000000000000000000000000a94494c66e149dbd7aa3fddd9cc7b05873", - "0x0000000000000000000000000000000000243021ce1dd076e98f6e6d861a420c", - "0x0000000000000000000000000000000f71ef565bb081d1ebb049515d24264da4", - "0x00000000000000000000000000000000000afeee73f2aa3b02af56407bb6afdb", - "0x0000000000000000000000000000001afcdd7968ded28f10b0cf1107b36f4a44", - "0x00000000000000000000000000000000001e4246ba3dcd63b2b44f091fdd4077", - "0x000000000000000000000000000000453e4d4deaef89712bccd4a9f8486a5b2f", - "0x00000000000000000000000000000000000082ffd3cfc3dfbf1fffe287b1c2f3", - "0x0000000000000000000000000000002288034f3ba3cacc74e8cced5c7cd19155", - "0x00000000000000000000000000000000001910a3dc7e741c76c08252e1f2af7a", - "0x000000000000000000000000000000c4825137303952af837523fdb87c5f1a27", - "0x00000000000000000000000000000000000bf36ee00449ecfdcfcd449edb7be8", - "0x000000000000000000000000000000dc4567b52908f0d9ee79f3430c0773f1d4", - "0x00000000000000000000000000000000000b3d06ca98da125cf7c03671375105", - "0x0000000000000000000000000000004c9d6c653b35a4e41ce0c28b8f3bc05f80", - "0x00000000000000000000000000000000001c6cbebc523077127e76e48715e3f7", - "0x00000000000000000000000000000010e9f0c36c8d13bc65ae5dc83aafea4d93", - "0x00000000000000000000000000000000001e6c3234c3d66e62f619f122abcf08", - "0x0000000000000000000000000000007c90b604558cb0031b2786ccfb4b0f267b", - "0x000000000000000000000000000000000023a5e79143fd2d6f9a5d5de119fe03", - "0x000000000000000000000000000000de49bef47504163f244087cb488de2f99a", - "0x00000000000000000000000000000000002b09a5701c772dea31d0fdb450e27b", - "0x000000000000000000000000000000d42fc4da775de36979dfa33a903f61a055", - "0x000000000000000000000000000000000019af65682cd77e5a6b7c48b6900022", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x00000000000000000000000000000000000000000000000000000000000003ec", + "0x00000000000000000000000000000000000000000000000000000000000003ed", + "0x00000000000000000000000000000000000000000000000000000000000003ee", + "0x00000000000000000000000000000000000000000000000000000000000003ef", + "0x00000000000000000000000000000000000000000000000000000000000003f0", + "0x00000000000000000000000000000000000000000000000000000000000003f1", + "0x00000000000000000000000000000000000000000000000000000000000003f2", + "0x00000000000000000000000000000000000000000000000000000000000003f3", + "0x00000000000000000000000000000000000000000000000000000000000003f4", + "0x00000000000000000000000000000000000000000000000000000000000003f5", + "0x000000000000000000000000000000a2e97fe21c4c3244e64d17d2393b2b514c", + "0x00000000000000000000000000000000001eafe7ad47e6091afaa3e72b6986ea", + "0x0000000000000000000000000000008b1506a4ee3bc392bc5418dee93f4caa17", + "0x00000000000000000000000000000000002d23b82c029141a8c0d55dd1df8bcc", + "0x000000000000000000000000000000b759841276cd5c571a018e3647b42a6ab0", + "0x00000000000000000000000000000000001934abcb558e9f25e0930c8e88e79d", + "0x0000000000000000000000000000001ca080ca12e9e8842ba9507f19711d0a74", + "0x000000000000000000000000000000000009bb566181d6bc478fcd238602cfe3", + "0x000000000000000000000000000000d0e9311408d4493a4711814f96a359b075", + "0x00000000000000000000000000000000000d4b34945f195219564b2b3a03316e", + "0x000000000000000000000000000000b227082ed8dee7c039cdc174a4bab14430", + "0x00000000000000000000000000000000001bc7c24bec9d747865a8f1708720fa", + "0x000000000000000000000000000000d3f8bde4eab53f516043abcb35467e3dcc", + "0x0000000000000000000000000000000000218a560bbc3d01fffce6654868ea62", + "0x000000000000000000000000000000bd054c6e320b091a5822e1715538b709ee", + "0x000000000000000000000000000000000003ce0856cfd3934759acff2e039ad5", + "0x000000000000000000000000000000f16f5f7b0c248008648c5bdd234758079c", + "0x0000000000000000000000000000000000147aed3d6ad9334315615413ba1ef4", + "0x000000000000000000000000000000869b3562b8a8555e79d890b2238aa49424", + "0x0000000000000000000000000000000000166a0e596ee6e4de319b667859caae", + "0x000000000000000000000000000000025dcc25fa7064aebee2e4cc59b9cd5634", + "0x00000000000000000000000000000000000bbf45e2bb0690999685c0173ae04f", + "0x000000000000000000000000000000c7ded2eb4db9c81b646064a903398d2d75", + "0x000000000000000000000000000000000012f5e96c64b98a2c0a8d9420c31b0b", + "0x000000000000000000000000000000a4184db5c37fb1cac638cfa9976d4e6111", + "0x000000000000000000000000000000000013cba8a2ad55e65f6de77a883b4bfb", + "0x0000000000000000000000000000005508c3c87897b3c27f01e15d39454d572d", + "0x00000000000000000000000000000000000c03afe0c334e840f52decc868ce1f", + "0x000000000000000000000000000000c3ff9a6fb0e0b22ed42a565be18cd7ee08", + "0x0000000000000000000000000000000000032129593c8c594f28557af41f4afd", + "0x000000000000000000000000000000dd84b27adb05ffab05b8bde876f9dd69c8", + "0x00000000000000000000000000000000001a551837b99163d39c5111d02883a9", + "0x000000000000000000000000000000aa3a46377f0759247d7280d2a329e9adfd", + "0x00000000000000000000000000000000000497c1504891395ff114353acc2e7a", + "0x0000000000000000000000000000009c931cf7071e656d60747f258a058b2e18", + "0x000000000000000000000000000000000024b22dfc8f98fa4335a83981d396e9", + "0x0000000000000000000000000000006991543b28ae523199163e6663b9ac3ae3", + "0x000000000000000000000000000000000017a56ce70a0757d6afdb23b481d4f2", + "0x0000000000000000000000000000005462a32f61512545cc982d00e35d116ee3", + "0x000000000000000000000000000000000025bce556c588b79d27050789d00bb0", + "0x0000000000000000000000000000008a6f0fcc1caab28eb85bc36639e685b419", + "0x00000000000000000000000000000000000cc069d18a5256ed1a94bef31bfb8e", + "0x000000000000000000000000000000c7c8fe7d2beca4a0ce8258a3b9a4cf795a", + "0x00000000000000000000000000000000000610cae82c5bedb48870f79f4f1084", + "0x000000000000000000000000000000bb683d5f4e0def606fd10ed165cb596a7b", + "0x00000000000000000000000000000000002f9246596b0a56b5f8cee09def1f71", + "0x0000000000000000000000000000007c9dd0656df3fe3d0d44649cb34f93a3aa", + "0x0000000000000000000000000000000000242d5fff28c49f4c0db9510b6fefca", + "0x0000000000000000000000000000007ad8610290f68c65d369dd4d6bef7ddd96", + "0x0000000000000000000000000000000000028e86f9a0873299bce50a8a3bdd3a", + "0x0000000000000000000000000000002cf59babbc0f40bdb65eb2069c2333e287", + "0x0000000000000000000000000000000000218e9abaacc55d05fc16d837409ea2", + "0x00000000000000000000000000000093850fcf5c04564ffcc598eb550426edd2", + "0x0000000000000000000000000000000000022dcfa91bb75ff4bf7070b8673511", + "0x0000000000000000000000000000007ca24f0e07eaba2baea1aac625ce2b782f", + "0x00000000000000000000000000000000000fb15c00ccfa291c3763b2698842ac", + "0x00000000000000000000000000000074478d20a5176030241b9dc05fcfb42e55", + "0x00000000000000000000000000000000000cb4823147ba7690f81576d6411d20", + "0x000000000000000000000000000000daf9ff3f18dd71f6600abb43410b001875", + "0x00000000000000000000000000000000002c8a3745093820c3bc562ce5a9279b", + "0x0000000000000000000000000000002382bfd4a08e9c97e07caffbabd758f111", + "0x00000000000000000000000000000000002bc6bbf9413ad4c639710e2a73505f", + "0x0000000000000000000000000000004997325b1d8f05e2485a89a615f8ebca8f", + "0x000000000000000000000000000000000014a32c0fb3fbe4c1b05d3ee2bc4518", + "0x000000000000000000000000000000acb0c90b97713ab6dd1b681f1331d5c955", + "0x00000000000000000000000000000000001a668efc6d9e700763df4ddf06ab37", + "0x0000000000000000000000000000002be3247adfe55392dbef6fafe6dca43feb", + "0x0000000000000000000000000000000000092483a5ee9f43accd6b21136472db", + "0x000000000000000000000000000000f94d53a43e9663163b3dff3e977712150b", + "0x00000000000000000000000000000000002713072700fdaae2245b2bf81fe2dd", + "0x000000000000000000000000000000c663bdb87bf7f091998980275f97004f9c", + "0x00000000000000000000000000000000001a93837f8ce3c12b02aacfc84af4cd", + "0x0000000000000000000000000000009016d09a302e888a2a49d2a46fc90efe68", + "0x000000000000000000000000000000000024e8aea5de3f0ef4318d5f58ae51e7", + "0x00000000000000000000000000000001262f260af8ea8e808089ab8d73b639e2", + "0x00000000000000000000000000000000001157ab39f4e6a58c389ab906bad619", + "0x000000000000000000000000000000825af1c181884503ef7f0235d24877f672", + "0x000000000000000000000000000000000015f06a813d9ca73b5a067a0cd9e6df", + "0x0000000000000000000000000000004d6fc45d45ecc3a8ca0a446777604e8f61", + "0x0000000000000000000000000000000000143e748ae9a0ab858ceb5cbcb150ad", + "0x00000000000000000000000000000044e4b3fa82ed716580df975c7585e94cee", + "0x00000000000000000000000000000000002370d74b9e5298f858bc642d265196", + "0x000000000000000000000000000000980b6cdeb45e67ca23be75801b05d804a7", + "0x0000000000000000000000000000000000064bca4dd3a03634f961457f341748", + "0x0000000000000000000000000000004accc6790cde08f56b88bbb11627acf6ca", + "0x00000000000000000000000000000000001d1a9ec2c77205349211a747e6c419", + "0x0000000000000000000000000000008af5bc6460f55da3387da766f7a99f4e1f", + "0x00000000000000000000000000000000000b27a1ac65d6b1b9b775a14a2631b9", + "0x000000000000000000000000000000694c88b1b5cab3d6ae68c0ee9ad733b701", + "0x000000000000000000000000000000000022d97f246bc683a32f8c0cfbde699d", + "0x000000000000000000000000000000e0c89f4c6b4acd48faaee1f4013c5e087c", + "0x00000000000000000000000000000000000422bb79624189ef8f81bc9d9a3beb", + "0x000000000000000000000000000000382ff07631faa1b40164bad38be6b7927c", + "0x0000000000000000000000000000000000165c4640af66b8e1c331a2ead11c04", + "0x00000000000000000000000000000097ecf47c92944e395460bc5e2696eeca8d", + "0x00000000000000000000000000000000001bbab1b78d9e1a2beea56619c280f1", + "0x000000000000000000000000000000e82d43e4aa841e7054414a9c7296e9be52", + "0x00000000000000000000000000000000002591b3d7440d3bba42545bd8727097", + "0x000000000000000000000000000000d13a50ac76e2c04abfe51ada45e1780e8d", + "0x0000000000000000000000000000000000058cc463564e3321a5428def7eeeb5", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000006862cdf7072422c5d915238fc5fc77e655", - "0x00000000000000000000000000000000000bcabfcf0533b67a88e1a1a2a14a31", - "0x00000000000000000000000000000091b77708688421f998b7f47d4a4ce9ec51", - "0x0000000000000000000000000000000000146762eab5e705427d962991cfa509" + "0x000000000000000000000000000000faabefa6ba0bfb91b8cd399b3d06c6f8ba", + "0x00000000000000000000000000000000002342990bed832e482acc2ce1094302", + "0x00000000000000000000000000000076ebe61784b818a8953cbf336daf8348fa", + "0x000000000000000000000000000000000020e74088a18017f7f53d082a5157bf" ] -hash = "0x23314c114e2e6d7d1dcc2c42f769b7eaa5a42c83e69cb9539ffbbb897d90363d" +hash = "0x036026be76fff4091e5e3c4dbfb5b72b6f54cf7f0515b411f11a635228ede13c" [inputs.previous_rollup_data.vk_witness] leaf_index = "0x000000000000000000000000000000000000000000000000000000000000000d" sibling_path = [ - "0x19c9a76e17167348bb8b76d9d8c5de5df1aeecbb8aba20a1a0432659ca33152b", - "0x03eebb70e90e891dd8280fc233bca53f212597b12b308823c33a3c2c6dc8f28d", - "0x220ebe2ec739267877ea7a9dfdd070c92cc88f558917466660908410bd66dabc", - "0x268b4fb54bbdda64dd707ee86cb0729dfb9a9e8b6ae83e973b37bc7e4b18f875", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x217f63f6ba754bc12fbfabfbee0ae6bd971d39952a50143b0eb3f21c75c52bf4", + "0x087b9cae6e6aa8792660fa4cd27f3a0af3ef8bda6ea4a5c2d40631837c7c4019", + "0x132d9d2d0b96d031d5e97901ab35527c4123d7c9dfc33070b26ff2bba3d0201d", + "0x0178af4ea3a679e0025251b9543017390bf56038f217158886965e52d7b0c8cd", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] [[inputs.previous_rollup_data]] [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs] -previous_block_hash = "0x002618b2ab9d69c78576160e237eab9c7b0e42bea8e433224af2abb5aa0ea51f" -end_block_hash = "0x205dc0e6c4055f045d9c226b52b42ccc6062d9ab2702e4e0acbf3209178b1e53" -out_hash = "0x00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb" -vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" -protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" +previous_block_hash = "0x0c150ae62bbfe2aee5df3282e26a74765d1767fd8b71018b4dcd1e0bd40238b0" +end_block_hash = "0x27d314f0e262ebc3eefebd3f38b3e59e5ecfcd7850f8d9258411b5ebe1218cf5" +out_hash = "0x00db4f24d6eff7983ec163d02c230d6a44237feabd8a2da284edce08afc71435" +vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" +protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.previous_archive] - root = "0x0781b1cc32dbe21aba1e27519e765bd44222b52ef464c6b63dfa97b399376c2e" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000009" + root = "0x04f7f51d5b6e46fa9f34e4913304cd932bdd85edbc0ed0b8bf038c897440e6e6" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000007" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.new_archive] - root = "0x176c781186011b45fed098e21264ed31abe491d165380b1490641d5bc1c7ec85" - next_available_leaf_index = "0x000000000000000000000000000000000000000000000000000000000000000a" + root = "0x148982e14549cad3887a3c4e0b93de0c350ba45bdd4af324913c50077fe63462" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000009" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000016" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2eae" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000007" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000014" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a9ed" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000009" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000016" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2eae" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000007" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000014" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a9ed" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees]] - value = "0x0000000000000000000000000000000000000000000000000011b417896f129a" + value = "0x000000000000000000000000000000000000000000000000001c8e5eeb80de9c" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees.recipient] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees]] value = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -3641,19 +3723,19 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs]] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] -z = "0x172d7f736e107938e1bc1e8a4a11b55937b11a6d1bac463f17efe75495db19e5" +z = "0x2992fb787db88dd43c3dd8ab2988c270182f54a46c78b1c4b8d4f26be46462c6" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.y] limbs = [ - "0x3bb56352d775bd9572666507c876fa", - "0xabf177bc013f733764b4f023e81e66", - "0x19f1" + "0xdc88489e918db9ac4fa016c6cade4a", + "0x0899a2696ac262ee50aec19293f8ab", + "0x2631" ] [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.kzg_commitment] inner = [ - "0x00b4b024814b9a355c67327ec0af765ab3871da695c51a4bdfbe3407ab865fe2", - "0x00000000000000000000000000000074b4d39d0d3840c2a1e97f1924f19a4455" + "0x00867525ebe35db7a92a6d5f62e1288548757ec0ddec3afad8fd3cd15f7007e9", + "0x0000000000000000000000000000009a633acba2c6557eca26bafbfd9f551561" ] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] @@ -6455,13 +6537,84 @@ fields = [ "0x00000000000000000000000000000000000000000000000000000000000001cc", "0x00000000000000000000000000000000000000000000000000000000000001cd", "0x00000000000000000000000000000000000000000000000000000000000001ce", - "0x00000000000000000000000000000000000000000000000000000000000001cf" + "0x00000000000000000000000000000000000000000000000000000000000001cf", + "0x00000000000000000000000000000000000000000000000000000000000001d0", + "0x00000000000000000000000000000000000000000000000000000000000001d1", + "0x00000000000000000000000000000000000000000000000000000000000001d2", + "0x00000000000000000000000000000000000000000000000000000000000001d3", + "0x00000000000000000000000000000000000000000000000000000000000001d4", + "0x00000000000000000000000000000000000000000000000000000000000001d5", + "0x00000000000000000000000000000000000000000000000000000000000001d6", + "0x00000000000000000000000000000000000000000000000000000000000001d7", + "0x00000000000000000000000000000000000000000000000000000000000001d8", + "0x00000000000000000000000000000000000000000000000000000000000001d9", + "0x00000000000000000000000000000000000000000000000000000000000001da", + "0x00000000000000000000000000000000000000000000000000000000000001db", + "0x00000000000000000000000000000000000000000000000000000000000001dc", + "0x00000000000000000000000000000000000000000000000000000000000001dd", + "0x00000000000000000000000000000000000000000000000000000000000001de", + "0x00000000000000000000000000000000000000000000000000000000000001df", + "0x00000000000000000000000000000000000000000000000000000000000001e0", + "0x00000000000000000000000000000000000000000000000000000000000001e1", + "0x00000000000000000000000000000000000000000000000000000000000001e2", + "0x00000000000000000000000000000000000000000000000000000000000001e3", + "0x00000000000000000000000000000000000000000000000000000000000001e4", + "0x00000000000000000000000000000000000000000000000000000000000001e5", + "0x00000000000000000000000000000000000000000000000000000000000001e6", + "0x00000000000000000000000000000000000000000000000000000000000001e7", + "0x00000000000000000000000000000000000000000000000000000000000001e8", + "0x00000000000000000000000000000000000000000000000000000000000001e9", + "0x00000000000000000000000000000000000000000000000000000000000001ea", + "0x00000000000000000000000000000000000000000000000000000000000001eb", + "0x00000000000000000000000000000000000000000000000000000000000001ec", + "0x00000000000000000000000000000000000000000000000000000000000001ed", + "0x00000000000000000000000000000000000000000000000000000000000001ee", + "0x00000000000000000000000000000000000000000000000000000000000001ef", + "0x00000000000000000000000000000000000000000000000000000000000001f0", + "0x00000000000000000000000000000000000000000000000000000000000001f1", + "0x00000000000000000000000000000000000000000000000000000000000001f2", + "0x00000000000000000000000000000000000000000000000000000000000001f3", + "0x00000000000000000000000000000000000000000000000000000000000001f4", + "0x00000000000000000000000000000000000000000000000000000000000001f5", + "0x00000000000000000000000000000000000000000000000000000000000001f6", + "0x00000000000000000000000000000000000000000000000000000000000001f7", + "0x00000000000000000000000000000000000000000000000000000000000001f8", + "0x00000000000000000000000000000000000000000000000000000000000001f9", + "0x00000000000000000000000000000000000000000000000000000000000001fa", + "0x00000000000000000000000000000000000000000000000000000000000001fb", + "0x00000000000000000000000000000000000000000000000000000000000001fc", + "0x00000000000000000000000000000000000000000000000000000000000001fd", + "0x00000000000000000000000000000000000000000000000000000000000001fe", + "0x00000000000000000000000000000000000000000000000000000000000001ff", + "0x0000000000000000000000000000000000000000000000000000000000000200", + "0x0000000000000000000000000000000000000000000000000000000000000201", + "0x0000000000000000000000000000000000000000000000000000000000000202", + "0x0000000000000000000000000000000000000000000000000000000000000203", + "0x0000000000000000000000000000000000000000000000000000000000000204", + "0x0000000000000000000000000000000000000000000000000000000000000205", + "0x0000000000000000000000000000000000000000000000000000000000000206", + "0x0000000000000000000000000000000000000000000000000000000000000207", + "0x0000000000000000000000000000000000000000000000000000000000000208", + "0x0000000000000000000000000000000000000000000000000000000000000209", + "0x000000000000000000000000000000000000000000000000000000000000020a", + "0x000000000000000000000000000000000000000000000000000000000000020b", + "0x000000000000000000000000000000000000000000000000000000000000020c", + "0x000000000000000000000000000000000000000000000000000000000000020d", + "0x000000000000000000000000000000000000000000000000000000000000020e", + "0x000000000000000000000000000000000000000000000000000000000000020f", + "0x0000000000000000000000000000000000000000000000000000000000000210", + "0x0000000000000000000000000000000000000000000000000000000000000211", + "0x0000000000000000000000000000000000000000000000000000000000000212", + "0x0000000000000000000000000000000000000000000000000000000000000213", + "0x0000000000000000000000000000000000000000000000000000000000000214", + "0x0000000000000000000000000000000000000000000000000000000000000215", + "0x0000000000000000000000000000000000000000000000000000000000000216" ] [inputs.previous_rollup_data.vk] key = [ "0x0000000000000000000000000000000000000000000000000000000000800000", - "0x00000000000000000000000000000000000000000000000000000000000003ec", + "0x00000000000000000000000000000000000000000000000000000000000003f6", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x00000000000000000000000000000000000000000000000000000000000003dc", @@ -6480,124 +6633,135 @@ key = [ "0x00000000000000000000000000000000000000000000000000000000000003e9", "0x00000000000000000000000000000000000000000000000000000000000003ea", "0x00000000000000000000000000000000000000000000000000000000000003eb", - "0x000000000000000000000000000000e2a70abf2db5a56e3b80b735d8fe93844f", - "0x000000000000000000000000000000000007d5e763ad00e11b46ba2c01874266", - "0x000000000000000000000000000000717f06f4849fabc0eb379038c2787f4f0a", - "0x00000000000000000000000000000000002432b88686a770539feb7073936af2", - "0x000000000000000000000000000000241b31d36d4fa2d3d0b65b60a0b30fbe1f", - "0x00000000000000000000000000000000001647b3c906eea3d9a936ca32d1d2cc", - "0x000000000000000000000000000000bf5b7e0e7905e95b6dd16f1549320f091a", - "0x00000000000000000000000000000000001d761d19f3a363e0dfeb81bb9d7b17", - "0x0000000000000000000000000000002de78f3b7bf60a3dcaef2403e7a480f674", - "0x000000000000000000000000000000000027a6694dc12546d2169a7af214d7d9", - "0x00000000000000000000000000000084e5ac9a2a9c89b7ba303748f68920fd59", - "0x00000000000000000000000000000000001bcb1558f8a5f2a022f5b21bc84c4f", - "0x000000000000000000000000000000cff61694d99e06f2f6cea24184c6faff45", - "0x000000000000000000000000000000000026def465f5e787af29baad942d31c9", - "0x000000000000000000000000000000d22e435b810b60fdb70b693cd4e9b502a4", - "0x00000000000000000000000000000000000021c68681bd4b10fbf975192b50c9", - "0x000000000000000000000000000000de2b147b0aeeb897830ec93888b8df2dfa", - "0x00000000000000000000000000000000000786effde53516b0c48c462f99a595", - "0x0000000000000000000000000000007627848e3f39e8b9eb64ea954d26f14549", - "0x00000000000000000000000000000000002144cf1b643ca17330f7e84cd5a655", - "0x00000000000000000000000000000084c15b6e7545324c008347e91d3c485e2d", - "0x00000000000000000000000000000000002bda8532a1ddbb20ef1d06d16a559c", - "0x000000000000000000000000000000285cd754d96c51c5d82a3e96b49a4703a8", - "0x000000000000000000000000000000000028849510d5ecb9fec5e503a8643a64", - "0x00000000000000000000000000000026d90971e11e22590bd1d23c26c3e60643", - "0x00000000000000000000000000000000000ac0ff4f2e738321956625babc98a2", - "0x000000000000000000000000000000e23e99370dee05182b2a6e288a3f1dbe78", - "0x000000000000000000000000000000000026423ab2c1b6c27161c560409b49b2", - "0x000000000000000000000000000000f12699521992cd11507cc3d857f365bda3", - "0x0000000000000000000000000000000000015a68530ca40650b503a2e93f04e4", - "0x0000000000000000000000000000005e671e550d38f3437820a475d19b334a8d", - "0x00000000000000000000000000000000001c572e9a754b84ff4f93feb3419f94", - "0x00000000000000000000000000000001af74368cb4e6c463f81d68f73147a827", - "0x00000000000000000000000000000000002a166f4d388c12d05337733d06f0d4", - "0x000000000000000000000000000000034a2ffe8bc843f57d8769875413c5f1a1", - "0x00000000000000000000000000000000001ede2a33e28cab3b0b987e1e42b23c", - "0x0000000000000000000000000000003052f5dda64a52abe35257bc568f5a6890", - "0x00000000000000000000000000000000002819569643e54119f9cfe02eed2540", - "0x0000000000000000000000000000009f53577bb68e274ee47b6cbe60d5156e44", - "0x00000000000000000000000000000000000a8a3bb75a45fcb1a20cf8b8ea179e", - "0x0000000000000000000000000000005984c45840392053bafefa6c0381d8f3e7", - "0x00000000000000000000000000000000001c5edf25521f683b0f073678aeba28", - "0x0000000000000000000000000000005a03cab51ad1c2b4d7e0c5692d4761bffa", - "0x000000000000000000000000000000000022381d8ee1f8d2b626b4f24c0c5eab", - "0x000000000000000000000000000000b4d4c6827fb665f5f762bec8b5409feba0", - "0x000000000000000000000000000000000013cbf0363025690914296b298c4a34", - "0x000000000000000000000000000000ce0770aa5228294769532c04a9ed052b7e", - "0x00000000000000000000000000000000001cf2c5ff4797fb3fa2f1f4e44d7fff", - "0x000000000000000000000000000000e1333724197aac54787a168048b74fd8ff", - "0x00000000000000000000000000000000002292de33028268f14f0f45a17d1b1b", - "0x000000000000000000000000000000ac1f66a28d7f48bafac5ba6c9f912a007d", - "0x00000000000000000000000000000000000fc04990a04b4db2e4b6934201b2d4", - "0x00000000000000000000000000000082c892d466f77738a2218d9a84669bcf91", - "0x00000000000000000000000000000000000eb8975fa3133acdefe25319c313a9", - "0x000000000000000000000000000000b85d8e7ef7fd09ef6cf3336fbabc64a0b8", - "0x000000000000000000000000000000000015b5395c80352154ac5b0420929c7b", - "0x0000000000000000000000000000002c89b9bf9c26e42c912d240d995cd305e8", - "0x0000000000000000000000000000000000038a3059e3934a59df7f5e6affdb7c", - "0x000000000000000000000000000000353cc4fe06b285bcf7b0420a2f4808d481", - "0x00000000000000000000000000000000002d9098560c035657987a3f0b03aa9f", - "0x000000000000000000000000000000f55966792a244309f68913edafc1a0e283", - "0x00000000000000000000000000000000002cd001744329f9bb8dcf7f706b64d5", - "0x0000000000000000000000000000002e510b8812fe71e3447efb2a703ecf3bbb", - "0x000000000000000000000000000000000003919d6cd79b6b0d98933eee1deed8", - "0x000000000000000000000000000000deb4123671f3d3a36aaf79bf942110ed26", - "0x0000000000000000000000000000000000092e04fd33c62c5b4cde24ef2bd9af", - "0x00000000000000000000000000000017c72822051e3880df0896d457633bb8a8", - "0x00000000000000000000000000000000001b4155a75c956f0335205bb32bb281", - "0x00000000000000000000000000000001a5624432f3837cffa189dd0901903dd4", - "0x000000000000000000000000000000000010ca437fe4ed9cd31e0d885ee10f49", - "0x000000000000000000000000000000eff4e55e0657194f731217645db19db66f", - "0x00000000000000000000000000000000002207f65676e67cbaae6c720b900062", - "0x000000000000000000000000000000db14f5d3c0c91e328f5e9cdf987b3287a6", - "0x00000000000000000000000000000000000815fd61ec34584686d6a57dfe619c", - "0x000000000000000000000000000000e511dcf88b34b04b43d5ac4b5c26bb226c", - "0x00000000000000000000000000000000000517d7a24181453772a8c1c18776a1", - "0x000000000000000000000000000000a94494c66e149dbd7aa3fddd9cc7b05873", - "0x0000000000000000000000000000000000243021ce1dd076e98f6e6d861a420c", - "0x0000000000000000000000000000000f71ef565bb081d1ebb049515d24264da4", - "0x00000000000000000000000000000000000afeee73f2aa3b02af56407bb6afdb", - "0x0000000000000000000000000000001afcdd7968ded28f10b0cf1107b36f4a44", - "0x00000000000000000000000000000000001e4246ba3dcd63b2b44f091fdd4077", - "0x000000000000000000000000000000453e4d4deaef89712bccd4a9f8486a5b2f", - "0x00000000000000000000000000000000000082ffd3cfc3dfbf1fffe287b1c2f3", - "0x0000000000000000000000000000002288034f3ba3cacc74e8cced5c7cd19155", - "0x00000000000000000000000000000000001910a3dc7e741c76c08252e1f2af7a", - "0x000000000000000000000000000000c4825137303952af837523fdb87c5f1a27", - "0x00000000000000000000000000000000000bf36ee00449ecfdcfcd449edb7be8", - "0x000000000000000000000000000000dc4567b52908f0d9ee79f3430c0773f1d4", - "0x00000000000000000000000000000000000b3d06ca98da125cf7c03671375105", - "0x0000000000000000000000000000004c9d6c653b35a4e41ce0c28b8f3bc05f80", - "0x00000000000000000000000000000000001c6cbebc523077127e76e48715e3f7", - "0x00000000000000000000000000000010e9f0c36c8d13bc65ae5dc83aafea4d93", - "0x00000000000000000000000000000000001e6c3234c3d66e62f619f122abcf08", - "0x0000000000000000000000000000007c90b604558cb0031b2786ccfb4b0f267b", - "0x000000000000000000000000000000000023a5e79143fd2d6f9a5d5de119fe03", - "0x000000000000000000000000000000de49bef47504163f244087cb488de2f99a", - "0x00000000000000000000000000000000002b09a5701c772dea31d0fdb450e27b", - "0x000000000000000000000000000000d42fc4da775de36979dfa33a903f61a055", - "0x000000000000000000000000000000000019af65682cd77e5a6b7c48b6900022", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x00000000000000000000000000000000000000000000000000000000000003ec", + "0x00000000000000000000000000000000000000000000000000000000000003ed", + "0x00000000000000000000000000000000000000000000000000000000000003ee", + "0x00000000000000000000000000000000000000000000000000000000000003ef", + "0x00000000000000000000000000000000000000000000000000000000000003f0", + "0x00000000000000000000000000000000000000000000000000000000000003f1", + "0x00000000000000000000000000000000000000000000000000000000000003f2", + "0x00000000000000000000000000000000000000000000000000000000000003f3", + "0x00000000000000000000000000000000000000000000000000000000000003f4", + "0x00000000000000000000000000000000000000000000000000000000000003f5", + "0x000000000000000000000000000000a2e97fe21c4c3244e64d17d2393b2b514c", + "0x00000000000000000000000000000000001eafe7ad47e6091afaa3e72b6986ea", + "0x0000000000000000000000000000008b1506a4ee3bc392bc5418dee93f4caa17", + "0x00000000000000000000000000000000002d23b82c029141a8c0d55dd1df8bcc", + "0x000000000000000000000000000000b759841276cd5c571a018e3647b42a6ab0", + "0x00000000000000000000000000000000001934abcb558e9f25e0930c8e88e79d", + "0x0000000000000000000000000000001ca080ca12e9e8842ba9507f19711d0a74", + "0x000000000000000000000000000000000009bb566181d6bc478fcd238602cfe3", + "0x000000000000000000000000000000d0e9311408d4493a4711814f96a359b075", + "0x00000000000000000000000000000000000d4b34945f195219564b2b3a03316e", + "0x000000000000000000000000000000b227082ed8dee7c039cdc174a4bab14430", + "0x00000000000000000000000000000000001bc7c24bec9d747865a8f1708720fa", + "0x000000000000000000000000000000d3f8bde4eab53f516043abcb35467e3dcc", + "0x0000000000000000000000000000000000218a560bbc3d01fffce6654868ea62", + "0x000000000000000000000000000000bd054c6e320b091a5822e1715538b709ee", + "0x000000000000000000000000000000000003ce0856cfd3934759acff2e039ad5", + "0x000000000000000000000000000000f16f5f7b0c248008648c5bdd234758079c", + "0x0000000000000000000000000000000000147aed3d6ad9334315615413ba1ef4", + "0x000000000000000000000000000000869b3562b8a8555e79d890b2238aa49424", + "0x0000000000000000000000000000000000166a0e596ee6e4de319b667859caae", + "0x000000000000000000000000000000025dcc25fa7064aebee2e4cc59b9cd5634", + "0x00000000000000000000000000000000000bbf45e2bb0690999685c0173ae04f", + "0x000000000000000000000000000000c7ded2eb4db9c81b646064a903398d2d75", + "0x000000000000000000000000000000000012f5e96c64b98a2c0a8d9420c31b0b", + "0x000000000000000000000000000000a4184db5c37fb1cac638cfa9976d4e6111", + "0x000000000000000000000000000000000013cba8a2ad55e65f6de77a883b4bfb", + "0x0000000000000000000000000000005508c3c87897b3c27f01e15d39454d572d", + "0x00000000000000000000000000000000000c03afe0c334e840f52decc868ce1f", + "0x000000000000000000000000000000c3ff9a6fb0e0b22ed42a565be18cd7ee08", + "0x0000000000000000000000000000000000032129593c8c594f28557af41f4afd", + "0x000000000000000000000000000000dd84b27adb05ffab05b8bde876f9dd69c8", + "0x00000000000000000000000000000000001a551837b99163d39c5111d02883a9", + "0x000000000000000000000000000000aa3a46377f0759247d7280d2a329e9adfd", + "0x00000000000000000000000000000000000497c1504891395ff114353acc2e7a", + "0x0000000000000000000000000000009c931cf7071e656d60747f258a058b2e18", + "0x000000000000000000000000000000000024b22dfc8f98fa4335a83981d396e9", + "0x0000000000000000000000000000006991543b28ae523199163e6663b9ac3ae3", + "0x000000000000000000000000000000000017a56ce70a0757d6afdb23b481d4f2", + "0x0000000000000000000000000000005462a32f61512545cc982d00e35d116ee3", + "0x000000000000000000000000000000000025bce556c588b79d27050789d00bb0", + "0x0000000000000000000000000000008a6f0fcc1caab28eb85bc36639e685b419", + "0x00000000000000000000000000000000000cc069d18a5256ed1a94bef31bfb8e", + "0x000000000000000000000000000000c7c8fe7d2beca4a0ce8258a3b9a4cf795a", + "0x00000000000000000000000000000000000610cae82c5bedb48870f79f4f1084", + "0x000000000000000000000000000000bb683d5f4e0def606fd10ed165cb596a7b", + "0x00000000000000000000000000000000002f9246596b0a56b5f8cee09def1f71", + "0x0000000000000000000000000000007c9dd0656df3fe3d0d44649cb34f93a3aa", + "0x0000000000000000000000000000000000242d5fff28c49f4c0db9510b6fefca", + "0x0000000000000000000000000000007ad8610290f68c65d369dd4d6bef7ddd96", + "0x0000000000000000000000000000000000028e86f9a0873299bce50a8a3bdd3a", + "0x0000000000000000000000000000002cf59babbc0f40bdb65eb2069c2333e287", + "0x0000000000000000000000000000000000218e9abaacc55d05fc16d837409ea2", + "0x00000000000000000000000000000093850fcf5c04564ffcc598eb550426edd2", + "0x0000000000000000000000000000000000022dcfa91bb75ff4bf7070b8673511", + "0x0000000000000000000000000000007ca24f0e07eaba2baea1aac625ce2b782f", + "0x00000000000000000000000000000000000fb15c00ccfa291c3763b2698842ac", + "0x00000000000000000000000000000074478d20a5176030241b9dc05fcfb42e55", + "0x00000000000000000000000000000000000cb4823147ba7690f81576d6411d20", + "0x000000000000000000000000000000daf9ff3f18dd71f6600abb43410b001875", + "0x00000000000000000000000000000000002c8a3745093820c3bc562ce5a9279b", + "0x0000000000000000000000000000002382bfd4a08e9c97e07caffbabd758f111", + "0x00000000000000000000000000000000002bc6bbf9413ad4c639710e2a73505f", + "0x0000000000000000000000000000004997325b1d8f05e2485a89a615f8ebca8f", + "0x000000000000000000000000000000000014a32c0fb3fbe4c1b05d3ee2bc4518", + "0x000000000000000000000000000000acb0c90b97713ab6dd1b681f1331d5c955", + "0x00000000000000000000000000000000001a668efc6d9e700763df4ddf06ab37", + "0x0000000000000000000000000000002be3247adfe55392dbef6fafe6dca43feb", + "0x0000000000000000000000000000000000092483a5ee9f43accd6b21136472db", + "0x000000000000000000000000000000f94d53a43e9663163b3dff3e977712150b", + "0x00000000000000000000000000000000002713072700fdaae2245b2bf81fe2dd", + "0x000000000000000000000000000000c663bdb87bf7f091998980275f97004f9c", + "0x00000000000000000000000000000000001a93837f8ce3c12b02aacfc84af4cd", + "0x0000000000000000000000000000009016d09a302e888a2a49d2a46fc90efe68", + "0x000000000000000000000000000000000024e8aea5de3f0ef4318d5f58ae51e7", + "0x00000000000000000000000000000001262f260af8ea8e808089ab8d73b639e2", + "0x00000000000000000000000000000000001157ab39f4e6a58c389ab906bad619", + "0x000000000000000000000000000000825af1c181884503ef7f0235d24877f672", + "0x000000000000000000000000000000000015f06a813d9ca73b5a067a0cd9e6df", + "0x0000000000000000000000000000004d6fc45d45ecc3a8ca0a446777604e8f61", + "0x0000000000000000000000000000000000143e748ae9a0ab858ceb5cbcb150ad", + "0x00000000000000000000000000000044e4b3fa82ed716580df975c7585e94cee", + "0x00000000000000000000000000000000002370d74b9e5298f858bc642d265196", + "0x000000000000000000000000000000980b6cdeb45e67ca23be75801b05d804a7", + "0x0000000000000000000000000000000000064bca4dd3a03634f961457f341748", + "0x0000000000000000000000000000004accc6790cde08f56b88bbb11627acf6ca", + "0x00000000000000000000000000000000001d1a9ec2c77205349211a747e6c419", + "0x0000000000000000000000000000008af5bc6460f55da3387da766f7a99f4e1f", + "0x00000000000000000000000000000000000b27a1ac65d6b1b9b775a14a2631b9", + "0x000000000000000000000000000000694c88b1b5cab3d6ae68c0ee9ad733b701", + "0x000000000000000000000000000000000022d97f246bc683a32f8c0cfbde699d", + "0x000000000000000000000000000000e0c89f4c6b4acd48faaee1f4013c5e087c", + "0x00000000000000000000000000000000000422bb79624189ef8f81bc9d9a3beb", + "0x000000000000000000000000000000382ff07631faa1b40164bad38be6b7927c", + "0x0000000000000000000000000000000000165c4640af66b8e1c331a2ead11c04", + "0x00000000000000000000000000000097ecf47c92944e395460bc5e2696eeca8d", + "0x00000000000000000000000000000000001bbab1b78d9e1a2beea56619c280f1", + "0x000000000000000000000000000000e82d43e4aa841e7054414a9c7296e9be52", + "0x00000000000000000000000000000000002591b3d7440d3bba42545bd8727097", + "0x000000000000000000000000000000d13a50ac76e2c04abfe51ada45e1780e8d", + "0x0000000000000000000000000000000000058cc463564e3321a5428def7eeeb5", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000006862cdf7072422c5d915238fc5fc77e655", - "0x00000000000000000000000000000000000bcabfcf0533b67a88e1a1a2a14a31", - "0x00000000000000000000000000000091b77708688421f998b7f47d4a4ce9ec51", - "0x0000000000000000000000000000000000146762eab5e705427d962991cfa509" + "0x000000000000000000000000000000faabefa6ba0bfb91b8cd399b3d06c6f8ba", + "0x00000000000000000000000000000000002342990bed832e482acc2ce1094302", + "0x00000000000000000000000000000076ebe61784b818a8953cbf336daf8348fa", + "0x000000000000000000000000000000000020e74088a18017f7f53d082a5157bf" ] -hash = "0x23314c114e2e6d7d1dcc2c42f769b7eaa5a42c83e69cb9539ffbbb897d90363d" +hash = "0x036026be76fff4091e5e3c4dbfb5b72b6f54cf7f0515b411f11a635228ede13c" [inputs.previous_rollup_data.vk_witness] leaf_index = "0x000000000000000000000000000000000000000000000000000000000000000d" sibling_path = [ - "0x19c9a76e17167348bb8b76d9d8c5de5df1aeecbb8aba20a1a0432659ca33152b", - "0x03eebb70e90e891dd8280fc233bca53f212597b12b308823c33a3c2c6dc8f28d", - "0x220ebe2ec739267877ea7a9dfdd070c92cc88f558917466660908410bd66dabc", - "0x268b4fb54bbdda64dd707ee86cb0729dfb9a9e8b6ae83e973b37bc7e4b18f875", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x217f63f6ba754bc12fbfabfbee0ae6bd971d39952a50143b0eb3f21c75c52bf4", + "0x087b9cae6e6aa8792660fa4cd27f3a0af3ef8bda6ea4a5c2d40631837c7c4019", + "0x132d9d2d0b96d031d5e97901ab35527c4123d7c9dfc33070b26ff2bba3d0201d", + "0x0178af4ea3a679e0025251b9543017390bf56038f217158886965e52d7b0c8cd", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-block-root/Prover.toml b/noir-projects/noir-protocol-circuits/crates/rollup-block-root/Prover.toml index fa054576428..5f258bbe77f 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-block-root/Prover.toml +++ b/noir-projects/noir-protocol-circuits/crates/rollup-block-root/Prover.toml @@ -56,9 +56,9 @@ l1_to_l2_message_subtree_sibling_path = [ ] new_archive_sibling_path = [ "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0b63a53787021a4a962a452c2921b3663aff1ffd8d5510540f8e659e782956f1", - "0x0e34ac2c09f45a503d2908bcb12f1cbae5fa4065759c88d501c097506a8b2290", - "0x207f82708405f34873fadee80edfe9b399ab76b1182523986a388c1e9e560f69", + "0x1ac50d40f2ca4224489f95f493a60e0f0a285a716eb8037dbf5871deead849d0", + "0x1c32d9e59590c6d2e69edfeeeb19900697469ccdde47e3663a3f26c658cf2aa8", + "0x21f9172d72fdcdafc312eee05cf5092980dda821da5b760a9fb8dbdf607c8a20", "0x2373ea368857ec7af97e7b470d705848e2bf93ed7bef142a490f2119bcf82d8e", "0x120157cfaaa49ce3da30f8b47879114977c24b266d58b0ac18b325d878aafddf", "0x01c28fe1059ae0237b72334700697bdf465e03df03986fe05200cadeda66bd76", @@ -85,72 +85,72 @@ new_archive_sibling_path = [ "0x064769603ba3f6c41f664d266ecb9a3a0f6567cd3e48b40f34d4894ee4c361b3", "0x1595bb3cd19f84619dc2e368175a88d8627a7439eda9397202cdb1167531fd3f" ] -previous_block_hash = "0x022087729c552378b2572eb9be555e7dff2161a22e9a1d5e175d3558163a615b" +previous_block_hash = "0x0200b0dad256c4ca38d898520100fdc6b332166c4edbf55bd5ee569f1758f04d" prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" blobs_fields = [ - "0x000000000000000000000000000000000074785f737461727400000900010000", - "0x0002000000000000000000000000000000000000000000000011b417896f129a", - "0x0000000000000000000000000000000000000000000000000000000004000001", - "0x1f402bc61864bc9d78571eb2ff08bd21be788986bfc07e9e7865cbe3dd0a905b", - "0x0000000000000000000000000000000000000000000000000000000006000004", - "0x0384c877dba0f9d849d02e07dac0d3105f8e09b0959c5ee77843b8c037b195bc", - "0x0000000000000000000000000000000000000000000000000000000000002328", - "0x0d38d167da0ccd3ba447ce36953062d88783b02447d5af2bd09519bcd2a928f4", - "0x00000000000000000000000000000000000000000000000000000000000003e8", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000000000000074785f737461727400003f00010000", + "0x0002000000000000000000000000000000000000000000000003a83680db4900", + "0x0000000000000000000000000000000000000000000000000000000003000002", + "0x203d415d2bbd43b332fcc6fbdbf24a3df7d8f403b2b2a4051d6a8c8a9e913486", + "0x1f80d1990c62befb84e60cbfe6475483bdb3b1b860156d84ec55b561a1e963f7", + "0x0000000000000000000000000000000000000000000000000000000004000002", + "0x1c092e50dfdc08e3bbe145aa1ffcc554d22937b7e1dab9d4b30d59368634d28d", + "0x1e5500b16b3acfb338162c1db2abca255b4c3aa696dc43669bdbc802110d48f2", + "0x0000000000000000000000000000000000000000000000000000000007000036", + "0x2325620ddd257cf7f2641a085b45be26f2fcfde718824c457fdaebabbb46a172", + "0x000bc558b3eef99be45bddc263bc31cbbb17a7ffa1d815c6921ec80c8b1c0523", + "0x003eb458eaa8db4858c9db7789e9ad41710bb3e5502ab85cc0ad8d4bc8eb52ce", + "0x00ff08a9664c256053396edfeda7c8f0cc5d8d00000000000000000000000000", + "0x0000005a12365b2a7eeae19796d04db3d06e2d30ae9d74c27f1d44a55d329c4a", + "0x008b547e32e13b40a76dde1047d859c8ec42862d7f81ee223a57ff73a4547266", + "0x00443f4f8a52ad47628d5ecdb5a2365220e979f5d41aec99c080bc4b061bf2c8", + "0x00d457726247f55680896963585b2a9e4a3e6b54135dd7649359b58ad3716582", + "0x002faf3f16beaa6682cc90c3251ffc910f535b03004b2016863173b7ac40d117", + "0x00cbcf8860bfedb383d3c728b374de8b059699d3fee06f3a34c74bf1b3cfd6d2", + "0x002026f90e50a32bfed5b79cf380be00990bcbfba3b91de691b5b0fad72200c4", + "0x00a5ca52258750ac51c0eb3dedca43f651a835e4322f6b0aa44f60b40415d943", + "0x00c03f53a8b0448582cc95aa8c3acbf1b7ecc0c182235b8a495c7250df8fb093", + "0x0099c0c6a4ffaa80a9faa80d9c514d79b0a52ff15ca75387bd591042eb9f8a9d", + "0x002ba5de9cab52824a8261bca9e0101cdbcc2f035985baeb1a24dc6d68968cb1", + "0x00d749741c1d63d56a16c937f747b0763afde032947cb672867532a14dd9cf92", + "0x00abd177c77edf0ba47f8c56e263ffbd8d3e1819fc0dada3ed74c61dc1afdf07", + "0x005df82a4ae3ab7ab59a2ad4aaff615b4bf3409fcaa06c8d115b90a6827c7282", + "0x1c14ed2b8419855659fd5853c36fae0ad535319646889d630a2ecdc70975ee7d", + "0x009ab44c19d12bebb91d93f52d01179f33873667ca688633a20bf58942d641f5", + "0x004640cf4a0d35a53cb5107f7887ce2eb59320dc3692c761e70688b1c75c9d6e", + "0x0006e1c046e924a7e9be8a462e45c05c27347200000000000000000000000000", + "0x0000003131993bbab963d3bbcfaea2ad4ce93d7f187b4678592ebeff1969c0f7", + "0x007d15be7812b7d4f039bcadecbdbd5a764af23bdec8a0780a62bd836598cf8f", + "0x001373dbaa94dbf7f1c6e5841a6ca7c338319a3efcd25c2502b7675cfd4b9c73", + "0x006d865887d564824338a227fb1a94e367dc7671755d2a7749ea47ed531bc671", + "0x00604c0d1e54498cf3cb6c56af2c321f6660e185e8caf7b0a8199e5f16157ce0", + "0x00bb93fae1b7266c7b7c691b329def0e589c12ff05a63a86f4e0addf52403859", + "0x006a11b63046badb3b3af5d46e798bcda1bbe4bfa1d9389fa0cfb0d6983465c5", + "0x0036063476ff230f0204e873cfd653b5b6d9767101d51e6c741be7fb84e06512", + "0x00c3bfe9bc1085e587a2f5fb826fd619c4ec62403c50395bf2e092e04f4a34af", + "0x001f21d3ee5a5faaa44c0575b66754315810c83b2cc6f28054cc06cdd882a8e7", + "0x009f2dfb20248037ef311445c5d691a39c0b621681280ae03e42aa6fddcea432", + "0x00260e97d44f0896e42991e0cb2ac86cb0caaca5a6ec1c96cb9b2f13d0d351ea", + "0x0024b676f2f447f84a1db4f1a1976ecfb01ccd564aed18db57ac6da3dfa5d414", + "0x009454ddc2c942b5ecd157fbcd9733f1cb7bd438b3ed29742b083952bc8292de", + "0x1941848b9f4dbf4fbf4fd476af5d8db2b634f2abca61f23dc0befa41d5aae324", + "0x0000c9e7f1229c5a696998191774658a0ec879295a48b67de81c9bd51d416639", + "0x00fb7c81593791e34ed0115550ef6c73f371943860c12f6ea38a0305ca2da541", + "0x00182db292d67aeddce921ec21a07d74be11de00000000000000000000000000", + "0x000000ff556505d358d4d47b910cdf40859434df3e7447db66cf2dae1483c17b", + "0x00aa01d114b32832bbc33a6d980d4e4a69a4e2612197f7d06b3c39baf657d863", + "0x00166c91e4709fb7600be1cc08622cfc70977233656f98bc03b4154ad07d765e", + "0x00f4967c08a2c14d543feaf59f6ec51725c4a77a5733ddbec4e0fa981c2c4a05", + "0x00e4226df458c612e0d5883566e139f3f6fd528dcbd2c663965bf3d0acd92977", + "0x001d8bae2045a25b4fc298ee092508ba91ef5869e555bef5439a429a81fc0966", + "0x004591f96d04aa30636f077d598d2005bcd02def8fe097d39935f6e9be3f59a6", + "0x0048bfa7037e177ee29bb000841b65a50a3988782addcdb99af5774c67470c27", + "0x00fd50b1ed92b18e50534745e847804ce0f06e640dadb08bbb0e91c7a45d1967", + "0x00b149957c7c683a66c3128a39c1d2c40b95e54988254916600ae30a14d51b3c", + "0x005d73b57f9a10b757da69f8e437c0ce806ba23eff9f7e88f38121a5b3c97095", + "0x00c83ff06632c1f9f512b72972547a5d53d80f942575567a9159472b497a015d", + "0x00cf1422a25529918047a95cfb4067cebc5f376df3194405b1f7ce2e1cde4944", + "0x00458caecbf2fabacbb7cd4d72ca1f62588a1e41b8831d8f74b3f09fd683b102", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -12377,68 +12377,68 @@ blobs_fields = [ "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000" ] -blobs_hash = "0x00694ef58caf7e83ff6c9a65d3667adff33912aec5d9564ce4d8994fd5e33290" +blobs_hash = "0x00f3676b98d23ecebc9b510296e6989479e95220e611a67ce218f66a8130ba7d" [[inputs.previous_rollup_data]] [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs] rollup_type = "0x0000000000000000000000000000000000000000000000000000000000000000" num_txs = "0x0000000000000000000000000000000000000000000000000000000000000001" out_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" -accumulated_fees = "0x0000000000000000000000000000000000000000000000000011b417896f129a" -accumulated_mana_used = "0x0000000000000000000000000000000000000000000000000000000000016771" +accumulated_fees = "0x0000000000000000000000000000000000000000000000000003a83680db4900" +accumulated_mana_used = "0x0000000000000000000000000000000000000000000000000000000000004a40" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants] - vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" - protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" + vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" + protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.last_archive] - root = "0x04b51aa5df89d177213335ca62dee74d15b920e231f5ea5198ed405967d188fd" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" + root = "0x026e8d4564303241e67610a78bc5a2cfbd383ef1673f9e2a00a226d6bb280d34" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000006" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000008" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000015" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2e96" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000006" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000013" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a9d5" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000380" +root = "0x265f2fb8ecbd96d51d74d79901934e60af982af7b6caa46153eafcf3201df280" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000280" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.nullifier_tree] -root = "0x085a35f42d569f7aac0404ce29055696f738a6c798a32632d15a8453e59115ff" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000400" +root = "0x0d8cfcd6ecef742ecda848c0db79ef7d0fe639b7b69564d103f788d530832eba" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.public_data_tree] -root = "0x0ff17010ab909b4a0c9581a9c33cf0af93280c6fcd6664cf27270b8762a9e418" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x00000000000000000000000000000000000000000000000000000000000003c0" +root = "0x03fbff7873541e17d3fd41ec5a5cd19d0bbd804ac426bdc0e177a422b927fcfe" +next_available_leaf_index = "0x00000000000000000000000000000000000000000000000000000000000002c0" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.nullifier_tree] -root = "0x0b3cd059f3a14d1fc149e845404ee3733e58010456792a3f61c3803f4ddd1248" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000440" +root = "0x06cc7ec18acca02c7efcfe551cd95ebb5890d0b39393a9af3d81dd711b3966da" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000340" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.public_data_tree] -root = "0x28b5d86e557e528de4452115c3b6ca2b8075465411e73f310c843fa8d2b5faad" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start_sponge_blob] fields = "0x0000000000000000000000000000000000000000000000000000000000000000" - expected_fields = "0x0000000000000000000000000000000000000000000000000000000000000009" + expected_fields = "0x000000000000000000000000000000000000000000000000000000000000003f" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start_sponge_blob.sponge] cache = [ @@ -12450,26 +12450,26 @@ next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000 "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000000000000000000000000000090000000000000000" + "0x00000000000000000000000000000000000000000000003f0000000000000000" ] cache_size = "0x0000000000000000000000000000000000000000000000000000000000000000" squeeze_mode = false [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end_sponge_blob] - fields = "0x0000000000000000000000000000000000000000000000000000000000000009" - expected_fields = "0x0000000000000000000000000000000000000000000000000000000000000009" + fields = "0x000000000000000000000000000000000000000000000000000000000000003f" + expected_fields = "0x000000000000000000000000000000000000000000000000000000000000003f" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end_sponge_blob.sponge] cache = [ - "0x0000000000000000000000000000000000000000000000000000000000002328", - "0x0d38d167da0ccd3ba447ce36953062d88783b02447d5af2bd09519bcd2a928f4", - "0x00000000000000000000000000000000000000000000000000000000000003e8" + "0x00c83ff06632c1f9f512b72972547a5d53d80f942575567a9159472b497a015d", + "0x00cf1422a25529918047a95cfb4067cebc5f376df3194405b1f7ce2e1cde4944", + "0x00458caecbf2fabacbb7cd4d72ca1f62588a1e41b8831d8f74b3f09fd683b102" ] state = [ - "0x05dc8cfb21681a19bd8e67518d2b9e22d31ba0380ecbb3653e00daa9dabe7e56", - "0x0ebafbb8e482cfd14bfe06b18ba8ef29493892e5c55e9b5ed16ede0e4cfe7562", - "0x22fa4ea0b8f5633a4701f717c52914a96bc5be0e69d2e84d86b4a1a717dfac6d", - "0x0991732e4b69f8065c9beb388f953e963baab29beb67084560f6116c9fdec042" + "0x1d2f5a89ec40f9771505edb0964cf3fdf907d6adbc9ff97d05e4a0453e32ba59", + "0x25acf706095d13fc935b5efaf54e588477d5e112005b62904a14a20fe4b1dc9f", + "0x11f8473a261c76fb22683bddceaa3202810d9915614403cf12de9aaa4e3725e3", + "0x27a6eaab5fc28b1018b264233fb622d3c02dafef137e391af1785f7dbc403e67" ] cache_size = "0x0000000000000000000000000000000000000000000000000000000000000003" squeeze_mode = false @@ -12938,13 +12938,84 @@ fields = [ "0x00000000000000000000000000000000000000000000000000000000000001cc", "0x00000000000000000000000000000000000000000000000000000000000001cd", "0x00000000000000000000000000000000000000000000000000000000000001ce", - "0x00000000000000000000000000000000000000000000000000000000000001cf" + "0x00000000000000000000000000000000000000000000000000000000000001cf", + "0x00000000000000000000000000000000000000000000000000000000000001d0", + "0x00000000000000000000000000000000000000000000000000000000000001d1", + "0x00000000000000000000000000000000000000000000000000000000000001d2", + "0x00000000000000000000000000000000000000000000000000000000000001d3", + "0x00000000000000000000000000000000000000000000000000000000000001d4", + "0x00000000000000000000000000000000000000000000000000000000000001d5", + "0x00000000000000000000000000000000000000000000000000000000000001d6", + "0x00000000000000000000000000000000000000000000000000000000000001d7", + "0x00000000000000000000000000000000000000000000000000000000000001d8", + "0x00000000000000000000000000000000000000000000000000000000000001d9", + "0x00000000000000000000000000000000000000000000000000000000000001da", + "0x00000000000000000000000000000000000000000000000000000000000001db", + "0x00000000000000000000000000000000000000000000000000000000000001dc", + "0x00000000000000000000000000000000000000000000000000000000000001dd", + "0x00000000000000000000000000000000000000000000000000000000000001de", + "0x00000000000000000000000000000000000000000000000000000000000001df", + "0x00000000000000000000000000000000000000000000000000000000000001e0", + "0x00000000000000000000000000000000000000000000000000000000000001e1", + "0x00000000000000000000000000000000000000000000000000000000000001e2", + "0x00000000000000000000000000000000000000000000000000000000000001e3", + "0x00000000000000000000000000000000000000000000000000000000000001e4", + "0x00000000000000000000000000000000000000000000000000000000000001e5", + "0x00000000000000000000000000000000000000000000000000000000000001e6", + "0x00000000000000000000000000000000000000000000000000000000000001e7", + "0x00000000000000000000000000000000000000000000000000000000000001e8", + "0x00000000000000000000000000000000000000000000000000000000000001e9", + "0x00000000000000000000000000000000000000000000000000000000000001ea", + "0x00000000000000000000000000000000000000000000000000000000000001eb", + "0x00000000000000000000000000000000000000000000000000000000000001ec", + "0x00000000000000000000000000000000000000000000000000000000000001ed", + "0x00000000000000000000000000000000000000000000000000000000000001ee", + "0x00000000000000000000000000000000000000000000000000000000000001ef", + "0x00000000000000000000000000000000000000000000000000000000000001f0", + "0x00000000000000000000000000000000000000000000000000000000000001f1", + "0x00000000000000000000000000000000000000000000000000000000000001f2", + "0x00000000000000000000000000000000000000000000000000000000000001f3", + "0x00000000000000000000000000000000000000000000000000000000000001f4", + "0x00000000000000000000000000000000000000000000000000000000000001f5", + "0x00000000000000000000000000000000000000000000000000000000000001f6", + "0x00000000000000000000000000000000000000000000000000000000000001f7", + "0x00000000000000000000000000000000000000000000000000000000000001f8", + "0x00000000000000000000000000000000000000000000000000000000000001f9", + "0x00000000000000000000000000000000000000000000000000000000000001fa", + "0x00000000000000000000000000000000000000000000000000000000000001fb", + "0x00000000000000000000000000000000000000000000000000000000000001fc", + "0x00000000000000000000000000000000000000000000000000000000000001fd", + "0x00000000000000000000000000000000000000000000000000000000000001fe", + "0x00000000000000000000000000000000000000000000000000000000000001ff", + "0x0000000000000000000000000000000000000000000000000000000000000200", + "0x0000000000000000000000000000000000000000000000000000000000000201", + "0x0000000000000000000000000000000000000000000000000000000000000202", + "0x0000000000000000000000000000000000000000000000000000000000000203", + "0x0000000000000000000000000000000000000000000000000000000000000204", + "0x0000000000000000000000000000000000000000000000000000000000000205", + "0x0000000000000000000000000000000000000000000000000000000000000206", + "0x0000000000000000000000000000000000000000000000000000000000000207", + "0x0000000000000000000000000000000000000000000000000000000000000208", + "0x0000000000000000000000000000000000000000000000000000000000000209", + "0x000000000000000000000000000000000000000000000000000000000000020a", + "0x000000000000000000000000000000000000000000000000000000000000020b", + "0x000000000000000000000000000000000000000000000000000000000000020c", + "0x000000000000000000000000000000000000000000000000000000000000020d", + "0x000000000000000000000000000000000000000000000000000000000000020e", + "0x000000000000000000000000000000000000000000000000000000000000020f", + "0x0000000000000000000000000000000000000000000000000000000000000210", + "0x0000000000000000000000000000000000000000000000000000000000000211", + "0x0000000000000000000000000000000000000000000000000000000000000212", + "0x0000000000000000000000000000000000000000000000000000000000000213", + "0x0000000000000000000000000000000000000000000000000000000000000214", + "0x0000000000000000000000000000000000000000000000000000000000000215", + "0x0000000000000000000000000000000000000000000000000000000000000216" ] [inputs.previous_rollup_data.vk] key = [ - "0x0000000000000000000000000000000000000000000000000000000002000000", - "0x0000000000000000000000000000000000000000000000000000000000000044", + "0x0000000000000000000000000000000000000000000000000000000001000000", + "0x000000000000000000000000000000000000000000000000000000000000004e", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000034", @@ -12963,126 +13034,137 @@ key = [ "0x0000000000000000000000000000000000000000000000000000000000000041", "0x0000000000000000000000000000000000000000000000000000000000000042", "0x0000000000000000000000000000000000000000000000000000000000000043", - "0x0000000000000000000000000000007acea76220f3dcf559941a7e87a6b28907", - "0x000000000000000000000000000000000017503e58c81a120517cdb8a4f99a55", - "0x00000000000000000000000000000030e0a46a7056ec5d122358957f34be6420", - "0x000000000000000000000000000000000019af3ba7be026356d5013338e6a9c8", - "0x000000000000000000000000000000941c8c03340dc6ac1ac21dfc245eec52ae", - "0x000000000000000000000000000000000028a50b16a95bfe8d5d5910fa14acf9", - "0x000000000000000000000000000000d750fd9b7a01bfd4e6553bf8ab2e513a06", - "0x000000000000000000000000000000000005cb7ef208180dc12701ec1bf16e6e", - "0x000000000000000000000000000000226a41a3cde055871146a14f69ceed3189", - "0x00000000000000000000000000000000001905f4d4e4516041c993103f21ed23", - "0x000000000000000000000000000000e1343257a50d0cf1554d5fa39b63807f82", - "0x000000000000000000000000000000000029c01e95b47fd55a3af50c144b0334", - "0x000000000000000000000000000000061cb8849db1149ba384d6eb537ec1d821", - "0x00000000000000000000000000000000001bd9e9b6b2864c7e76f8d6f987d224", - "0x000000000000000000000000000000fbd7c650b1b4c0ba0255b744ddd75e735c", - "0x000000000000000000000000000000000014ac90285cdead0ec12cad3d8d3a31", - "0x00000000000000000000000000000004bd04287093441c75d05b6cb594d378de", - "0x00000000000000000000000000000000001cfa05ce692088c27bb7e9a8a262c2", - "0x0000000000000000000000000000000943740754bb6d7f5fb55d5570754381c0", - "0x000000000000000000000000000000000006cfaa5c166143d59ab33b6f57b88c", - "0x000000000000000000000000000000c3f3c5edfca877fb6c14f7e913c178f044", - "0x00000000000000000000000000000000001def2c9873d161b5ffc87d4b9c60dc", - "0x0000000000000000000000000000002837ed4f4febbbe8635ac74a35ef13542d", - "0x00000000000000000000000000000000002e15fa9496d154e169360820b701f7", - "0x0000000000000000000000000000007f4ae2590c599ca3e076d8a504c9761169", - "0x000000000000000000000000000000000008d15a8f153ffea92236a73f8e00ec", - "0x0000000000000000000000000000009a5f9f5cc321cda5967ab3977408842a1b", - "0x00000000000000000000000000000000001aef0ad6d98239a10226c1e7a66701", - "0x00000000000000000000000000000013ed1c45df71665ea0553a8a92ef89b0ea", - "0x00000000000000000000000000000000001e6c3f8b5ee0db10934643cab5960c", - "0x000000000000000000000000000000e6fa0a76bfb524488e71aa8cba569d3273", - "0x00000000000000000000000000000000000e146846a27a9e994aa5eb95368e43", - "0x0000000000000000000000000000004722d45629beb72092ae034d7a116eea80", - "0x000000000000000000000000000000000011b3074e83b178395fdbf16779ecd4", - "0x000000000000000000000000000000a1560ad69fb0f87cbb68e2469c17405a88", - "0x000000000000000000000000000000000016664440497257aab435766cd8daa4", - "0x0000000000000000000000000000008c0e5d61ceae65541e501766f2133c9a05", - "0x00000000000000000000000000000000000348d59b536e2d9124401c032218d4", - "0x000000000000000000000000000000c3bec12bcd8c5519adc22cc13745a6a5ba", - "0x0000000000000000000000000000000000099b37362358ccfb574e08a5d589c5", - "0x0000000000000000000000000000001a7603f798b4001644ac6346536db682c3", - "0x0000000000000000000000000000000000294bc6e456c49353364126e7acfa5d", - "0x000000000000000000000000000000ab11980eb66b6674b9668c4bf810f2dbd8", - "0x00000000000000000000000000000000002a71b3517077a7e806ed8c7bd41fa5", - "0x0000000000000000000000000000005f94f02f427c74fe51265b2501485c6681", - "0x00000000000000000000000000000000001f6b4f952f28290b3907e9fd89a04d", - "0x0000000000000000000000000000000e0cb8cc77e8e0da284dfa81fb659ed69e", - "0x0000000000000000000000000000000000108d2a188563f05f8c03cc1a1478c1", - "0x0000000000000000000000000000001d68539ab56b251c9bdd606b72eae2fbe2", - "0x0000000000000000000000000000000000222d18f43c8767fbdc01e1149c5606", - "0x00000000000000000000000000000099b18017f081d6cde0fe1dba203d35f031", - "0x0000000000000000000000000000000000144df7fc0ec590f0ae163b2206b2a0", - "0x000000000000000000000000000000fe935114b354bc67d2668722921ebac6ba", - "0x0000000000000000000000000000000000075d80d0ccb2ebb8e503e0bc8830c2", - "0x0000000000000000000000000000003b90abab25d1cc86543ee6ff8bfb36a141", - "0x00000000000000000000000000000000002f2b5f13b32122f25179e756a5bfb6", - "0x000000000000000000000000000000897ab9f551efb564c420ec89c75f025c72", - "0x00000000000000000000000000000000001c0ea2c5e6ab8dbcb5c04b013def2b", - "0x000000000000000000000000000000a0075bff7fe7d309a4a62e4697e0910dee", - "0x00000000000000000000000000000000001dab25f9c69e46eea9ef77449361e4", - "0x00000000000000000000000000000099547f9d90555739ddb33d81f778b79663", - "0x000000000000000000000000000000000009900c88d768eb3db72dd478bde74a", - "0x000000000000000000000000000000d92c26c30401619e97a43b2187b1e133a2", - "0x00000000000000000000000000000000000f991e56504f78fa90c31cb1a39102", - "0x000000000000000000000000000000c2d41c0bbfbf46ba1250ac1c9e0fe538a7", - "0x00000000000000000000000000000000001a64c934662e4d7843869e10bcf0cc", - "0x00000000000000000000000000000060971ccd87ad954d4a3a53beb136a115e5", - "0x000000000000000000000000000000000010bd7c99936aad440199663e48b08c", - "0x0000000000000000000000000000002fdcaae4a7ea95151eaa408586b1860983", - "0x0000000000000000000000000000000000288a0ff0315966a7a54a4884071b87", - "0x0000000000000000000000000000002455cf89f168533af00a61b6cc5dff0b25", - "0x00000000000000000000000000000000002bd11c6ee070b426cbeab3ff2b61b9", - "0x000000000000000000000000000000253a264c658d6d8b3e4a96d1e60d4ddbcf", - "0x000000000000000000000000000000000019e1190a385281dc72fa0d1e6e3173", - "0x00000000000000000000000000000001ca9ee62603b8684b4435a11fbe81fe77", - "0x00000000000000000000000000000000000fb6c90cf416bdc5cad8fcc8c5b077", - "0x000000000000000000000000000000cbaabba02d5684703afd2db78a4f2a9440", - "0x000000000000000000000000000000000029ae159051a17e5ce8e48ac542d5fe", - "0x000000000000000000000000000000d3380d3fc8294269fb9db3fcc5a60a29ca", - "0x00000000000000000000000000000000002b6571e09ef0385e86a817eac71f02", - "0x000000000000000000000000000000dfbc5112ae66004756cc08168e703dbcdc", - "0x00000000000000000000000000000000000a1361207b6352bb3e47b8afdcdee4", - "0x000000000000000000000000000000e9d60c7571a644bd754d4bd8f89ce3f771", - "0x000000000000000000000000000000000025bcafa95e5c0470321ffae1ac1d1f", - "0x000000000000000000000000000000e3cb7b601f7eed6dca3e591857166b4d1c", - "0x0000000000000000000000000000000000125aad145d0dbafb8da2dc1b0700bc", - "0x0000000000000000000000000000007a67f2caa5046f4d1dfc3a63469566de81", - "0x000000000000000000000000000000000022a98cee0b4cc5268adc92e2229271", - "0x000000000000000000000000000000f7c7c14a69ad0052dced057951a74436f5", - "0x0000000000000000000000000000000000263b96899c9835ce217f54f6df4acd", - "0x0000000000000000000000000000006c8c4e747cb6085c5735b9c68f2db633ac", - "0x00000000000000000000000000000000001157b26152b34ab05419f38acc15da", - "0x00000000000000000000000000000054cf89815a06c242c5e433264079487fc0", - "0x0000000000000000000000000000000000049a97286033e7c6c80520a963c7a1", - "0x00000000000000000000000000000077cb47275a750777c993d845849365ae73", - "0x00000000000000000000000000000000001bef3fe6a136f8f3419040fb2fb9a8", - "0x000000000000000000000000000000cb5bdeb788a62ab7fefa163b44aa4fe480", - "0x000000000000000000000000000000000019c8da60322e5b15147bb67ee97c3c", - "0x0000000000000000000000000000001f35e0f8d62d480f37b4aa13b09005e059", - "0x00000000000000000000000000000000002eaf8692eeea251928fb9c16523574", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000044", + "0x0000000000000000000000000000000000000000000000000000000000000045", + "0x0000000000000000000000000000000000000000000000000000000000000046", + "0x0000000000000000000000000000000000000000000000000000000000000047", + "0x0000000000000000000000000000000000000000000000000000000000000048", + "0x0000000000000000000000000000000000000000000000000000000000000049", + "0x000000000000000000000000000000000000000000000000000000000000004a", + "0x000000000000000000000000000000000000000000000000000000000000004b", + "0x000000000000000000000000000000000000000000000000000000000000004c", + "0x000000000000000000000000000000000000000000000000000000000000004d", + "0x000000000000000000000000000000f810621a89c0517bee8e9091db33db5c31", + "0x000000000000000000000000000000000023741b91621c46040b5424ed914cc3", + "0x0000000000000000000000000000000f2fdfeb783fd6b40c78b5a63626a2f4e8", + "0x000000000000000000000000000000000017c899276b4aa148261fd5165b4f56", + "0x000000000000000000000000000000750b00e06c1f82f6f7f8e9ffebecc8b88e", + "0x00000000000000000000000000000000002e67b42a1cdb772145adfa042777eb", + "0x00000000000000000000000000000003c1bdcb7081df174d8f62d105c7bff108", + "0x00000000000000000000000000000000002d06f33162b682c82ba4d9631a0027", + "0x000000000000000000000000000000dc698986b132b014eb4cdb327fb1956f02", + "0x00000000000000000000000000000000001482ea94ef6e3792d74efe0e6d42f3", + "0x000000000000000000000000000000902e134d5c55320e5fd683e5e53db12819", + "0x0000000000000000000000000000000000223df39d2eaf34c15e9717d324638a", + "0x0000000000000000000000000000002a5d591d542407f6b7d9ca238e99d82476", + "0x00000000000000000000000000000000002328c39734acbb8b0615f2d079297e", + "0x0000000000000000000000000000004f656b00fe245ffcdfbe8526e7b94c3111", + "0x0000000000000000000000000000000000187e94c09606156ec475f83f072a1f", + "0x000000000000000000000000000000704932164b12d2d58443d282182510d82e", + "0x000000000000000000000000000000000009aee85440e936170d234cf2649cee", + "0x0000000000000000000000000000007638fdafd153b31e9ea8d27691e659e4eb", + "0x00000000000000000000000000000000000b28639f9f5f7b23d393c05550f930", + "0x000000000000000000000000000000275c4aaa3c929fb9274e0f2fc9153595cd", + "0x000000000000000000000000000000000027e32f7bdb492449996367ef0004cd", + "0x0000000000000000000000000000003aa5c01174d8bd58c7fc421d918915179a", + "0x0000000000000000000000000000000000175690a38c8464195a0d844b151793", + "0x0000000000000000000000000000007e01eb776da2b909e2f1d2b472fff43df3", + "0x000000000000000000000000000000000010de06f5969f3ab84832887f1d5f52", + "0x000000000000000000000000000000759640ca4e26c0d38ecd1d4dd30875e0a2", + "0x00000000000000000000000000000000000b3c95d4f96a9a628c96ca3548e4eb", + "0x00000000000000000000000000000027fa12fffc90187366a57715f98862688a", + "0x00000000000000000000000000000000002a26918d1bad54e9d82537a338919e", + "0x00000000000000000000000000000042a57d4b3a4f9c9b354b2d867df2b072ea", + "0x000000000000000000000000000000000013c953c7e5a7fadc0390ad77307cd6", + "0x00000000000000000000000000000058838c67b417a534481aa4f903ace16e33", + "0x000000000000000000000000000000000012a966212ece3e60bf0a54a8c03dce", + "0x000000000000000000000000000000cb6a8d8f66c50a64289ec51920b9d50669", + "0x0000000000000000000000000000000000103935e0b731b79f36574b22020913", + "0x0000000000000000000000000000000e68036fcd68025a4e3219134423574f2f", + "0x0000000000000000000000000000000000237ea6ef46098313177c83f6fa4281", + "0x000000000000000000000000000000757dbb350dd7e88ed4d424a0d7be0c9dff", + "0x00000000000000000000000000000000002e1b8df33ca43d8b5df02609942e5a", + "0x00000000000000000000000000000062044f8b8ace9bb00d4451e0b7379b4a7f", + "0x000000000000000000000000000000000008dbb15ea45f2f206070707678dbb2", + "0x0000000000000000000000000000003295d364033bace41c91c5c628eb03de15", + "0x000000000000000000000000000000000020f9f22a5afa1a4f430383d9c6d7e3", + "0x0000000000000000000000000000004f0ec8592442c7a1edbbd9c5d9bb831cb8", + "0x000000000000000000000000000000000001f54b925350d2d2b064c9d3fbd0cf", + "0x00000000000000000000000000000059627119d9083cc00de857b3d52fc96dbf", + "0x00000000000000000000000000000000002cf6d0606f923ba3f371ae4d301db3", + "0x000000000000000000000000000000fa40760d371cfc576bca875d39fdc50859", + "0x00000000000000000000000000000000001d3e6f2196202bdc6f18b3e598822e", + "0x0000000000000000000000000000009d841a46762133236edc638ad9be7a1611", + "0x00000000000000000000000000000000001e1dca2657e3ddc0654b7f81c453ac", + "0x000000000000000000000000000000d3ebcba1ed5d8e2e5db46a53c7bcafdf3d", + "0x00000000000000000000000000000000001c5f9a76abadd6f16656921223c2c7", + "0x000000000000000000000000000000578a9f6317f82f575e7516bc23ba446296", + "0x000000000000000000000000000000000009db554cd7afded36685b2cc2afa46", + "0x00000000000000000000000000000072df2edf3d30c7e4dd65e54008f53aac17", + "0x00000000000000000000000000000000000d69eda07181cc43b55282cab19e30", + "0x000000000000000000000000000000c45121433b4527b3ad8203145c47a21d2a", + "0x000000000000000000000000000000000011615b62f470f0df362b84fbfbee1c", + "0x0000000000000000000000000000007941a8641a1af06de3e170a6e54001825b", + "0x0000000000000000000000000000000000135cdffb854c3e83cd156635d0d9f5", + "0x00000000000000000000000000000090a5255eb2fbe1c21cf428430babb4ebff", + "0x00000000000000000000000000000000000373ed0d5bf33c93261c7f0cd70167", + "0x00000000000000000000000000000086389340b1c54ad6767fa4a7feac0b6931", + "0x000000000000000000000000000000000008141f7a07dc48b972c9efeee86914", + "0x0000000000000000000000000000008b607ad199f1ade5bb162883afc34901e9", + "0x000000000000000000000000000000000000cceeeb457a4683b83aee0a250394", + "0x0000000000000000000000000000003dd5db36319e2234492e3fc10802586a2c", + "0x00000000000000000000000000000000001483f496f4e6582c81f06e95cd0ab3", + "0x000000000000000000000000000000595201832785ce5841162229f1e7890af6", + "0x0000000000000000000000000000000000035bf04e3cddb88b7599dde215eb3c", + "0x000000000000000000000000000000f92163b6dcf703e9cf58c6f07f6398b168", + "0x000000000000000000000000000000000005629bc60bbbdd1b8acd7bd9404ae9", + "0x00000000000000000000000000000050e8c38fd5fe50acdc1110d1430f1e5092", + "0x00000000000000000000000000000000002493ecb5f2a6e1ca53275d39e85729", + "0x000000000000000000000000000000a4b4680e14b0f1ac89c50a55ccc91c2a60", + "0x00000000000000000000000000000000000265575c1d7e5e530bdc57e6041833", + "0x0000000000000000000000000000005f086fea719519af18e8b0a29a79359c7a", + "0x0000000000000000000000000000000000056bd2133d3186dad025e38d33ba66", + "0x0000000000000000000000000000007e3f0eaafa9128149f29d76a9967a6f5b1", + "0x000000000000000000000000000000000019c4e7a4c7a7641a25f58aa889df9a", + "0x0000000000000000000000000000006ac73b780057a7dcb1c9ce19a1b443f63a", + "0x000000000000000000000000000000000018e1de9ac1d7cfa2c0500ce49f881d", + "0x000000000000000000000000000000e97fb648fc1ff99f9988a73de181e0de22", + "0x000000000000000000000000000000000024cae2d5d2c4daefe858889eeb01b8", + "0x000000000000000000000000000000e072297115d09425f5612d626dc82f1002", + "0x00000000000000000000000000000000000815a38741b61a4a746b6256b1eb91", + "0x00000000000000000000000000000023edf5ec8727bc87281eab66284f87ad2c", + "0x000000000000000000000000000000000001817943bc850dcd02d4ea565c1493", + "0x000000000000000000000000000000a52f5a3cb7bdd0393d39866d9524b8bb74", + "0x000000000000000000000000000000000015360b6039f6183da9a066d31f21ae", + "0x0000000000000000000000000000000d870e4369af12e9a713d607cf717fe72b", + "0x00000000000000000000000000000000000002298c8bc804808d58756dae84ae", + "0x00000000000000000000000000000073944baa9d28defedd72c6f09aca49727b", + "0x000000000000000000000000000000000004bae3c183b76cf6730ad3aee810d7", + "0x000000000000000000000000000000f2fa4474406d74b57cdb71ec6be23ddef4", + "0x0000000000000000000000000000000000052169f2bbc2f3f5c8f655b41c0150", + "0x000000000000000000000000000000d703c362037631c809f2999aecf387f66b", + "0x000000000000000000000000000000000020bf636ea187b713b19af5ef19a560", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000000000048e3a765d915435b20c18944c02674e924", - "0x000000000000000000000000000000000008468b14fb49e8f7fdd86769c0e96e", - "0x000000000000000000000000000000b79ddc3696c5d21245a4e6e20e566201f1", - "0x00000000000000000000000000000000002a3a1bf035af4b9fb6bf9c890d61ec" + "0x000000000000000000000000000000f8b91015dd9e75d2c481301e4b71ecd06a", + "0x00000000000000000000000000000000001d07cee0ae2afabca8c10513a44b86", + "0x000000000000000000000000000000ef950d707842f8a387388b7a8f5f9a6933", + "0x00000000000000000000000000000000000745ad8f37d8f526173fb2651e2521" ] -hash = "0x1f07a2890c9deb79fe6cc78935c6dfa810ee56922785f37307cb463f7797f73e" +hash = "0x18c47824d925ac614bb14be8d502f072b1bfc96abff5e4951f46323faa3de032" [inputs.previous_rollup_data.vk_witness] -leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000009" +leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" sibling_path = [ - "0x03cde467306e7d05bcd957b9dde81fdb644d6a7e21d7857bc1bf647f78bfde83", - "0x19861a044ec84aaf6e41d02a20051d349f07206356e10a0846d4fa892534e306", - "0x236d849434a03c2e9d181e5365fe087cb14fd703bff61e5676bfa24c4f4509b7", - "0x268b4fb54bbdda64dd707ee86cb0729dfb9a9e8b6ae83e973b37bc7e4b18f875", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x09ab650e88dcf88f3610303c453731d759afd016234d47efd3d1338ee79f5496", + "0x0c99fd462f2396fcaed337dec2f74fe2706ccbf75677c6b57f41e46de091b910", + "0x24de6a6697f70e960e2e69307ed9c63592ed48ee81c6d59440352c0f250f379d", + "0x0178af4ea3a679e0025251b9543017390bf56038f217158886965e52d7b0c8cd", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] [[inputs.previous_rollup_data]] @@ -13094,88 +13176,88 @@ accumulated_fees = "0x0000000000000000000000000000000000000000000000000000000000 accumulated_mana_used = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants] - vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" - protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" + vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" + protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.last_archive] - root = "0x04b51aa5df89d177213335ca62dee74d15b920e231f5ea5198ed405967d188fd" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" + root = "0x026e8d4564303241e67610a78bc5a2cfbd383ef1673f9e2a00a226d6bb280d34" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000006" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000008" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000015" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2e96" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000006" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000013" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a9d5" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables.gas_fees] fee_per_da_gas = "0x0000000000000000000000000000000000000000000000000000000000000000" - fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" + fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x00000000000000000000000000000000000000000000000000000000000003c0" +root = "0x03fbff7873541e17d3fd41ec5a5cd19d0bbd804ac426bdc0e177a422b927fcfe" +next_available_leaf_index = "0x00000000000000000000000000000000000000000000000000000000000002c0" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.nullifier_tree] -root = "0x0b3cd059f3a14d1fc149e845404ee3733e58010456792a3f61c3803f4ddd1248" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000440" +root = "0x06cc7ec18acca02c7efcfe551cd95ebb5890d0b39393a9af3d81dd711b3966da" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000340" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.public_data_tree] -root = "0x28b5d86e557e528de4452115c3b6ca2b8075465411e73f310c843fa8d2b5faad" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.note_hash_tree] -root = "0x266514a4f987058cb2deb71c37e845df4f7f85ab2a23f208dd98cf7eeeb7cbc4" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000400" +root = "0x03fbff7873541e17d3fd41ec5a5cd19d0bbd804ac426bdc0e177a422b927fcfe" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.nullifier_tree] -root = "0x0b3cd059f3a14d1fc149e845404ee3733e58010456792a3f61c3803f4ddd1248" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000480" +root = "0x06cc7ec18acca02c7efcfe551cd95ebb5890d0b39393a9af3d81dd711b3966da" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000380" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.public_data_tree] -root = "0x28b5d86e557e528de4452115c3b6ca2b8075465411e73f310c843fa8d2b5faad" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start_sponge_blob] - fields = "0x0000000000000000000000000000000000000000000000000000000000000009" - expected_fields = "0x0000000000000000000000000000000000000000000000000000000000000009" + fields = "0x000000000000000000000000000000000000000000000000000000000000003f" + expected_fields = "0x000000000000000000000000000000000000000000000000000000000000003f" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start_sponge_blob.sponge] cache = [ - "0x0000000000000000000000000000000000000000000000000000000000002328", - "0x0d38d167da0ccd3ba447ce36953062d88783b02447d5af2bd09519bcd2a928f4", - "0x00000000000000000000000000000000000000000000000000000000000003e8" + "0x00c83ff06632c1f9f512b72972547a5d53d80f942575567a9159472b497a015d", + "0x00cf1422a25529918047a95cfb4067cebc5f376df3194405b1f7ce2e1cde4944", + "0x00458caecbf2fabacbb7cd4d72ca1f62588a1e41b8831d8f74b3f09fd683b102" ] state = [ - "0x05dc8cfb21681a19bd8e67518d2b9e22d31ba0380ecbb3653e00daa9dabe7e56", - "0x0ebafbb8e482cfd14bfe06b18ba8ef29493892e5c55e9b5ed16ede0e4cfe7562", - "0x22fa4ea0b8f5633a4701f717c52914a96bc5be0e69d2e84d86b4a1a717dfac6d", - "0x0991732e4b69f8065c9beb388f953e963baab29beb67084560f6116c9fdec042" + "0x1d2f5a89ec40f9771505edb0964cf3fdf907d6adbc9ff97d05e4a0453e32ba59", + "0x25acf706095d13fc935b5efaf54e588477d5e112005b62904a14a20fe4b1dc9f", + "0x11f8473a261c76fb22683bddceaa3202810d9915614403cf12de9aaa4e3725e3", + "0x27a6eaab5fc28b1018b264233fb622d3c02dafef137e391af1785f7dbc403e67" ] cache_size = "0x0000000000000000000000000000000000000000000000000000000000000003" squeeze_mode = false [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end_sponge_blob] - fields = "0x0000000000000000000000000000000000000000000000000000000000000009" - expected_fields = "0x0000000000000000000000000000000000000000000000000000000000000009" + fields = "0x000000000000000000000000000000000000000000000000000000000000003f" + expected_fields = "0x000000000000000000000000000000000000000000000000000000000000003f" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end_sponge_blob.sponge] cache = [ - "0x0000000000000000000000000000000000000000000000000000000000002328", - "0x0d38d167da0ccd3ba447ce36953062d88783b02447d5af2bd09519bcd2a928f4", - "0x00000000000000000000000000000000000000000000000000000000000003e8" + "0x00c83ff06632c1f9f512b72972547a5d53d80f942575567a9159472b497a015d", + "0x00cf1422a25529918047a95cfb4067cebc5f376df3194405b1f7ce2e1cde4944", + "0x00458caecbf2fabacbb7cd4d72ca1f62588a1e41b8831d8f74b3f09fd683b102" ] state = [ - "0x05dc8cfb21681a19bd8e67518d2b9e22d31ba0380ecbb3653e00daa9dabe7e56", - "0x0ebafbb8e482cfd14bfe06b18ba8ef29493892e5c55e9b5ed16ede0e4cfe7562", - "0x22fa4ea0b8f5633a4701f717c52914a96bc5be0e69d2e84d86b4a1a717dfac6d", - "0x0991732e4b69f8065c9beb388f953e963baab29beb67084560f6116c9fdec042" + "0x1d2f5a89ec40f9771505edb0964cf3fdf907d6adbc9ff97d05e4a0453e32ba59", + "0x25acf706095d13fc935b5efaf54e588477d5e112005b62904a14a20fe4b1dc9f", + "0x11f8473a261c76fb22683bddceaa3202810d9915614403cf12de9aaa4e3725e3", + "0x27a6eaab5fc28b1018b264233fb622d3c02dafef137e391af1785f7dbc403e67" ] cache_size = "0x0000000000000000000000000000000000000000000000000000000000000003" squeeze_mode = false @@ -13644,13 +13726,84 @@ fields = [ "0x00000000000000000000000000000000000000000000000000000000000001cc", "0x00000000000000000000000000000000000000000000000000000000000001cd", "0x00000000000000000000000000000000000000000000000000000000000001ce", - "0x00000000000000000000000000000000000000000000000000000000000001cf" + "0x00000000000000000000000000000000000000000000000000000000000001cf", + "0x00000000000000000000000000000000000000000000000000000000000001d0", + "0x00000000000000000000000000000000000000000000000000000000000001d1", + "0x00000000000000000000000000000000000000000000000000000000000001d2", + "0x00000000000000000000000000000000000000000000000000000000000001d3", + "0x00000000000000000000000000000000000000000000000000000000000001d4", + "0x00000000000000000000000000000000000000000000000000000000000001d5", + "0x00000000000000000000000000000000000000000000000000000000000001d6", + "0x00000000000000000000000000000000000000000000000000000000000001d7", + "0x00000000000000000000000000000000000000000000000000000000000001d8", + "0x00000000000000000000000000000000000000000000000000000000000001d9", + "0x00000000000000000000000000000000000000000000000000000000000001da", + "0x00000000000000000000000000000000000000000000000000000000000001db", + "0x00000000000000000000000000000000000000000000000000000000000001dc", + "0x00000000000000000000000000000000000000000000000000000000000001dd", + "0x00000000000000000000000000000000000000000000000000000000000001de", + "0x00000000000000000000000000000000000000000000000000000000000001df", + "0x00000000000000000000000000000000000000000000000000000000000001e0", + "0x00000000000000000000000000000000000000000000000000000000000001e1", + "0x00000000000000000000000000000000000000000000000000000000000001e2", + "0x00000000000000000000000000000000000000000000000000000000000001e3", + "0x00000000000000000000000000000000000000000000000000000000000001e4", + "0x00000000000000000000000000000000000000000000000000000000000001e5", + "0x00000000000000000000000000000000000000000000000000000000000001e6", + "0x00000000000000000000000000000000000000000000000000000000000001e7", + "0x00000000000000000000000000000000000000000000000000000000000001e8", + "0x00000000000000000000000000000000000000000000000000000000000001e9", + "0x00000000000000000000000000000000000000000000000000000000000001ea", + "0x00000000000000000000000000000000000000000000000000000000000001eb", + "0x00000000000000000000000000000000000000000000000000000000000001ec", + "0x00000000000000000000000000000000000000000000000000000000000001ed", + "0x00000000000000000000000000000000000000000000000000000000000001ee", + "0x00000000000000000000000000000000000000000000000000000000000001ef", + "0x00000000000000000000000000000000000000000000000000000000000001f0", + "0x00000000000000000000000000000000000000000000000000000000000001f1", + "0x00000000000000000000000000000000000000000000000000000000000001f2", + "0x00000000000000000000000000000000000000000000000000000000000001f3", + "0x00000000000000000000000000000000000000000000000000000000000001f4", + "0x00000000000000000000000000000000000000000000000000000000000001f5", + "0x00000000000000000000000000000000000000000000000000000000000001f6", + "0x00000000000000000000000000000000000000000000000000000000000001f7", + "0x00000000000000000000000000000000000000000000000000000000000001f8", + "0x00000000000000000000000000000000000000000000000000000000000001f9", + "0x00000000000000000000000000000000000000000000000000000000000001fa", + "0x00000000000000000000000000000000000000000000000000000000000001fb", + "0x00000000000000000000000000000000000000000000000000000000000001fc", + "0x00000000000000000000000000000000000000000000000000000000000001fd", + "0x00000000000000000000000000000000000000000000000000000000000001fe", + "0x00000000000000000000000000000000000000000000000000000000000001ff", + "0x0000000000000000000000000000000000000000000000000000000000000200", + "0x0000000000000000000000000000000000000000000000000000000000000201", + "0x0000000000000000000000000000000000000000000000000000000000000202", + "0x0000000000000000000000000000000000000000000000000000000000000203", + "0x0000000000000000000000000000000000000000000000000000000000000204", + "0x0000000000000000000000000000000000000000000000000000000000000205", + "0x0000000000000000000000000000000000000000000000000000000000000206", + "0x0000000000000000000000000000000000000000000000000000000000000207", + "0x0000000000000000000000000000000000000000000000000000000000000208", + "0x0000000000000000000000000000000000000000000000000000000000000209", + "0x000000000000000000000000000000000000000000000000000000000000020a", + "0x000000000000000000000000000000000000000000000000000000000000020b", + "0x000000000000000000000000000000000000000000000000000000000000020c", + "0x000000000000000000000000000000000000000000000000000000000000020d", + "0x000000000000000000000000000000000000000000000000000000000000020e", + "0x000000000000000000000000000000000000000000000000000000000000020f", + "0x0000000000000000000000000000000000000000000000000000000000000210", + "0x0000000000000000000000000000000000000000000000000000000000000211", + "0x0000000000000000000000000000000000000000000000000000000000000212", + "0x0000000000000000000000000000000000000000000000000000000000000213", + "0x0000000000000000000000000000000000000000000000000000000000000214", + "0x0000000000000000000000000000000000000000000000000000000000000215", + "0x0000000000000000000000000000000000000000000000000000000000000216" ] [inputs.previous_rollup_data.vk] key = [ "0x0000000000000000000000000000000000000000000000000000000001000000", - "0x0000000000000000000000000000000000000000000000000000000000000044", + "0x000000000000000000000000000000000000000000000000000000000000004e", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000034", @@ -13669,136 +13822,147 @@ key = [ "0x0000000000000000000000000000000000000000000000000000000000000041", "0x0000000000000000000000000000000000000000000000000000000000000042", "0x0000000000000000000000000000000000000000000000000000000000000043", - "0x000000000000000000000000000000222d2b638470648efe806272902759bfe4", - "0x000000000000000000000000000000000026717cb116c9f379f6053d43ed7131", - "0x000000000000000000000000000000d72dc52e13931348a07d4d75dbdef7b696", - "0x000000000000000000000000000000000007a17849605cd5acdf47218d8ff6ab", - "0x0000000000000000000000000000000ead8b79c9d9733b45796b315aed219c46", - "0x000000000000000000000000000000000001520cbd65e9f9c12d2d804e5408a8", - "0x000000000000000000000000000000d4fd951f0c8b3f5c93c914a9ca3e3ad82b", - "0x00000000000000000000000000000000000c06cda5de6eb85a2dc3a3e461edf4", - "0x0000000000000000000000000000008fda111b457d9cbb2c2140e6e29baaa93d", - "0x000000000000000000000000000000000019250c98c82093236c18a9efa7bbcb", - "0x000000000000000000000000000000809dff0c74860533c531966cefa5e6b82f", - "0x0000000000000000000000000000000000096b5c6f4eb1c8d72e0812cabe6b20", - "0x0000000000000000000000000000002b40eba3c1a07bab631194a295de31fa39", - "0x00000000000000000000000000000000000053902748ef91505fca0d1db29c64", - "0x000000000000000000000000000000aa3b1b8cf6fbc5c81dc722111d10e6940b", - "0x0000000000000000000000000000000000206cb99da8d346b786537ed3b15446", - "0x0000000000000000000000000000001271113c751d045274a3317a01895808c9", - "0x00000000000000000000000000000000000ae017203dd40d764ddbaa912b9d03", - "0x000000000000000000000000000000f46fc3542fcfee505d2e9eacb7f397bb36", - "0x00000000000000000000000000000000002e5a0e507a80a266a9e62a94a7bb97", - "0x000000000000000000000000000000b44304dbc2fc1d02d3d903d01d29e76efb", - "0x00000000000000000000000000000000000fb528b629b4fbbf48fddeca9f54de", - "0x000000000000000000000000000000ffa188c0ab2f8df7c201783dc282a782cd", - "0x00000000000000000000000000000000000edbbec3674d50e52b6e83867b3007", - "0x00000000000000000000000000000058ea22bca57bfe9a1c46ce63c2c240901f", - "0x000000000000000000000000000000000028cce7cf665942fee68c3ffd344c71", - "0x000000000000000000000000000000bbda5287b41d69b0a203243ebb2d861d58", - "0x0000000000000000000000000000000000136b53ea88a30b784ec14018041c4e", - "0x0000000000000000000000000000004702b68f21e97f4ec2533229bdb2172de3", - "0x00000000000000000000000000000000002c307c0f773885110a0d7188d22899", - "0x000000000000000000000000000000ccfc8d16713b3ac84c531b3a09b57a5632", - "0x000000000000000000000000000000000018177fc15055bc6ded75133159116e", - "0x000000000000000000000000000000bf31ddaed25f6a3812d47d47eb1003c336", - "0x000000000000000000000000000000000030301fd8ac21f9dd93ae4de2223f3a", - "0x000000000000000000000000000000d8b510b22cee8d476c3ae3a5a643c12fcd", - "0x00000000000000000000000000000000001ed2d09f2ac6322b815bc0e35be630", - "0x0000000000000000000000000000005c2e45d0fa6b1156c250a016a8d6025717", - "0x0000000000000000000000000000000000116ef26a99b319f7ddf9a72b920d7e", - "0x000000000000000000000000000000887bef3a2f390f75c5c1c7d2804839dc40", - "0x0000000000000000000000000000000000241d35489e5ec7ae0ec539a511f4bb", - "0x0000000000000000000000000000001e9eed55f46c30f0a643e7fadc0f1c5b5f", - "0x00000000000000000000000000000000002d224bdb537e45356dad6719a44670", - "0x000000000000000000000000000000905b34d9aeffbef40ad032415b3b0e66bd", - "0x0000000000000000000000000000000000147a5bb3c75194935a583029501d7c", - "0x0000000000000000000000000000001a183288e3ecb3c21f96eb8e6c8fa774db", - "0x00000000000000000000000000000000001ef984af2d88e47be0e9664b8fd752", - "0x00000000000000000000000000000039f3dad17da7386018cab36996698755d5", - "0x00000000000000000000000000000000001561ce1450ac8840dbcf97e91bd5b6", - "0x000000000000000000000000000000f1b27c35585e11cbbf5612de0413672d01", - "0x0000000000000000000000000000000000012046c089f10f8c8c82265e2d6825", - "0x000000000000000000000000000000a2b89785fa94123ec142277619e45360fd", - "0x0000000000000000000000000000000000159d0140b54b1703d4f4ebdd75d849", - "0x000000000000000000000000000000539cb47199bd3c2245bc3044a89cf91958", - "0x0000000000000000000000000000000000096f804be4f55c1c25b387dc128f12", - "0x0000000000000000000000000000000d6ea4f662ce5d29fe8d5c30e717ed3f45", - "0x00000000000000000000000000000000000505aeb30b5f6acb1c0e335e27c510", - "0x0000000000000000000000000000003bafc94403ed6cbde5cd3bcd4b14d6c0fa", - "0x00000000000000000000000000000000001ad585be43d722b6a37d8b3832a770", - "0x000000000000000000000000000000d0ecec90f37a38b0b770d04148856f191a", - "0x0000000000000000000000000000000000195175c4eceb80ac5b567c05686b6a", - "0x00000000000000000000000000000018d09a6452cffee1251ce810df1987c3fe", - "0x000000000000000000000000000000000018a58c0116caf02d8187113b216b50", - "0x000000000000000000000000000000786c72f5cb45e0b2ef50d429284962d8f2", - "0x00000000000000000000000000000000001edecd8d2daf475aea627cddc4bf83", - "0x000000000000000000000000000000f11f76923fbc94bb9da677ef4ea48d8e5d", - "0x000000000000000000000000000000000009e363fd3b9fba1921f8a620453c8b", - "0x000000000000000000000000000000130337f88d1a3501deb7548bf12f3bf8c7", - "0x00000000000000000000000000000000001caf1ae2f1b7c284d4fa064660e2d4", - "0x0000000000000000000000000000001f3243dcfe519ae43f5fda7c4e071489ec", - "0x000000000000000000000000000000000028ddb68ba85ec82fbe2c3d13f3f4f3", - "0x000000000000000000000000000000b8d7efb798a996ad6f6cc79bbb2c23e051", - "0x000000000000000000000000000000000014064ac87a8676a6c0701105a76924", - "0x000000000000000000000000000000c4f5d6ec595af7e188571eb533255210bb", - "0x00000000000000000000000000000000000b751e85d1d0a4d12321b8f3001d93", - "0x00000000000000000000000000000053c44079c3fbeb350e7347576b96a518a2", - "0x00000000000000000000000000000000002cf5eeea78f9cc5b1c698613d5a0ac", - "0x0000000000000000000000000000006ebb8205fddf556a03c81473e3d7f128da", - "0x000000000000000000000000000000000005e04349dee59bf22cab15fbcf6579", - "0x000000000000000000000000000000119e7803dc1f0d42d610c1e636b763e84a", - "0x0000000000000000000000000000000000150cdd897a47b83debe2a86b41df03", - "0x000000000000000000000000000000b2627cae7ef76e48877e5f65dda01de6fa", - "0x00000000000000000000000000000000002df31114d6ea625d30f40fcd6501ae", - "0x000000000000000000000000000000d9ff339dabc896850436795e686c8b7892", - "0x0000000000000000000000000000000000045d737d25201a48aabff3f6bca6b3", - "0x000000000000000000000000000000de93c07b11d2e6fa6550a3cefb321e16d7", - "0x00000000000000000000000000000000001752e736d3439003c65c42a97c0f09", - "0x0000000000000000000000000000009365c7dc3d4484e835a8c4cd523db7cb52", - "0x000000000000000000000000000000000004bd96b70a7ceca6e250998dd29d04", - "0x000000000000000000000000000000383c0eef46c0b99e9af36ae88ed755eab8", - "0x000000000000000000000000000000000017750cb080368dc310dba9dc7b1627", - "0x000000000000000000000000000000ce7ee23afcb014b28d8ad4a8ca1576f27c", - "0x000000000000000000000000000000000029e9346b8314cc77921b3d989c68a0", - "0x0000000000000000000000000000009c8ee8e93120da7baa9e1aa23de4ebf086", - "0x00000000000000000000000000000000002d2475bbb16b1577d3933a25e17410", - "0x0000000000000000000000000000001c775e636250539aa55b35901031d8a234", - "0x000000000000000000000000000000000027a3acd1183085d9619ddfb13ce036", - "0x000000000000000000000000000000258cb84ffd27a5cb5a91a096c098cbcd14", - "0x00000000000000000000000000000000000cc296cc5967bc2eca88c4b55ec976", - "0x0000000000000000000000000000007b6f66567f2710b238fadf1e211206376b", - "0x00000000000000000000000000000000001c58cff4dbc4ad672c2b263cc7b065", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000044", + "0x0000000000000000000000000000000000000000000000000000000000000045", + "0x0000000000000000000000000000000000000000000000000000000000000046", + "0x0000000000000000000000000000000000000000000000000000000000000047", + "0x0000000000000000000000000000000000000000000000000000000000000048", + "0x0000000000000000000000000000000000000000000000000000000000000049", + "0x000000000000000000000000000000000000000000000000000000000000004a", + "0x000000000000000000000000000000000000000000000000000000000000004b", + "0x000000000000000000000000000000000000000000000000000000000000004c", + "0x000000000000000000000000000000000000000000000000000000000000004d", + "0x000000000000000000000000000000f810621a89c0517bee8e9091db33db5c31", + "0x000000000000000000000000000000000023741b91621c46040b5424ed914cc3", + "0x0000000000000000000000000000000f2fdfeb783fd6b40c78b5a63626a2f4e8", + "0x000000000000000000000000000000000017c899276b4aa148261fd5165b4f56", + "0x000000000000000000000000000000750b00e06c1f82f6f7f8e9ffebecc8b88e", + "0x00000000000000000000000000000000002e67b42a1cdb772145adfa042777eb", + "0x00000000000000000000000000000003c1bdcb7081df174d8f62d105c7bff108", + "0x00000000000000000000000000000000002d06f33162b682c82ba4d9631a0027", + "0x000000000000000000000000000000dc698986b132b014eb4cdb327fb1956f02", + "0x00000000000000000000000000000000001482ea94ef6e3792d74efe0e6d42f3", + "0x000000000000000000000000000000902e134d5c55320e5fd683e5e53db12819", + "0x0000000000000000000000000000000000223df39d2eaf34c15e9717d324638a", + "0x0000000000000000000000000000002a5d591d542407f6b7d9ca238e99d82476", + "0x00000000000000000000000000000000002328c39734acbb8b0615f2d079297e", + "0x0000000000000000000000000000004f656b00fe245ffcdfbe8526e7b94c3111", + "0x0000000000000000000000000000000000187e94c09606156ec475f83f072a1f", + "0x000000000000000000000000000000704932164b12d2d58443d282182510d82e", + "0x000000000000000000000000000000000009aee85440e936170d234cf2649cee", + "0x0000000000000000000000000000007638fdafd153b31e9ea8d27691e659e4eb", + "0x00000000000000000000000000000000000b28639f9f5f7b23d393c05550f930", + "0x000000000000000000000000000000275c4aaa3c929fb9274e0f2fc9153595cd", + "0x000000000000000000000000000000000027e32f7bdb492449996367ef0004cd", + "0x0000000000000000000000000000003aa5c01174d8bd58c7fc421d918915179a", + "0x0000000000000000000000000000000000175690a38c8464195a0d844b151793", + "0x0000000000000000000000000000007e01eb776da2b909e2f1d2b472fff43df3", + "0x000000000000000000000000000000000010de06f5969f3ab84832887f1d5f52", + "0x000000000000000000000000000000759640ca4e26c0d38ecd1d4dd30875e0a2", + "0x00000000000000000000000000000000000b3c95d4f96a9a628c96ca3548e4eb", + "0x00000000000000000000000000000027fa12fffc90187366a57715f98862688a", + "0x00000000000000000000000000000000002a26918d1bad54e9d82537a338919e", + "0x00000000000000000000000000000042a57d4b3a4f9c9b354b2d867df2b072ea", + "0x000000000000000000000000000000000013c953c7e5a7fadc0390ad77307cd6", + "0x00000000000000000000000000000058838c67b417a534481aa4f903ace16e33", + "0x000000000000000000000000000000000012a966212ece3e60bf0a54a8c03dce", + "0x000000000000000000000000000000cb6a8d8f66c50a64289ec51920b9d50669", + "0x0000000000000000000000000000000000103935e0b731b79f36574b22020913", + "0x0000000000000000000000000000000e68036fcd68025a4e3219134423574f2f", + "0x0000000000000000000000000000000000237ea6ef46098313177c83f6fa4281", + "0x000000000000000000000000000000757dbb350dd7e88ed4d424a0d7be0c9dff", + "0x00000000000000000000000000000000002e1b8df33ca43d8b5df02609942e5a", + "0x00000000000000000000000000000062044f8b8ace9bb00d4451e0b7379b4a7f", + "0x000000000000000000000000000000000008dbb15ea45f2f206070707678dbb2", + "0x0000000000000000000000000000003295d364033bace41c91c5c628eb03de15", + "0x000000000000000000000000000000000020f9f22a5afa1a4f430383d9c6d7e3", + "0x0000000000000000000000000000004f0ec8592442c7a1edbbd9c5d9bb831cb8", + "0x000000000000000000000000000000000001f54b925350d2d2b064c9d3fbd0cf", + "0x00000000000000000000000000000059627119d9083cc00de857b3d52fc96dbf", + "0x00000000000000000000000000000000002cf6d0606f923ba3f371ae4d301db3", + "0x000000000000000000000000000000fa40760d371cfc576bca875d39fdc50859", + "0x00000000000000000000000000000000001d3e6f2196202bdc6f18b3e598822e", + "0x0000000000000000000000000000009d841a46762133236edc638ad9be7a1611", + "0x00000000000000000000000000000000001e1dca2657e3ddc0654b7f81c453ac", + "0x000000000000000000000000000000d3ebcba1ed5d8e2e5db46a53c7bcafdf3d", + "0x00000000000000000000000000000000001c5f9a76abadd6f16656921223c2c7", + "0x000000000000000000000000000000578a9f6317f82f575e7516bc23ba446296", + "0x000000000000000000000000000000000009db554cd7afded36685b2cc2afa46", + "0x00000000000000000000000000000072df2edf3d30c7e4dd65e54008f53aac17", + "0x00000000000000000000000000000000000d69eda07181cc43b55282cab19e30", + "0x000000000000000000000000000000c45121433b4527b3ad8203145c47a21d2a", + "0x000000000000000000000000000000000011615b62f470f0df362b84fbfbee1c", + "0x0000000000000000000000000000007941a8641a1af06de3e170a6e54001825b", + "0x0000000000000000000000000000000000135cdffb854c3e83cd156635d0d9f5", + "0x00000000000000000000000000000090a5255eb2fbe1c21cf428430babb4ebff", + "0x00000000000000000000000000000000000373ed0d5bf33c93261c7f0cd70167", + "0x00000000000000000000000000000086389340b1c54ad6767fa4a7feac0b6931", + "0x000000000000000000000000000000000008141f7a07dc48b972c9efeee86914", + "0x0000000000000000000000000000008b607ad199f1ade5bb162883afc34901e9", + "0x000000000000000000000000000000000000cceeeb457a4683b83aee0a250394", + "0x0000000000000000000000000000003dd5db36319e2234492e3fc10802586a2c", + "0x00000000000000000000000000000000001483f496f4e6582c81f06e95cd0ab3", + "0x000000000000000000000000000000595201832785ce5841162229f1e7890af6", + "0x0000000000000000000000000000000000035bf04e3cddb88b7599dde215eb3c", + "0x000000000000000000000000000000f92163b6dcf703e9cf58c6f07f6398b168", + "0x000000000000000000000000000000000005629bc60bbbdd1b8acd7bd9404ae9", + "0x00000000000000000000000000000050e8c38fd5fe50acdc1110d1430f1e5092", + "0x00000000000000000000000000000000002493ecb5f2a6e1ca53275d39e85729", + "0x000000000000000000000000000000a4b4680e14b0f1ac89c50a55ccc91c2a60", + "0x00000000000000000000000000000000000265575c1d7e5e530bdc57e6041833", + "0x0000000000000000000000000000005f086fea719519af18e8b0a29a79359c7a", + "0x0000000000000000000000000000000000056bd2133d3186dad025e38d33ba66", + "0x0000000000000000000000000000007e3f0eaafa9128149f29d76a9967a6f5b1", + "0x000000000000000000000000000000000019c4e7a4c7a7641a25f58aa889df9a", + "0x0000000000000000000000000000006ac73b780057a7dcb1c9ce19a1b443f63a", + "0x000000000000000000000000000000000018e1de9ac1d7cfa2c0500ce49f881d", + "0x000000000000000000000000000000e97fb648fc1ff99f9988a73de181e0de22", + "0x000000000000000000000000000000000024cae2d5d2c4daefe858889eeb01b8", + "0x000000000000000000000000000000e072297115d09425f5612d626dc82f1002", + "0x00000000000000000000000000000000000815a38741b61a4a746b6256b1eb91", + "0x00000000000000000000000000000023edf5ec8727bc87281eab66284f87ad2c", + "0x000000000000000000000000000000000001817943bc850dcd02d4ea565c1493", + "0x000000000000000000000000000000a52f5a3cb7bdd0393d39866d9524b8bb74", + "0x000000000000000000000000000000000015360b6039f6183da9a066d31f21ae", + "0x0000000000000000000000000000000d870e4369af12e9a713d607cf717fe72b", + "0x00000000000000000000000000000000000002298c8bc804808d58756dae84ae", + "0x00000000000000000000000000000073944baa9d28defedd72c6f09aca49727b", + "0x000000000000000000000000000000000004bae3c183b76cf6730ad3aee810d7", + "0x000000000000000000000000000000f2fa4474406d74b57cdb71ec6be23ddef4", + "0x0000000000000000000000000000000000052169f2bbc2f3f5c8f655b41c0150", + "0x000000000000000000000000000000d703c362037631c809f2999aecf387f66b", + "0x000000000000000000000000000000000020bf636ea187b713b19af5ef19a560", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000000000a653c3ebcdb2ec03f5bededc1780032446", - "0x0000000000000000000000000000000000143112234ac9aa9f7ef289152fccda", - "0x00000000000000000000000000000073d1f6ce5b511d1a45307e35b4e146876d", - "0x00000000000000000000000000000000002ca743c017d5c16d5953d03410d5a5" + "0x000000000000000000000000000000f8b91015dd9e75d2c481301e4b71ecd06a", + "0x00000000000000000000000000000000001d07cee0ae2afabca8c10513a44b86", + "0x000000000000000000000000000000ef950d707842f8a387388b7a8f5f9a6933", + "0x00000000000000000000000000000000000745ad8f37d8f526173fb2651e2521" ] -hash = "0x03cde467306e7d05bcd957b9dde81fdb644d6a7e21d7857bc1bf647f78bfde83" +hash = "0x18c47824d925ac614bb14be8d502f072b1bfc96abff5e4951f46323faa3de032" [inputs.previous_rollup_data.vk_witness] leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" sibling_path = [ - "0x1f07a2890c9deb79fe6cc78935c6dfa810ee56922785f37307cb463f7797f73e", - "0x19861a044ec84aaf6e41d02a20051d349f07206356e10a0846d4fa892534e306", - "0x236d849434a03c2e9d181e5365fe087cb14fd703bff61e5676bfa24c4f4509b7", - "0x268b4fb54bbdda64dd707ee86cb0729dfb9a9e8b6ae83e973b37bc7e4b18f875", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x09ab650e88dcf88f3610303c453731d759afd016234d47efd3d1338ee79f5496", + "0x0c99fd462f2396fcaed337dec2f74fe2706ccbf75677c6b57f41e46de091b910", + "0x24de6a6697f70e960e2e69307ed9c63592ed48ee81c6d59440352c0f250f379d", + "0x0178af4ea3a679e0025251b9543017390bf56038f217158886965e52d7b0c8cd", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] [inputs.l1_to_l2_roots] vk_path = [ - "0x161b493a1213baf6622d929c1fc116cc43fe1814a596e068cead7d06be55329d", - "0x0339cf04d96013da57fbdde5b8fc0ef4715a16f28de5d42966ffd1394729cd51", - "0x236d849434a03c2e9d181e5365fe087cb14fd703bff61e5676bfa24c4f4509b7", - "0x268b4fb54bbdda64dd707ee86cb0729dfb9a9e8b6ae83e973b37bc7e4b18f875", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x0d937d0c6940973c71f9090ff28db3d79a16705d7a56ba2146a310296594926c", + "0x147e0be1bf6b38d5b969bd2c86561db2e2da639f5a1c9cae3d52da4ff3690fed", + "0x24de6a6697f70e960e2e69307ed9c63592ed48ee81c6d59440352c0f250f379d", + "0x0178af4ea3a679e0025251b9543017390bf56038f217158886965e52d7b0c8cd", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] [inputs.l1_to_l2_roots.proof] @@ -14261,11 +14425,7 @@ sibling_path = [ "0x00000000000000000000000000000000000000000000000000000000000001c8", "0x00000000000000000000000000000000000000000000000000000000000001c9", "0x00000000000000000000000000000000000000000000000000000000000001ca", - "0x00000000000000000000000000000000000000000000000000000000000001cb", - "0x00000000000000000000000000000000000000000000000000000000000001cc", - "0x00000000000000000000000000000000000000000000000000000000000001cd", - "0x00000000000000000000000000000000000000000000000000000000000001ce", - "0x00000000000000000000000000000000000000000000000000000000000001cf" + "0x00000000000000000000000000000000000000000000000000000000000001cb" ] [inputs.l1_to_l2_roots.verification_key] @@ -14290,134 +14450,134 @@ sibling_path = [ "0x0000000000000000000000000000000000000000000000000000000000000010", "0x0000000000000000000000000000000000000000000000000000000000000011", "0x0000000000000000000000000000000000000000000000000000000000000012", - "0x000000000000000000000000000000ef83b38b2adfeae9003ed25049bf5a8127", - "0x00000000000000000000000000000000002f6804ac00ed4ac9c12ff372dff4f1", - "0x000000000000000000000000000000cc77099ec2b643439807e7876fad2c9ba2", - "0x0000000000000000000000000000000000189fe72941b8761529cdec879e70c3", - "0x0000000000000000000000000000005c21f4d06f37d56db1519a1f0067f8325c", - "0x0000000000000000000000000000000000240f7fb629fc6fac9c01a15a81a29d", - "0x000000000000000000000000000000baad6c7e6298352fa7b24edf7dd5e1ebe6", - "0x00000000000000000000000000000000001d95172fd685cbacf6161e5faea826", - "0x00000000000000000000000000000071b58c3c1aea5098420025a2aaf4ebe3d4", - "0x00000000000000000000000000000000000dfb79669eb9b7661caa8d029d8286", - "0x0000000000000000000000000000005ee94b8c8879ad84db0b3e4c3f9a7543ff", - "0x00000000000000000000000000000000002bbb7fbd08328822904381b7fefead", - "0x000000000000000000000000000000576e5f08a5f41e12f28187f9786454cd5d", - "0x00000000000000000000000000000000001e71d3b1f2afcfb7477ba51110db5b", - "0x000000000000000000000000000000a4bca7718514674b6ab56109c42736ea7c", - "0x0000000000000000000000000000000000071b722c8d87bbfd0cf448c31f81bc", - "0x00000000000000000000000000000025b11596c239dae5057125d05eb8cc6557", - "0x00000000000000000000000000000000002a319a7045785ddbfd2e01866b63a1", - "0x000000000000000000000000000000eb8b982636ed767b93b8c6e944831b4f35", - "0x00000000000000000000000000000000000fa95738e669f13a780f2e532ac0c6", - "0x000000000000000000000000000000dd15bc2e2ba0e2c65e6a29ff0d76959549", - "0x00000000000000000000000000000000000ec94bcf6af94a2915bf1c2a310d4a", - "0x000000000000000000000000000000a5febcf1818fc85fae3fe27cf330f8f611", - "0x00000000000000000000000000000000002ea22d66ad35aebbb913d41f81ed36", - "0x000000000000000000000000000000183ba8d5faae59b85b2bca96ec6f2cd725", - "0x0000000000000000000000000000000000093c1fcf5f6e4778203fda698738d2", - "0x000000000000000000000000000000c3349712daded22564626cf8bf805ee156", - "0x00000000000000000000000000000000001200bfd0c056032a36740fa7c17d8a", - "0x000000000000000000000000000000f0442acb9227365fa391e5b24de1b8b829", - "0x00000000000000000000000000000000001efcbef4be20dafb606d9fe26ccb6d", - "0x0000000000000000000000000000000a3434c757b6cdf4e171e777c3f36f42e4", - "0x000000000000000000000000000000000027e62534f646bba5e31b7f99909e8a", - "0x00000000000000000000000000000079d48b61f1c30319e84d2db5cadf9db534", - "0x000000000000000000000000000000000006c22981c92b67b75a1a7e718205db", - "0x000000000000000000000000000000267ef0534bb1162f69b63c6074a9d959fc", - "0x0000000000000000000000000000000000052dba76a66b4133ecb9f2bca8c380", - "0x00000000000000000000000000000008b52c29909ad1bfa954da8e57ea4a066a", - "0x0000000000000000000000000000000000109ff22b42ffa34a1048d1cf7e85f2", - "0x000000000000000000000000000000cafab2f766bee54b3695ec724f8973f588", - "0x0000000000000000000000000000000000055bdea69cd65d01ffe3b7bf6e0abe", - "0x000000000000000000000000000000d0a224122ee5ebb826535f06f15adaba46", - "0x0000000000000000000000000000000000005c21930f20683a963e879e95e0eb", - "0x00000000000000000000000000000057ab4c4fbae63414a156791ecb00f1bc5a", - "0x000000000000000000000000000000000013a6918d60b19830c00e3972619e94", - "0x000000000000000000000000000000722c10b61e2f8387dec086bb464b884150", - "0x00000000000000000000000000000000000cdaf3a64ca4794ca238d7fcdcecb3", - "0x000000000000000000000000000000ba93532e80bcd28c489a8540829640a02f", - "0x00000000000000000000000000000000000dccd3477b06045551bbe751031249", - "0x00000000000000000000000000000033bd7a9cf0fd754e5df28e9a2e678c496d", - "0x00000000000000000000000000000000002dd95c5b299310b245d58792c40cdb", - "0x000000000000000000000000000000439b907e0a9aaf7069461801093dcab835", - "0x00000000000000000000000000000000001335daf28fe677041b7c2c0b53ea80", - "0x00000000000000000000000000000066505d6c6857e0ff6081bf191c7b501af8", - "0x0000000000000000000000000000000000036ea1a34f9dac9abd0443118e6a74", - "0x00000000000000000000000000000031c04a43642ef06a56d9951d837d2a77b8", - "0x000000000000000000000000000000000000613e5d8a161533954c2885c05d44", - "0x00000000000000000000000000000096112c8b51229d049e119f55ff16c0cc46", - "0x000000000000000000000000000000000025f4924d517cd360f35f94bdc7be6c", - "0x000000000000000000000000000000fdc27898080f429ff8620e35140200a58e", - "0x00000000000000000000000000000000001b6f39a89f4ebc48295e228b30abe8", - "0x000000000000000000000000000000f80b54e38cb801f342ab82d7354e219e33", - "0x00000000000000000000000000000000002bca4749a44bb3c577ee97897e7792", - "0x000000000000000000000000000000be5d5831c52353c0a74a70345214f349dc", - "0x000000000000000000000000000000000008aa5b88aa0e13dae13d9e43c9e695", - "0x000000000000000000000000000000fb8045f8e8895d666eb162235ac4c05631", - "0x0000000000000000000000000000000000088cfba36a0a4046b654b389fe511f", - "0x000000000000000000000000000000d29dd74fa0b498959f4845bf59e29302f1", - "0x00000000000000000000000000000000001f6f0668aa5bafc7ef1e5b045bb524", - "0x000000000000000000000000000000113fd70eae2ff08f9e67846bdbb99fecc6", - "0x00000000000000000000000000000000000d6365aa67ac09db2d9a68e4e3b266", - "0x000000000000000000000000000000f178bd7fd4e507267f274cbb47b7707ca0", - "0x0000000000000000000000000000000000067ba20a9d7417f34586a9efd52440", - "0x000000000000000000000000000000521c51f8b15b4d56afa135439f639f760c", - "0x000000000000000000000000000000000018e56583282afa9f1b8537ecae629a", - "0x000000000000000000000000000000e605e75816e2ea9f583d44a0a1733ed1c7", - "0x000000000000000000000000000000000017f7dc0243458b7e84142310fbc98c", - "0x0000000000000000000000000000004c414c873d55767084c7efd12649cf484d", - "0x00000000000000000000000000000000000b76024cf3afa7d296c0552a8b9162", - "0x000000000000000000000000000000dd7e743cdf36e28ca926a5a72a077a582b", - "0x00000000000000000000000000000000000221356b123f38d03cd61faaf8c1b9", - "0x000000000000000000000000000000a87eae59bb0c50c7ae7e9eb63329456478", - "0x00000000000000000000000000000000002f1aebfba475c3c5e5b7aef25dc0d4", - "0x00000000000000000000000000000096f2dc2660b1528b582196a321fa22156b", - "0x00000000000000000000000000000000001c1d153734760312cadebc84e5deb2", - "0x0000000000000000000000000000009994cda75e4b4d76adecefc5fdfaedd890", - "0x0000000000000000000000000000000000292a4c0c5e217951a2a035377ca7c1", - "0x00000000000000000000000000000071dac06b84fbc70b0ea6fa4b967228ee05", - "0x00000000000000000000000000000000002c608447811602745e0220080f4f2e", - "0x0000000000000000000000000000002e4e72704b61a701fa7137313db1168d05", - "0x00000000000000000000000000000000001fc5345c8f1f0eabd4ce83d09bef6b", - "0x000000000000000000000000000000ffff1b7f5093c84b02d134afc0636c1d8f", - "0x00000000000000000000000000000000002c37e011d34a90133668385615c3ce", - "0x0000000000000000000000000000008cd6f83b1d4cf06810d804be0a1dfcb0eb", - "0x0000000000000000000000000000000000264144a05a6313cce7e4735f77b75e", - "0x0000000000000000000000000000003709f8978d2f3806ac989432cf46ab52b2", - "0x00000000000000000000000000000000000a0dc9cba8aa7d2b1991b6ce6ab8dd", - "0x000000000000000000000000000000bc7da4a5cd763a1a5cf1acba2e654e5985", - "0x00000000000000000000000000000000000a35e16ef55d15ea0182640e03d71f", - "0x000000000000000000000000000000716bd4734483981c1dfef425096a3cc48c", - "0x00000000000000000000000000000000000e0aeb4c2362bda3b93ec82e1dc9c0", + "0x000000000000000000000000000000d99e8e0835363e4a763eb92ef7f214c694", + "0x00000000000000000000000000000000000da44a6ddb1ed3d524ac57238ed05f", + "0x00000000000000000000000000000020103ca48b1507c552ac4ba9c545bafcee", + "0x00000000000000000000000000000000001b171529280d36682e6ae2ecf31776", + "0x000000000000000000000000000000f3b3d69db364d3884188d841a4ed1e717d", + "0x000000000000000000000000000000000015d050ccabb8ff8eca28600afb9c91", + "0x00000000000000000000000000000072495880c690cc88f9bbbda01b5aeae7e8", + "0x000000000000000000000000000000000017a20c6d3ba47d0ef5874519722c69", + "0x0000000000000000000000000000008eeb5b26ca0f33f1c345174efca056ca58", + "0x000000000000000000000000000000000016b25f3effa1cdc031e4425f25b70a", + "0x0000000000000000000000000000002ce13941925f526cfeaa089154b7b93f41", + "0x000000000000000000000000000000000015b3f886830ee31f6b8a4ef5aa70dd", + "0x0000000000000000000000000000004a297d53c3cd63cc2fa1ddbf3cbcbcffc7", + "0x000000000000000000000000000000000023c61ca568f9768a19c7d0bfe6bfc8", + "0x000000000000000000000000000000bcc1404f0b277f876560ffd1b77d5f4a90", + "0x000000000000000000000000000000000002fb21e497726796b6f8775053d9dd", + "0x0000000000000000000000000000003bb9db4a653da3e54eec0b5a78462f53cc", + "0x000000000000000000000000000000000009f56a25547bab80f201c3ddb0c8c8", + "0x000000000000000000000000000000c66625c0a24606f888a7784f0a41980f28", + "0x000000000000000000000000000000000004666fa6404d6a2b636dec52504e0a", + "0x00000000000000000000000000000070fdb8c302e90c85177cb0507890ead649", + "0x000000000000000000000000000000000015fad28ecebe46b5b96403a2b281a8", + "0x000000000000000000000000000000698ed7dbc672603cbf53f65ae87eb476ac", + "0x00000000000000000000000000000000001d796432e0534eed0446cc857af7f3", + "0x000000000000000000000000000000b862080874183fbd8beafade4db201cf5c", + "0x00000000000000000000000000000000000d51c793d0f427c476d6580576b5fb", + "0x000000000000000000000000000000de866f4da1aad9653b7f3eb7e2596c60cc", + "0x00000000000000000000000000000000000034d03c26f3f80a0c7216002f7e18", + "0x00000000000000000000000000000006ed5599aa8e52b96297cb95e755626bc9", + "0x000000000000000000000000000000000021cc1631ce909ccf8ebb6c24caabca", + "0x0000000000000000000000000000001507294e3fddfa7e58aec27f339c76964b", + "0x00000000000000000000000000000000001745de1cef14c0f32628ae3864fe9e", + "0x0000000000000000000000000000009bfb5fd579d796c3fc8f979820cf0ac23e", + "0x0000000000000000000000000000000000102e68b94a394bd536f11505b1752a", + "0x000000000000000000000000000000be0eaf76b3581477679fab993fbf4b266b", + "0x000000000000000000000000000000000007f0ef0c3d9c38d944f02c4d3ea2b3", + "0x00000000000000000000000000000051718f1eb246d488b02122b6ff0d4a2042", + "0x000000000000000000000000000000000001680330781656f4453cdbe18926e0", + "0x000000000000000000000000000000c16cbba91186a0bff6cfe1b5a8ecf63297", + "0x00000000000000000000000000000000001a6019ba41e20011ee7d5b40ee1bb8", + "0x0000000000000000000000000000001052b76ff838481ce4eca2b3cb98c9a060", + "0x000000000000000000000000000000000000018b9aea3f716f59880d6c69ca4c", + "0x0000000000000000000000000000009a5b37e18106b7ec421a5751a5a9328b1f", + "0x00000000000000000000000000000000002229cdb824cc649aed477355d47b5f", + "0x000000000000000000000000000000ed7df24feb46762e1f7e07df1956a049f2", + "0x0000000000000000000000000000000000258804f338e80a79a6d001e8bacd59", + "0x000000000000000000000000000000e262b831c8e62e1fec1e45f338d29f5676", + "0x00000000000000000000000000000000002555d3f122ccd3aa05654e48b4655c", + "0x0000000000000000000000000000002840e13b645b01eaba0b9485c9cfd7d3aa", + "0x00000000000000000000000000000000001119a1d5e258ce847b72b9631f0a53", + "0x00000000000000000000000000000098e8f60d8a8a9520ebcb64efb7aab903b6", + "0x00000000000000000000000000000000000ff4bab1114a31dcd1fd2e0ccf5bb6", + "0x000000000000000000000000000000531598b1d4506e2f3717fc71fd3f593c62", + "0x000000000000000000000000000000000022f8774edb03d6bf55a421540e7674", + "0x00000000000000000000000000000019da4c3b3cb58c613696003bf4019ac041", + "0x000000000000000000000000000000000004046309360253bbac8d440c5cd9de", + "0x000000000000000000000000000000995e715085162972a6c055459a0918d17d", + "0x000000000000000000000000000000000014e6a3f3eb4a1b4ce77ea10f59d72d", + "0x00000000000000000000000000000063c12ef7a10623eda2b595461d05ad77df", + "0x00000000000000000000000000000000001f92bfb9d1bf921e655f934dad3b3a", + "0x000000000000000000000000000000d70951511000463de265e63110679a8caa", + "0x0000000000000000000000000000000000071e6875d5afb102180bd980ac509e", + "0x00000000000000000000000000000063d14025a3f85e51a2807366711017f47c", + "0x00000000000000000000000000000000000fe4dfce28d5a632b50bceda8e3337", + "0x00000000000000000000000000000075018a1054e8d4b9c5be1c6105d7bd8b45", + "0x00000000000000000000000000000000002206cd0639a682d9e73092b5c84cb8", + "0x000000000000000000000000000000d31162c3f6eceba01ddafca8c6f930b405", + "0x00000000000000000000000000000000001d893cecd00ad660c7c364d0a77838", + "0x00000000000000000000000000000092e97d548363b7372bf4404c680f341aad", + "0x000000000000000000000000000000000027540fd0cdc83d6cc8743d135b49cc", + "0x000000000000000000000000000000f9f62f8c5373b43bc733c84d45003e3977", + "0x00000000000000000000000000000000002883879c5d4f51dba2383b233c7aa1", + "0x0000000000000000000000000000007dbdc15516d0ecccb0d436b25cd7ec32fe", + "0x0000000000000000000000000000000000127da16317f6217f1bb5b11804262b", + "0x00000000000000000000000000000032488459ddf4ebce8ecea3fa50c6d96eda", + "0x00000000000000000000000000000000002cbc7b4f39f5081e3536f0d5f796f4", + "0x00000000000000000000000000000039c5976d34eb9ff8974d55384319a2c03b", + "0x00000000000000000000000000000000000dad00ec414fc70bcf2fcd5c13731b", + "0x000000000000000000000000000000203e3fd98e10f69b82062e4be7c405e1fb", + "0x0000000000000000000000000000000000253649de777b036f3a0580463a7a10", + "0x000000000000000000000000000000150d55e2ed9e250f9718237f01629f6bc1", + "0x0000000000000000000000000000000000105e7ffbf1f41f57b5f13f7c287cb4", + "0x000000000000000000000000000000fd072894526fead3510b4f759ec47a173a", + "0x000000000000000000000000000000000024761087a668c1a3923adc4f69c987", + "0x000000000000000000000000000000725ce8e8fb5c6346f6dfeb9261eb398cee", + "0x00000000000000000000000000000000000721ab622e3899d1164f3cf8c1bf06", + "0x0000000000000000000000000000009656984ef9db170ea5f30f9ec4165d1919", + "0x000000000000000000000000000000000008c3893f3d828ecea492501dbd4a5c", + "0x000000000000000000000000000000b4ea037a98206a837386972f51514e7707", + "0x0000000000000000000000000000000000036cb36e7e154ac681f44700b5ebfb", + "0x000000000000000000000000000000fb4c91717eaa15464ec1ce1a66cc2bc84d", + "0x0000000000000000000000000000000000120960ff3c95454dc197ec3038c0b7", + "0x000000000000000000000000000000f3daadc83ebb3b21eb32698da0cdf9b70d", + "0x000000000000000000000000000000000000d1bd164daa25b5c550701336dc66", + "0x0000000000000000000000000000003d76a2e6728a436ea5d4d9fe0a917c10b2", + "0x00000000000000000000000000000000002f0608fa3b5dafda8c8daa77fdefc4", + "0x000000000000000000000000000000de6c251949ab9720c5726addf449f582b8", + "0x00000000000000000000000000000000000f3ffd48df2972678acc44800f54ce", + "0x000000000000000000000000000000891b2672889eeb03795f85ee676a1b6792", + "0x000000000000000000000000000000000008c95ecb36077b4e651f295f120335", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000000000bffaa2c460088fff6bb2fd98d4eb2db429", - "0x000000000000000000000000000000000015d2c8f918e40e39044cf6837a606b", - "0x0000000000000000000000000000006852404c6e5ad16e7f7145667ca7f936c2", - "0x00000000000000000000000000000000001df468a82cff18d9fa14a32dd6e09a" + "0x000000000000000000000000000000448404a19c5637c2ab20c6927363ac1803", + "0x00000000000000000000000000000000000138151560dcc94b97b9999bf65b15", + "0x000000000000000000000000000000cf08fdbfae3a6d0c17964e64ae33777048", + "0x000000000000000000000000000000000022b2600eadfe873433194f01856776" ] - hash = "0x2e0cce49628efb36cd158bf4a421fbb6bbc1bd1d4d61a9a07a6d72eac792e035" + hash = "0x2a80ad686d515d43589bc1c41e5f4ddb9f276ac3fc16b24398fe4dc541ae9eb0" [inputs.l1_to_l2_roots.public_inputs] sha_root = "0x00089a9d421a82c4a25f7acbebe69e638d5b064fa8a60e018793dcb0be53752c" converted_root = "0x2373ea368857ec7af97e7b470d705848e2bf93ed7bef142a490f2119bcf82d8e" - vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" + vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" [inputs.start_l1_to_l2_message_tree_snapshot] root = "0x2e33ee2008411c04b99c24b313513d097a0d21a5040b6193d1f978b8226892d6" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000070" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000050" [inputs.start_archive_snapshot] - root = "0x04b51aa5df89d177213335ca62dee74d15b920e231f5ea5198ed405967d188fd" - next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" + root = "0x026e8d4564303241e67610a78bc5a2cfbd383ef1673f9e2a00a226d6bb280d34" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000006" [[inputs.blob_commitments]] inner = [ - "0x00aae0654b3ba2a2f1e2fa2c7d23b35ab21cfba67951dcf917925cc2325eb866", - "0x0000000000000000000000000000001eea78b1856d5770ee11f410332f1be2af" + "0x009321642da96004c157e6e0bdd65edba0037caf61d44e41f27d8fac79ca5372", + "0x000000000000000000000000000000c807f24f1a9025eabd5db962279bc477d5" ] [[inputs.blob_commitments]] diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr index 3a81f8e3923..0f63dffab72 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr @@ -1,10 +1,9 @@ use crate::abis::block_root_or_block_merge_public_inputs::BlockRootOrBlockMergePublicInputs; use dep::types::{ - constants::{PROOF_TYPE_ROLLUP_HONK, VK_TREE_HEIGHT}, + constants::VK_TREE_HEIGHT, merkle_tree::{membership::assert_check_membership, MembershipWitness}, proof::{ rollup_recursive_proof::NestedRecursiveProof, - traits::Verifiable, verification_key::{RollupHonkVerificationKey, VerificationKey}, }, traits::Empty, @@ -18,8 +17,8 @@ pub struct PreviousRollupBlockData { pub vk_witness: MembershipWitness, } -impl Verifiable for PreviousRollupBlockData { - fn verify(self) { +impl PreviousRollupBlockData { + fn verify(self, proof_type_id: u32) { let inputs = BlockRootOrBlockMergePublicInputs::serialize( self.block_root_or_block_merge_public_inputs, ); @@ -28,7 +27,7 @@ impl Verifiable for PreviousRollupBlockData { self.proof.fields, inputs, self.vk.hash, - PROOF_TYPE_ROLLUP_HONK, + proof_type_id, ); } } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_merge/block_merge_rollup_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_merge/block_merge_rollup_inputs.nr index d753043a639..cac5ba693bd 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_merge/block_merge_rollup_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_merge/block_merge_rollup_inputs.nr @@ -1,7 +1,10 @@ use crate::abis::block_root_or_block_merge_public_inputs::BlockRootOrBlockMergePublicInputs; use crate::abis::previous_rollup_block_data::PreviousRollupBlockData; use crate::components; -use dep::types::{constants::{BLOCK_MERGE_ROLLUP_INDEX, BLOCK_ROOT_ROLLUP_INDEX}, traits::Empty}; +use dep::types::{ + constants::{BLOCK_MERGE_ROLLUP_INDEX, BLOCK_ROOT_ROLLUP_INDEX, PROOF_TYPE_ROLLUP_HONK}, + traits::Empty, +}; // TODO(#7346): Currently unused! Will be used when batch rollup circuits are integrated. global ALLOWED_PREVIOUS_CIRCUITS: [u32; 2] = [BLOCK_ROOT_ROLLUP_INDEX, BLOCK_MERGE_ROLLUP_INDEX]; @@ -21,10 +24,10 @@ impl BlockMergeRollupInputs { // we don't have a set of permitted kernel vks yet. // Verify the previous rollup proofs if !dep::std::runtime::is_unconstrained() { - self.previous_rollup_data[0].verify(); + self.previous_rollup_data[0].verify(PROOF_TYPE_ROLLUP_HONK); self.previous_rollup_data[0].validate_in_vk_tree(ALLOWED_PREVIOUS_CIRCUITS); - self.previous_rollup_data[1].verify(); + self.previous_rollup_data[1].verify(PROOF_TYPE_ROLLUP_HONK); self.previous_rollup_data[1].validate_in_vk_tree(ALLOWED_PREVIOUS_CIRCUITS); } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root/root_rollup_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root/root_rollup_inputs.nr index c94ece862f3..7ede3a240b5 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root/root_rollup_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root/root_rollup_inputs.nr @@ -3,7 +3,10 @@ use crate::{ root::root_rollup_public_inputs::RootRollupPublicInputs, }; use types::{ - constants::{BLOCK_MERGE_ROLLUP_INDEX, BLOCK_ROOT_ROLLUP_EMPTY_INDEX, BLOCK_ROOT_ROLLUP_INDEX}, + constants::{ + BLOCK_MERGE_ROLLUP_INDEX, BLOCK_ROOT_ROLLUP_EMPTY_INDEX, BLOCK_ROOT_ROLLUP_INDEX, + PROOF_TYPE_ROLLUP_HONK, PROOF_TYPE_ROOT_ROLLUP_HONK, + }, traits::Empty, }; // TODO(#7346): Currently unused! Will be used when batch rollup circuits are integrated. @@ -28,10 +31,10 @@ impl RootRollupInputs { pub fn root_rollup_circuit(self) -> RootRollupPublicInputs { // Verify the previous rollup proofs if !dep::std::runtime::is_unconstrained() { - self.previous_rollup_data[0].verify(); + self.previous_rollup_data[0].verify(PROOF_TYPE_ROOT_ROLLUP_HONK); // root rollup honk proof type so we do full IPA recursive verifier self.previous_rollup_data[0].validate_in_vk_tree(ALLOWED_PREVIOUS_CIRCUITS); - self.previous_rollup_data[1].verify(); + self.previous_rollup_data[1].verify(PROOF_TYPE_ROOT_ROLLUP_HONK); // root rollup honk proof type so we do full IPA recursive verifier self.previous_rollup_data[1].validate_in_vk_tree(ALLOWED_PREVIOUS_CIRCUITS); } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-merge/Prover.toml b/noir-projects/noir-protocol-circuits/crates/rollup-merge/Prover.toml index a405158a2df..524414e4f42 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-merge/Prover.toml +++ b/noir-projects/noir-protocol-circuits/crates/rollup-merge/Prover.toml @@ -3,15 +3,15 @@ rollup_type = "0x0000000000000000000000000000000000000000000000000000000000000000" num_txs = "0x0000000000000000000000000000000000000000000000000000000000000001" out_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" -accumulated_fees = "0x0000000000000000000000000000000000000000000000000007a1b1bce60cc8" -accumulated_mana_used = "0x0000000000000000000000000000000000000000000000000000000000009af2" +accumulated_fees = "0x00000000000000000000000000000000000000000000000000116fe7c0d1779c" +accumulated_mana_used = "0x0000000000000000000000000000000000000000000000000000000000016207" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants] - vk_tree_root = "0x257719447a2c71ab94f300207f5a8096a1b8c9f15a614e409d7d48f95c6bdff9" - protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" + vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" + protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.last_archive] - root = "0x22697e2f4dca9f7c06b64c9a987d5e3411f2f28786d9f1d48ce27b61b8d8abe3" + root = "0x04f7f51d5b6e46fa9f34e4913304cd932bdd85edbc0ed0b8bf038c897440e6e6" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000007" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables] @@ -19,10 +19,10 @@ accumulated_mana_used = "0x00000000000000000000000000000000000000000000000000000 version = "0x0000000000000000000000000000000000000000000000000000000000000001" block_number = "0x0000000000000000000000000000000000000000000000000000000000000007" slot_number = "0x0000000000000000000000000000000000000000000000000000000000000014" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2d53" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a9ed" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables.coinbase] - inner = "0x000000000000000000000000b5b0e9c243b20a09c501dee16790e9dfc23506bc" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -32,28 +32,28 @@ accumulated_mana_used = "0x00000000000000000000000000000000000000000000000000000 fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.note_hash_tree] -root = "0x2b93be1d42d6277477a71a288ca7f05209d7edefdde05a5fc7e424d8ba4882a7" +root = "0x03fbff7873541e17d3fd41ec5a5cd19d0bbd804ac426bdc0e177a422b927fcfe" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000300" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.nullifier_tree] -root = "0x26f5b03416869c68bccb4bbf106ec858d6a3e822527bc8c48fdd6ba7cfd884ec" +root = "0x06cc7ec18acca02c7efcfe551cd95ebb5890d0b39393a9af3d81dd711b3966da" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000380" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.public_data_tree] -root = "0x2da9b69e8a02d9a3b9372d63f6eb07578d3a901d7d9bb5eed7e0723edbe02da1" +root = "0x155947e662d272924817325abe7bb5ccf6181cdd8d7747504aa66a6a9e240039" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.note_hash_tree] -root = "0x2b93be1d42d6277477a71a288ca7f05209d7edefdde05a5fc7e424d8ba4882a7" +root = "0x03fbff7873541e17d3fd41ec5a5cd19d0bbd804ac426bdc0e177a422b927fcfe" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000340" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.nullifier_tree] -root = "0x24ede285714e37dbc99f53093e640034e671b219229c72f354bf78f409f9f383" +root = "0x26685b0d46e9f595caeb351cf93ecdbd32f1a73783965cdd428de0d40213f39d" next_available_leaf_index = "0x00000000000000000000000000000000000000000000000000000000000003c0" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.public_data_tree] -root = "0x2da9b69e8a02d9a3b9372d63f6eb07578d3a901d7d9bb5eed7e0723edbe02da1" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" +root = "0x2de06dc379678174b469169d016af35ce9abde298f45f74b251be83c61fbb9fb" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start_sponge_blob] fields = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -75,22 +75,22 @@ next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000 squeeze_mode = false [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end_sponge_blob] - fields = "0x0000000000000000000000000000000000000000000000000000000000000007" + fields = "0x0000000000000000000000000000000000000000000000000000000000000009" expected_fields = "0x000000000000000000000000000000000000000000000000000000000000004f" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end_sponge_blob.sponge] cache = [ - "0x12e7b967d4eedec7cbc843b52b7413174df59b4d212a07cd5137bfb5914e9387", - "0x0000000000000000000000000000000000000000000000000000000006000002", - "0x02f71e7f13a0520af9e75ee37b71703ace10b7df98538c8384614743dc310151" + "0x0000000000000000000000000000000000000000000000000000000000002328", + "0x0076ea2b6f0dd2bb00e6767f9150e6e0a13116ab0572f0ab7a55ca0bb6a99fef", + "0x00000000000000000000000000000000000000000000000000000000000003e8" ] state = [ - "0x0212f33afeb25b4d2de9e2d9a2d20e3c8995c949b22f3e6f5d2839c84a236d6f", - "0x23c128d8c6faf52fbd5408e415baad147807a63384a20e0b177d8ebc8d1bb0f4", - "0x165d09f061a90bac1945fde4922ec437a8a7a21138819bcb78c0079297bece5f", - "0x0ba3a0bbbc38b7389727f6bce882b3c584b85ce4830bb22c3068eb02e28ab0ab" + "0x0890df6ab9fde67ff7b71aac467b0b132af91b554147ad708c1a302585a9fa08", + "0x080dbebdb83ea1bd1335be1ecdb0faa6649cd2cef92b036c6a679f4bd54c1d7b", + "0x2afb7d4ed10af902cc0adf28a1d799a887ae7f0375b13030d9a8d19d06ee6191", + "0x0973491257c748eb3ef2f9a689505e1b81aae5c0803d1f296e640ef21ffa17dc" ] - cache_size = "0x0000000000000000000000000000000000000000000000000000000000000001" + cache_size = "0x0000000000000000000000000000000000000000000000000000000000000003" squeeze_mode = false [inputs.previous_rollup_data.proof] @@ -557,13 +557,84 @@ fields = [ "0x00000000000000000000000000000000000000000000000000000000000001cc", "0x00000000000000000000000000000000000000000000000000000000000001cd", "0x00000000000000000000000000000000000000000000000000000000000001ce", - "0x00000000000000000000000000000000000000000000000000000000000001cf" + "0x00000000000000000000000000000000000000000000000000000000000001cf", + "0x00000000000000000000000000000000000000000000000000000000000001d0", + "0x00000000000000000000000000000000000000000000000000000000000001d1", + "0x00000000000000000000000000000000000000000000000000000000000001d2", + "0x00000000000000000000000000000000000000000000000000000000000001d3", + "0x00000000000000000000000000000000000000000000000000000000000001d4", + "0x00000000000000000000000000000000000000000000000000000000000001d5", + "0x00000000000000000000000000000000000000000000000000000000000001d6", + "0x00000000000000000000000000000000000000000000000000000000000001d7", + "0x00000000000000000000000000000000000000000000000000000000000001d8", + "0x00000000000000000000000000000000000000000000000000000000000001d9", + "0x00000000000000000000000000000000000000000000000000000000000001da", + "0x00000000000000000000000000000000000000000000000000000000000001db", + "0x00000000000000000000000000000000000000000000000000000000000001dc", + "0x00000000000000000000000000000000000000000000000000000000000001dd", + "0x00000000000000000000000000000000000000000000000000000000000001de", + "0x00000000000000000000000000000000000000000000000000000000000001df", + "0x00000000000000000000000000000000000000000000000000000000000001e0", + "0x00000000000000000000000000000000000000000000000000000000000001e1", + "0x00000000000000000000000000000000000000000000000000000000000001e2", + "0x00000000000000000000000000000000000000000000000000000000000001e3", + "0x00000000000000000000000000000000000000000000000000000000000001e4", + "0x00000000000000000000000000000000000000000000000000000000000001e5", + "0x00000000000000000000000000000000000000000000000000000000000001e6", + "0x00000000000000000000000000000000000000000000000000000000000001e7", + "0x00000000000000000000000000000000000000000000000000000000000001e8", + "0x00000000000000000000000000000000000000000000000000000000000001e9", + "0x00000000000000000000000000000000000000000000000000000000000001ea", + "0x00000000000000000000000000000000000000000000000000000000000001eb", + "0x00000000000000000000000000000000000000000000000000000000000001ec", + "0x00000000000000000000000000000000000000000000000000000000000001ed", + "0x00000000000000000000000000000000000000000000000000000000000001ee", + "0x00000000000000000000000000000000000000000000000000000000000001ef", + "0x00000000000000000000000000000000000000000000000000000000000001f0", + "0x00000000000000000000000000000000000000000000000000000000000001f1", + "0x00000000000000000000000000000000000000000000000000000000000001f2", + "0x00000000000000000000000000000000000000000000000000000000000001f3", + "0x00000000000000000000000000000000000000000000000000000000000001f4", + "0x00000000000000000000000000000000000000000000000000000000000001f5", + "0x00000000000000000000000000000000000000000000000000000000000001f6", + "0x00000000000000000000000000000000000000000000000000000000000001f7", + "0x00000000000000000000000000000000000000000000000000000000000001f8", + "0x00000000000000000000000000000000000000000000000000000000000001f9", + "0x00000000000000000000000000000000000000000000000000000000000001fa", + "0x00000000000000000000000000000000000000000000000000000000000001fb", + "0x00000000000000000000000000000000000000000000000000000000000001fc", + "0x00000000000000000000000000000000000000000000000000000000000001fd", + "0x00000000000000000000000000000000000000000000000000000000000001fe", + "0x00000000000000000000000000000000000000000000000000000000000001ff", + "0x0000000000000000000000000000000000000000000000000000000000000200", + "0x0000000000000000000000000000000000000000000000000000000000000201", + "0x0000000000000000000000000000000000000000000000000000000000000202", + "0x0000000000000000000000000000000000000000000000000000000000000203", + "0x0000000000000000000000000000000000000000000000000000000000000204", + "0x0000000000000000000000000000000000000000000000000000000000000205", + "0x0000000000000000000000000000000000000000000000000000000000000206", + "0x0000000000000000000000000000000000000000000000000000000000000207", + "0x0000000000000000000000000000000000000000000000000000000000000208", + "0x0000000000000000000000000000000000000000000000000000000000000209", + "0x000000000000000000000000000000000000000000000000000000000000020a", + "0x000000000000000000000000000000000000000000000000000000000000020b", + "0x000000000000000000000000000000000000000000000000000000000000020c", + "0x000000000000000000000000000000000000000000000000000000000000020d", + "0x000000000000000000000000000000000000000000000000000000000000020e", + "0x000000000000000000000000000000000000000000000000000000000000020f", + "0x0000000000000000000000000000000000000000000000000000000000000210", + "0x0000000000000000000000000000000000000000000000000000000000000211", + "0x0000000000000000000000000000000000000000000000000000000000000212", + "0x0000000000000000000000000000000000000000000000000000000000000213", + "0x0000000000000000000000000000000000000000000000000000000000000214", + "0x0000000000000000000000000000000000000000000000000000000000000215", + "0x0000000000000000000000000000000000000000000000000000000000000216" ] [inputs.previous_rollup_data.vk] key = [ - "0x0000000000000000000000000000000000000000000000000000000002000000", - "0x0000000000000000000000000000000000000000000000000000000000000044", + "0x0000000000000000000000000000000000000000000000000000000001000000", + "0x000000000000000000000000000000000000000000000000000000000000004e", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000034", @@ -582,126 +653,137 @@ key = [ "0x0000000000000000000000000000000000000000000000000000000000000041", "0x0000000000000000000000000000000000000000000000000000000000000042", "0x0000000000000000000000000000000000000000000000000000000000000043", - "0x0000000000000000000000000000007acea76220f3dcf559941a7e87a6b28907", - "0x000000000000000000000000000000000017503e58c81a120517cdb8a4f99a55", - "0x00000000000000000000000000000030e0a46a7056ec5d122358957f34be6420", - "0x000000000000000000000000000000000019af3ba7be026356d5013338e6a9c8", - "0x000000000000000000000000000000941c8c03340dc6ac1ac21dfc245eec52ae", - "0x000000000000000000000000000000000028a50b16a95bfe8d5d5910fa14acf9", - "0x000000000000000000000000000000d750fd9b7a01bfd4e6553bf8ab2e513a06", - "0x000000000000000000000000000000000005cb7ef208180dc12701ec1bf16e6e", - "0x000000000000000000000000000000226a41a3cde055871146a14f69ceed3189", - "0x00000000000000000000000000000000001905f4d4e4516041c993103f21ed23", - "0x000000000000000000000000000000e1343257a50d0cf1554d5fa39b63807f82", - "0x000000000000000000000000000000000029c01e95b47fd55a3af50c144b0334", - "0x000000000000000000000000000000061cb8849db1149ba384d6eb537ec1d821", - "0x00000000000000000000000000000000001bd9e9b6b2864c7e76f8d6f987d224", - "0x000000000000000000000000000000fbd7c650b1b4c0ba0255b744ddd75e735c", - "0x000000000000000000000000000000000014ac90285cdead0ec12cad3d8d3a31", - "0x00000000000000000000000000000004bd04287093441c75d05b6cb594d378de", - "0x00000000000000000000000000000000001cfa05ce692088c27bb7e9a8a262c2", - "0x0000000000000000000000000000000943740754bb6d7f5fb55d5570754381c0", - "0x000000000000000000000000000000000006cfaa5c166143d59ab33b6f57b88c", - "0x000000000000000000000000000000c3f3c5edfca877fb6c14f7e913c178f044", - "0x00000000000000000000000000000000001def2c9873d161b5ffc87d4b9c60dc", - "0x0000000000000000000000000000002837ed4f4febbbe8635ac74a35ef13542d", - "0x00000000000000000000000000000000002e15fa9496d154e169360820b701f7", - "0x0000000000000000000000000000007f4ae2590c599ca3e076d8a504c9761169", - "0x000000000000000000000000000000000008d15a8f153ffea92236a73f8e00ec", - "0x0000000000000000000000000000009a5f9f5cc321cda5967ab3977408842a1b", - "0x00000000000000000000000000000000001aef0ad6d98239a10226c1e7a66701", - "0x00000000000000000000000000000013ed1c45df71665ea0553a8a92ef89b0ea", - "0x00000000000000000000000000000000001e6c3f8b5ee0db10934643cab5960c", - "0x000000000000000000000000000000e6fa0a76bfb524488e71aa8cba569d3273", - "0x00000000000000000000000000000000000e146846a27a9e994aa5eb95368e43", - "0x0000000000000000000000000000004722d45629beb72092ae034d7a116eea80", - "0x000000000000000000000000000000000011b3074e83b178395fdbf16779ecd4", - "0x000000000000000000000000000000a1560ad69fb0f87cbb68e2469c17405a88", - "0x000000000000000000000000000000000016664440497257aab435766cd8daa4", - "0x0000000000000000000000000000008c0e5d61ceae65541e501766f2133c9a05", - "0x00000000000000000000000000000000000348d59b536e2d9124401c032218d4", - "0x000000000000000000000000000000c3bec12bcd8c5519adc22cc13745a6a5ba", - "0x0000000000000000000000000000000000099b37362358ccfb574e08a5d589c5", - "0x0000000000000000000000000000001a7603f798b4001644ac6346536db682c3", - "0x0000000000000000000000000000000000294bc6e456c49353364126e7acfa5d", - "0x000000000000000000000000000000ab11980eb66b6674b9668c4bf810f2dbd8", - "0x00000000000000000000000000000000002a71b3517077a7e806ed8c7bd41fa5", - "0x0000000000000000000000000000005f94f02f427c74fe51265b2501485c6681", - "0x00000000000000000000000000000000001f6b4f952f28290b3907e9fd89a04d", - "0x0000000000000000000000000000000e0cb8cc77e8e0da284dfa81fb659ed69e", - "0x0000000000000000000000000000000000108d2a188563f05f8c03cc1a1478c1", - "0x0000000000000000000000000000001d68539ab56b251c9bdd606b72eae2fbe2", - "0x0000000000000000000000000000000000222d18f43c8767fbdc01e1149c5606", - "0x00000000000000000000000000000099b18017f081d6cde0fe1dba203d35f031", - "0x0000000000000000000000000000000000144df7fc0ec590f0ae163b2206b2a0", - "0x000000000000000000000000000000fe935114b354bc67d2668722921ebac6ba", - "0x0000000000000000000000000000000000075d80d0ccb2ebb8e503e0bc8830c2", - "0x0000000000000000000000000000003b90abab25d1cc86543ee6ff8bfb36a141", - "0x00000000000000000000000000000000002f2b5f13b32122f25179e756a5bfb6", - "0x000000000000000000000000000000897ab9f551efb564c420ec89c75f025c72", - "0x00000000000000000000000000000000001c0ea2c5e6ab8dbcb5c04b013def2b", - "0x000000000000000000000000000000a0075bff7fe7d309a4a62e4697e0910dee", - "0x00000000000000000000000000000000001dab25f9c69e46eea9ef77449361e4", - "0x00000000000000000000000000000099547f9d90555739ddb33d81f778b79663", - "0x000000000000000000000000000000000009900c88d768eb3db72dd478bde74a", - "0x000000000000000000000000000000d92c26c30401619e97a43b2187b1e133a2", - "0x00000000000000000000000000000000000f991e56504f78fa90c31cb1a39102", - "0x000000000000000000000000000000c2d41c0bbfbf46ba1250ac1c9e0fe538a7", - "0x00000000000000000000000000000000001a64c934662e4d7843869e10bcf0cc", - "0x00000000000000000000000000000060971ccd87ad954d4a3a53beb136a115e5", - "0x000000000000000000000000000000000010bd7c99936aad440199663e48b08c", - "0x0000000000000000000000000000002fdcaae4a7ea95151eaa408586b1860983", - "0x0000000000000000000000000000000000288a0ff0315966a7a54a4884071b87", - "0x0000000000000000000000000000002455cf89f168533af00a61b6cc5dff0b25", - "0x00000000000000000000000000000000002bd11c6ee070b426cbeab3ff2b61b9", - "0x000000000000000000000000000000253a264c658d6d8b3e4a96d1e60d4ddbcf", - "0x000000000000000000000000000000000019e1190a385281dc72fa0d1e6e3173", - "0x00000000000000000000000000000001ca9ee62603b8684b4435a11fbe81fe77", - "0x00000000000000000000000000000000000fb6c90cf416bdc5cad8fcc8c5b077", - "0x000000000000000000000000000000cbaabba02d5684703afd2db78a4f2a9440", - "0x000000000000000000000000000000000029ae159051a17e5ce8e48ac542d5fe", - "0x000000000000000000000000000000d3380d3fc8294269fb9db3fcc5a60a29ca", - "0x00000000000000000000000000000000002b6571e09ef0385e86a817eac71f02", - "0x000000000000000000000000000000dfbc5112ae66004756cc08168e703dbcdc", - "0x00000000000000000000000000000000000a1361207b6352bb3e47b8afdcdee4", - "0x000000000000000000000000000000e9d60c7571a644bd754d4bd8f89ce3f771", - "0x000000000000000000000000000000000025bcafa95e5c0470321ffae1ac1d1f", - "0x000000000000000000000000000000e3cb7b601f7eed6dca3e591857166b4d1c", - "0x0000000000000000000000000000000000125aad145d0dbafb8da2dc1b0700bc", - "0x0000000000000000000000000000007a67f2caa5046f4d1dfc3a63469566de81", - "0x000000000000000000000000000000000022a98cee0b4cc5268adc92e2229271", - "0x000000000000000000000000000000f7c7c14a69ad0052dced057951a74436f5", - "0x0000000000000000000000000000000000263b96899c9835ce217f54f6df4acd", - "0x0000000000000000000000000000006c8c4e747cb6085c5735b9c68f2db633ac", - "0x00000000000000000000000000000000001157b26152b34ab05419f38acc15da", - "0x00000000000000000000000000000054cf89815a06c242c5e433264079487fc0", - "0x0000000000000000000000000000000000049a97286033e7c6c80520a963c7a1", - "0x00000000000000000000000000000077cb47275a750777c993d845849365ae73", - "0x00000000000000000000000000000000001bef3fe6a136f8f3419040fb2fb9a8", - "0x000000000000000000000000000000cb5bdeb788a62ab7fefa163b44aa4fe480", - "0x000000000000000000000000000000000019c8da60322e5b15147bb67ee97c3c", - "0x0000000000000000000000000000001f35e0f8d62d480f37b4aa13b09005e059", - "0x00000000000000000000000000000000002eaf8692eeea251928fb9c16523574", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000044", + "0x0000000000000000000000000000000000000000000000000000000000000045", + "0x0000000000000000000000000000000000000000000000000000000000000046", + "0x0000000000000000000000000000000000000000000000000000000000000047", + "0x0000000000000000000000000000000000000000000000000000000000000048", + "0x0000000000000000000000000000000000000000000000000000000000000049", + "0x000000000000000000000000000000000000000000000000000000000000004a", + "0x000000000000000000000000000000000000000000000000000000000000004b", + "0x000000000000000000000000000000000000000000000000000000000000004c", + "0x000000000000000000000000000000000000000000000000000000000000004d", + "0x000000000000000000000000000000dc945e095000c47b493f10ead440435e41", + "0x00000000000000000000000000000000000f58415388d13398418c1461c1bda3", + "0x000000000000000000000000000000dbce30dcdb3c13c4aa6070888068c6dcb1", + "0x00000000000000000000000000000000002d31b20988c0927fb088c34880921e", + "0x000000000000000000000000000000f581782d5c24200bee64cd64d34cdda4ba", + "0x000000000000000000000000000000000000518828248a4bdb6a145e1d0be91a", + "0x00000000000000000000000000000008b0a2adcd7d8e2737ce7c4f306f61959a", + "0x0000000000000000000000000000000000193f1a5b82ebc8f0d39b9e4b9b355d", + "0x000000000000000000000000000000da78fe62605e734a33fd3c84ef3f3ae56b", + "0x00000000000000000000000000000000000d73092011a573815ea8c586505255", + "0x00000000000000000000000000000072abb2bbe9ff9063cbe8e509f2f61fdc84", + "0x00000000000000000000000000000000001612aa8e79ab5b1f699de4035daf73", + "0x00000000000000000000000000000020a57d6f25deb7cc13fe64382fbd2345a0", + "0x00000000000000000000000000000000001cec60b70bc02a770566861ff46bc5", + "0x0000000000000000000000000000000fc8333271ddae6ecc3aaf554e52592e0b", + "0x000000000000000000000000000000000018d943099525d52fb709593328ae07", + "0x0000000000000000000000000000005d957288ed9ef60eba15bfc0bb84a774bc", + "0x00000000000000000000000000000000002cfab20bd6429b5f7c36f87f8be4cc", + "0x00000000000000000000000000000054903e79f249255b754291481166a72799", + "0x00000000000000000000000000000000000f7ad2f708c574a8cb90d5fcf52f2e", + "0x000000000000000000000000000000b44bd418717651e03e82f9e58b03b4ff2c", + "0x0000000000000000000000000000000000193900d9b63f73e75802bf683c2852", + "0x0000000000000000000000000000003d3a7e6f1c077493808fbea8c24437fcba", + "0x00000000000000000000000000000000000e87fd71e305c9a0f41a06efdcdf4a", + "0x0000000000000000000000000000007e01eb776da2b909e2f1d2b472fff43df3", + "0x000000000000000000000000000000000010de06f5969f3ab84832887f1d5f52", + "0x000000000000000000000000000000759640ca4e26c0d38ecd1d4dd30875e0a2", + "0x00000000000000000000000000000000000b3c95d4f96a9a628c96ca3548e4eb", + "0x000000000000000000000000000000c210e36924ada16ad68b953e00e8a6bda0", + "0x000000000000000000000000000000000007855f746d00d72cc4e1bf10433d9c", + "0x000000000000000000000000000000d2abf8e4b6afc75c40e44dab1ce5dab3cc", + "0x000000000000000000000000000000000003da8a9f30966f277a1920ff52e53e", + "0x000000000000000000000000000000e2ee0c1499921d3672fed69bc5f2fef690", + "0x00000000000000000000000000000000000a0155e386199b92ab91cc2a08ad0e", + "0x0000000000000000000000000000000343319f3d7670a09a92c4fdfe3f6c4fd1", + "0x00000000000000000000000000000000000f3001c12dcc1a71b5a876065b131f", + "0x000000000000000000000000000000a0e7583d4b002b6ac3cc8efb551c765c39", + "0x000000000000000000000000000000000012cf334267286b6b057645d22f5bdc", + "0x00000000000000000000000000000083c4500c794fe2bb671b87d4910d07e11a", + "0x00000000000000000000000000000000000dbf761c3333cf18109b9fd34fad0b", + "0x00000000000000000000000000000095aff0fe2596072cc507e5b386b7b60d92", + "0x000000000000000000000000000000000027aca24e01b35ce9647132adc15154", + "0x0000000000000000000000000000007687a663b3868244c443907769071d85e6", + "0x00000000000000000000000000000000002ff74eaf6a7d1023738e0e64d3346b", + "0x0000000000000000000000000000000e788546c74fe6a1fe1f009187f46e71c7", + "0x00000000000000000000000000000000002b5fbaa13a37f80a9c7a8db4efd4e6", + "0x0000000000000000000000000000002ec4891a55adad779ef3a6e6adf897a984", + "0x00000000000000000000000000000000000479305b5438e5c58d1bb08ec671d8", + "0x0000000000000000000000000000005f6cb741d09f3d51a9c168a0c2e01d65a0", + "0x000000000000000000000000000000000002523bbecb5263be6a20d4bb3f0bb5", + "0x000000000000000000000000000000552865f272d5043d2629da7d5d5bd4e325", + "0x00000000000000000000000000000000000942fa18c75e204c17d4551138ca9e", + "0x000000000000000000000000000000c5d616c4c32edead14c8c7a4bd38ed0c90", + "0x000000000000000000000000000000000013fe370c4ebc7cd840e00b95b637a9", + "0x000000000000000000000000000000c32bfa2198bfb75f96977f5d11cf67a505", + "0x00000000000000000000000000000000002146420bceb3c525147da06bb1004e", + "0x000000000000000000000000000000051c38dfd958b65c7357e45790c089a0b4", + "0x00000000000000000000000000000000002fe4d601ce3ddfe6bbe3f0d9385719", + "0x0000000000000000000000000000004c95591a142aa6c6e51a54fdba3e3601a9", + "0x0000000000000000000000000000000000079b5c9121fe72cb99776cf63bd6b0", + "0x000000000000000000000000000000c0688be6efca16117d785c5560b5fcd514", + "0x000000000000000000000000000000000006135c8351955ae767ec1f15d10d43", + "0x0000000000000000000000000000005dfaab115a831ae8383f327cb5bc5b2007", + "0x000000000000000000000000000000000003a7cf2109e28ecd4ba526a19123e8", + "0x000000000000000000000000000000256f3aae12f38f78a82afbc6d5cecba42a", + "0x00000000000000000000000000000000000bd47bf82cc8445783c116c9e8f47e", + "0x00000000000000000000000000000044a23751ecd840f4df73bbe55f2b117f42", + "0x0000000000000000000000000000000000018f5db8cda9d92b15b35b07e31eb9", + "0x000000000000000000000000000000ba993ceddc62845d8fb57ab93bc0b081f2", + "0x000000000000000000000000000000000028e969f941d0ad93884ecb2cc346d8", + "0x0000000000000000000000000000005619501295c1dadaf68d44c34179bd9bb3", + "0x0000000000000000000000000000000000020d4949d6083acc33ac13c3de56fb", + "0x000000000000000000000000000000e943a98a975658b516a4ae66435476b8c1", + "0x00000000000000000000000000000000000e28572719e34a00865869188e5ed1", + "0x000000000000000000000000000000e78020e4e0a125aee557f4d98a83fdb41b", + "0x00000000000000000000000000000000002ef99ad23435a3d750c6c532d40f32", + "0x000000000000000000000000000000b8f2eb6c55c55f013ecc997fa2bcba4b36", + "0x00000000000000000000000000000000000fc92a86100da3fb74097042fe2410", + "0x00000000000000000000000000000021b3a517242c24ce004c78ca3d93e69ba1", + "0x00000000000000000000000000000000000a8030660e498eec33bc73dd3e3294", + "0x000000000000000000000000000000378780d7736bd50c4bf2a7d2a4ea90645d", + "0x0000000000000000000000000000000000209e9c7571a43de63ea81335995add", + "0x000000000000000000000000000000edb54ff97e2d8b9d682def757db19150f9", + "0x000000000000000000000000000000000003e2438949ab34e2011879d2e39e2f", + "0x000000000000000000000000000000e97fb648fc1ff99f9988a73de181e0de22", + "0x000000000000000000000000000000000024cae2d5d2c4daefe858889eeb01b8", + "0x000000000000000000000000000000e072297115d09425f5612d626dc82f1002", + "0x00000000000000000000000000000000000815a38741b61a4a746b6256b1eb91", + "0x00000000000000000000000000000023edf5ec8727bc87281eab66284f87ad2c", + "0x000000000000000000000000000000000001817943bc850dcd02d4ea565c1493", + "0x000000000000000000000000000000a52f5a3cb7bdd0393d39866d9524b8bb74", + "0x000000000000000000000000000000000015360b6039f6183da9a066d31f21ae", + "0x0000000000000000000000000000000d870e4369af12e9a713d607cf717fe72b", + "0x00000000000000000000000000000000000002298c8bc804808d58756dae84ae", + "0x00000000000000000000000000000073944baa9d28defedd72c6f09aca49727b", + "0x000000000000000000000000000000000004bae3c183b76cf6730ad3aee810d7", + "0x000000000000000000000000000000f2fa4474406d74b57cdb71ec6be23ddef4", + "0x0000000000000000000000000000000000052169f2bbc2f3f5c8f655b41c0150", + "0x000000000000000000000000000000d703c362037631c809f2999aecf387f66b", + "0x000000000000000000000000000000000020bf636ea187b713b19af5ef19a560", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000000000048e3a765d915435b20c18944c02674e924", - "0x000000000000000000000000000000000008468b14fb49e8f7fdd86769c0e96e", - "0x000000000000000000000000000000b79ddc3696c5d21245a4e6e20e566201f1", - "0x00000000000000000000000000000000002a3a1bf035af4b9fb6bf9c890d61ec" + "0x00000000000000000000000000000005e195fade28091e4d8484dc37730fb47a", + "0x000000000000000000000000000000000005cf2076383efa3933d1ac79354102", + "0x000000000000000000000000000000ac058a3d7cf26277afa71874ce562351de", + "0x000000000000000000000000000000000005374d0e1dc1d09312c3188fdb8514" ] -hash = "0x1f07a2890c9deb79fe6cc78935c6dfa810ee56922785f37307cb463f7797f73e" +hash = "0x09ab650e88dcf88f3610303c453731d759afd016234d47efd3d1338ee79f5496" [inputs.previous_rollup_data.vk_witness] leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000009" sibling_path = [ - "0x03cde467306e7d05bcd957b9dde81fdb644d6a7e21d7857bc1bf647f78bfde83", - "0x19861a044ec84aaf6e41d02a20051d349f07206356e10a0846d4fa892534e306", - "0x236d849434a03c2e9d181e5365fe087cb14fd703bff61e5676bfa24c4f4509b7", - "0x019a340a354ef9114e2e61774efec255560cbbdd81448834fe6d764cae443a44", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x18c47824d925ac614bb14be8d502f072b1bfc96abff5e4951f46323faa3de032", + "0x0c99fd462f2396fcaed337dec2f74fe2706ccbf75677c6b57f41e46de091b910", + "0x24de6a6697f70e960e2e69307ed9c63592ed48ee81c6d59440352c0f250f379d", + "0x0178af4ea3a679e0025251b9543017390bf56038f217158886965e52d7b0c8cd", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] [[inputs.previous_rollup_data]] @@ -713,11 +795,11 @@ accumulated_fees = "0x0000000000000000000000000000000000000000000000000003a83680 accumulated_mana_used = "0x0000000000000000000000000000000000000000000000000000000000004a40" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants] - vk_tree_root = "0x257719447a2c71ab94f300207f5a8096a1b8c9f15a614e409d7d48f95c6bdff9" - protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" + vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" + protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.last_archive] - root = "0x22697e2f4dca9f7c06b64c9a987d5e3411f2f28786d9f1d48ce27b61b8d8abe3" + root = "0x04f7f51d5b6e46fa9f34e4913304cd932bdd85edbc0ed0b8bf038c897440e6e6" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000007" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables] @@ -725,10 +807,10 @@ accumulated_mana_used = "0x00000000000000000000000000000000000000000000000000000 version = "0x0000000000000000000000000000000000000000000000000000000000000001" block_number = "0x0000000000000000000000000000000000000000000000000000000000000007" slot_number = "0x0000000000000000000000000000000000000000000000000000000000000014" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2d53" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a9ed" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables.coinbase] - inner = "0x000000000000000000000000b5b0e9c243b20a09c501dee16790e9dfc23506bc" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.constants.global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -738,65 +820,65 @@ accumulated_mana_used = "0x00000000000000000000000000000000000000000000000000000 fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9be2b484" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.note_hash_tree] -root = "0x2b93be1d42d6277477a71a288ca7f05209d7edefdde05a5fc7e424d8ba4882a7" +root = "0x03fbff7873541e17d3fd41ec5a5cd19d0bbd804ac426bdc0e177a422b927fcfe" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000340" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.nullifier_tree] -root = "0x24ede285714e37dbc99f53093e640034e671b219229c72f354bf78f409f9f383" +root = "0x26685b0d46e9f595caeb351cf93ecdbd32f1a73783965cdd428de0d40213f39d" next_available_leaf_index = "0x00000000000000000000000000000000000000000000000000000000000003c0" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start.public_data_tree] -root = "0x2da9b69e8a02d9a3b9372d63f6eb07578d3a901d7d9bb5eed7e0723edbe02da1" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" +root = "0x2de06dc379678174b469169d016af35ce9abde298f45f74b251be83c61fbb9fb" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.note_hash_tree] -root = "0x28083f11c306105343805c8c26a5e3d1c2c03714f4fb38d18661a9a1cd97fb44" +root = "0x20381eeb1906be36ee4380d9b60fb23f51d654299ef836579c56e2233d865f7e" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000380" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.nullifier_tree] -root = "0x2b4981e52a2918a8536adf5416354b20f0667537b35073f608c1f126cdf2556a" +root = "0x092da5fb66dcdd3b7fcda998991593c202863628ff18c69a9b6d26d5713c0d6c" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000400" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end.public_data_tree] -root = "0x2da9b69e8a02d9a3b9372d63f6eb07578d3a901d7d9bb5eed7e0723edbe02da1" -next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000096" +root = "0x2de06dc379678174b469169d016af35ce9abde298f45f74b251be83c61fbb9fb" +next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000097" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start_sponge_blob] - fields = "0x0000000000000000000000000000000000000000000000000000000000000007" + fields = "0x0000000000000000000000000000000000000000000000000000000000000009" expected_fields = "0x000000000000000000000000000000000000000000000000000000000000004f" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.start_sponge_blob.sponge] cache = [ - "0x12e7b967d4eedec7cbc843b52b7413174df59b4d212a07cd5137bfb5914e9387", - "0x0000000000000000000000000000000000000000000000000000000006000002", - "0x02f71e7f13a0520af9e75ee37b71703ace10b7df98538c8384614743dc310151" + "0x0000000000000000000000000000000000000000000000000000000000002328", + "0x0076ea2b6f0dd2bb00e6767f9150e6e0a13116ab0572f0ab7a55ca0bb6a99fef", + "0x00000000000000000000000000000000000000000000000000000000000003e8" ] state = [ - "0x0212f33afeb25b4d2de9e2d9a2d20e3c8995c949b22f3e6f5d2839c84a236d6f", - "0x23c128d8c6faf52fbd5408e415baad147807a63384a20e0b177d8ebc8d1bb0f4", - "0x165d09f061a90bac1945fde4922ec437a8a7a21138819bcb78c0079297bece5f", - "0x0ba3a0bbbc38b7389727f6bce882b3c584b85ce4830bb22c3068eb02e28ab0ab" + "0x0890df6ab9fde67ff7b71aac467b0b132af91b554147ad708c1a302585a9fa08", + "0x080dbebdb83ea1bd1335be1ecdb0faa6649cd2cef92b036c6a679f4bd54c1d7b", + "0x2afb7d4ed10af902cc0adf28a1d799a887ae7f0375b13030d9a8d19d06ee6191", + "0x0973491257c748eb3ef2f9a689505e1b81aae5c0803d1f296e640ef21ffa17dc" ] - cache_size = "0x0000000000000000000000000000000000000000000000000000000000000001" + cache_size = "0x0000000000000000000000000000000000000000000000000000000000000003" squeeze_mode = false [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end_sponge_blob] - fields = "0x0000000000000000000000000000000000000000000000000000000000000046" + fields = "0x0000000000000000000000000000000000000000000000000000000000000048" expected_fields = "0x000000000000000000000000000000000000000000000000000000000000004f" [inputs.previous_rollup_data.base_or_merge_rollup_public_inputs.end_sponge_blob.sponge] cache = [ - "0x00833cb4e0eb2519f668205a47679cd3da9cfd6f817b0493e5caf180f5d228ce", - "0x00c00794884e2bdeeb17481a11e8802ac0eb406aa32abaef06b8c16d2e02ba31", - "0x00e02685013c43900fb8432a4093ea7be3f7d9becbb5d9c4e4ed46bace2ba444" + "0x005af8f32ed2424a85f3764e1cf0fd24448b549d934ad29ce868827b72f82a03", + "0x004ff49174c753b907b07148a2777333d2f699bf5f548645aba5b741c5ef5934", + "0x00eac66f1622b2e2b6388ae7efee8ec5e978aaa2bb03ed5b8af9291083ce3561" ] state = [ - "0x105393772749b65609043d8ecdb2dd3fe0aace54ea61fae3c276d9b67475a44b", - "0x01afc140f5e9024433e2cbbcae49e8b524d8bc02e466d9ffaa75236f2eb78d47", - "0x0d50121d0d96b893589dc71b0317bd18054d85feeef5d9e0fd7594c224a2b1a7", - "0x1948c14f493f80c6b0fafe96ff051c386154b81021106ba7fb5cd7db85abb6a2" + "0x16e04cc634b598d9be9487c42d92d9c60abc8075145b207dace10d74691a69b3", + "0x0d8efee23cc54749e4f44fa95d1a3c3f3a8344213e154bb5b9ce59a0b1cea0af", + "0x275df287fc0adc0e39db8dc5857d39ad7d9b6cf49289211fdc04a54bc0a6543b", + "0x007f915041c583301c3a4e7d3983894b1fd82ccd2a2de5dcc3e42b491adee3f5" ] - cache_size = "0x0000000000000000000000000000000000000000000000000000000000000001" + cache_size = "0x0000000000000000000000000000000000000000000000000000000000000003" squeeze_mode = false [inputs.previous_rollup_data.proof] @@ -1263,13 +1345,84 @@ fields = [ "0x00000000000000000000000000000000000000000000000000000000000001cc", "0x00000000000000000000000000000000000000000000000000000000000001cd", "0x00000000000000000000000000000000000000000000000000000000000001ce", - "0x00000000000000000000000000000000000000000000000000000000000001cf" + "0x00000000000000000000000000000000000000000000000000000000000001cf", + "0x00000000000000000000000000000000000000000000000000000000000001d0", + "0x00000000000000000000000000000000000000000000000000000000000001d1", + "0x00000000000000000000000000000000000000000000000000000000000001d2", + "0x00000000000000000000000000000000000000000000000000000000000001d3", + "0x00000000000000000000000000000000000000000000000000000000000001d4", + "0x00000000000000000000000000000000000000000000000000000000000001d5", + "0x00000000000000000000000000000000000000000000000000000000000001d6", + "0x00000000000000000000000000000000000000000000000000000000000001d7", + "0x00000000000000000000000000000000000000000000000000000000000001d8", + "0x00000000000000000000000000000000000000000000000000000000000001d9", + "0x00000000000000000000000000000000000000000000000000000000000001da", + "0x00000000000000000000000000000000000000000000000000000000000001db", + "0x00000000000000000000000000000000000000000000000000000000000001dc", + "0x00000000000000000000000000000000000000000000000000000000000001dd", + "0x00000000000000000000000000000000000000000000000000000000000001de", + "0x00000000000000000000000000000000000000000000000000000000000001df", + "0x00000000000000000000000000000000000000000000000000000000000001e0", + "0x00000000000000000000000000000000000000000000000000000000000001e1", + "0x00000000000000000000000000000000000000000000000000000000000001e2", + "0x00000000000000000000000000000000000000000000000000000000000001e3", + "0x00000000000000000000000000000000000000000000000000000000000001e4", + "0x00000000000000000000000000000000000000000000000000000000000001e5", + "0x00000000000000000000000000000000000000000000000000000000000001e6", + "0x00000000000000000000000000000000000000000000000000000000000001e7", + "0x00000000000000000000000000000000000000000000000000000000000001e8", + "0x00000000000000000000000000000000000000000000000000000000000001e9", + "0x00000000000000000000000000000000000000000000000000000000000001ea", + "0x00000000000000000000000000000000000000000000000000000000000001eb", + "0x00000000000000000000000000000000000000000000000000000000000001ec", + "0x00000000000000000000000000000000000000000000000000000000000001ed", + "0x00000000000000000000000000000000000000000000000000000000000001ee", + "0x00000000000000000000000000000000000000000000000000000000000001ef", + "0x00000000000000000000000000000000000000000000000000000000000001f0", + "0x00000000000000000000000000000000000000000000000000000000000001f1", + "0x00000000000000000000000000000000000000000000000000000000000001f2", + "0x00000000000000000000000000000000000000000000000000000000000001f3", + "0x00000000000000000000000000000000000000000000000000000000000001f4", + "0x00000000000000000000000000000000000000000000000000000000000001f5", + "0x00000000000000000000000000000000000000000000000000000000000001f6", + "0x00000000000000000000000000000000000000000000000000000000000001f7", + "0x00000000000000000000000000000000000000000000000000000000000001f8", + "0x00000000000000000000000000000000000000000000000000000000000001f9", + "0x00000000000000000000000000000000000000000000000000000000000001fa", + "0x00000000000000000000000000000000000000000000000000000000000001fb", + "0x00000000000000000000000000000000000000000000000000000000000001fc", + "0x00000000000000000000000000000000000000000000000000000000000001fd", + "0x00000000000000000000000000000000000000000000000000000000000001fe", + "0x00000000000000000000000000000000000000000000000000000000000001ff", + "0x0000000000000000000000000000000000000000000000000000000000000200", + "0x0000000000000000000000000000000000000000000000000000000000000201", + "0x0000000000000000000000000000000000000000000000000000000000000202", + "0x0000000000000000000000000000000000000000000000000000000000000203", + "0x0000000000000000000000000000000000000000000000000000000000000204", + "0x0000000000000000000000000000000000000000000000000000000000000205", + "0x0000000000000000000000000000000000000000000000000000000000000206", + "0x0000000000000000000000000000000000000000000000000000000000000207", + "0x0000000000000000000000000000000000000000000000000000000000000208", + "0x0000000000000000000000000000000000000000000000000000000000000209", + "0x000000000000000000000000000000000000000000000000000000000000020a", + "0x000000000000000000000000000000000000000000000000000000000000020b", + "0x000000000000000000000000000000000000000000000000000000000000020c", + "0x000000000000000000000000000000000000000000000000000000000000020d", + "0x000000000000000000000000000000000000000000000000000000000000020e", + "0x000000000000000000000000000000000000000000000000000000000000020f", + "0x0000000000000000000000000000000000000000000000000000000000000210", + "0x0000000000000000000000000000000000000000000000000000000000000211", + "0x0000000000000000000000000000000000000000000000000000000000000212", + "0x0000000000000000000000000000000000000000000000000000000000000213", + "0x0000000000000000000000000000000000000000000000000000000000000214", + "0x0000000000000000000000000000000000000000000000000000000000000215", + "0x0000000000000000000000000000000000000000000000000000000000000216" ] [inputs.previous_rollup_data.vk] key = [ "0x0000000000000000000000000000000000000000000000000000000001000000", - "0x0000000000000000000000000000000000000000000000000000000000000044", + "0x000000000000000000000000000000000000000000000000000000000000004e", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000034", @@ -1288,124 +1441,135 @@ key = [ "0x0000000000000000000000000000000000000000000000000000000000000041", "0x0000000000000000000000000000000000000000000000000000000000000042", "0x0000000000000000000000000000000000000000000000000000000000000043", - "0x000000000000000000000000000000222d2b638470648efe806272902759bfe4", - "0x000000000000000000000000000000000026717cb116c9f379f6053d43ed7131", - "0x000000000000000000000000000000d72dc52e13931348a07d4d75dbdef7b696", - "0x000000000000000000000000000000000007a17849605cd5acdf47218d8ff6ab", - "0x0000000000000000000000000000000ead8b79c9d9733b45796b315aed219c46", - "0x000000000000000000000000000000000001520cbd65e9f9c12d2d804e5408a8", - "0x000000000000000000000000000000d4fd951f0c8b3f5c93c914a9ca3e3ad82b", - "0x00000000000000000000000000000000000c06cda5de6eb85a2dc3a3e461edf4", - "0x0000000000000000000000000000008fda111b457d9cbb2c2140e6e29baaa93d", - "0x000000000000000000000000000000000019250c98c82093236c18a9efa7bbcb", - "0x000000000000000000000000000000809dff0c74860533c531966cefa5e6b82f", - "0x0000000000000000000000000000000000096b5c6f4eb1c8d72e0812cabe6b20", - "0x0000000000000000000000000000002b40eba3c1a07bab631194a295de31fa39", - "0x00000000000000000000000000000000000053902748ef91505fca0d1db29c64", - "0x000000000000000000000000000000aa3b1b8cf6fbc5c81dc722111d10e6940b", - "0x0000000000000000000000000000000000206cb99da8d346b786537ed3b15446", - "0x0000000000000000000000000000001271113c751d045274a3317a01895808c9", - "0x00000000000000000000000000000000000ae017203dd40d764ddbaa912b9d03", - "0x000000000000000000000000000000f46fc3542fcfee505d2e9eacb7f397bb36", - "0x00000000000000000000000000000000002e5a0e507a80a266a9e62a94a7bb97", - "0x000000000000000000000000000000b44304dbc2fc1d02d3d903d01d29e76efb", - "0x00000000000000000000000000000000000fb528b629b4fbbf48fddeca9f54de", - "0x000000000000000000000000000000ffa188c0ab2f8df7c201783dc282a782cd", - "0x00000000000000000000000000000000000edbbec3674d50e52b6e83867b3007", - "0x00000000000000000000000000000058ea22bca57bfe9a1c46ce63c2c240901f", - "0x000000000000000000000000000000000028cce7cf665942fee68c3ffd344c71", - "0x000000000000000000000000000000bbda5287b41d69b0a203243ebb2d861d58", - "0x0000000000000000000000000000000000136b53ea88a30b784ec14018041c4e", - "0x0000000000000000000000000000004702b68f21e97f4ec2533229bdb2172de3", - "0x00000000000000000000000000000000002c307c0f773885110a0d7188d22899", - "0x000000000000000000000000000000ccfc8d16713b3ac84c531b3a09b57a5632", - "0x000000000000000000000000000000000018177fc15055bc6ded75133159116e", - "0x000000000000000000000000000000bf31ddaed25f6a3812d47d47eb1003c336", - "0x000000000000000000000000000000000030301fd8ac21f9dd93ae4de2223f3a", - "0x000000000000000000000000000000d8b510b22cee8d476c3ae3a5a643c12fcd", - "0x00000000000000000000000000000000001ed2d09f2ac6322b815bc0e35be630", - "0x0000000000000000000000000000005c2e45d0fa6b1156c250a016a8d6025717", - "0x0000000000000000000000000000000000116ef26a99b319f7ddf9a72b920d7e", - "0x000000000000000000000000000000887bef3a2f390f75c5c1c7d2804839dc40", - "0x0000000000000000000000000000000000241d35489e5ec7ae0ec539a511f4bb", - "0x0000000000000000000000000000001e9eed55f46c30f0a643e7fadc0f1c5b5f", - "0x00000000000000000000000000000000002d224bdb537e45356dad6719a44670", - "0x000000000000000000000000000000905b34d9aeffbef40ad032415b3b0e66bd", - "0x0000000000000000000000000000000000147a5bb3c75194935a583029501d7c", - "0x0000000000000000000000000000001a183288e3ecb3c21f96eb8e6c8fa774db", - "0x00000000000000000000000000000000001ef984af2d88e47be0e9664b8fd752", - "0x00000000000000000000000000000039f3dad17da7386018cab36996698755d5", - "0x00000000000000000000000000000000001561ce1450ac8840dbcf97e91bd5b6", - "0x000000000000000000000000000000f1b27c35585e11cbbf5612de0413672d01", - "0x0000000000000000000000000000000000012046c089f10f8c8c82265e2d6825", - "0x000000000000000000000000000000a2b89785fa94123ec142277619e45360fd", - "0x0000000000000000000000000000000000159d0140b54b1703d4f4ebdd75d849", - "0x000000000000000000000000000000539cb47199bd3c2245bc3044a89cf91958", - "0x0000000000000000000000000000000000096f804be4f55c1c25b387dc128f12", - "0x0000000000000000000000000000000d6ea4f662ce5d29fe8d5c30e717ed3f45", - "0x00000000000000000000000000000000000505aeb30b5f6acb1c0e335e27c510", - "0x0000000000000000000000000000003bafc94403ed6cbde5cd3bcd4b14d6c0fa", - "0x00000000000000000000000000000000001ad585be43d722b6a37d8b3832a770", - "0x000000000000000000000000000000d0ecec90f37a38b0b770d04148856f191a", - "0x0000000000000000000000000000000000195175c4eceb80ac5b567c05686b6a", - "0x00000000000000000000000000000018d09a6452cffee1251ce810df1987c3fe", - "0x000000000000000000000000000000000018a58c0116caf02d8187113b216b50", - "0x000000000000000000000000000000786c72f5cb45e0b2ef50d429284962d8f2", - "0x00000000000000000000000000000000001edecd8d2daf475aea627cddc4bf83", - "0x000000000000000000000000000000f11f76923fbc94bb9da677ef4ea48d8e5d", - "0x000000000000000000000000000000000009e363fd3b9fba1921f8a620453c8b", - "0x000000000000000000000000000000130337f88d1a3501deb7548bf12f3bf8c7", - "0x00000000000000000000000000000000001caf1ae2f1b7c284d4fa064660e2d4", - "0x0000000000000000000000000000001f3243dcfe519ae43f5fda7c4e071489ec", - "0x000000000000000000000000000000000028ddb68ba85ec82fbe2c3d13f3f4f3", - "0x000000000000000000000000000000b8d7efb798a996ad6f6cc79bbb2c23e051", - "0x000000000000000000000000000000000014064ac87a8676a6c0701105a76924", - "0x000000000000000000000000000000c4f5d6ec595af7e188571eb533255210bb", - "0x00000000000000000000000000000000000b751e85d1d0a4d12321b8f3001d93", - "0x00000000000000000000000000000053c44079c3fbeb350e7347576b96a518a2", - "0x00000000000000000000000000000000002cf5eeea78f9cc5b1c698613d5a0ac", - "0x0000000000000000000000000000006ebb8205fddf556a03c81473e3d7f128da", - "0x000000000000000000000000000000000005e04349dee59bf22cab15fbcf6579", - "0x000000000000000000000000000000119e7803dc1f0d42d610c1e636b763e84a", - "0x0000000000000000000000000000000000150cdd897a47b83debe2a86b41df03", - "0x000000000000000000000000000000b2627cae7ef76e48877e5f65dda01de6fa", - "0x00000000000000000000000000000000002df31114d6ea625d30f40fcd6501ae", - "0x000000000000000000000000000000d9ff339dabc896850436795e686c8b7892", - "0x0000000000000000000000000000000000045d737d25201a48aabff3f6bca6b3", - "0x000000000000000000000000000000de93c07b11d2e6fa6550a3cefb321e16d7", - "0x00000000000000000000000000000000001752e736d3439003c65c42a97c0f09", - "0x0000000000000000000000000000009365c7dc3d4484e835a8c4cd523db7cb52", - "0x000000000000000000000000000000000004bd96b70a7ceca6e250998dd29d04", - "0x000000000000000000000000000000383c0eef46c0b99e9af36ae88ed755eab8", - "0x000000000000000000000000000000000017750cb080368dc310dba9dc7b1627", - "0x000000000000000000000000000000ce7ee23afcb014b28d8ad4a8ca1576f27c", - "0x000000000000000000000000000000000029e9346b8314cc77921b3d989c68a0", - "0x0000000000000000000000000000009c8ee8e93120da7baa9e1aa23de4ebf086", - "0x00000000000000000000000000000000002d2475bbb16b1577d3933a25e17410", - "0x0000000000000000000000000000001c775e636250539aa55b35901031d8a234", - "0x000000000000000000000000000000000027a3acd1183085d9619ddfb13ce036", - "0x000000000000000000000000000000258cb84ffd27a5cb5a91a096c098cbcd14", - "0x00000000000000000000000000000000000cc296cc5967bc2eca88c4b55ec976", - "0x0000000000000000000000000000007b6f66567f2710b238fadf1e211206376b", - "0x00000000000000000000000000000000001c58cff4dbc4ad672c2b263cc7b065", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000000000000000000000000000044", + "0x0000000000000000000000000000000000000000000000000000000000000045", + "0x0000000000000000000000000000000000000000000000000000000000000046", + "0x0000000000000000000000000000000000000000000000000000000000000047", + "0x0000000000000000000000000000000000000000000000000000000000000048", + "0x0000000000000000000000000000000000000000000000000000000000000049", + "0x000000000000000000000000000000000000000000000000000000000000004a", + "0x000000000000000000000000000000000000000000000000000000000000004b", + "0x000000000000000000000000000000000000000000000000000000000000004c", + "0x000000000000000000000000000000000000000000000000000000000000004d", + "0x000000000000000000000000000000f810621a89c0517bee8e9091db33db5c31", + "0x000000000000000000000000000000000023741b91621c46040b5424ed914cc3", + "0x0000000000000000000000000000000f2fdfeb783fd6b40c78b5a63626a2f4e8", + "0x000000000000000000000000000000000017c899276b4aa148261fd5165b4f56", + "0x000000000000000000000000000000750b00e06c1f82f6f7f8e9ffebecc8b88e", + "0x00000000000000000000000000000000002e67b42a1cdb772145adfa042777eb", + "0x00000000000000000000000000000003c1bdcb7081df174d8f62d105c7bff108", + "0x00000000000000000000000000000000002d06f33162b682c82ba4d9631a0027", + "0x000000000000000000000000000000dc698986b132b014eb4cdb327fb1956f02", + "0x00000000000000000000000000000000001482ea94ef6e3792d74efe0e6d42f3", + "0x000000000000000000000000000000902e134d5c55320e5fd683e5e53db12819", + "0x0000000000000000000000000000000000223df39d2eaf34c15e9717d324638a", + "0x0000000000000000000000000000002a5d591d542407f6b7d9ca238e99d82476", + "0x00000000000000000000000000000000002328c39734acbb8b0615f2d079297e", + "0x0000000000000000000000000000004f656b00fe245ffcdfbe8526e7b94c3111", + "0x0000000000000000000000000000000000187e94c09606156ec475f83f072a1f", + "0x000000000000000000000000000000704932164b12d2d58443d282182510d82e", + "0x000000000000000000000000000000000009aee85440e936170d234cf2649cee", + "0x0000000000000000000000000000007638fdafd153b31e9ea8d27691e659e4eb", + "0x00000000000000000000000000000000000b28639f9f5f7b23d393c05550f930", + "0x000000000000000000000000000000275c4aaa3c929fb9274e0f2fc9153595cd", + "0x000000000000000000000000000000000027e32f7bdb492449996367ef0004cd", + "0x0000000000000000000000000000003aa5c01174d8bd58c7fc421d918915179a", + "0x0000000000000000000000000000000000175690a38c8464195a0d844b151793", + "0x0000000000000000000000000000007e01eb776da2b909e2f1d2b472fff43df3", + "0x000000000000000000000000000000000010de06f5969f3ab84832887f1d5f52", + "0x000000000000000000000000000000759640ca4e26c0d38ecd1d4dd30875e0a2", + "0x00000000000000000000000000000000000b3c95d4f96a9a628c96ca3548e4eb", + "0x00000000000000000000000000000027fa12fffc90187366a57715f98862688a", + "0x00000000000000000000000000000000002a26918d1bad54e9d82537a338919e", + "0x00000000000000000000000000000042a57d4b3a4f9c9b354b2d867df2b072ea", + "0x000000000000000000000000000000000013c953c7e5a7fadc0390ad77307cd6", + "0x00000000000000000000000000000058838c67b417a534481aa4f903ace16e33", + "0x000000000000000000000000000000000012a966212ece3e60bf0a54a8c03dce", + "0x000000000000000000000000000000cb6a8d8f66c50a64289ec51920b9d50669", + "0x0000000000000000000000000000000000103935e0b731b79f36574b22020913", + "0x0000000000000000000000000000000e68036fcd68025a4e3219134423574f2f", + "0x0000000000000000000000000000000000237ea6ef46098313177c83f6fa4281", + "0x000000000000000000000000000000757dbb350dd7e88ed4d424a0d7be0c9dff", + "0x00000000000000000000000000000000002e1b8df33ca43d8b5df02609942e5a", + "0x00000000000000000000000000000062044f8b8ace9bb00d4451e0b7379b4a7f", + "0x000000000000000000000000000000000008dbb15ea45f2f206070707678dbb2", + "0x0000000000000000000000000000003295d364033bace41c91c5c628eb03de15", + "0x000000000000000000000000000000000020f9f22a5afa1a4f430383d9c6d7e3", + "0x0000000000000000000000000000004f0ec8592442c7a1edbbd9c5d9bb831cb8", + "0x000000000000000000000000000000000001f54b925350d2d2b064c9d3fbd0cf", + "0x00000000000000000000000000000059627119d9083cc00de857b3d52fc96dbf", + "0x00000000000000000000000000000000002cf6d0606f923ba3f371ae4d301db3", + "0x000000000000000000000000000000fa40760d371cfc576bca875d39fdc50859", + "0x00000000000000000000000000000000001d3e6f2196202bdc6f18b3e598822e", + "0x0000000000000000000000000000009d841a46762133236edc638ad9be7a1611", + "0x00000000000000000000000000000000001e1dca2657e3ddc0654b7f81c453ac", + "0x000000000000000000000000000000d3ebcba1ed5d8e2e5db46a53c7bcafdf3d", + "0x00000000000000000000000000000000001c5f9a76abadd6f16656921223c2c7", + "0x000000000000000000000000000000578a9f6317f82f575e7516bc23ba446296", + "0x000000000000000000000000000000000009db554cd7afded36685b2cc2afa46", + "0x00000000000000000000000000000072df2edf3d30c7e4dd65e54008f53aac17", + "0x00000000000000000000000000000000000d69eda07181cc43b55282cab19e30", + "0x000000000000000000000000000000c45121433b4527b3ad8203145c47a21d2a", + "0x000000000000000000000000000000000011615b62f470f0df362b84fbfbee1c", + "0x0000000000000000000000000000007941a8641a1af06de3e170a6e54001825b", + "0x0000000000000000000000000000000000135cdffb854c3e83cd156635d0d9f5", + "0x00000000000000000000000000000090a5255eb2fbe1c21cf428430babb4ebff", + "0x00000000000000000000000000000000000373ed0d5bf33c93261c7f0cd70167", + "0x00000000000000000000000000000086389340b1c54ad6767fa4a7feac0b6931", + "0x000000000000000000000000000000000008141f7a07dc48b972c9efeee86914", + "0x0000000000000000000000000000008b607ad199f1ade5bb162883afc34901e9", + "0x000000000000000000000000000000000000cceeeb457a4683b83aee0a250394", + "0x0000000000000000000000000000003dd5db36319e2234492e3fc10802586a2c", + "0x00000000000000000000000000000000001483f496f4e6582c81f06e95cd0ab3", + "0x000000000000000000000000000000595201832785ce5841162229f1e7890af6", + "0x0000000000000000000000000000000000035bf04e3cddb88b7599dde215eb3c", + "0x000000000000000000000000000000f92163b6dcf703e9cf58c6f07f6398b168", + "0x000000000000000000000000000000000005629bc60bbbdd1b8acd7bd9404ae9", + "0x00000000000000000000000000000050e8c38fd5fe50acdc1110d1430f1e5092", + "0x00000000000000000000000000000000002493ecb5f2a6e1ca53275d39e85729", + "0x000000000000000000000000000000a4b4680e14b0f1ac89c50a55ccc91c2a60", + "0x00000000000000000000000000000000000265575c1d7e5e530bdc57e6041833", + "0x0000000000000000000000000000005f086fea719519af18e8b0a29a79359c7a", + "0x0000000000000000000000000000000000056bd2133d3186dad025e38d33ba66", + "0x0000000000000000000000000000007e3f0eaafa9128149f29d76a9967a6f5b1", + "0x000000000000000000000000000000000019c4e7a4c7a7641a25f58aa889df9a", + "0x0000000000000000000000000000006ac73b780057a7dcb1c9ce19a1b443f63a", + "0x000000000000000000000000000000000018e1de9ac1d7cfa2c0500ce49f881d", + "0x000000000000000000000000000000e97fb648fc1ff99f9988a73de181e0de22", + "0x000000000000000000000000000000000024cae2d5d2c4daefe858889eeb01b8", + "0x000000000000000000000000000000e072297115d09425f5612d626dc82f1002", + "0x00000000000000000000000000000000000815a38741b61a4a746b6256b1eb91", + "0x00000000000000000000000000000023edf5ec8727bc87281eab66284f87ad2c", + "0x000000000000000000000000000000000001817943bc850dcd02d4ea565c1493", + "0x000000000000000000000000000000a52f5a3cb7bdd0393d39866d9524b8bb74", + "0x000000000000000000000000000000000015360b6039f6183da9a066d31f21ae", + "0x0000000000000000000000000000000d870e4369af12e9a713d607cf717fe72b", + "0x00000000000000000000000000000000000002298c8bc804808d58756dae84ae", + "0x00000000000000000000000000000073944baa9d28defedd72c6f09aca49727b", + "0x000000000000000000000000000000000004bae3c183b76cf6730ad3aee810d7", + "0x000000000000000000000000000000f2fa4474406d74b57cdb71ec6be23ddef4", + "0x0000000000000000000000000000000000052169f2bbc2f3f5c8f655b41c0150", + "0x000000000000000000000000000000d703c362037631c809f2999aecf387f66b", + "0x000000000000000000000000000000000020bf636ea187b713b19af5ef19a560", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000000000a653c3ebcdb2ec03f5bededc1780032446", - "0x0000000000000000000000000000000000143112234ac9aa9f7ef289152fccda", - "0x00000000000000000000000000000073d1f6ce5b511d1a45307e35b4e146876d", - "0x00000000000000000000000000000000002ca743c017d5c16d5953d03410d5a5" + "0x000000000000000000000000000000f8b91015dd9e75d2c481301e4b71ecd06a", + "0x00000000000000000000000000000000001d07cee0ae2afabca8c10513a44b86", + "0x000000000000000000000000000000ef950d707842f8a387388b7a8f5f9a6933", + "0x00000000000000000000000000000000000745ad8f37d8f526173fb2651e2521" ] -hash = "0x03cde467306e7d05bcd957b9dde81fdb644d6a7e21d7857bc1bf647f78bfde83" +hash = "0x18c47824d925ac614bb14be8d502f072b1bfc96abff5e4951f46323faa3de032" [inputs.previous_rollup_data.vk_witness] leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" sibling_path = [ - "0x1f07a2890c9deb79fe6cc78935c6dfa810ee56922785f37307cb463f7797f73e", - "0x19861a044ec84aaf6e41d02a20051d349f07206356e10a0846d4fa892534e306", - "0x236d849434a03c2e9d181e5365fe087cb14fd703bff61e5676bfa24c4f4509b7", - "0x019a340a354ef9114e2e61774efec255560cbbdd81448834fe6d764cae443a44", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x09ab650e88dcf88f3610303c453731d759afd016234d47efd3d1338ee79f5496", + "0x0c99fd462f2396fcaed337dec2f74fe2706ccbf75677c6b57f41e46de091b910", + "0x24de6a6697f70e960e2e69307ed9c63592ed48ee81c6d59440352c0f250f379d", + "0x0178af4ea3a679e0025251b9543017390bf56038f217158886965e52d7b0c8cd", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-root/Prover.toml b/noir-projects/noir-protocol-circuits/crates/rollup-root/Prover.toml index c8ed964761f..5d53dd284db 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-root/Prover.toml +++ b/noir-projects/noir-protocol-circuits/crates/rollup-root/Prover.toml @@ -3,19 +3,19 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" [[inputs.previous_rollup_data]] [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs] -previous_block_hash = "0x0cbe9ba8209cff81f755fb74efb4e92a9227a891378316ad62c685d6750b3a47" -end_block_hash = "0x022087729c552378b2572eb9be555e7dff2161a22e9a1d5e175d3558163a615b" -out_hash = "0x0007638bb56b6dda2b64b8f76841114ac3a87a1820030e2e16772c4d294879c3" -vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" -protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" +previous_block_hash = "0x0200b0dad256c4ca38d898520100fdc6b332166c4edbf55bd5ee569f1758f04d" +end_block_hash = "0x27d314f0e262ebc3eefebd3f38b3e59e5ecfcd7850f8d9258411b5ebe1218cf5" +out_hash = "0x002a771424effd60834b38521293e1aa35cc527721bfd5aa2ec9c98a67fdb6a5" +vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" +protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.previous_archive] - root = "0x12a67a275560c583960931231ad3a43c5446c4ecf990edce34f69e4a8924e2a6" + root = "0x026e8d4564303241e67610a78bc5a2cfbd383ef1673f9e2a00a226d6bb280d34" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000006" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.new_archive] - root = "0x04b51aa5df89d177213335ca62dee74d15b920e231f5ea5198ed405967d188fd" + root = "0x148982e14549cad3887a3c4e0b93de0c350ba45bdd4af324913c50077fe63462" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables] @@ -23,10 +23,10 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" version = "0x0000000000000000000000000000000000000000000000000000000000000001" block_number = "0x0000000000000000000000000000000000000000000000000000000000000006" slot_number = "0x0000000000000000000000000000000000000000000000000000000000000013" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2e66" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a9d5" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -40,10 +40,10 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" version = "0x0000000000000000000000000000000000000000000000000000000000000001" block_number = "0x0000000000000000000000000000000000000000000000000000000000000007" slot_number = "0x0000000000000000000000000000000000000000000000000000000000000014" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2e7e" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776a9ed" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -56,13 +56,13 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" value = "0x0000000000000000000000000000000000000000000000000003a83680db4900" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees.recipient] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees]] - value = "0x000000000000000000000000000000000000000000000000000b49e83dc155c8" + value = "0x000000000000000000000000000000000000000000000000001c8e5eeb80de9c" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees.recipient] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees]] value = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -342,19 +342,19 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs]] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] -z = "0x08096b8a07dd58a4075534aa941683d65b968c85454e4127a93a2441c4e481ba" +z = "0x00a12d93050ef5b515abd05a69966d0b2e704357e28ea2de1a87c881dd718dba" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.y] limbs = [ - "0x0f27c0c90ff3d54ed9057f9d961481", - "0x10f7712b10865230fc579fcf643ffb", - "0x5af9" + "0xc5d2a26bf1faa20862a064ee702c88", + "0x62c837e30ff0b74f961b6048dadefa", + "0x2f63" ] [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.kzg_commitment] inner = [ - "0x008890c7177b340e82eef47e7b4364d2bd8425cfecd2ce2e1657247d960b3592", - "0x0000000000000000000000000000005c40f1b8daf1afa2af8971237b4faf5888" + "0x009321642da96004c157e6e0bdd65edba0037caf61d44e41f27d8fac79ca5372", + "0x000000000000000000000000000000c807f24f1a9025eabd5db962279bc477d5" ] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] @@ -391,19 +391,19 @@ z = "0x0000000000000000000000000000000000000000000000000000000000000000" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs]] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] -z = "0x2680a618cce5a117fe2420af8070f94769bf55e2a342fdc5c500d65bf128f97c" +z = "0x2992fb787db88dd43c3dd8ab2988c270182f54a46c78b1c4b8d4f26be46462c6" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.y] limbs = [ - "0x2c225f699251daa2795d209a680710", - "0xe870212bf38b51bf54abe6a2b87dd9", - "0x459c" + "0xdc88489e918db9ac4fa016c6cade4a", + "0x0899a2696ac262ee50aec19293f8ab", + "0x2631" ] [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.kzg_commitment] inner = [ - "0x00a1f4b43df5cca374ba67b1201841744deb0c9ca51b45320341378839870643", - "0x000000000000000000000000000000b7c11d8b7e10d09c979df87e342a9f281e" + "0x00867525ebe35db7a92a6d5f62e1288548757ec0ddec3afad8fd3cd15f7007e9", + "0x0000000000000000000000000000009a633acba2c6557eca26bafbfd9f551561" ] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] @@ -3156,13 +3156,84 @@ fields = [ "0x00000000000000000000000000000000000000000000000000000000000001cc", "0x00000000000000000000000000000000000000000000000000000000000001cd", "0x00000000000000000000000000000000000000000000000000000000000001ce", - "0x00000000000000000000000000000000000000000000000000000000000001cf" + "0x00000000000000000000000000000000000000000000000000000000000001cf", + "0x00000000000000000000000000000000000000000000000000000000000001d0", + "0x00000000000000000000000000000000000000000000000000000000000001d1", + "0x00000000000000000000000000000000000000000000000000000000000001d2", + "0x00000000000000000000000000000000000000000000000000000000000001d3", + "0x00000000000000000000000000000000000000000000000000000000000001d4", + "0x00000000000000000000000000000000000000000000000000000000000001d5", + "0x00000000000000000000000000000000000000000000000000000000000001d6", + "0x00000000000000000000000000000000000000000000000000000000000001d7", + "0x00000000000000000000000000000000000000000000000000000000000001d8", + "0x00000000000000000000000000000000000000000000000000000000000001d9", + "0x00000000000000000000000000000000000000000000000000000000000001da", + "0x00000000000000000000000000000000000000000000000000000000000001db", + "0x00000000000000000000000000000000000000000000000000000000000001dc", + "0x00000000000000000000000000000000000000000000000000000000000001dd", + "0x00000000000000000000000000000000000000000000000000000000000001de", + "0x00000000000000000000000000000000000000000000000000000000000001df", + "0x00000000000000000000000000000000000000000000000000000000000001e0", + "0x00000000000000000000000000000000000000000000000000000000000001e1", + "0x00000000000000000000000000000000000000000000000000000000000001e2", + "0x00000000000000000000000000000000000000000000000000000000000001e3", + "0x00000000000000000000000000000000000000000000000000000000000001e4", + "0x00000000000000000000000000000000000000000000000000000000000001e5", + "0x00000000000000000000000000000000000000000000000000000000000001e6", + "0x00000000000000000000000000000000000000000000000000000000000001e7", + "0x00000000000000000000000000000000000000000000000000000000000001e8", + "0x00000000000000000000000000000000000000000000000000000000000001e9", + "0x00000000000000000000000000000000000000000000000000000000000001ea", + "0x00000000000000000000000000000000000000000000000000000000000001eb", + "0x00000000000000000000000000000000000000000000000000000000000001ec", + "0x00000000000000000000000000000000000000000000000000000000000001ed", + "0x00000000000000000000000000000000000000000000000000000000000001ee", + "0x00000000000000000000000000000000000000000000000000000000000001ef", + "0x00000000000000000000000000000000000000000000000000000000000001f0", + "0x00000000000000000000000000000000000000000000000000000000000001f1", + "0x00000000000000000000000000000000000000000000000000000000000001f2", + "0x00000000000000000000000000000000000000000000000000000000000001f3", + "0x00000000000000000000000000000000000000000000000000000000000001f4", + "0x00000000000000000000000000000000000000000000000000000000000001f5", + "0x00000000000000000000000000000000000000000000000000000000000001f6", + "0x00000000000000000000000000000000000000000000000000000000000001f7", + "0x00000000000000000000000000000000000000000000000000000000000001f8", + "0x00000000000000000000000000000000000000000000000000000000000001f9", + "0x00000000000000000000000000000000000000000000000000000000000001fa", + "0x00000000000000000000000000000000000000000000000000000000000001fb", + "0x00000000000000000000000000000000000000000000000000000000000001fc", + "0x00000000000000000000000000000000000000000000000000000000000001fd", + "0x00000000000000000000000000000000000000000000000000000000000001fe", + "0x00000000000000000000000000000000000000000000000000000000000001ff", + "0x0000000000000000000000000000000000000000000000000000000000000200", + "0x0000000000000000000000000000000000000000000000000000000000000201", + "0x0000000000000000000000000000000000000000000000000000000000000202", + "0x0000000000000000000000000000000000000000000000000000000000000203", + "0x0000000000000000000000000000000000000000000000000000000000000204", + "0x0000000000000000000000000000000000000000000000000000000000000205", + "0x0000000000000000000000000000000000000000000000000000000000000206", + "0x0000000000000000000000000000000000000000000000000000000000000207", + "0x0000000000000000000000000000000000000000000000000000000000000208", + "0x0000000000000000000000000000000000000000000000000000000000000209", + "0x000000000000000000000000000000000000000000000000000000000000020a", + "0x000000000000000000000000000000000000000000000000000000000000020b", + "0x000000000000000000000000000000000000000000000000000000000000020c", + "0x000000000000000000000000000000000000000000000000000000000000020d", + "0x000000000000000000000000000000000000000000000000000000000000020e", + "0x000000000000000000000000000000000000000000000000000000000000020f", + "0x0000000000000000000000000000000000000000000000000000000000000210", + "0x0000000000000000000000000000000000000000000000000000000000000211", + "0x0000000000000000000000000000000000000000000000000000000000000212", + "0x0000000000000000000000000000000000000000000000000000000000000213", + "0x0000000000000000000000000000000000000000000000000000000000000214", + "0x0000000000000000000000000000000000000000000000000000000000000215", + "0x0000000000000000000000000000000000000000000000000000000000000216" ] [inputs.previous_rollup_data.vk] key = [ "0x0000000000000000000000000000000000000000000000000000000000200000", - "0x00000000000000000000000000000000000000000000000000000000000003ec", + "0x00000000000000000000000000000000000000000000000000000000000003f6", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x00000000000000000000000000000000000000000000000000000000000003dc", @@ -3181,154 +3252,165 @@ key = [ "0x00000000000000000000000000000000000000000000000000000000000003e9", "0x00000000000000000000000000000000000000000000000000000000000003ea", "0x00000000000000000000000000000000000000000000000000000000000003eb", - "0x000000000000000000000000000000998e5be31abe68fe2f1d08ec68178d5e55", - "0x000000000000000000000000000000000025ab0352159abdadfb1c5163f7d202", - "0x000000000000000000000000000000bcd393b12573d6d5e53fc42c17f71d4c8b", - "0x000000000000000000000000000000000027925c9ebd2056d20410e57df614ed", - "0x0000000000000000000000000000004a0d4495d868843067a6d1ad3607e091a7", - "0x00000000000000000000000000000000001958c78407cbcd95b771b31d38a1c1", - "0x0000000000000000000000000000007e68740a53fd37e46590ab1c6f5b58b328", - "0x00000000000000000000000000000000002980bcd4948a9fbb5723af68df31da", - "0x000000000000000000000000000000dcdb1d1d1c5173490b696673e0313c62bd", - "0x000000000000000000000000000000000028d0610e818fedd71ec3a9281a7781", - "0x000000000000000000000000000000d17c67572cce970c5757a9a84445102eed", - "0x00000000000000000000000000000000002f4c160a312790dabbd93d572f07bb", - "0x0000000000000000000000000000004c61674567376a482c90a5bf7c53976cfe", - "0x00000000000000000000000000000000002d7f4779d914d01d064e7b406fb808", - "0x0000000000000000000000000000006c3b45eb8698c1e59dfeea80a9c3db9f5f", - "0x0000000000000000000000000000000000060a2cfa606a2ce7d86eb2162d7e71", - "0x00000000000000000000000000000062f1da156b5112d7cb9f320d5452e60627", - "0x000000000000000000000000000000000023325f29f5d61154778ac60e962c31", - "0x000000000000000000000000000000071a7bd0219e592d3a65f399b2a4964241", - "0x0000000000000000000000000000000000162558d3b4de45fdbde1b0d8f89bf8", - "0x000000000000000000000000000000488d6af9e2b2c6dfed9a16bef551a40255", - "0x0000000000000000000000000000000000099f9e36cd0b4f59b9c98c01b88003", - "0x000000000000000000000000000000a9267458a56c12b55c15b7c51e505b8e6c", - "0x000000000000000000000000000000000015ca0f8807b968cf2dc4222c0ec955", - "0x0000000000000000000000000000004b4b7c7b2144700873a7af327468d6edf5", - "0x00000000000000000000000000000000001f0c1785ec10d742cdd7817c9ff404", - "0x0000000000000000000000000000004ade21f14ed1ff588175882ce70339db26", - "0x0000000000000000000000000000000000279f17c283202f883245d3a4c47747", - "0x00000000000000000000000000000085157b1b29066dfe5edf96c38344140801", - "0x000000000000000000000000000000000023791cefa64559dbdade3a6190f039", - "0x000000000000000000000000000000164cfe1d74198193dd30197a589b236f88", - "0x00000000000000000000000000000000000c70733b2a932741394e86bd8a57e2", - "0x0000000000000000000000000000003f14d7f440e8578acce63f8eec32380f7a", - "0x0000000000000000000000000000000000303d66f56023c8588baffd7e092e67", - "0x000000000000000000000000000000fedfeb52b321b9cb36c9634c3730492ab1", - "0x00000000000000000000000000000000002f0aff78047292f42b7f5bb19c05f7", - "0x000000000000000000000000000000994d21d6354422208e38715f37e48fa16d", - "0x00000000000000000000000000000000001eb0eb53130ca20d5e87c0a254f7c6", - "0x00000000000000000000000000000007f75f0866bac3efe692c450e2c6de3a55", - "0x000000000000000000000000000000000017a3177f2e8def9f22c11e4b6d7618", - "0x000000000000000000000000000000a763b50f06bec58aa0e1e7a36aa5e0ef9d", - "0x0000000000000000000000000000000000072fcc6fdb06628b8adff26ce4f3f6", - "0x0000000000000000000000000000004e587f87e7ecfb15dd38d65b300a0ed04b", - "0x00000000000000000000000000000000001067a37239b8f86c8b34885e5f93f4", - "0x000000000000000000000000000000d532562004237072c915a771ef2abd6a00", - "0x000000000000000000000000000000000012f352a9d1783669dbd48c685920db", - "0x0000000000000000000000000000003b1f4cb9dcde9f5112acea5e520123a491", - "0x0000000000000000000000000000000000143a7afda4f460bbebe4ba1141501a", - "0x000000000000000000000000000000bc5cf78a7230c328e37d3f2fe19f6777ca", - "0x00000000000000000000000000000000000dcbe3389d11e40a5faf40a385ad22", - "0x000000000000000000000000000000f7c9cfa27095a937ada1a7897eb222ce89", - "0x000000000000000000000000000000000014b4924c74371f51dacd2bf2866c13", - "0x000000000000000000000000000000f2d8c4588bb4679bff57e660e17cc33973", - "0x0000000000000000000000000000000000151e2efe25ec498ed563261e36c555", - "0x0000000000000000000000000000001f2e91f77895aa5de8e452c6fca1550a7c", - "0x000000000000000000000000000000000023a05e0263e278950bccbabc25d273", - "0x00000000000000000000000000000005057a4276a0a97ef69b09241d942e1a9c", - "0x000000000000000000000000000000000018c875aec30f26a998a59cd9204d7f", - "0x0000000000000000000000000000008e7332630bd450e6ac0ee872e7e83aca38", - "0x00000000000000000000000000000000000eb1e133f51a031dfee4d967ec7321", - "0x00000000000000000000000000000034530e460a13a571bc35cfa6451fe6187e", - "0x00000000000000000000000000000000001de2c208c273d874060093c41d6815", - "0x000000000000000000000000000000e4f54fcade01d40e3e2858b5dd48341f72", - "0x00000000000000000000000000000000001e9026e6c62cfacecca45033e276cd", - "0x00000000000000000000000000000048fe4b2e662e8f72008deaaeb3cae82889", - "0x00000000000000000000000000000000000f23cd4f99e1879d8446159daeb62c", - "0x0000000000000000000000000000007a40e933ce7da86e405e300f09e9696a80", - "0x00000000000000000000000000000000002be3c84c3b52d758c814a963ba2f94", - "0x000000000000000000000000000000052c1133e365eda815b0be14c147398afd", - "0x00000000000000000000000000000000002e362f1ae1a9653e20e4ea7fff40a8", - "0x000000000000000000000000000000e550b0f1e7405c2a3eff981bb0f01c7d1f", - "0x000000000000000000000000000000000013dba20a64ae2d9f8482e61610a66f", - "0x000000000000000000000000000000642e7b3cbb6059b084f85a6010a256faa0", - "0x00000000000000000000000000000000001956c1f43bf67c2c942afd7e48353d", - "0x0000000000000000000000000000000e48669367ac01cdc80311fc55a0e60bd8", - "0x00000000000000000000000000000000002139d444b492ec82d558636ffc1e97", - "0x0000000000000000000000000000006fa4e2aa15e6518b1a6bb34141b1c46202", - "0x000000000000000000000000000000000011ded7a51635993f8ba273a699c2bb", - "0x0000000000000000000000000000004c1dc1dc7bfa3216f08dcfb9311062f721", - "0x000000000000000000000000000000000003696e65c014736dadc105517f571a", - "0x0000000000000000000000000000008de75372e4ec795c962f02a2e099c02489", - "0x00000000000000000000000000000000001e04420c925ab1c6575c7be2bf84c2", - "0x0000000000000000000000000000004858ea68d4d6587c4d8fb1856940db0220", - "0x00000000000000000000000000000000000b120f02c14e10a3fb1ce4ed95e4c6", - "0x00000000000000000000000000000095fce621e5d13adb1600ff34a7cab78ce7", - "0x0000000000000000000000000000000000138f458a343844776fda405a5271cf", - "0x00000000000000000000000000000046a68a67cbd929d663206821ce8fc5e230", - "0x00000000000000000000000000000000000baad17f09e16020481a4d67f735a2", - "0x0000000000000000000000000000005d157a3ade75ffbbc28195549243fd12a3", - "0x000000000000000000000000000000000017cabc064e4238d6844b8703d41d24", - "0x000000000000000000000000000000152ce071b703eb0716af995f8c91e13ce9", - "0x00000000000000000000000000000000002299066301428e31449b88fe5a4a76", - "0x00000000000000000000000000000039d0f4c6ba5eb83fd6fe632dba5ccd9361", - "0x00000000000000000000000000000000001bbb5e0fe4c482f456058dfb96f9ab", - "0x0000000000000000000000000000006ada264c4d8f433774b81314666f8e9d09", - "0x00000000000000000000000000000000002889ea5c1cdd05bca629fc629023cf", - "0x0000000000000000000000000000002b819d712cc9b72347f629fa9ae632b155", - "0x0000000000000000000000000000000000257b6eabdd8823096556a6263402b1", - "0x000000000000000000000000000000460b98103674e0ac00918e8877f22f1b71", - "0x0000000000000000000000000000000000054eae798f898372c126db4bd48259", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x00000000000000000000000000000000000000000000000000000000000003ec", + "0x00000000000000000000000000000000000000000000000000000000000003ed", + "0x00000000000000000000000000000000000000000000000000000000000003ee", + "0x00000000000000000000000000000000000000000000000000000000000003ef", + "0x00000000000000000000000000000000000000000000000000000000000003f0", + "0x00000000000000000000000000000000000000000000000000000000000003f1", + "0x00000000000000000000000000000000000000000000000000000000000003f2", + "0x00000000000000000000000000000000000000000000000000000000000003f3", + "0x00000000000000000000000000000000000000000000000000000000000003f4", + "0x00000000000000000000000000000000000000000000000000000000000003f5", + "0x000000000000000000000000000000845efdb71c0341d033ab057aa4dd919b4d", + "0x00000000000000000000000000000000000115b8e25d1c105df51a2e0428bc8b", + "0x000000000000000000000000000000f536b35d402d3ee67fd032a0e4ef71871c", + "0x00000000000000000000000000000000002ff57d711fe269a06cfcc98eb46d9c", + "0x000000000000000000000000000000c51091f53327a25c779ac09304e0588c05", + "0x00000000000000000000000000000000001a053950b62b43f449de6e9bcff3c2", + "0x0000000000000000000000000000008b1d2c1a624d4b6486d355e92562e39bb3", + "0x000000000000000000000000000000000020481b8fcc02be1b8ce0debe64c1c9", + "0x00000000000000000000000000000004c32c48fd8d443727712a1b4d2427eac0", + "0x000000000000000000000000000000000014d4cac523a533e271eb30e298f70a", + "0x000000000000000000000000000000c5788144e336a203b0ed00c45cb3868ad7", + "0x00000000000000000000000000000000001c88d858bbc467fc265c10fd367a1d", + "0x000000000000000000000000000000a13aebe0172094df2ceec7a5bb09793af8", + "0x00000000000000000000000000000000002c055d07eff26c62484598e4c76630", + "0x000000000000000000000000000000bd02f12357aa2fd45d8de03dde09175cc4", + "0x000000000000000000000000000000000010b8d8a55aa68df793c5e93b3d955f", + "0x000000000000000000000000000000ced447a2ca820a793c4b9be832a42608e1", + "0x00000000000000000000000000000000002f0ad902aa7432bc3a3a9ffa95823f", + "0x000000000000000000000000000000bfe3d1dba24355bf4a397f071ddbf755b5", + "0x00000000000000000000000000000000001e2320877eecec72a6dc023db9b2b3", + "0x00000000000000000000000000000091a5a8029d3ec7b65321ef6985581f2330", + "0x00000000000000000000000000000000002ab7f6a78b6ee160e2b2f2613fc2bc", + "0x000000000000000000000000000000c23c1f21de7bf127ec91e0ccd65c37a0c8", + "0x000000000000000000000000000000000015152bf9742824805496149e2612f5", + "0x0000000000000000000000000000002d642c1daea7215b9298f7902c21212ed3", + "0x00000000000000000000000000000000002deca8c3e7386ea6f9f9ad25d371a5", + "0x0000000000000000000000000000000d6a5e9d6e5aa66534e125fe442bbd2c1f", + "0x0000000000000000000000000000000000248c4daaa0943137eb97510041d0bc", + "0x000000000000000000000000000000d6a791b91bb247689fcc9d830cd286f1a5", + "0x000000000000000000000000000000000006f2ba625d40bc69bc7c998880177c", + "0x0000000000000000000000000000009eeeb319c808167b23e862e77168bd9c11", + "0x00000000000000000000000000000000001fa9691ce70ea6ac266b4075447801", + "0x0000000000000000000000000000008bef9e390177ec526da318a987fa81ab85", + "0x000000000000000000000000000000000019cf37ca841efad66449bcb5fed35d", + "0x000000000000000000000000000000f4830dd037dee552b9677c694fed90443f", + "0x0000000000000000000000000000000000001b58a4fc333101cabb0ece108016", + "0x00000000000000000000000000000038d94fe9860f1a27d06aae520ceeefc321", + "0x0000000000000000000000000000000000032650a5026c347a2841fa9c6197e2", + "0x000000000000000000000000000000e74982e4c75b9294e60dfc331cf8f6746b", + "0x00000000000000000000000000000000002d85f243a7f36fad62a67f256fffff", + "0x0000000000000000000000000000001f567d0014c983ea1b761d1243da1ce90e", + "0x000000000000000000000000000000000026a16bd28afc39bcf1a93448100df6", + "0x0000000000000000000000000000005e7a11e90934d9ed670c03bb8961b16280", + "0x00000000000000000000000000000000000221b7347adade1f41a2c07d42e6b4", + "0x000000000000000000000000000000affd30b2072c4f082d1024866640a8a311", + "0x0000000000000000000000000000000000261dd0a259450202dab07befdecb26", + "0x000000000000000000000000000000dcd11f17fec6c5278b82c04e6c1da0ad28", + "0x0000000000000000000000000000000000044eb311a393c97b2ecc3a169172eb", + "0x000000000000000000000000000000e4f1338f6258f85c76d112af68a9364173", + "0x0000000000000000000000000000000000066bb6771b20f055747953cddb94de", + "0x000000000000000000000000000000268a0c464147c8496fc09dc65153ec9eaf", + "0x00000000000000000000000000000000000f1895be2cc0c7b5e08d01f3c59523", + "0x0000000000000000000000000000005dec66b3a3a81c3cda4dc1d4664d989b01", + "0x000000000000000000000000000000000026f82de72dcb4ce45f7f7aa9e1b072", + "0x00000000000000000000000000000089d0a7b39ded86e908e1f1915677e5fd9c", + "0x00000000000000000000000000000000000c66de1f80f0ec95ce14dd6c91cbb0", + "0x000000000000000000000000000000cdee3853f3741ad7106f182b6aeea7ca64", + "0x00000000000000000000000000000000001dd7aef4f014571421e69ff3872867", + "0x0000000000000000000000000000002ef222cbf09cfb1177fede87c102d4e513", + "0x000000000000000000000000000000000021e4567c56d1e009c7e97d83dec2fc", + "0x000000000000000000000000000000d0c1389bc46539a02267a90000b8b98c7c", + "0x00000000000000000000000000000000001fb4ca83ee04dd0f2ce06df6381d92", + "0x000000000000000000000000000000989d9829ff3ca98e5c9a570f90bf3e9d1e", + "0x000000000000000000000000000000000028b8c34131db7b71a89e8a2ae6644f", + "0x000000000000000000000000000000d0c1937a39fef66c9c387635c543c236cd", + "0x000000000000000000000000000000000007022411ee523e256110238cd12a22", + "0x0000000000000000000000000000002c6035e7abce88e32e268f1325ec09d0ea", + "0x000000000000000000000000000000000029d6db176d3f67559cee6312dda936", + "0x0000000000000000000000000000009692b513809036e2d8ba63800d8c8b0fe0", + "0x000000000000000000000000000000000006f20fb0b548f1304854a1d503dd96", + "0x00000000000000000000000000000036c0f75794b1ef51789990a2afe38dc902", + "0x000000000000000000000000000000000008af61c8706efcb1709d6b2208497a", + "0x000000000000000000000000000000e6df8e396de87d59076d7b85eaab4aa1e5", + "0x0000000000000000000000000000000000256a416c7351a66f3a3791a615a084", + "0x000000000000000000000000000000bc76aa218e7c7a2fb4c1d9bff2f0cb0cc7", + "0x00000000000000000000000000000000002ed9c9683cb9b803c39827847b5b49", + "0x000000000000000000000000000000fed9fa34d28de0eb52baef248f23e85308", + "0x0000000000000000000000000000000000155ec7b8354339218a8a66481da115", + "0x0000000000000000000000000000009a7de62e04de5a65723b6c5aae9e2d3694", + "0x00000000000000000000000000000000000dc7ee25e13a06e65874cc8389e1f8", + "0x000000000000000000000000000000953b486d52626bbdf62859f6119090b3cd", + "0x000000000000000000000000000000000009df6736669336de78713388e95535", + "0x0000000000000000000000000000003a313f87eb0e6a691ee1d380b3bd66d0ee", + "0x000000000000000000000000000000000004cf7acb278171bce564b5942a1857", + "0x0000000000000000000000000000003bdcd78296b6bdafc182df096e72b8e885", + "0x000000000000000000000000000000000029cb0722970834563ea229c9811477", + "0x000000000000000000000000000000a2174b8fe2ef0b1755e966ee129e39d78f", + "0x00000000000000000000000000000000001a430087d34eaaaaa27b5e6720ed61", + "0x00000000000000000000000000000032ee50da813a57f0d6aebcec43c9eedb2f", + "0x00000000000000000000000000000000000949da3b3f9dd09e59c1f9e0a1e00c", + "0x00000000000000000000000000000046e4c294fb285fbcd5fc2957c4c9bd7ddf", + "0x00000000000000000000000000000000000f097db24a007a4ab0bce654a5aa58", + "0x00000000000000000000000000000067bff4b83d1043fca42a0047bc1e7e1583", + "0x00000000000000000000000000000000000b906f789c0118845ef4cba34918a5", + "0x000000000000000000000000000000c5d5972a503e8ebd2ab8071fb776863dec", + "0x000000000000000000000000000000000026e70079c014b71ec1012c8f82b4a2", + "0x000000000000000000000000000000c2db2e3aafe08ab6cb32f073750885e43b", + "0x00000000000000000000000000000000000e4ef3f025348491c2b658044d1a82", + "0x000000000000000000000000000000bf344c256e0c8973f634bb4d57ac582c7e", + "0x00000000000000000000000000000000000a4ba900bcb3d32e44d5f004bd77d3", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000000000aea6c2f5d00b46c5ccf035d8c19f11101a", - "0x00000000000000000000000000000000002728e3debd0a243c2174d473988eb3", - "0x0000000000000000000000000000000ee308876e5271eb3bf8b463c94ce996e7", - "0x00000000000000000000000000000000001d9bc82bf7a9b8810f3c4ae1690471" + "0x0000000000000000000000000000007f47c9705231464f7bad5732f58e1fee41", + "0x000000000000000000000000000000000008fe2ff2b9d12a43d09d66b8fe7a34", + "0x000000000000000000000000000000c311ccd09888e074cd2810b77c1d003664", + "0x000000000000000000000000000000000029450aa8d207a9b8974bd04149e9ba" ] -hash = "0x2e7f7b71ec9506e7c37f331a6e16f9e576f5ac374fa60e4aea986776087da83f" +hash = "0x04af37b417428bf82808557cfa9c020bb6fb3fd2c19b8eff285f7b6f70e019ad" [inputs.previous_rollup_data.vk_witness] leaf_index = "0x000000000000000000000000000000000000000000000000000000000000000e" sibling_path = [ - "0x2efa03aa055caa1718bf1e397afc0f2c2628ec115188f95f9f46027a21fab345", - "0x29e27c1d0934d5550f382c4b65288f9e4e62757ebaf45fc1c197c920c3528cdd", - "0x220ebe2ec739267877ea7a9dfdd070c92cc88f558917466660908410bd66dabc", - "0x268b4fb54bbdda64dd707ee86cb0729dfb9a9e8b6ae83e973b37bc7e4b18f875", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x2efee9b38090bb865fe0caedc97d1a82efccae52457d5ba87f86c4d16eec8c84", + "0x07d3bcb907334375be741318ef9d6244609494dd09573f89196156ac7f002f4e", + "0x132d9d2d0b96d031d5e97901ab35527c4123d7c9dfc33070b26ff2bba3d0201d", + "0x0178af4ea3a679e0025251b9543017390bf56038f217158886965e52d7b0c8cd", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] [[inputs.previous_rollup_data]] [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs] -previous_block_hash = "0x022087729c552378b2572eb9be555e7dff2161a22e9a1d5e175d3558163a615b" -end_block_hash = "0x205dc0e6c4055f045d9c226b52b42ccc6062d9ab2702e4e0acbf3209178b1e53" -out_hash = "0x0007638bb56b6dda2b64b8f76841114ac3a87a1820030e2e16772c4d294879c3" -vk_tree_root = "0x0bee8f04d48c18c88f2b9dd3b87daba3b3c8d000f44d290587504ae770942c56" -protocol_contract_tree_root = "0x1c4e64cbb91a46bc2fd73590e1dacd3ddf84d1b5e7a7182795ab02fe80399caf" +previous_block_hash = "0x27d314f0e262ebc3eefebd3f38b3e59e5ecfcd7850f8d9258411b5ebe1218cf5" +end_block_hash = "0x099ca83f2b1c85738ea97bef472b02e2d506b53d16f16422157936439445d54a" +out_hash = "0x00f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb" +vk_tree_root = "0x2aaf57a966a26265d97b6705e9b6473f122d85baab6b6457ea2f5939c147acb7" +protocol_contract_tree_root = "0x2431e1d42149c19a560e80cfde544d97aa75833c7d3a54f9c7545372aff2d295" prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.previous_archive] - root = "0x04b51aa5df89d177213335ca62dee74d15b920e231f5ea5198ed405967d188fd" + root = "0x148982e14549cad3887a3c4e0b93de0c350ba45bdd4af324913c50077fe63462" next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000008" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.new_archive] - root = "0x176c781186011b45fed098e21264ed31abe491d165380b1490641d5bc1c7ec85" - next_available_leaf_index = "0x000000000000000000000000000000000000000000000000000000000000000a" + root = "0x08c1a4c4d455a050afda6532f3c7d878611f0aa1d07a28d6668489478d5ff0f4" + next_available_leaf_index = "0x0000000000000000000000000000000000000000000000000000000000000009" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" block_number = "0x0000000000000000000000000000000000000000000000000000000000000008" slot_number = "0x0000000000000000000000000000000000000000000000000000000000000015" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2e96" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776aa05" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.start_global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -3340,12 +3422,12 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables] chain_id = "0x0000000000000000000000000000000000000000000000000000000000007a69" version = "0x0000000000000000000000000000000000000000000000000000000000000001" - block_number = "0x0000000000000000000000000000000000000000000000000000000000000009" - slot_number = "0x0000000000000000000000000000000000000000000000000000000000000016" - timestamp = "0x00000000000000000000000000000000000000000000000000000000675c2eae" + block_number = "0x0000000000000000000000000000000000000000000000000000000000000008" + slot_number = "0x0000000000000000000000000000000000000000000000000000000000000015" + timestamp = "0x000000000000000000000000000000000000000000000000000000006776aa05" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables.coinbase] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.end_global_variables.fee_recipient] inner = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -3355,16 +3437,16 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" fee_per_l2_gas = "0x0000000000000000000000000000000000000000000000000000000c9bd4533a" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees]] - value = "0x0000000000000000000000000000000000000000000000000011b417896f129a" + value = "0x00000000000000000000000000000000000000000000000000116fd3dde47a96" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees.recipient] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x000000000000000000000000ae3c1a85b13eb468a43775bc8c580aa03904f4a2" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees]] - value = "0x0000000000000000000000000000000000000000000000000011b417896f129a" + value = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees.recipient] - inner = "0x000000000000000000000000ed846b6f217c7084a6c108eda50abce8c8367eac" + inner = "0x0000000000000000000000000000000000000000000000000000000000000000" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.fees]] value = "0x0000000000000000000000000000000000000000000000000000000000000000" @@ -3644,19 +3726,19 @@ prover_id = "0x0000000000000000000000000000000000000000000000000000000000000051" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs]] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] -z = "0x05620cfa3125101fc126dcb1cd967ae0cda5bfbb0c413bb1ad570ede664953cf" +z = "0x0c18c217f46f0d3d2015c62fd2b039a43d49a1872a5f1d4cbca4ad8b485fe613" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.y] limbs = [ - "0x1965375f1fcd10c386e8da3da65bf4", - "0xb17c73370563522d2debdb7994b039", - "0x17f0" + "0xf2e955d298def72866e94e9e5f2513", + "0xb53f2d86ab304a80e950a044ade29f", + "0x6974" ] [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.kzg_commitment] inner = [ - "0x00aae0654b3ba2a2f1e2fa2c7d23b35ab21cfba67951dcf917925cc2325eb866", - "0x0000000000000000000000000000001eea78b1856d5770ee11f410332f1be2af" + "0x0084eef713cb1d2f09e1ac4f99d63d809261753b9c8cf2e1c9727d4706e9ce74", + "0x0000000000000000000000000000003f8c2810fac7497ec37298a9be3f3140fe" ] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] @@ -3693,19 +3775,19 @@ z = "0x0000000000000000000000000000000000000000000000000000000000000000" [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs]] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] -z = "0x172d7f736e107938e1bc1e8a4a11b55937b11a6d1bac463f17efe75495db19e5" +z = "0x0000000000000000000000000000000000000000000000000000000000000000" [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.y] limbs = [ - "0x3bb56352d775bd9572666507c876fa", - "0xabf177bc013f733764b4f023e81e66", - "0x19f1" + "0x000000000000000000000000000000", + "0x000000000000000000000000000000", + "0x0000" ] [inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner.kzg_commitment] inner = [ - "0x00b4b024814b9a355c67327ec0af765ab3871da695c51a4bdfbe3407ab865fe2", - "0x00000000000000000000000000000074b4d39d0d3840c2a1e97f1924f19a4455" + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000000000000000000000000000" ] [[inputs.previous_rollup_data.block_root_or_block_merge_public_inputs.blob_public_inputs.inner]] @@ -6458,13 +6540,84 @@ fields = [ "0x00000000000000000000000000000000000000000000000000000000000001cc", "0x00000000000000000000000000000000000000000000000000000000000001cd", "0x00000000000000000000000000000000000000000000000000000000000001ce", - "0x00000000000000000000000000000000000000000000000000000000000001cf" + "0x00000000000000000000000000000000000000000000000000000000000001cf", + "0x00000000000000000000000000000000000000000000000000000000000001d0", + "0x00000000000000000000000000000000000000000000000000000000000001d1", + "0x00000000000000000000000000000000000000000000000000000000000001d2", + "0x00000000000000000000000000000000000000000000000000000000000001d3", + "0x00000000000000000000000000000000000000000000000000000000000001d4", + "0x00000000000000000000000000000000000000000000000000000000000001d5", + "0x00000000000000000000000000000000000000000000000000000000000001d6", + "0x00000000000000000000000000000000000000000000000000000000000001d7", + "0x00000000000000000000000000000000000000000000000000000000000001d8", + "0x00000000000000000000000000000000000000000000000000000000000001d9", + "0x00000000000000000000000000000000000000000000000000000000000001da", + "0x00000000000000000000000000000000000000000000000000000000000001db", + "0x00000000000000000000000000000000000000000000000000000000000001dc", + "0x00000000000000000000000000000000000000000000000000000000000001dd", + "0x00000000000000000000000000000000000000000000000000000000000001de", + "0x00000000000000000000000000000000000000000000000000000000000001df", + "0x00000000000000000000000000000000000000000000000000000000000001e0", + "0x00000000000000000000000000000000000000000000000000000000000001e1", + "0x00000000000000000000000000000000000000000000000000000000000001e2", + "0x00000000000000000000000000000000000000000000000000000000000001e3", + "0x00000000000000000000000000000000000000000000000000000000000001e4", + "0x00000000000000000000000000000000000000000000000000000000000001e5", + "0x00000000000000000000000000000000000000000000000000000000000001e6", + "0x00000000000000000000000000000000000000000000000000000000000001e7", + "0x00000000000000000000000000000000000000000000000000000000000001e8", + "0x00000000000000000000000000000000000000000000000000000000000001e9", + "0x00000000000000000000000000000000000000000000000000000000000001ea", + "0x00000000000000000000000000000000000000000000000000000000000001eb", + "0x00000000000000000000000000000000000000000000000000000000000001ec", + "0x00000000000000000000000000000000000000000000000000000000000001ed", + "0x00000000000000000000000000000000000000000000000000000000000001ee", + "0x00000000000000000000000000000000000000000000000000000000000001ef", + "0x00000000000000000000000000000000000000000000000000000000000001f0", + "0x00000000000000000000000000000000000000000000000000000000000001f1", + "0x00000000000000000000000000000000000000000000000000000000000001f2", + "0x00000000000000000000000000000000000000000000000000000000000001f3", + "0x00000000000000000000000000000000000000000000000000000000000001f4", + "0x00000000000000000000000000000000000000000000000000000000000001f5", + "0x00000000000000000000000000000000000000000000000000000000000001f6", + "0x00000000000000000000000000000000000000000000000000000000000001f7", + "0x00000000000000000000000000000000000000000000000000000000000001f8", + "0x00000000000000000000000000000000000000000000000000000000000001f9", + "0x00000000000000000000000000000000000000000000000000000000000001fa", + "0x00000000000000000000000000000000000000000000000000000000000001fb", + "0x00000000000000000000000000000000000000000000000000000000000001fc", + "0x00000000000000000000000000000000000000000000000000000000000001fd", + "0x00000000000000000000000000000000000000000000000000000000000001fe", + "0x00000000000000000000000000000000000000000000000000000000000001ff", + "0x0000000000000000000000000000000000000000000000000000000000000200", + "0x0000000000000000000000000000000000000000000000000000000000000201", + "0x0000000000000000000000000000000000000000000000000000000000000202", + "0x0000000000000000000000000000000000000000000000000000000000000203", + "0x0000000000000000000000000000000000000000000000000000000000000204", + "0x0000000000000000000000000000000000000000000000000000000000000205", + "0x0000000000000000000000000000000000000000000000000000000000000206", + "0x0000000000000000000000000000000000000000000000000000000000000207", + "0x0000000000000000000000000000000000000000000000000000000000000208", + "0x0000000000000000000000000000000000000000000000000000000000000209", + "0x000000000000000000000000000000000000000000000000000000000000020a", + "0x000000000000000000000000000000000000000000000000000000000000020b", + "0x000000000000000000000000000000000000000000000000000000000000020c", + "0x000000000000000000000000000000000000000000000000000000000000020d", + "0x000000000000000000000000000000000000000000000000000000000000020e", + "0x000000000000000000000000000000000000000000000000000000000000020f", + "0x0000000000000000000000000000000000000000000000000000000000000210", + "0x0000000000000000000000000000000000000000000000000000000000000211", + "0x0000000000000000000000000000000000000000000000000000000000000212", + "0x0000000000000000000000000000000000000000000000000000000000000213", + "0x0000000000000000000000000000000000000000000000000000000000000214", + "0x0000000000000000000000000000000000000000000000000000000000000215", + "0x0000000000000000000000000000000000000000000000000000000000000216" ] [inputs.previous_rollup_data.vk] key = [ - "0x0000000000000000000000000000000000000000000000000000000000200000", - "0x00000000000000000000000000000000000000000000000000000000000003ec", + "0x0000000000000000000000000000000000000000000000000000000000800000", + "0x00000000000000000000000000000000000000000000000000000000000003f6", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x00000000000000000000000000000000000000000000000000000000000003dc", @@ -6483,124 +6636,135 @@ key = [ "0x00000000000000000000000000000000000000000000000000000000000003e9", "0x00000000000000000000000000000000000000000000000000000000000003ea", "0x00000000000000000000000000000000000000000000000000000000000003eb", - "0x000000000000000000000000000000998e5be31abe68fe2f1d08ec68178d5e55", - "0x000000000000000000000000000000000025ab0352159abdadfb1c5163f7d202", - "0x000000000000000000000000000000bcd393b12573d6d5e53fc42c17f71d4c8b", - "0x000000000000000000000000000000000027925c9ebd2056d20410e57df614ed", - "0x0000000000000000000000000000004a0d4495d868843067a6d1ad3607e091a7", - "0x00000000000000000000000000000000001958c78407cbcd95b771b31d38a1c1", - "0x0000000000000000000000000000007e68740a53fd37e46590ab1c6f5b58b328", - "0x00000000000000000000000000000000002980bcd4948a9fbb5723af68df31da", - "0x000000000000000000000000000000dcdb1d1d1c5173490b696673e0313c62bd", - "0x000000000000000000000000000000000028d0610e818fedd71ec3a9281a7781", - "0x000000000000000000000000000000d17c67572cce970c5757a9a84445102eed", - "0x00000000000000000000000000000000002f4c160a312790dabbd93d572f07bb", - "0x0000000000000000000000000000004c61674567376a482c90a5bf7c53976cfe", - "0x00000000000000000000000000000000002d7f4779d914d01d064e7b406fb808", - "0x0000000000000000000000000000006c3b45eb8698c1e59dfeea80a9c3db9f5f", - "0x0000000000000000000000000000000000060a2cfa606a2ce7d86eb2162d7e71", - "0x00000000000000000000000000000062f1da156b5112d7cb9f320d5452e60627", - "0x000000000000000000000000000000000023325f29f5d61154778ac60e962c31", - "0x000000000000000000000000000000071a7bd0219e592d3a65f399b2a4964241", - "0x0000000000000000000000000000000000162558d3b4de45fdbde1b0d8f89bf8", - "0x000000000000000000000000000000488d6af9e2b2c6dfed9a16bef551a40255", - "0x0000000000000000000000000000000000099f9e36cd0b4f59b9c98c01b88003", - "0x000000000000000000000000000000a9267458a56c12b55c15b7c51e505b8e6c", - "0x000000000000000000000000000000000015ca0f8807b968cf2dc4222c0ec955", - "0x0000000000000000000000000000004b4b7c7b2144700873a7af327468d6edf5", - "0x00000000000000000000000000000000001f0c1785ec10d742cdd7817c9ff404", - "0x0000000000000000000000000000004ade21f14ed1ff588175882ce70339db26", - "0x0000000000000000000000000000000000279f17c283202f883245d3a4c47747", - "0x00000000000000000000000000000085157b1b29066dfe5edf96c38344140801", - "0x000000000000000000000000000000000023791cefa64559dbdade3a6190f039", - "0x000000000000000000000000000000164cfe1d74198193dd30197a589b236f88", - "0x00000000000000000000000000000000000c70733b2a932741394e86bd8a57e2", - "0x0000000000000000000000000000003f14d7f440e8578acce63f8eec32380f7a", - "0x0000000000000000000000000000000000303d66f56023c8588baffd7e092e67", - "0x000000000000000000000000000000fedfeb52b321b9cb36c9634c3730492ab1", - "0x00000000000000000000000000000000002f0aff78047292f42b7f5bb19c05f7", - "0x000000000000000000000000000000994d21d6354422208e38715f37e48fa16d", - "0x00000000000000000000000000000000001eb0eb53130ca20d5e87c0a254f7c6", - "0x00000000000000000000000000000007f75f0866bac3efe692c450e2c6de3a55", - "0x000000000000000000000000000000000017a3177f2e8def9f22c11e4b6d7618", - "0x000000000000000000000000000000a763b50f06bec58aa0e1e7a36aa5e0ef9d", - "0x0000000000000000000000000000000000072fcc6fdb06628b8adff26ce4f3f6", - "0x0000000000000000000000000000004e587f87e7ecfb15dd38d65b300a0ed04b", - "0x00000000000000000000000000000000001067a37239b8f86c8b34885e5f93f4", - "0x000000000000000000000000000000d532562004237072c915a771ef2abd6a00", - "0x000000000000000000000000000000000012f352a9d1783669dbd48c685920db", - "0x0000000000000000000000000000003b1f4cb9dcde9f5112acea5e520123a491", - "0x0000000000000000000000000000000000143a7afda4f460bbebe4ba1141501a", - "0x000000000000000000000000000000bc5cf78a7230c328e37d3f2fe19f6777ca", - "0x00000000000000000000000000000000000dcbe3389d11e40a5faf40a385ad22", - "0x000000000000000000000000000000f7c9cfa27095a937ada1a7897eb222ce89", - "0x000000000000000000000000000000000014b4924c74371f51dacd2bf2866c13", - "0x000000000000000000000000000000f2d8c4588bb4679bff57e660e17cc33973", - "0x0000000000000000000000000000000000151e2efe25ec498ed563261e36c555", - "0x0000000000000000000000000000001f2e91f77895aa5de8e452c6fca1550a7c", - "0x000000000000000000000000000000000023a05e0263e278950bccbabc25d273", - "0x00000000000000000000000000000005057a4276a0a97ef69b09241d942e1a9c", - "0x000000000000000000000000000000000018c875aec30f26a998a59cd9204d7f", - "0x0000000000000000000000000000008e7332630bd450e6ac0ee872e7e83aca38", - "0x00000000000000000000000000000000000eb1e133f51a031dfee4d967ec7321", - "0x00000000000000000000000000000034530e460a13a571bc35cfa6451fe6187e", - "0x00000000000000000000000000000000001de2c208c273d874060093c41d6815", - "0x000000000000000000000000000000e4f54fcade01d40e3e2858b5dd48341f72", - "0x00000000000000000000000000000000001e9026e6c62cfacecca45033e276cd", - "0x00000000000000000000000000000048fe4b2e662e8f72008deaaeb3cae82889", - "0x00000000000000000000000000000000000f23cd4f99e1879d8446159daeb62c", - "0x0000000000000000000000000000007a40e933ce7da86e405e300f09e9696a80", - "0x00000000000000000000000000000000002be3c84c3b52d758c814a963ba2f94", - "0x000000000000000000000000000000052c1133e365eda815b0be14c147398afd", - "0x00000000000000000000000000000000002e362f1ae1a9653e20e4ea7fff40a8", - "0x000000000000000000000000000000e550b0f1e7405c2a3eff981bb0f01c7d1f", - "0x000000000000000000000000000000000013dba20a64ae2d9f8482e61610a66f", - "0x000000000000000000000000000000642e7b3cbb6059b084f85a6010a256faa0", - "0x00000000000000000000000000000000001956c1f43bf67c2c942afd7e48353d", - "0x0000000000000000000000000000000e48669367ac01cdc80311fc55a0e60bd8", - "0x00000000000000000000000000000000002139d444b492ec82d558636ffc1e97", - "0x0000000000000000000000000000006fa4e2aa15e6518b1a6bb34141b1c46202", - "0x000000000000000000000000000000000011ded7a51635993f8ba273a699c2bb", - "0x0000000000000000000000000000004c1dc1dc7bfa3216f08dcfb9311062f721", - "0x000000000000000000000000000000000003696e65c014736dadc105517f571a", - "0x0000000000000000000000000000008de75372e4ec795c962f02a2e099c02489", - "0x00000000000000000000000000000000001e04420c925ab1c6575c7be2bf84c2", - "0x0000000000000000000000000000004858ea68d4d6587c4d8fb1856940db0220", - "0x00000000000000000000000000000000000b120f02c14e10a3fb1ce4ed95e4c6", - "0x00000000000000000000000000000095fce621e5d13adb1600ff34a7cab78ce7", - "0x0000000000000000000000000000000000138f458a343844776fda405a5271cf", - "0x00000000000000000000000000000046a68a67cbd929d663206821ce8fc5e230", - "0x00000000000000000000000000000000000baad17f09e16020481a4d67f735a2", - "0x0000000000000000000000000000005d157a3ade75ffbbc28195549243fd12a3", - "0x000000000000000000000000000000000017cabc064e4238d6844b8703d41d24", - "0x000000000000000000000000000000152ce071b703eb0716af995f8c91e13ce9", - "0x00000000000000000000000000000000002299066301428e31449b88fe5a4a76", - "0x00000000000000000000000000000039d0f4c6ba5eb83fd6fe632dba5ccd9361", - "0x00000000000000000000000000000000001bbb5e0fe4c482f456058dfb96f9ab", - "0x0000000000000000000000000000006ada264c4d8f433774b81314666f8e9d09", - "0x00000000000000000000000000000000002889ea5c1cdd05bca629fc629023cf", - "0x0000000000000000000000000000002b819d712cc9b72347f629fa9ae632b155", - "0x0000000000000000000000000000000000257b6eabdd8823096556a6263402b1", - "0x000000000000000000000000000000460b98103674e0ac00918e8877f22f1b71", - "0x0000000000000000000000000000000000054eae798f898372c126db4bd48259", + "0x0000000000000000000000000000000000000000000000000000000000000001", + "0x00000000000000000000000000000000000000000000000000000000000003ec", + "0x00000000000000000000000000000000000000000000000000000000000003ed", + "0x00000000000000000000000000000000000000000000000000000000000003ee", + "0x00000000000000000000000000000000000000000000000000000000000003ef", + "0x00000000000000000000000000000000000000000000000000000000000003f0", + "0x00000000000000000000000000000000000000000000000000000000000003f1", + "0x00000000000000000000000000000000000000000000000000000000000003f2", + "0x00000000000000000000000000000000000000000000000000000000000003f3", + "0x00000000000000000000000000000000000000000000000000000000000003f4", + "0x00000000000000000000000000000000000000000000000000000000000003f5", + "0x000000000000000000000000000000a2e97fe21c4c3244e64d17d2393b2b514c", + "0x00000000000000000000000000000000001eafe7ad47e6091afaa3e72b6986ea", + "0x0000000000000000000000000000008b1506a4ee3bc392bc5418dee93f4caa17", + "0x00000000000000000000000000000000002d23b82c029141a8c0d55dd1df8bcc", + "0x000000000000000000000000000000b759841276cd5c571a018e3647b42a6ab0", + "0x00000000000000000000000000000000001934abcb558e9f25e0930c8e88e79d", + "0x0000000000000000000000000000001ca080ca12e9e8842ba9507f19711d0a74", + "0x000000000000000000000000000000000009bb566181d6bc478fcd238602cfe3", + "0x000000000000000000000000000000d0e9311408d4493a4711814f96a359b075", + "0x00000000000000000000000000000000000d4b34945f195219564b2b3a03316e", + "0x000000000000000000000000000000b227082ed8dee7c039cdc174a4bab14430", + "0x00000000000000000000000000000000001bc7c24bec9d747865a8f1708720fa", + "0x000000000000000000000000000000d3f8bde4eab53f516043abcb35467e3dcc", + "0x0000000000000000000000000000000000218a560bbc3d01fffce6654868ea62", + "0x000000000000000000000000000000bd054c6e320b091a5822e1715538b709ee", + "0x000000000000000000000000000000000003ce0856cfd3934759acff2e039ad5", + "0x000000000000000000000000000000f16f5f7b0c248008648c5bdd234758079c", + "0x0000000000000000000000000000000000147aed3d6ad9334315615413ba1ef4", + "0x000000000000000000000000000000869b3562b8a8555e79d890b2238aa49424", + "0x0000000000000000000000000000000000166a0e596ee6e4de319b667859caae", + "0x000000000000000000000000000000025dcc25fa7064aebee2e4cc59b9cd5634", + "0x00000000000000000000000000000000000bbf45e2bb0690999685c0173ae04f", + "0x000000000000000000000000000000c7ded2eb4db9c81b646064a903398d2d75", + "0x000000000000000000000000000000000012f5e96c64b98a2c0a8d9420c31b0b", + "0x000000000000000000000000000000a4184db5c37fb1cac638cfa9976d4e6111", + "0x000000000000000000000000000000000013cba8a2ad55e65f6de77a883b4bfb", + "0x0000000000000000000000000000005508c3c87897b3c27f01e15d39454d572d", + "0x00000000000000000000000000000000000c03afe0c334e840f52decc868ce1f", + "0x000000000000000000000000000000c3ff9a6fb0e0b22ed42a565be18cd7ee08", + "0x0000000000000000000000000000000000032129593c8c594f28557af41f4afd", + "0x000000000000000000000000000000dd84b27adb05ffab05b8bde876f9dd69c8", + "0x00000000000000000000000000000000001a551837b99163d39c5111d02883a9", + "0x000000000000000000000000000000aa3a46377f0759247d7280d2a329e9adfd", + "0x00000000000000000000000000000000000497c1504891395ff114353acc2e7a", + "0x0000000000000000000000000000009c931cf7071e656d60747f258a058b2e18", + "0x000000000000000000000000000000000024b22dfc8f98fa4335a83981d396e9", + "0x0000000000000000000000000000006991543b28ae523199163e6663b9ac3ae3", + "0x000000000000000000000000000000000017a56ce70a0757d6afdb23b481d4f2", + "0x0000000000000000000000000000005462a32f61512545cc982d00e35d116ee3", + "0x000000000000000000000000000000000025bce556c588b79d27050789d00bb0", + "0x0000000000000000000000000000008a6f0fcc1caab28eb85bc36639e685b419", + "0x00000000000000000000000000000000000cc069d18a5256ed1a94bef31bfb8e", + "0x000000000000000000000000000000c7c8fe7d2beca4a0ce8258a3b9a4cf795a", + "0x00000000000000000000000000000000000610cae82c5bedb48870f79f4f1084", + "0x000000000000000000000000000000bb683d5f4e0def606fd10ed165cb596a7b", + "0x00000000000000000000000000000000002f9246596b0a56b5f8cee09def1f71", + "0x0000000000000000000000000000007c9dd0656df3fe3d0d44649cb34f93a3aa", + "0x0000000000000000000000000000000000242d5fff28c49f4c0db9510b6fefca", + "0x0000000000000000000000000000007ad8610290f68c65d369dd4d6bef7ddd96", + "0x0000000000000000000000000000000000028e86f9a0873299bce50a8a3bdd3a", + "0x0000000000000000000000000000002cf59babbc0f40bdb65eb2069c2333e287", + "0x0000000000000000000000000000000000218e9abaacc55d05fc16d837409ea2", + "0x00000000000000000000000000000093850fcf5c04564ffcc598eb550426edd2", + "0x0000000000000000000000000000000000022dcfa91bb75ff4bf7070b8673511", + "0x0000000000000000000000000000007ca24f0e07eaba2baea1aac625ce2b782f", + "0x00000000000000000000000000000000000fb15c00ccfa291c3763b2698842ac", + "0x00000000000000000000000000000074478d20a5176030241b9dc05fcfb42e55", + "0x00000000000000000000000000000000000cb4823147ba7690f81576d6411d20", + "0x000000000000000000000000000000daf9ff3f18dd71f6600abb43410b001875", + "0x00000000000000000000000000000000002c8a3745093820c3bc562ce5a9279b", + "0x0000000000000000000000000000002382bfd4a08e9c97e07caffbabd758f111", + "0x00000000000000000000000000000000002bc6bbf9413ad4c639710e2a73505f", + "0x0000000000000000000000000000004997325b1d8f05e2485a89a615f8ebca8f", + "0x000000000000000000000000000000000014a32c0fb3fbe4c1b05d3ee2bc4518", + "0x000000000000000000000000000000acb0c90b97713ab6dd1b681f1331d5c955", + "0x00000000000000000000000000000000001a668efc6d9e700763df4ddf06ab37", + "0x0000000000000000000000000000002be3247adfe55392dbef6fafe6dca43feb", + "0x0000000000000000000000000000000000092483a5ee9f43accd6b21136472db", + "0x000000000000000000000000000000f94d53a43e9663163b3dff3e977712150b", + "0x00000000000000000000000000000000002713072700fdaae2245b2bf81fe2dd", + "0x000000000000000000000000000000c663bdb87bf7f091998980275f97004f9c", + "0x00000000000000000000000000000000001a93837f8ce3c12b02aacfc84af4cd", + "0x0000000000000000000000000000009016d09a302e888a2a49d2a46fc90efe68", + "0x000000000000000000000000000000000024e8aea5de3f0ef4318d5f58ae51e7", + "0x00000000000000000000000000000001262f260af8ea8e808089ab8d73b639e2", + "0x00000000000000000000000000000000001157ab39f4e6a58c389ab906bad619", + "0x000000000000000000000000000000825af1c181884503ef7f0235d24877f672", + "0x000000000000000000000000000000000015f06a813d9ca73b5a067a0cd9e6df", + "0x0000000000000000000000000000004d6fc45d45ecc3a8ca0a446777604e8f61", + "0x0000000000000000000000000000000000143e748ae9a0ab858ceb5cbcb150ad", + "0x00000000000000000000000000000044e4b3fa82ed716580df975c7585e94cee", + "0x00000000000000000000000000000000002370d74b9e5298f858bc642d265196", + "0x000000000000000000000000000000980b6cdeb45e67ca23be75801b05d804a7", + "0x0000000000000000000000000000000000064bca4dd3a03634f961457f341748", + "0x0000000000000000000000000000004accc6790cde08f56b88bbb11627acf6ca", + "0x00000000000000000000000000000000001d1a9ec2c77205349211a747e6c419", + "0x0000000000000000000000000000008af5bc6460f55da3387da766f7a99f4e1f", + "0x00000000000000000000000000000000000b27a1ac65d6b1b9b775a14a2631b9", + "0x000000000000000000000000000000694c88b1b5cab3d6ae68c0ee9ad733b701", + "0x000000000000000000000000000000000022d97f246bc683a32f8c0cfbde699d", + "0x000000000000000000000000000000e0c89f4c6b4acd48faaee1f4013c5e087c", + "0x00000000000000000000000000000000000422bb79624189ef8f81bc9d9a3beb", + "0x000000000000000000000000000000382ff07631faa1b40164bad38be6b7927c", + "0x0000000000000000000000000000000000165c4640af66b8e1c331a2ead11c04", + "0x00000000000000000000000000000097ecf47c92944e395460bc5e2696eeca8d", + "0x00000000000000000000000000000000001bbab1b78d9e1a2beea56619c280f1", + "0x000000000000000000000000000000e82d43e4aa841e7054414a9c7296e9be52", + "0x00000000000000000000000000000000002591b3d7440d3bba42545bd8727097", + "0x000000000000000000000000000000d13a50ac76e2c04abfe51ada45e1780e8d", + "0x0000000000000000000000000000000000058cc463564e3321a5428def7eeeb5", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000000000aea6c2f5d00b46c5ccf035d8c19f11101a", - "0x00000000000000000000000000000000002728e3debd0a243c2174d473988eb3", - "0x0000000000000000000000000000000ee308876e5271eb3bf8b463c94ce996e7", - "0x00000000000000000000000000000000001d9bc82bf7a9b8810f3c4ae1690471" + "0x000000000000000000000000000000faabefa6ba0bfb91b8cd399b3d06c6f8ba", + "0x00000000000000000000000000000000002342990bed832e482acc2ce1094302", + "0x00000000000000000000000000000076ebe61784b818a8953cbf336daf8348fa", + "0x000000000000000000000000000000000020e74088a18017f7f53d082a5157bf" ] -hash = "0x2e7f7b71ec9506e7c37f331a6e16f9e576f5ac374fa60e4aea986776087da83f" +hash = "0x036026be76fff4091e5e3c4dbfb5b72b6f54cf7f0515b411f11a635228ede13c" [inputs.previous_rollup_data.vk_witness] -leaf_index = "0x000000000000000000000000000000000000000000000000000000000000000e" +leaf_index = "0x000000000000000000000000000000000000000000000000000000000000000d" sibling_path = [ - "0x2efa03aa055caa1718bf1e397afc0f2c2628ec115188f95f9f46027a21fab345", - "0x29e27c1d0934d5550f382c4b65288f9e4e62757ebaf45fc1c197c920c3528cdd", - "0x220ebe2ec739267877ea7a9dfdd070c92cc88f558917466660908410bd66dabc", - "0x268b4fb54bbdda64dd707ee86cb0729dfb9a9e8b6ae83e973b37bc7e4b18f875", - "0x1967335d7b185023afd52d8f7f40be4ced0d80ba63d4dce2de3e26bfe772e394", - "0x122cddd247164987e2287f8ce124bea7a68052e85bffebe2fc6cd71718689069" + "0x217f63f6ba754bc12fbfabfbee0ae6bd971d39952a50143b0eb3f21c75c52bf4", + "0x087b9cae6e6aa8792660fa4cd27f3a0af3ef8bda6ea4a5c2d40631837c7c4019", + "0x132d9d2d0b96d031d5e97901ab35527c4123d7c9dfc33070b26ff2bba3d0201d", + "0x0178af4ea3a679e0025251b9543017390bf56038f217158886965e52d7b0c8cd", + "0x2eaee03fd6ca3810bbf1a3e75db287cda1b2201dd5af38e6edfe81228b509b5c", + "0x29cb3bc5105aeefb55ed7ea6df55312b394a8e74ec4228125a52b22fd3f1ad9e" ] diff --git a/noir-projects/scripts/run_test.sh b/noir-projects/scripts/run_test.sh new file mode 100755 index 00000000000..94da2afdbac --- /dev/null +++ b/noir-projects/scripts/run_test.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -eu + +sub_project=$1 +package=$2 +test=$3 +txe_port=${4:-} + +cd $(dirname $0)/../$sub_project + +export RAYON_NUM_THREADS=1 +export NARGO=${NARGO:-../../noir/noir-repo/target/release/nargo} + +[ -n "$txe_port" ] && args="--oracle-resolver http://127.0.0.1:$txe_port" || args="" + +$NARGO test --silence-warnings --skip-brillig-constraints-check $args --package $package --exact $test \ No newline at end of file diff --git a/noir/bootstrap.sh b/noir/bootstrap.sh index 2c26204d309..b8fe93766b2 100755 --- a/noir/bootstrap.sh +++ b/noir/bootstrap.sh @@ -19,17 +19,41 @@ function build { function test_hash() { hash_str $hash-$(cache_content_hash .rebuild_patterns_tests) } + function test { test_flag=noir-test-$(test_hash) - if test_should_run $test_flag; then - github_group "noir test" - export COMMIT_HASH="$(echo "$hash" | sed 's/-.*//g')" - export PATH="$PWD/noir-repo/target/release/:$PATH" - parallel --tag --line-buffered --timeout 5m --halt now,fail=1 \ - denoise ::: ./scripts/test_native.sh ./scripts/test_js_packages.sh - cache_upload_flag $test_flag - github_endgroup - fi + test_should_run $test_flag || return 0 + + github_group "noir test" + export COMMIT_HASH="$(echo "$hash" | sed 's/-.*//g')" + export PATH="$PWD/noir-repo/target/release/:$PATH" + # parallel --tag --line-buffered --timeout 5m --halt now,fail=1 \ + # denoise ::: ./scripts/test_native.sh ./scripts/test_js_packages.sh + denoise ./scripts/test_native.sh + denoise ./scripts/test_js_packages.sh + cache_upload_flag $test_flag + github_endgroup +} + +function build_tests { + cd noir-repo + cargo nextest list --workspace --locked --release &>/dev/null +} + +function test_cmds { + cd noir-repo + cargo nextest list --workspace --locked --release -Tjson-pretty 2>/dev/null | \ + jq -r ' + .["rust-suites"][] | + .testcases as $tests | + .["binary-path"] as $binary | + $tests | + to_entries[] | + select(.value.ignored == false and .value["filter-match"].status == "matches") | + "noir/scripts/run_test.sh \($binary) \(.key)"' | \ + sed "s|$PWD/target/release/deps/||" | \ + # TODO: These fail. Figure out why. + grep -vE "(test_caches_open|requests)" } case "$cmd" in @@ -46,6 +70,12 @@ case "$cmd" in build test ;; + "build-tests") + build_tests + ;; + "test-cmds") + test_cmds + ;; "hash") echo $hash ;; diff --git a/noir/noir-repo/.github/workflows/reports.yml b/noir/noir-repo/.github/workflows/reports.yml index e8a22984318..85a54147423 100644 --- a/noir/noir-repo/.github/workflows/reports.yml +++ b/noir/noir-repo/.github/workflows/reports.yml @@ -217,10 +217,24 @@ jobs: ./memory_report.sh mv memory_report.json ../memory_report.json - - name: Upload memory report + - name: Upload compilation memory report uses: actions/upload-artifact@v4 with: - name: in_progress_memory_report + name: in_progress_compilation_mem_report + path: memory_report.json + retention-days: 3 + overwrite: true + + - name: Generate execution memory report + working-directory: ./test_programs + run: | + ./memory_report.sh 0 1 + mv memory_report.json ../memory_report.json + + - name: Upload execution memory report + uses: actions/upload-artifact@v4 + with: + name: in_progress_execution_mem_report path: memory_report.json retention-days: 3 overwrite: true @@ -290,6 +304,9 @@ jobs: - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner, take_average: true } - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail, take_average: true } - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset, take_average: true } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-root } + #- project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-block-root } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-block-merge } - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-private } - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-public } @@ -389,6 +406,72 @@ jobs: mv /home/runner/work/noir/noir/scripts/test_programs/execution_report.sh ./execution_report.sh ./execution_report.sh 1 1 + - name: Generate compilation report with averages + working-directory: ./test-repo/${{ matrix.project.path }} + if: ${{ matrix.project.take_average }} + run: | + mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh + chmod +x ./compilation_report.sh + ./compilation_report.sh 1 1 + + - name: Generate execution report without averages + working-directory: ./test-repo/${{ matrix.project.path }} + if: ${{ !matrix.project.is_library && !matrix.project.take_average }} + run: | + mv /home/runner/work/noir/noir/scripts/test_programs/execution_report.sh ./execution_report.sh + ./execution_report.sh 1 + + - name: Generate execution report with averages + working-directory: ./test-repo/${{ matrix.project.path }} + if: ${{ !matrix.project.is_library && matrix.project.take_average }} + run: | + mv /home/runner/work/noir/noir/scripts/test_programs/execution_report.sh ./execution_report.sh + ./execution_report.sh 1 1 + + - name: Generate compilation report with averages + working-directory: ./test-repo/${{ matrix.project.path }} + if: ${{ matrix.project.take_average }} + run: | + mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh + chmod +x ./compilation_report.sh + ./compilation_report.sh 1 1 + + - name: Generate execution report without averages + working-directory: ./test-repo/${{ matrix.project.path }} + if: ${{ !matrix.project.is_library && !matrix.project.take_average }} + run: | + mv /home/runner/work/noir/noir/scripts/test_programs/execution_report.sh ./execution_report.sh + ./execution_report.sh 1 + + - name: Generate execution report with averages + working-directory: ./test-repo/${{ matrix.project.path }} + if: ${{ !matrix.project.is_library && matrix.project.take_average }} + run: | + mv /home/runner/work/noir/noir/scripts/test_programs/execution_report.sh ./execution_report.sh + ./execution_report.sh 1 1 + + - name: Generate compilation report with averages + working-directory: ./test-repo/${{ matrix.project.path }} + if: ${{ matrix.project.take_average }} + run: | + mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh + chmod +x ./compilation_report.sh + ./compilation_report.sh 1 1 + + - name: Generate execution report without averages + working-directory: ./test-repo/${{ matrix.project.path }} + if: ${{ !matrix.project.is_library && !matrix.project.take_average }} + run: | + mv /home/runner/work/noir/noir/scripts/test_programs/execution_report.sh ./execution_report.sh + ./execution_report.sh 1 + + - name: Generate execution report with averages + working-directory: ./test-repo/${{ matrix.project.path }} + if: ${{ !matrix.project.is_library && matrix.project.take_average }} + run: | + mv /home/runner/work/noir/noir/scripts/test_programs/execution_report.sh ./execution_report.sh + ./execution_report.sh 1 1 + - name: Move compilation report id: compilation_report shell: bash @@ -454,11 +537,11 @@ jobs: - name: Parse compilation report id: compilation_report - uses: noir-lang/noir-bench-report@e408e131e96c3615b4f820d7d642360fb4d6e2f4 + uses: noir-lang/noir-bench-report@6ba151d7795042c4ff51864fbeb13c0a6a79246c with: report: compilation_report.json header: | - # Compilation Report + Compilation Report memory_report: false - name: Add memory report to sticky comment @@ -482,6 +565,8 @@ jobs: - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-inner } - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-reset } - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/private-kernel-tail } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-private } + - project: { repo: AztecProtocol/aztec-packages, path: noir-projects/noir-protocol-circuits/crates/rollup-base-public } name: External repo memory report - ${{ matrix.project.repo }}/${{ matrix.project.path }} steps: @@ -513,15 +598,38 @@ jobs: path: test-repo ref: ${{ matrix.project.ref }} - - name: Generate compilation report + - name: Generate compilation memory report working-directory: ./test-repo/${{ matrix.project.path }} run: | mv /home/runner/work/noir/noir/scripts/test_programs/memory_report.sh ./memory_report.sh - chmod +x ./memory_report.sh ./memory_report.sh 1 + # Rename the memory report as the execution report is about to write to the same file + cp memory_report.json compilation_memory_report.json + + - name: Generate execution memory report + working-directory: ./test-repo/${{ matrix.project.path }} + run: | + ./memory_report.sh 1 1 - name: Move compilation report - id: report + id: compilation_mem_report + shell: bash + run: | + PACKAGE_NAME=${{ matrix.project.path }} + PACKAGE_NAME=$(basename $PACKAGE_NAME) + mv ./test-repo/${{ matrix.project.path }}/compilation_memory_report.json ./memory_report_$PACKAGE_NAME.json + echo "memory_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT + + - name: Upload compilation memory report + uses: actions/upload-artifact@v4 + with: + name: compilation_mem_report_${{ steps.compilation_mem_report.outputs.memory_report_name }} + path: memory_report_${{ steps.compilation_mem_report.outputs.memory_report_name }}.json + retention-days: 3 + overwrite: true + + - name: Move execution report + id: execution_mem_report shell: bash run: | PACKAGE_NAME=${{ matrix.project.path }} @@ -529,16 +637,16 @@ jobs: mv ./test-repo/${{ matrix.project.path }}/memory_report.json ./memory_report_$PACKAGE_NAME.json echo "memory_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT - - name: Upload memory report + - name: Upload execution memory report uses: actions/upload-artifact@v4 with: - name: memory_report_${{ steps.report.outputs.memory_report_name }} - path: memory_report_${{ steps.report.outputs.memory_report_name }}.json + name: execution_mem_report_${{ steps.execution_mem_report.outputs.memory_report_name }} + path: memory_report_${{ steps.execution_mem_report.outputs.memory_report_name }}.json retention-days: 3 overwrite: true - upload_memory_report: - name: Upload memory report + upload_compilation_memory_report: + name: Upload compilation memory report needs: [generate_memory_report, external_repo_memory_report] # We want this job to run even if one variation of the matrix in `external_repo_memory_report` fails if: always() @@ -552,12 +660,12 @@ jobs: - name: Download initial memory report uses: actions/download-artifact@v4 with: - name: in_progress_memory_report + name: in_progress_compilation_mem_report - name: Download matrix memory reports uses: actions/download-artifact@v4 with: - pattern: memory_report_* + pattern: compilation_mem_report_* path: ./reports - name: Merge memory reports using jq @@ -565,21 +673,67 @@ jobs: mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh ./merge-bench-reports.sh memory_report - - name: Parse memory report - id: memory_report - uses: noir-lang/noir-bench-report@e408e131e96c3615b4f820d7d642360fb4d6e2f4 + - name: Parse compilation memory report + id: compilation_mem_report + uses: noir-lang/noir-bench-report@6ba151d7795042c4ff51864fbeb13c0a6a79246c with: report: memory_report.json header: | - # Memory Report + Compilation Memory Report memory_report: true - name: Add memory report to sticky comment if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' uses: marocchino/sticky-pull-request-comment@v2 with: - header: memory - message: ${{ steps.memory_report.outputs.markdown }} + header: compilation_memory + message: ${{ steps.compilation_mem_report.outputs.markdown }} + + upload_execution_memory_report: + name: Upload execution memory report + needs: [generate_memory_report, external_repo_memory_report] + # We want this job to run even if one variation of the matrix in `external_repo_memory_report` fails + if: always() + runs-on: ubuntu-latest + permissions: + pull-requests: write + + steps: + - uses: actions/checkout@v4 + + - name: Download initial memory report + uses: actions/download-artifact@v4 + with: + name: in_progress_execution_mem_report + + - name: Download matrix memory reports + uses: actions/download-artifact@v4 + with: + pattern: execution_mem_report_* + path: ./reports + + - name: Merge memory reports using jq + run: | + mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh + ./merge-bench-reports.sh memory_report + # Rename the memory report as to not clash with the compilation memory report file name + cp memory_report.json execution_memory_report.json + + - name: Parse execution memory report + id: execution_mem_report + uses: noir-lang/noir-bench-report@6ba151d7795042c4ff51864fbeb13c0a6a79246c + with: + report: execution_memory_report.json + header: | + Execution Memory Report + memory_report: true + + - name: Add execution memory report to sticky comment + if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target' + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: execution_memory + message: ${{ steps.execution_mem_report.outputs.markdown }} upload_execution_report: name: Upload execution report @@ -611,11 +765,11 @@ jobs: - name: Parse execution report id: execution_report - uses: noir-lang/noir-bench-report@e408e131e96c3615b4f820d7d642360fb4d6e2f4 + uses: noir-lang/noir-bench-report@6ba151d7795042c4ff51864fbeb13c0a6a79246c with: report: execution_report.json header: | - # Execution Report + Execution Report execution_report: true - name: Add memory report to sticky comment diff --git a/noir/noir-repo/.gitignore b/noir/noir-repo/.gitignore index 9bfb8a89331..49d9e2dbb2f 100644 --- a/noir/noir-repo/.gitignore +++ b/noir/noir-repo/.gitignore @@ -51,3 +51,5 @@ tooling/noir_js/lib # docs autogen build /docs/docs/noir_js/reference/ + +codegen \ No newline at end of file diff --git a/noir/noir-repo/.release-please-manifest.json b/noir/noir-repo/.release-please-manifest.json index b5c8da729e3..fd6cef7047a 100644 --- a/noir/noir-repo/.release-please-manifest.json +++ b/noir/noir-repo/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.0-beta.0" + ".": "1.0.0-beta.1" } diff --git a/noir/noir-repo/CHANGELOG.md b/noir/noir-repo/CHANGELOG.md index 19d36b885ed..da72291a3b0 100644 --- a/noir/noir-repo/CHANGELOG.md +++ b/noir/noir-repo/CHANGELOG.md @@ -1,5 +1,106 @@ # Changelog +## [1.0.0-beta.1](https://github.com/noir-lang/noir/compare/v1.0.0-beta.0...v1.0.0-beta.1) (2024-12-20) + + +### ⚠ BREAKING CHANGES + +* **stdlib:** Remove Schnorr ([#6749](https://github.com/noir-lang/noir/issues/6749)) +* remove SchnorrVerify opcode (https://github.com/AztecProtocol/aztec-packages/pull/9897) +* several format string fixes and improvements ([#6703](https://github.com/noir-lang/noir/issues/6703)) +* remove `ec` module from stdlib ([#6612](https://github.com/noir-lang/noir/issues/6612)) +* Disallow `#[export]` on associated methods ([#6626](https://github.com/noir-lang/noir/issues/6626)) + +### Features + +* `nargo test -q` (or `nargo test --format terse`) ([#6776](https://github.com/noir-lang/noir/issues/6776)) ([919149d](https://github.com/noir-lang/noir/commit/919149d3413be5232b33611094687fdb5fd86086)) +* `std::hint::black_box` function. ([#6529](https://github.com/noir-lang/noir/issues/6529)) ([237e8fa](https://github.com/noir-lang/noir/commit/237e8fa9ef8621e3da472e64c649849b4281004c)) +* Add `(x | 1)` optimization for booleans ([#6795](https://github.com/noir-lang/noir/issues/6795)) ([feec2a1](https://github.com/noir-lang/noir/commit/feec2a1a9851306d7cf682c796ab084dea10b2ec)) +* Add `BoundedVec::from_parts` and `BoundedVec::from_parts_unchecked` ([#6691](https://github.com/noir-lang/noir/issues/6691)) ([768aa7c](https://github.com/noir-lang/noir/commit/768aa7ce9ed809fa2c9d368f2b2f625d9689a63f)) +* Add `nargo test --format json` ([#6796](https://github.com/noir-lang/noir/issues/6796)) ([eb975ab](https://github.com/noir-lang/noir/commit/eb975ab28fb056cf92859377c02f2bb1a608eda3)) +* Add a warning when using unsafe blocks without safety comments ([#6860](https://github.com/noir-lang/noir/issues/6860)) ([5c00a79](https://github.com/noir-lang/noir/commit/5c00a79d2c93056d07330c350bf7b6efbf81d477)) +* Add memory report into the CI ([#6630](https://github.com/noir-lang/noir/issues/6630)) ([6acef6d](https://github.com/noir-lang/noir/commit/6acef6d795cd74dee4a21e82c5a912d58b40b06c)) +* Allow filtering which SSA passes are printed ([#6636](https://github.com/noir-lang/noir/issues/6636)) ([50f4aa7](https://github.com/noir-lang/noir/commit/50f4aa72e409e7205724f90046d394bb83584e9c)) +* Allow ignoring test failures from foreign calls ([#6660](https://github.com/noir-lang/noir/issues/6660)) ([e3a0914](https://github.com/noir-lang/noir/commit/e3a0914c6dede6f54f426ed7d790a0c98a7e0908)) +* Better error message when trying to invoke struct function field ([#6661](https://github.com/noir-lang/noir/issues/6661)) ([ea7c04a](https://github.com/noir-lang/noir/commit/ea7c04a8410ed8d2ce8e5a27e3c0784ba3195638)) +* **ci:** Initial compilation report on test_programs ([#6731](https://github.com/noir-lang/noir/issues/6731)) ([b3c04f0](https://github.com/noir-lang/noir/commit/b3c04f02d467c71ac9cb5eb6eca20b5bc0a2e47d)) +* **cli:** Run command on the package closest to the current directory ([#6752](https://github.com/noir-lang/noir/issues/6752)) ([f45b354](https://github.com/noir-lang/noir/commit/f45b3546bf82fd35eb446f7cbf00b739f287b92a)) +* **cli:** Verify `return` against ABI and `Prover.toml` ([#6765](https://github.com/noir-lang/noir/issues/6765)) ([5795a09](https://github.com/noir-lang/noir/commit/5795a099657a268b735a539298dfeefa445db3ff)) +* **comptime:** Implement blackbox functions in comptime interpreter ([#6551](https://github.com/noir-lang/noir/issues/6551)) ([10a9f81](https://github.com/noir-lang/noir/commit/10a9f8104e1ebb8fad044927ff130a0e2ce9131b)) +* Configurable external check failures ([#6810](https://github.com/noir-lang/noir/issues/6810)) ([73ccd45](https://github.com/noir-lang/noir/commit/73ccd45590222fc82642a6a9aa657c2915fc2c58)) +* Flatten nested if-else statements with equivalent conditions ([#6875](https://github.com/noir-lang/noir/issues/6875)) ([1a0a5f6](https://github.com/noir-lang/noir/commit/1a0a5f61231c3b65fa6397ec0769d3e6c5c238a3)) +* Improve parser recovery of constructor field with '::' instead of ':' ([#6701](https://github.com/noir-lang/noir/issues/6701)) ([c400543](https://github.com/noir-lang/noir/commit/c400543a9d9747798fd3b27b8508ac0a0668a09c)) +* Order attribute execution by their source ordering ([#6326](https://github.com/noir-lang/noir/issues/6326)) ([852155d](https://github.com/noir-lang/noir/commit/852155dc1c4a910bf9cd4e7af334f3856c1c4643)) +* **perf:** Track last loads per block in mem2reg and remove them if possible ([#6088](https://github.com/noir-lang/noir/issues/6088)) ([624ae6c](https://github.com/noir-lang/noir/commit/624ae6c6f0fdb077533abf93f8ff94814a7394f4)) +* Reduce memory consumption by storing array length as `u32` during SSA ([#6606](https://github.com/noir-lang/noir/issues/6606)) ([6196d05](https://github.com/noir-lang/noir/commit/6196d05bcb7ecd0b84fcc5ccc20d8dab99bc8052)) +* Replace `eval_global_as_array_length` with type/interpreter evaluation ([#6469](https://github.com/noir-lang/noir/issues/6469)) ([ddb4673](https://github.com/noir-lang/noir/commit/ddb46733fcf596b5c8508a208b2690df52aa16e3)) +* Replace quadratic removal of `rc` instructions ([#6705](https://github.com/noir-lang/noir/issues/6705)) ([7619da5](https://github.com/noir-lang/noir/commit/7619da59fc34cdd6e3b2581ad1668b5131ba4dde)) +* Replace quadratic removal of rc instructions (https://github.com/AztecProtocol/aztec-packages/pull/10416) ([66d3275](https://github.com/noir-lang/noir/commit/66d32751311378701b075ee7b2106d61e531ae4f)) +* Revert changes to `ValueMerger` and `Instruction::IfElse` ([#6673](https://github.com/noir-lang/noir/issues/6673)) ([f81244c](https://github.com/noir-lang/noir/commit/f81244c6bb29e8869f489d536141eebf6f68f00a)) +* Several `nargo test` improvements ([#6728](https://github.com/noir-lang/noir/issues/6728)) ([1b0dd41](https://github.com/noir-lang/noir/commit/1b0dd4149d9249f0ea4fb5e2228c688e0135618f)) +* Show printable byte arrays as byte strings in SSA ([#6709](https://github.com/noir-lang/noir/issues/6709)) ([fc11b63](https://github.com/noir-lang/noir/commit/fc11b631a2a1c0054b3b2a9e9fd2b7fa3a285076)) +* Simplify `jmpif`s by reversing branches if condition is negated ([#5891](https://github.com/noir-lang/noir/issues/5891)) ([ba7a568](https://github.com/noir-lang/noir/commit/ba7a568430c3477cc39e0ec147b11bdfc95093de)) +* **ssa:** Bring back tracking of RC instructions during DIE ([#6783](https://github.com/noir-lang/noir/issues/6783)) ([bc03152](https://github.com/noir-lang/noir/commit/bc03152366f242a6976f6e006e12520989e5e112)) +* **ssa:** Deduplicate intrinsics with predicates ([#6615](https://github.com/noir-lang/noir/issues/6615)) ([53f16c7](https://github.com/noir-lang/noir/commit/53f16c7fe75da04c54517b3d3199094b15195ce4)) +* **ssa:** Hoist MakeArray instructions during loop invariant code motion ([#6782](https://github.com/noir-lang/noir/issues/6782)) ([b88db67](https://github.com/noir-lang/noir/commit/b88db67a4fa92f861329105fb732a7b1309620fe)) +* **ssa:** Hoisting of array get using known induction variable maximum ([#6639](https://github.com/noir-lang/noir/issues/6639)) ([26d2351](https://github.com/noir-lang/noir/commit/26d235198f9a2fedbe438b3f7b39184554c5e1c1)) +* **ssa:** Implement missing brillig constraints SSA check ([#6658](https://github.com/noir-lang/noir/issues/6658)) ([c5a4caf](https://github.com/noir-lang/noir/commit/c5a4caf4e3971b8e9cb73681dcb21db0ba5550fc)) +* **ssa:** Option to set the maximum acceptable Brillig bytecode increase in unrolling ([#6641](https://github.com/noir-lang/noir/issues/6641)) ([4ff3081](https://github.com/noir-lang/noir/commit/4ff308128755c95b4d461bbcb7e3a49f16145585)) +* **ssa:** Simplify array get from set that writes to the same dynamic index ([#6684](https://github.com/noir-lang/noir/issues/6684)) ([304403f](https://github.com/noir-lang/noir/commit/304403f24e2a15b57bb054c4402a8d7f8d275668)) +* Sync from aztec-packages ([#6634](https://github.com/noir-lang/noir/issues/6634)) ([aa143a7](https://github.com/noir-lang/noir/commit/aa143a75d3460785ed88ea7ab3337c880c1153fd)) +* Sync from aztec-packages ([#6656](https://github.com/noir-lang/noir/issues/6656)) ([594aad2](https://github.com/noir-lang/noir/commit/594aad21f30614b1733a3ba2b8a2a5f5d7b7e119)) +* Sync from aztec-packages ([#6824](https://github.com/noir-lang/noir/issues/6824)) ([b3bca76](https://github.com/noir-lang/noir/commit/b3bca76620229e32c531417c6fa92e4a2c044fa0)) +* Sync from noir (https://github.com/AztecProtocol/aztec-packages/pull/10307) ([66d3275](https://github.com/noir-lang/noir/commit/66d32751311378701b075ee7b2106d61e531ae4f)) +* **test:** Check that `nargo::ops::transform_program` is idempotent ([#6694](https://github.com/noir-lang/noir/issues/6694)) ([9f3e0e6](https://github.com/noir-lang/noir/commit/9f3e0e68f8bc179fbceb606598a9749d3dc1c9e3)) +* **tooling:** Skip program transformation when loaded from cache ([#6689](https://github.com/noir-lang/noir/issues/6689)) ([7feb658](https://github.com/noir-lang/noir/commit/7feb6589d98246400497dfa492f39d67bae85977)) +* Warn on unnecessary unsafe blocks ([#6867](https://github.com/noir-lang/noir/issues/6867)) ([a97402a](https://github.com/noir-lang/noir/commit/a97402aa3b3a1a7d40f61242e02d3772175846f2)) + + +### Bug Fixes + +* Allow empty loop headers ([#6736](https://github.com/noir-lang/noir/issues/6736)) ([332ba79](https://github.com/noir-lang/noir/commit/332ba790287b152f14af8c88d0349323287e59bf)) +* Allow multiple `_` parameters, and disallow `_` as an expression you can read from ([#6657](https://github.com/noir-lang/noir/issues/6657)) ([d80a9d7](https://github.com/noir-lang/noir/commit/d80a9d71a8e4081a3aeacf34b2d5c2b0faf87484)) +* Always return an array of `u8`s when simplifying `Intrinsic::ToRadix` calls ([#6663](https://github.com/noir-lang/noir/issues/6663)) ([59c0c35](https://github.com/noir-lang/noir/commit/59c0c3562ad75d6c10fa7c6a2f74e3fbf68ec3e6)) +* Correct signed integer handling in `noirc_abi` ([#6638](https://github.com/noir-lang/noir/issues/6638)) ([ecaf63d](https://github.com/noir-lang/noir/commit/ecaf63da19a3a76e7c2940721d9044b1980a588f)) +* Correct types returned by constant EC operations simplified within SSA ([#6652](https://github.com/noir-lang/noir/issues/6652)) ([eec5970](https://github.com/noir-lang/noir/commit/eec5970658157704dac5c41e6d61b2aa652ce996)) +* Detect cycles in globals ([#6859](https://github.com/noir-lang/noir/issues/6859)) ([0d7642c](https://github.com/noir-lang/noir/commit/0d7642cb2071fbee148978a89a0922bfffe5be6a)) +* Disable failure persistance in nargo test fuzzing ([#6777](https://github.com/noir-lang/noir/issues/6777)) ([68ff7bd](https://github.com/noir-lang/noir/commit/68ff7bd85cb17f57afd481ec55318ec282a93aa6)) +* Disallow `#[export]` on associated methods ([#6626](https://github.com/noir-lang/noir/issues/6626)) ([7b56904](https://github.com/noir-lang/noir/commit/7b56904e56d95b88cefcbf3862e822fd3b1c8730)) +* Do not merge expressions that contain output witnesses ([#6757](https://github.com/noir-lang/noir/issues/6757)) ([f9abf72](https://github.com/noir-lang/noir/commit/f9abf724abd674ea4ccb342a770d237c70864ee1)) +* Do not warn on unused functions marked with #[export] ([#6625](https://github.com/noir-lang/noir/issues/6625)) ([30f8378](https://github.com/noir-lang/noir/commit/30f8378525b6f8ee305d356388c32761e12ee61c)) +* Don't deduplicate binary math of unsigned types ([#6848](https://github.com/noir-lang/noir/issues/6848)) ([ee0754b](https://github.com/noir-lang/noir/commit/ee0754b1c6b36961c180901db59dd593c183de77)) +* Don't remove necessary RC instructions in DIE pass ([#6585](https://github.com/noir-lang/noir/issues/6585)) ([440d94d](https://github.com/noir-lang/noir/commit/440d94d8149ede5f211437e9405f65b460cfcbf8)) +* Double alias in path ([#6855](https://github.com/noir-lang/noir/issues/6855)) ([82f595b](https://github.com/noir-lang/noir/commit/82f595b960a8fd54bcb5d2a76ea304af5782509b)) +* Git dependency trailing slash ([#6725](https://github.com/noir-lang/noir/issues/6725)) ([df71df7](https://github.com/noir-lang/noir/commit/df71df7e875b40529aa9404d45fd391a8857568a)) +* Implement `as_field` and `from_field` in the interpreter ([#6829](https://github.com/noir-lang/noir/issues/6829)) ([f037c36](https://github.com/noir-lang/noir/commit/f037c36f6bfcb8efb1950e444b50bc3eff28ffc4)) +* Improve type error when indexing a variable of unknown type ([#6744](https://github.com/noir-lang/noir/issues/6744)) ([909b22b](https://github.com/noir-lang/noir/commit/909b22bb20645761aabf8b40622aa79c6a96ed6a)) +* LSP auto-import text indent ([#6699](https://github.com/noir-lang/noir/issues/6699)) ([bbe7564](https://github.com/noir-lang/noir/commit/bbe756414612a37371812ace300e77c309791729)) +* LSP code action wasn't triggering on beginning or end of identifier ([#6616](https://github.com/noir-lang/noir/issues/6616)) ([1b910bc](https://github.com/noir-lang/noir/commit/1b910bc424d0435479b4104d2ed50557fdaf2bea)) +* **LSP:** Use generic self type to narrow down methods to complete ([#6617](https://github.com/noir-lang/noir/issues/6617)) ([454b77b](https://github.com/noir-lang/noir/commit/454b77b3ac4e99b1a272fdc5c36f8babb5781cec)) +* Map entry point indexes after all ssa passes ([#6740](https://github.com/noir-lang/noir/issues/6740)) ([1b6e26b](https://github.com/noir-lang/noir/commit/1b6e26b06ceb12abf92fdd49b70e6e2d10852d3b)) +* Minimal change to avoid reverting entire PR [#6685](https://github.com/noir-lang/noir/issues/6685) ([#6778](https://github.com/noir-lang/noir/issues/6778)) ([0925a33](https://github.com/noir-lang/noir/commit/0925a332dbaa561aad195c143079588158498dad)) +* Optimize array ref counts to copy arrays much less often ([#6685](https://github.com/noir-lang/noir/issues/6685)) ([24cc19e](https://github.com/noir-lang/noir/commit/24cc19ed9f29792c7b056124b2adf87fc6c18e42)) +* Optimizer to keep track of changing opcode locations ([#6781](https://github.com/noir-lang/noir/issues/6781)) ([13c41d2](https://github.com/noir-lang/noir/commit/13c41d21f81fb40cdf2a970be119a83d11da9e03)) +* Parser would hand on function type with colon in it ([#6764](https://github.com/noir-lang/noir/issues/6764)) ([9d7aadc](https://github.com/noir-lang/noir/commit/9d7aadc63c28b2c61d3524902c8b1038a46ba6f0)) +* Prevent hoisting binary instructions which can overflow ([#6672](https://github.com/noir-lang/noir/issues/6672)) ([b4750d8](https://github.com/noir-lang/noir/commit/b4750d8dc13245bad81cbf7bef7010e3794e040a)) +* Print ssa blocks without recursion ([#6715](https://github.com/noir-lang/noir/issues/6715)) ([5ccde81](https://github.com/noir-lang/noir/commit/5ccde8196400a9b99e5c3c4d9af0e3136e72b4cb)) +* Println("{{}}") was printing "{{}}" instead of "{}" ([#6745](https://github.com/noir-lang/noir/issues/6745)) ([36bca82](https://github.com/noir-lang/noir/commit/36bca82c9a25fdb5f1cd657dace11e46e59491c8)) +* Several format string fixes and improvements ([#6703](https://github.com/noir-lang/noir/issues/6703)) ([b70daf4](https://github.com/noir-lang/noir/commit/b70daf423890aa0f885ccf32531fa1583770c23c)) +* **ssa:** Don't deduplicate constraints in blocks that are not dominated ([#6627](https://github.com/noir-lang/noir/issues/6627)) ([b024581](https://github.com/noir-lang/noir/commit/b0245811bfd84e0bf3559aa1e2f37ec52d08691e)) +* **ssa:** Remove RC tracker in DIE ([#6700](https://github.com/noir-lang/noir/issues/6700)) ([f2607fd](https://github.com/noir-lang/noir/commit/f2607fd0eafac0018c157e101c7ebb1fe4223f73)) +* **ssa:** Track all local allocations during flattening ([#6619](https://github.com/noir-lang/noir/issues/6619)) ([6491175](https://github.com/noir-lang/noir/commit/649117570b95b26776150e337c458d478eb48c2e)) +* Typo in u128 docs ([#6711](https://github.com/noir-lang/noir/issues/6711)) ([37a4996](https://github.com/noir-lang/noir/commit/37a4996a7e33b9afe78dcb494f6c3e796d852607)) +* Use correct type for attribute arguments ([#6640](https://github.com/noir-lang/noir/issues/6640)) ([de3e77a](https://github.com/noir-lang/noir/commit/de3e77a4acaab4bd2edc9a9e5226e54f468fd620)) +* Use extension in docs link so it also works on GitHub ([#6787](https://github.com/noir-lang/noir/issues/6787)) ([655a3d3](https://github.com/noir-lang/noir/commit/655a3d3fdcf4f4cdb4381e3ff47d2f822c4b2276)) +* Used signed division for signed modulo ([#6635](https://github.com/noir-lang/noir/issues/6635)) ([dace078](https://github.com/noir-lang/noir/commit/dace07849aa28795abb30b3f9d979ffc6b6487e6)) + + +### Miscellaneous Chores + +* Remove `ec` module from stdlib ([#6612](https://github.com/noir-lang/noir/issues/6612)) ([1e965bc](https://github.com/noir-lang/noir/commit/1e965bc8b9c4222c7b2ad7502df415781308de7f)) +* Remove SchnorrVerify opcode (https://github.com/AztecProtocol/aztec-packages/pull/9897) ([66d3275](https://github.com/noir-lang/noir/commit/66d32751311378701b075ee7b2106d61e531ae4f)) +* **stdlib:** Remove Schnorr ([#6749](https://github.com/noir-lang/noir/issues/6749)) ([57ebee0](https://github.com/noir-lang/noir/commit/57ebee03e00b69d1cc8f541b083b001cd517ec35)) + ## [1.0.0-beta.0](https://github.com/noir-lang/noir/compare/v0.39.0...v1.0.0-beta.0) (2024-11-22) diff --git a/noir/noir-repo/Cargo.lock b/noir/noir-repo/Cargo.lock index bb45ea80517..f8d09d8d39c 100644 --- a/noir/noir-repo/Cargo.lock +++ b/noir/noir-repo/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "acir" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir_field", "base64 0.21.7", @@ -26,12 +26,12 @@ dependencies = [ [[package]] name = "acir_field" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "ark-bls12-381", "ark-bn254", "ark-ff", - "cfg-if 1.0.0", + "cfg-if", "hex", "num-bigint", "proptest", @@ -40,7 +40,7 @@ dependencies = [ [[package]] name = "acvm" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir", "acvm_blackbox_solver", @@ -60,7 +60,7 @@ dependencies = [ [[package]] name = "acvm_blackbox_solver" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir", "blake2", @@ -88,23 +88,23 @@ dependencies = [ "nargo", "paste", "proptest", - "rand 0.8.5", + "rand", "thiserror", - "toml 0.7.8", + "toml", "tracing-appender", "tracing-subscriber", ] [[package]] name = "acvm_js" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "bn254_blackbox_solver", "build-data", "console_error_panic_hook", "const-str", - "getrandom 0.2.15", + "getrandom", "gloo-utils", "js-sys", "pkg-config", @@ -143,8 +143,8 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "cfg-if 1.0.0", - "getrandom 0.2.15", + "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -370,7 +370,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand 0.8.5", + "rand", ] [[package]] @@ -422,7 +422,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138985dd8aefbefeaa66b01b7f5b2b6b4c333fcef1cc5f32c63a2aabe37d6de3" dependencies = [ - "futures 0.3.31", + "futures", "lsp-types 0.94.1", "pin-project-lite", "rustix", @@ -436,6 +436,23 @@ dependencies = [ "waitpid-any", ] +[[package]] +name = "async-trait" +version = "0.1.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.4.0" @@ -450,7 +467,7 @@ checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide 0.7.4", "object", @@ -463,12 +480,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -573,7 +584,7 @@ dependencies = [ "arrayref", "arrayvec", "cc", - "cfg-if 1.0.0", + "cfg-if", "constant_time_eq", ] @@ -595,13 +606,13 @@ dependencies = [ "ff 0.12.1", "group 0.12.1", "pairing", - "rand_core 0.6.4", + "rand_core", "subtle", ] [[package]] name = "bn254_blackbox_solver" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir", "acvm_blackbox_solver", @@ -619,7 +630,7 @@ dependencies = [ [[package]] name = "brillig" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir_field", "serde", @@ -627,7 +638,7 @@ dependencies = [ [[package]] name = "brillig_vm" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir", "acvm_blackbox_solver", @@ -682,38 +693,6 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "cast" version = "0.3.0" @@ -730,10 +709,10 @@ dependencies = [ ] [[package]] -name = "cfg-if" -version = "0.1.10" +name = "cesu8" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfg-if" @@ -869,7 +848,7 @@ checksum = "fc4159b76af02757139baf42c0c971c6dc155330999fbfd8eddb29b97fb2db68" dependencies = [ "codespan-reporting", "lsp-types 0.88.0", - "url 2.5.4", + "url", ] [[package]] @@ -916,6 +895,16 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "comma" version = "1.0.0" @@ -940,7 +929,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen", ] @@ -982,12 +971,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "convert_case" version = "0.6.0" @@ -997,6 +980,16 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1009,7 +1002,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1027,7 +1020,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1113,7 +1106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -1201,12 +1194,12 @@ version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "hashbrown 0.14.5", "lock_api", "once_cell", - "parking_lot_core 0.9.10", + "parking_lot_core", ] [[package]] @@ -1249,19 +1242,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive_more" -version = "0.99.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" -dependencies = [ - "convert_case 0.4.0", - "proc-macro2", - "quote", - "rustc_version", - "syn 2.0.87", -] - [[package]] name = "difflib" version = "0.4.0" @@ -1294,7 +1274,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -1384,7 +1364,7 @@ dependencies = [ "generic-array", "group 0.12.1", "pkcs8", - "rand_core 0.6.4", + "rand_core", "sec1", "subtle", "zeroize", @@ -1495,7 +1475,7 @@ version = "3.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "rustix", "windows-sys 0.48.0", ] @@ -1507,7 +1487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ "bitvec", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -1518,7 +1498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "bitvec", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -1556,7 +1536,7 @@ version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "libredox 0.1.3", "windows-sys 0.59.0", @@ -1601,7 +1581,7 @@ dependencies = [ [[package]] name = "fm" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "codespan-reporting", "iter-extended", @@ -1620,7 +1600,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "percent-encoding 2.3.1", + "percent-encoding", ] [[package]] @@ -1638,12 +1618,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" -[[package]] -name = "futures" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" - [[package]] name = "futures" version = "0.3.31" @@ -1652,7 +1626,6 @@ checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", - "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -1675,18 +1648,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" -[[package]] -name = "futures-executor" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", - "num_cpus", -] - [[package]] name = "futures-io" version = "0.3.31" @@ -1722,7 +1683,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ - "futures 0.1.31", "futures-channel", "futures-core", "futures-io", @@ -1754,27 +1714,16 @@ dependencies = [ "version_check", ] -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - [[package]] name = "getrandom" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] @@ -1835,7 +1784,7 @@ checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ "ff 0.12.1", "memuse", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -1846,17 +1795,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff 0.13.0", - "rand_core 0.6.4", + "rand_core", "subtle", ] +[[package]] +name = "h2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap 2.6.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crunchy", ] @@ -1879,7 +1847,7 @@ dependencies = [ "ff 0.12.1", "group 0.12.1", "pasta_curves 0.4.1", - "rand_core 0.6.4", + "rand_core", "rayon", ] @@ -1960,9 +1928,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.12" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -1971,12 +1939,24 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", + "futures-util", "http", + "http-body", "pin-project-lite", ] @@ -1994,25 +1974,60 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.31" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", + "h2", "http", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "log", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", "socket2", "tokio", "tower-service", "tracing", - "want", ] [[package]] @@ -2168,17 +2183,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.3" @@ -2223,7 +2227,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" dependencies = [ "bitmaps", - "rand_core 0.6.4", + "rand_core", "rand_xoshiro", "serde", "sized-chunks", @@ -2326,15 +2330,6 @@ dependencies = [ "libc", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if 1.0.0", -] - [[package]] name = "is-terminal" version = "0.4.13" @@ -2354,7 +2349,7 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "iter-extended" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" [[package]] name = "itertools" @@ -2372,126 +2367,147 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] -name = "js-sys" -version = "0.3.63" +name = "jni" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" dependencies = [ - "wasm-bindgen", + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", ] [[package]] -name = "jsonrpc" -version = "0.16.0" +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "js-sys" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34efde8d2422fb79ed56db1d3aea8fa5b583351d15a26770cdee2f88813dd702" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ - "base64 0.13.1", - "minreq", - "serde", - "serde_json", + "wasm-bindgen", ] [[package]] -name = "jsonrpc-client-transports" -version = "18.0.0" +name = "jsonrpsee" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b99d4207e2a04fb4581746903c2bb7eb376f88de9c699d0f3e10feeac0cd3a" +checksum = "c5c71d8c1a731cc4227c2f698d377e7848ca12c8a48866fc5e6951c43a4db843" dependencies = [ - "derive_more", - "futures 0.3.31", - "jsonrpc-core", - "jsonrpc-pubsub", - "log", - "serde", - "serde_json", - "url 1.7.2", + "jsonrpsee-core", + "jsonrpsee-http-client", + "jsonrpsee-proc-macros", + "jsonrpsee-server", + "jsonrpsee-types", + "tokio", + "tracing", ] [[package]] -name = "jsonrpc-core" -version = "18.0.0" +name = "jsonrpsee-core" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" +checksum = "f2882f6f8acb9fdaec7cefc4fd607119a9bd709831df7d7672a1d3b644628280" dependencies = [ - "futures 0.3.31", - "futures-executor", + "async-trait", + "bytes", "futures-util", - "log", + "http", + "http-body", + "http-body-util", + "jsonrpsee-types", + "parking_lot", + "rand", + "rustc-hash 2.1.0", "serde", - "serde_derive", "serde_json", + "thiserror", + "tokio", + "tracing", ] [[package]] -name = "jsonrpc-core-client" -version = "18.0.0" +name = "jsonrpsee-http-client" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b51da17abecbdab3e3d4f26b01c5ec075e88d3abe3ab3b05dc9aa69392764ec0" +checksum = "b3638bc4617f96675973253b3a45006933bde93c2fd8a6170b33c777cc389e5b" dependencies = [ - "futures 0.3.31", - "jsonrpc-client-transports", + "async-trait", + "base64 0.22.1", + "http-body", + "hyper", + "hyper-rustls", + "hyper-util", + "jsonrpsee-core", + "jsonrpsee-types", + "rustls", + "rustls-platform-verifier", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", ] [[package]] -name = "jsonrpc-derive" -version = "18.0.0" +name = "jsonrpsee-proc-macros" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b939a78fa820cdfcb7ee7484466746a7377760970f6f9c6fe19f9edcc8a38d2" +checksum = "c06c01ae0007548e73412c08e2285ffe5d723195bf268bce67b1b77c3bb2a14d" dependencies = [ + "heck 0.5.0", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.87", ] [[package]] -name = "jsonrpc-http-server" -version = "18.0.0" +name = "jsonrpsee-server" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff" +checksum = "82ad8ddc14be1d4290cd68046e7d1d37acd408efed6d3ca08aefcc3ad6da069c" dependencies = [ - "futures 0.3.31", + "futures-util", + "http", + "http-body", + "http-body-util", "hyper", - "jsonrpc-core", - "jsonrpc-server-utils", - "log", - "net2", - "parking_lot 0.11.2", - "unicase", -] - -[[package]] -name = "jsonrpc-pubsub" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240f87695e6c6f62fb37f05c02c04953cf68d6408b8c1c89de85c7a0125b1011" -dependencies = [ - "futures 0.3.31", - "jsonrpc-core", - "lazy_static", - "log", - "parking_lot 0.11.2", - "rand 0.7.3", + "hyper-util", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "route-recognizer", "serde", + "serde_json", + "soketto", + "thiserror", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tracing", ] [[package]] -name = "jsonrpc-server-utils" -version = "18.0.0" +name = "jsonrpsee-types" +version = "0.24.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4fdea130485b572c39a460d50888beb00afb3e35de23ccd7fad8ff19f0e0d4" +checksum = "a178c60086f24cc35bb82f57c651d0d25d99c4742b4d335de04e97fa1f08a8a1" dependencies = [ - "bytes", - "futures 0.3.31", - "globset", - "jsonrpc-core", - "lazy_static", - "log", - "tokio", - "tokio-stream", - "tokio-util 0.6.10", - "unicase", + "http", + "serde", + "serde_json", + "thiserror", ] [[package]] @@ -2504,7 +2520,7 @@ dependencies = [ "bls12_381", "ff 0.12.1", "group 0.12.1", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -2514,7 +2530,7 @@ version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa", "elliptic-curve", "sha2", @@ -2657,7 +2673,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "url 2.5.4", + "url", ] [[package]] @@ -2670,7 +2686,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "url 2.5.4", + "url", ] [[package]] @@ -2682,12 +2698,6 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "memchr" version = "2.7.4" @@ -2736,17 +2746,6 @@ dependencies = [ "adler2", ] -[[package]] -name = "minreq" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763d142cdff44aaadd9268bebddb156ef6c65a0e13486bb81673cf2d8739f9b0" -dependencies = [ - "log", - "serde", - "serde_json", -] - [[package]] name = "mio" version = "0.8.11" @@ -2755,7 +2754,7 @@ checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -2767,22 +2766,18 @@ checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi 0.3.9", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.52.0", ] [[package]] name = "nargo" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "fm", "iter-extended", - "jsonrpc", - "jsonrpc-core", - "jsonrpc-core-client", - "jsonrpc-derive", - "jsonrpc-http-server", + "jsonrpsee", "noir_fuzzer", "noirc_abi", "noirc_driver", @@ -2790,17 +2785,19 @@ dependencies = [ "noirc_frontend", "noirc_printable_type", "proptest", - "rand 0.8.5", + "rand", "rayon", "serde", + "serde_json", "thiserror", + "tokio", "tracing", "walkdir", ] [[package]] name = "nargo_cli" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "ark-bn254", @@ -2850,12 +2847,11 @@ dependencies = [ "tempfile", "termcolor", "termion", - "test-binary", "test-case", "thiserror", "tokio", - "tokio-util 0.7.12", - "toml 0.7.8", + "tokio-util", + "toml", "tower", "tracing-appender", "tracing-subscriber", @@ -2863,18 +2859,18 @@ dependencies = [ [[package]] name = "nargo_fmt" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "noirc_frontend", "serde", "similar-asserts", "thiserror", - "toml 0.7.8", + "toml", ] [[package]] name = "nargo_toml" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "dirs", "fm", @@ -2886,19 +2882,8 @@ dependencies = [ "tempfile", "test-case", "thiserror", - "toml 0.7.8", - "url 2.5.4", -] - -[[package]] -name = "net2" -version = "0.2.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi", + "toml", + "url", ] [[package]] @@ -2918,7 +2903,7 @@ checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" dependencies = [ "bitflags 1.3.2", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", ] @@ -2931,7 +2916,7 @@ checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ "autocfg", "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", "pin-utils", @@ -2944,13 +2929,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "libc", ] [[package]] name = "noir_debugger" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "assert_cmd", @@ -2974,13 +2959,13 @@ dependencies = [ [[package]] name = "noir_fuzzer" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "noirc_abi", "noirc_artifacts", "proptest", - "rand 0.8.5", + "rand", ] [[package]] @@ -2997,12 +2982,12 @@ dependencies = [ [[package]] name = "noir_lsp" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "async-lsp", "codespan-lsp", - "convert_case 0.6.0", + "convert_case", "fm", "fxhash", "lsp-types 0.94.1", @@ -3024,7 +3009,7 @@ dependencies = [ [[package]] name = "noir_profiler" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acir", "bn254_blackbox_solver", @@ -3050,13 +3035,13 @@ dependencies = [ [[package]] name = "noir_wasm" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "build-data", "console_error_panic_hook", "fm", - "getrandom 0.2.15", + "getrandom", "gloo-utils", "js-sys", "nargo", @@ -3074,7 +3059,7 @@ dependencies = [ [[package]] name = "noirc_abi" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "iter-extended", @@ -3088,17 +3073,17 @@ dependencies = [ "strum", "strum_macros", "thiserror", - "toml 0.7.8", + "toml", ] [[package]] name = "noirc_abi_wasm" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "build-data", "console_error_panic_hook", - "getrandom 0.2.15", + "getrandom", "gloo-utils", "iter-extended", "js-sys", @@ -3110,11 +3095,11 @@ dependencies = [ [[package]] name = "noirc_arena" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" [[package]] name = "noirc_artifacts" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "codespan-reporting", @@ -3129,7 +3114,7 @@ dependencies = [ [[package]] name = "noirc_driver" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "build-data", @@ -3148,7 +3133,7 @@ dependencies = [ [[package]] name = "noirc_errors" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "base64 0.21.7", @@ -3165,11 +3150,11 @@ dependencies = [ [[package]] name = "noirc_evaluator" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "bn254_blackbox_solver", - "cfg-if 1.0.0", + "cfg-if", "chrono", "fxhash", "im", @@ -3193,12 +3178,12 @@ dependencies = [ [[package]] name = "noirc_frontend" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", "base64 0.21.7", "bn254_blackbox_solver", - "cfg-if 1.0.0", + "cfg-if", "fm", "im", "iter-extended", @@ -3211,7 +3196,7 @@ dependencies = [ "proptest", "proptest-derive 0.5.0", "rangemap", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "small-ord-set", @@ -3224,14 +3209,10 @@ dependencies = [ [[package]] name = "noirc_printable_type" -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" dependencies = [ "acvm", - "iter-extended", - "jsonrpc", "serde", - "serde_json", - "thiserror", ] [[package]] @@ -3269,7 +3250,7 @@ dependencies = [ "file-id", "log", "notify", - "parking_lot 0.12.3", + "parking_lot", "walkdir", ] @@ -3328,16 +3309,6 @@ dependencies = [ "libm", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - [[package]] name = "numtoa" version = "0.1.0" @@ -3365,6 +3336,12 @@ version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + [[package]] name = "overload" version = "0.1.1" @@ -3397,17 +3374,6 @@ dependencies = [ "group 0.12.1", ] -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -3415,21 +3381,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -3438,7 +3390,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.5.7", "smallvec", @@ -3455,7 +3407,7 @@ dependencies = [ "ff 0.12.1", "group 0.12.1", "lazy_static", - "rand 0.8.5", + "rand", "static_assertions", "subtle", ] @@ -3470,7 +3422,7 @@ dependencies = [ "ff 0.13.0", "group 0.13.0", "lazy_static", - "rand 0.8.5", + "rand", "static_assertions", "subtle", ] @@ -3481,12 +3433,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - [[package]] name = "percent-encoding" version = "2.3.1" @@ -3521,7 +3467,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" dependencies = [ "phf_shared", - "rand 0.8.5", + "rand", ] [[package]] @@ -3547,6 +3493,26 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pin-project" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -3617,7 +3583,7 @@ checksum = "ebbe2f8898beba44815fdc9e5a4ae9c929e21c5dc29b0c774a15555f7f58d6d0" dependencies = [ "aligned-vec", "backtrace", - "cfg-if 1.0.0", + "cfg-if", "criterion", "findshlibs", "inferno", @@ -3625,7 +3591,7 @@ dependencies = [ "log", "nix 0.26.4", "once_cell", - "parking_lot 0.12.3", + "parking_lot", "smallvec", "symbolic-demangle", "tempfile", @@ -3698,11 +3664,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "0.1.5" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml 0.5.11", + "toml_edit 0.22.22", ] [[package]] @@ -3731,8 +3697,8 @@ dependencies = [ "bitflags 2.6.0", "lazy_static", "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rand_xorshift", "regex-syntax 0.8.5", "rusty-fork", @@ -3802,19 +3768,6 @@ dependencies = [ "nibble_vec", ] -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -3822,18 +3775,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", ] [[package]] @@ -3843,16 +3786,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", + "rand_core", ] [[package]] @@ -3861,16 +3795,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", + "getrandom", ] [[package]] @@ -3879,7 +3804,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -3888,7 +3813,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" dependencies = [ - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -3917,15 +3842,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -3956,7 +3872,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.15", + "getrandom", "libredox 0.1.3", "thiserror", ] @@ -4038,6 +3954,27 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + [[package]] name = "rust-embed" version = "6.8.1" @@ -4084,6 +4021,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" + [[package]] name = "rustc_version" version = "0.4.1" @@ -4106,6 +4049,87 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.23.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" + +[[package]] +name = "rustls-platform-verifier" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-roots", + "winapi", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.18" @@ -4131,7 +4155,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db7826789c0e25614b03e5a54a0717a86f9ff6e6e5247f92b369472869320039" dependencies = [ "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "clipboard-win", "dirs-next", "fd-lock", @@ -4226,6 +4250,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -4252,14 +4285,35 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "core-foundation-sys", + "libc", + "num-bigint", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" -dependencies = [ - "serde", -] [[package]] name = "serde" @@ -4377,13 +4431,24 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha2" version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest", ] @@ -4426,7 +4491,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ "digest", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -4517,6 +4582,22 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "soketto" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e859df029d160cb88608f5d7df7fb4753fd20fdfb4de5644f3d8b8440841721" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures", + "http", + "httparse", + "log", + "rand", + "sha1", +] + [[package]] name = "spin" version = "0.9.8" @@ -4656,7 +4737,7 @@ version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "once_cell", "rustix", @@ -4701,19 +4782,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" -[[package]] -name = "test-binary" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c7cb854285c40b61c0fade358bf63a2bb1226688a1ea11432ea65349209e6e3" -dependencies = [ - "camino", - "cargo_metadata", - "once_cell", - "paste", - "thiserror", -] - [[package]] name = "test-case" version = "3.3.1" @@ -4729,7 +4797,7 @@ version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "proc-macro2", "quote", "syn 2.0.87", @@ -4794,7 +4862,7 @@ version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -4849,26 +4917,11 @@ dependencies = [ "serde_json", ] -[[package]] -name = "tinyvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -4892,28 +4945,25 @@ dependencies = [ ] [[package]] -name = "tokio-stream" -version = "0.1.16" +name = "tokio-rustls" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "futures-core", - "pin-project-lite", + "rustls", "tokio", ] [[package]] -name = "tokio-util" -version = "0.6.10" +name = "tokio-stream" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ - "bytes", "futures-core", - "futures-sink", - "log", "pin-project-lite", "tokio", + "tokio-util", ] [[package]] @@ -4930,15 +4980,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "toml" version = "0.7.8" @@ -4948,7 +4989,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.19.15", ] [[package]] @@ -4970,7 +5011,18 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap 2.6.0", + "toml_datetime", + "winnow 0.6.20", ] [[package]] @@ -4979,6 +5031,10 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", "tower-layer", "tower-service", "tracing", @@ -5141,18 +5197,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" -[[package]] -name = "unicase" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" - -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - [[package]] name = "unicode-ident" version = "1.0.13" @@ -5165,15 +5209,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-segmentation" version = "1.12.0" @@ -5193,15 +5228,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] -name = "url" -version = "1.7.2" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", -] +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" @@ -5210,8 +5240,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 1.0.3", - "percent-encoding 2.3.1", + "idna", + "percent-encoding", "serde", ] @@ -5289,12 +5319,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -5307,7 +5331,7 @@ version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "serde", "serde_json", "wasm-bindgen-macro", @@ -5334,7 +5358,7 @@ version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -5403,6 +5427,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "winapi" version = "0.3.9" @@ -5600,6 +5633,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +] + [[package]] name = "write16" version = "1.0.0" @@ -5741,7 +5783,7 @@ dependencies = [ "blake2", "bls12_381", "byteorder", - "cfg-if 1.0.0", + "cfg-if", "group 0.12.1", "group 0.13.0", "halo2", @@ -5749,7 +5791,7 @@ dependencies = [ "jubjub", "lazy_static", "pasta_curves 0.5.1", - "rand 0.8.5", + "rand", "serde", "sha2", "sha3", diff --git a/noir/noir-repo/Cargo.toml b/noir/noir-repo/Cargo.toml index 0acee2a040b..53a28b8002d 100644 --- a/noir/noir-repo/Cargo.toml +++ b/noir/noir-repo/Cargo.toml @@ -40,7 +40,7 @@ resolver = "2" [workspace.package] # x-release-please-start-version -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" # x-release-please-end authors = ["The Noir Team "] edition = "2021" @@ -57,13 +57,13 @@ unused_qualifications = "warn" [workspace.dependencies] # ACVM workspace dependencies -acir_field = { version = "1.0.0-beta.0", path = "acvm-repo/acir_field", default-features = false } -acir = { version = "1.0.0-beta.0", path = "acvm-repo/acir", default-features = false } -acvm = { version = "1.0.0-beta.0", path = "acvm-repo/acvm" } -brillig = { version = "1.0.0-beta.0", path = "acvm-repo/brillig", default-features = false } -brillig_vm = { version = "1.0.0-beta.0", path = "acvm-repo/brillig_vm", default-features = false } -acvm_blackbox_solver = { version = "1.0.0-beta.0", path = "acvm-repo/blackbox_solver", default-features = false } -bn254_blackbox_solver = { version = "1.0.0-beta.0", path = "acvm-repo/bn254_blackbox_solver", default-features = false } +acir_field = { version = "1.0.0-beta.1", path = "acvm-repo/acir_field", default-features = false } +acir = { version = "1.0.0-beta.1", path = "acvm-repo/acir", default-features = false } +acvm = { version = "1.0.0-beta.1", path = "acvm-repo/acvm" } +brillig = { version = "1.0.0-beta.1", path = "acvm-repo/brillig", default-features = false } +brillig_vm = { version = "1.0.0-beta.1", path = "acvm-repo/brillig_vm", default-features = false } +acvm_blackbox_solver = { version = "1.0.0-beta.1", path = "acvm-repo/blackbox_solver", default-features = false } +bn254_blackbox_solver = { version = "1.0.0-beta.1", path = "acvm-repo/bn254_blackbox_solver", default-features = false } # Noir compiler workspace dependencies fm = { path = "compiler/fm" } @@ -148,7 +148,7 @@ num-traits = "0.2" similar-asserts = "1.5.0" tempfile = "3.6.0" test-case = "3.3.1" -jsonrpc = { version = "0.16.0", features = ["minreq_http"] } +jsonrpsee = { version = "0.24.7", features = ["client-core"] } flate2 = "1.0.24" color-eyre = "0.6.2" rand = "0.8.5" @@ -159,7 +159,7 @@ sha2 = { version = "0.10.6", features = ["compress"] } sha3 = "0.10.6" strum = "0.24" strum_macros = "0.24" - +tokio = "1.42" im = { version = "15.1", features = ["serde"] } tracing = "0.1.40" tracing-web = "0.1.3" diff --git a/noir/noir-repo/acvm-repo/acir/Cargo.toml b/noir/noir-repo/acvm-repo/acir/Cargo.toml index 8139a58eefc..d7ff0a085f0 100644 --- a/noir/noir-repo/acvm-repo/acir/Cargo.toml +++ b/noir/noir-repo/acvm-repo/acir/Cargo.toml @@ -2,7 +2,7 @@ name = "acir" description = "ACIR is the IR that the VM processes, it is analogous to LLVM IR" # x-release-please-start-version -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" # x-release-please-end authors.workspace = true edition.workspace = true diff --git a/noir/noir-repo/acvm-repo/acir_field/Cargo.toml b/noir/noir-repo/acvm-repo/acir_field/Cargo.toml index 039aefe355e..f9ae3a4ea3f 100644 --- a/noir/noir-repo/acvm-repo/acir_field/Cargo.toml +++ b/noir/noir-repo/acvm-repo/acir_field/Cargo.toml @@ -2,7 +2,7 @@ name = "acir_field" description = "The field implementation being used by ACIR." # x-release-please-start-version -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" # x-release-please-end authors.workspace = true edition.workspace = true diff --git a/noir/noir-repo/acvm-repo/acvm/Cargo.toml b/noir/noir-repo/acvm-repo/acvm/Cargo.toml index ba01ac8ec16..4f80971b557 100644 --- a/noir/noir-repo/acvm-repo/acvm/Cargo.toml +++ b/noir/noir-repo/acvm-repo/acvm/Cargo.toml @@ -2,7 +2,7 @@ name = "acvm" description = "The virtual machine that processes ACIR given a backend/proof system." # x-release-please-start-version -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" # x-release-please-end authors.workspace = true edition.workspace = true diff --git a/noir/noir-repo/acvm-repo/acvm_js/Cargo.toml b/noir/noir-repo/acvm-repo/acvm_js/Cargo.toml index bd536817428..a69c5e2adec 100644 --- a/noir/noir-repo/acvm-repo/acvm_js/Cargo.toml +++ b/noir/noir-repo/acvm-repo/acvm_js/Cargo.toml @@ -2,7 +2,7 @@ name = "acvm_js" description = "Typescript wrapper around the ACVM allowing execution of ACIR code" # x-release-please-start-version -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" # x-release-please-end authors.workspace = true edition.workspace = true diff --git a/noir/noir-repo/acvm-repo/acvm_js/package.json b/noir/noir-repo/acvm-repo/acvm_js/package.json index 904263b5e27..85fcfd7adfb 100644 --- a/noir/noir-repo/acvm-repo/acvm_js/package.json +++ b/noir/noir-repo/acvm-repo/acvm_js/package.json @@ -1,6 +1,6 @@ { "name": "@noir-lang/acvm_js", - "version": "1.0.0-beta.0", + "version": "1.0.0-beta.1", "publishConfig": { "access": "public" }, diff --git a/noir/noir-repo/acvm-repo/blackbox_solver/Cargo.toml b/noir/noir-repo/acvm-repo/blackbox_solver/Cargo.toml index fe3a938c503..532f6f2c54f 100644 --- a/noir/noir-repo/acvm-repo/blackbox_solver/Cargo.toml +++ b/noir/noir-repo/acvm-repo/blackbox_solver/Cargo.toml @@ -2,7 +2,7 @@ name = "acvm_blackbox_solver" description = "A solver for the blackbox functions found in ACIR and Brillig" # x-release-please-start-version -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" # x-release-please-end authors.workspace = true edition.workspace = true diff --git a/noir/noir-repo/acvm-repo/bn254_blackbox_solver/Cargo.toml b/noir/noir-repo/acvm-repo/bn254_blackbox_solver/Cargo.toml index 825a0ef0481..ca6f7c22408 100644 --- a/noir/noir-repo/acvm-repo/bn254_blackbox_solver/Cargo.toml +++ b/noir/noir-repo/acvm-repo/bn254_blackbox_solver/Cargo.toml @@ -2,7 +2,7 @@ name = "bn254_blackbox_solver" description = "Solvers for black box functions which are specific for the bn254 curve" # x-release-please-start-version -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" # x-release-please-end authors.workspace = true edition.workspace = true diff --git a/noir/noir-repo/acvm-repo/brillig/Cargo.toml b/noir/noir-repo/acvm-repo/brillig/Cargo.toml index 9cc724f2b11..0d52b4b05ed 100644 --- a/noir/noir-repo/acvm-repo/brillig/Cargo.toml +++ b/noir/noir-repo/acvm-repo/brillig/Cargo.toml @@ -2,7 +2,7 @@ name = "brillig" description = "Brillig is the bytecode ACIR uses for non-determinism." # x-release-please-start-version -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" # x-release-please-end authors.workspace = true edition.workspace = true diff --git a/noir/noir-repo/acvm-repo/brillig_vm/Cargo.toml b/noir/noir-repo/acvm-repo/brillig_vm/Cargo.toml index 8225244f9a7..41d845f0d9e 100644 --- a/noir/noir-repo/acvm-repo/brillig_vm/Cargo.toml +++ b/noir/noir-repo/acvm-repo/brillig_vm/Cargo.toml @@ -2,7 +2,7 @@ name = "brillig_vm" description = "The virtual machine that processes Brillig bytecode, used to introduce non-determinism to the ACVM" # x-release-please-start-version -version = "1.0.0-beta.0" +version = "1.0.0-beta.1" # x-release-please-end authors.workspace = true edition.workspace = true diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/acir/mod.rs b/noir/noir-repo/compiler/noirc_evaluator/src/acir/mod.rs index 95e0dd12132..a82c54d8ce6 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/acir/mod.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/acir/mod.rs @@ -788,6 +788,7 @@ impl<'a> Context<'a> { let result = dfg.instruction_results(instruction_id)[0]; self.ssa_values.insert(result, value); } + Instruction::Noop => (), } self.acir_context.set_call_stack(CallStack::new()); diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs b/noir/noir-repo/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs index 5bcddc21275..66cc213a986 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/brillig/brillig_gen/brillig_block.rs @@ -837,6 +837,7 @@ impl<'block> BrilligBlock<'block> { self.brillig_context.deallocate_register(items_pointer); } } + Instruction::Noop => (), }; let dead_variables = self diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/checks/check_for_underconstrained_values.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/checks/check_for_underconstrained_values.rs index 2f167ec8ab3..106b01833cd 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/checks/check_for_underconstrained_values.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/checks/check_for_underconstrained_values.rs @@ -365,6 +365,7 @@ impl DependencyContext { | Instruction::DecrementRc { .. } | Instruction::EnableSideEffectsIf { .. } | Instruction::IncrementRc { .. } + | Instruction::Noop | Instruction::MakeArray { .. } => {} } } @@ -626,6 +627,7 @@ impl Context { | Instruction::DecrementRc { .. } | Instruction::EnableSideEffectsIf { .. } | Instruction::IncrementRc { .. } + | Instruction::Noop | Instruction::RangeCheck { .. } => {} } } diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/dfg.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/dfg.rs index 9ccf7f11512..902ff0775a9 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/dfg.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/dfg.rs @@ -448,6 +448,13 @@ impl DataFlowGraph { self.results.get(&instruction_id).expect("expected a list of Values").as_slice() } + /// Remove an instruction by replacing it with a `Noop` instruction. + /// Doing this avoids shifting over each instruction after this one in its block's instructions vector. + pub(crate) fn remove_instruction(&mut self, instruction: InstructionId) { + self.instructions[instruction] = Instruction::Noop; + self.results.insert(instruction, smallvec::SmallVec::new()); + } + /// Add a parameter to the given block pub(crate) fn add_block_parameter(&mut self, block_id: BasicBlockId, typ: Type) -> ValueId { let block = &mut self.blocks[block_id]; diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/instruction.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/instruction.rs index 5d9bfc89f61..0c8d8affeb1 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/instruction.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/instruction.rs @@ -22,7 +22,7 @@ use super::{ value::{Value, ValueId}, }; -mod binary; +pub(crate) mod binary; mod call; mod cast; mod constrain; @@ -335,6 +335,14 @@ pub(crate) enum Instruction { /// `typ` should be an array or slice type with an element type /// matching each of the `elements` values' types. MakeArray { elements: im::Vector, typ: Type }, + + /// A No-op instruction. These are intended to replace other instructions in a block's + /// instructions vector without having to move each instruction afterward. + /// + /// A No-op has no results and is always removed when Instruction::simplify is called. + /// When replacing another instruction, the instruction's results should always be mapped to a + /// new value since they will not be able to refer to their original instruction value any more. + Noop, } impl Instruction { @@ -360,6 +368,7 @@ impl Instruction { | Instruction::IncrementRc { .. } | Instruction::DecrementRc { .. } | Instruction::RangeCheck { .. } + | Instruction::Noop | Instruction::EnableSideEffectsIf { .. } => InstructionResultType::None, Instruction::Allocate { .. } | Instruction::Load { .. } @@ -399,7 +408,7 @@ impl Instruction { Constrain(..) | RangeCheck { .. } => true, // This should never be side-effectful - MakeArray { .. } => false, + MakeArray { .. } | Noop => false, // Some binary math can overflow or underflow Binary(binary) => match binary.operator { @@ -460,6 +469,10 @@ impl Instruction { // We can deduplicate these instructions if we know the predicate is also the same. Constrain(..) | RangeCheck { .. } => deduplicate_with_predicate, + // Noop instructions can always be deduplicated, although they're more likely to be + // removed entirely. + Noop => true, + // Arrays can be mutated in unconstrained code so code that handles this case must // take care to track whether the array was possibly mutated or not before // deduplicating. Since we don't know if the containing pass checks for this, we @@ -504,6 +517,7 @@ impl Instruction { | ArrayGet { .. } | IfElse { .. } | ArraySet { .. } + | Noop | MakeArray { .. } => true, // Store instructions must be removed by DIE in acir code, any load @@ -594,6 +608,7 @@ impl Instruction { | Instruction::IfElse { .. } | Instruction::IncrementRc { .. } | Instruction::DecrementRc { .. } + | Instruction::Noop | Instruction::MakeArray { .. } => false, } } @@ -673,6 +688,7 @@ impl Instruction { elements: elements.iter().copied().map(f).collect(), typ: typ.clone(), }, + Instruction::Noop => Instruction::Noop, } } @@ -737,6 +753,7 @@ impl Instruction { *element = f(*element); } } + Instruction::Noop => (), } } @@ -802,6 +819,7 @@ impl Instruction { f(*element); } } + Instruction::Noop => (), } } @@ -1035,6 +1053,7 @@ impl Instruction { } } Instruction::MakeArray { .. } => None, + Instruction::Noop => Remove, } } } diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/instruction/binary.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/instruction/binary.rs index 81f2f3b1e01..ce65343c7ef 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/instruction/binary.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/instruction/binary.rs @@ -294,7 +294,7 @@ impl Binary { } /// Evaluate a binary operation with constant arguments. -fn eval_constant_binary_op( +pub(crate) fn eval_constant_binary_op( lhs: FieldElement, rhs: FieldElement, operator: BinaryOp, diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/printer.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/printer.rs index 29e79728303..322639a03d2 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/printer.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/ir/printer.rs @@ -235,6 +235,7 @@ fn display_instruction_inner( writeln!(f, "] : {typ}") } + Instruction::Noop => writeln!(f, "no-op"), } } diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs index aec172dddcd..cbaacf1d70e 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg.rs @@ -818,13 +818,10 @@ mod test { use acvm::acir::AcirField; use crate::ssa::{ - function_builder::FunctionBuilder, ir::{ dfg::DataFlowGraph, function::Function, - instruction::{BinaryOp, Instruction, TerminatorInstruction}, - map::Id, - types::Type, + instruction::{Instruction, TerminatorInstruction}, value::{Value, ValueId}, }, opt::assert_normalized_ssa_equals, @@ -1337,104 +1334,50 @@ mod test { // Regression test for #1826. Ensures the `else` branch does not see the stores of the // `then` branch. // - // fn main f1 { - // b0(): - // v0 = allocate - // store Field 0 at v0 - // v2 = allocate - // store Field 2 at v2 - // v4 = load v2 - // v5 = lt v4, Field 2 - // jmpif v5 then: b1, else: b2 - // b1(): - // v24 = load v0 - // v25 = load v2 - // v26 = mul v25, Field 10 - // v27 = add v24, v26 - // store v27 at v0 - // v28 = load v2 - // v29 = add v28, Field 1 - // store v29 at v2 - // jmp b5() - // b5(): - // v14 = load v0 - // return v14 - // b2(): - // v6 = load v2 - // v8 = lt v6, Field 4 - // jmpif v8 then: b3, else: b4 - // b3(): - // v16 = load v0 - // v17 = load v2 - // v19 = mul v17, Field 100 - // v20 = add v16, v19 - // store v20 at v0 - // v21 = load v2 - // v23 = add v21, Field 1 - // store v23 at v2 - // jmp b4() - // b4(): - // jmp b5() - // } - let main_id = Id::test_new(0); - let mut builder = FunctionBuilder::new("main".into(), main_id); - - let b1 = builder.insert_block(); - let b2 = builder.insert_block(); - let b3 = builder.insert_block(); - let b4 = builder.insert_block(); - let b5 = builder.insert_block(); - - let zero = builder.field_constant(0u128); - let one = builder.field_constant(1u128); - let two = builder.field_constant(2u128); - let four = builder.field_constant(4u128); - let ten = builder.field_constant(10u128); - let one_hundred = builder.field_constant(100u128); - - let v0 = builder.insert_allocate(Type::field()); - builder.insert_store(v0, zero); - let v2 = builder.insert_allocate(Type::field()); - builder.insert_store(v2, two); - let v4 = builder.insert_load(v2, Type::field()); - let v5 = builder.insert_binary(v4, BinaryOp::Lt, two); - builder.terminate_with_jmpif(v5, b1, b2); - - builder.switch_to_block(b1); - let v24 = builder.insert_load(v0, Type::field()); - let v25 = builder.insert_load(v2, Type::field()); - let v26 = builder.insert_binary(v25, BinaryOp::Mul, ten); - let v27 = builder.insert_binary(v24, BinaryOp::Add, v26); - builder.insert_store(v0, v27); - let v28 = builder.insert_load(v2, Type::field()); - let v29 = builder.insert_binary(v28, BinaryOp::Add, one); - builder.insert_store(v2, v29); - builder.terminate_with_jmp(b5, vec![]); - - builder.switch_to_block(b5); - let v14 = builder.insert_load(v0, Type::field()); - builder.terminate_with_return(vec![v14]); - - builder.switch_to_block(b2); - let v6 = builder.insert_load(v2, Type::field()); - let v8 = builder.insert_binary(v6, BinaryOp::Lt, four); - builder.terminate_with_jmpif(v8, b3, b4); - - builder.switch_to_block(b3); - let v16 = builder.insert_load(v0, Type::field()); - let v17 = builder.insert_load(v2, Type::field()); - let v19 = builder.insert_binary(v17, BinaryOp::Mul, one_hundred); - let v20 = builder.insert_binary(v16, BinaryOp::Add, v19); - builder.insert_store(v0, v20); - let v21 = builder.insert_load(v2, Type::field()); - let v23 = builder.insert_binary(v21, BinaryOp::Add, one); - builder.insert_store(v2, v23); - builder.terminate_with_jmp(b4, vec![]); - - builder.switch_to_block(b4); - builder.terminate_with_jmp(b5, vec![]); - - let ssa = builder.finish().flatten_cfg().mem2reg().fold_constants(); + let src = " + acir(inline) fn main f0 { + b0(): + v0 = allocate -> &mut Field + store Field 0 at v0 + v2 = allocate -> &mut Field + store Field 2 at v2 + v4 = load v2 -> Field + v5 = lt v4, Field 2 + jmpif v5 then: b4, else: b1 + b1(): + v6 = load v2 -> Field + v8 = lt v6, Field 4 + jmpif v8 then: b2, else: b3 + b2(): + v9 = load v0 -> Field + v10 = load v2 -> Field + v12 = mul v10, Field 100 + v13 = add v9, v12 + store v13 at v0 + v14 = load v2 -> Field + v16 = add v14, Field 1 + store v16 at v2 + jmp b3() + b3(): + jmp b5() + b4(): + v17 = load v0 -> Field + v18 = load v2 -> Field + v20 = mul v18, Field 10 + v21 = add v17, v20 + store v21 at v0 + v22 = load v2 -> Field + v23 = add v22, Field 1 + store v23 at v2 + jmp b5() + b5(): + v24 = load v0 -> Field + return v24 + }"; + + let ssa = Ssa::from_str(src).unwrap(); + + let ssa = ssa.flatten_cfg().mem2reg().fold_constants(); let main = ssa.main(); @@ -1451,6 +1394,18 @@ mod test { } _ => unreachable!("Should have terminator instruction"), } + + let expected = " + acir(inline) fn main f0 { + b0(): + v0 = allocate -> &mut Field + v1 = allocate -> &mut Field + enable_side_effects u1 1 + return Field 200 + } + "; + + assert_normalized_ssa_equals(ssa, expected); } #[test] diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/inlining.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/inlining.rs index 11201fc8f85..36955480728 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/inlining.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/inlining.rs @@ -458,6 +458,7 @@ impl<'function> PerFunctionContext<'function> { /// and blocks respectively. If these assertions trigger it means a value is being used before /// the instruction or block that defines the value is inserted. fn translate_value(&mut self, id: ValueId) -> ValueId { + let id = self.source_function.dfg.resolve(id); if let Some(value) = self.values.get(&id) { return *value; } diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/loop_invariant.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/loop_invariant.rs index c188ed1f80f..0a3c18c1b1e 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/loop_invariant.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/loop_invariant.rs @@ -15,7 +15,7 @@ use crate::ssa::{ basic_block::BasicBlockId, function::Function, function_inserter::FunctionInserter, - instruction::{Instruction, InstructionId}, + instruction::{binary::eval_constant_binary_op, BinaryOp, Instruction, InstructionId}, types::Type, value::ValueId, }, @@ -207,6 +207,7 @@ impl<'f> LoopInvariantContext<'f> { let can_be_deduplicated = instruction.can_be_deduplicated(self.inserter.function, false) || matches!(instruction, Instruction::MakeArray { .. }) + || matches!(instruction, Instruction::Binary(_)) || self.can_be_deduplicated_from_upper_bound(&instruction); is_loop_invariant && can_be_deduplicated @@ -231,6 +232,31 @@ impl<'f> LoopInvariantContext<'f> { false } } + Instruction::Binary(binary) => { + if !matches!(binary.operator, BinaryOp::Add | BinaryOp::Mul) { + return false; + } + + let operand_type = + self.inserter.function.dfg.type_of_value(binary.lhs).unwrap_numeric(); + + let lhs_const = + self.inserter.function.dfg.get_numeric_constant_with_type(binary.lhs); + let rhs_const = + self.inserter.function.dfg.get_numeric_constant_with_type(binary.rhs); + let (lhs, rhs) = match ( + lhs_const, + rhs_const, + self.outer_induction_variables.get(&binary.lhs), + self.outer_induction_variables.get(&binary.rhs), + ) { + (Some((lhs, _)), None, None, Some(upper_bound)) => (lhs, *upper_bound), + (None, Some((rhs, _)), Some(upper_bound), None) => (*upper_bound, rhs), + _ => return false, + }; + + eval_constant_binary_op(lhs, rhs, binary.operator, operand_type).is_some() + } _ => false, } } diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/remove_bit_shifts.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/remove_bit_shifts.rs index 4c5189d8c91..61d53cbd960 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/remove_bit_shifts.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/remove_bit_shifts.rs @@ -128,9 +128,7 @@ impl Context<'_> { let bit_size_var = self.numeric_constant(FieldElement::from(bit_size as u128), u8_type); let overflow = self.insert_binary(rhs, BinaryOp::Lt, bit_size_var); let predicate = self.insert_cast(overflow, typ); - // we can safely cast to unsigned because overflow_checks prevent bit-shift with a negative value - let rhs_unsigned = self.insert_cast(rhs, NumericType::unsigned(bit_size)); - let pow = self.pow(base, rhs_unsigned); + let pow = self.pow(base, rhs); let pow = self.insert_cast(pow, typ); (FieldElement::max_num_bits(), self.insert_binary(predicate, BinaryOp::Mul, pow)) }; diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs index e99f239e82e..a22232ba49a 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/remove_enable_side_effects.rs @@ -147,6 +147,7 @@ impl Context { | IfElse { .. } | IncrementRc { .. } | DecrementRc { .. } + | Noop | MakeArray { .. } => false, EnableSideEffectsIf { .. } diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/resolve_is_unconstrained.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/resolve_is_unconstrained.rs index eff6576b87f..3ac7535a1c4 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/resolve_is_unconstrained.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/resolve_is_unconstrained.rs @@ -45,11 +45,11 @@ impl Function { let call_returns = self.dfg.instruction_results(instruction_id); let original_return_id = call_returns[0]; - // We replace the result with a fresh id. This will be unused, so the DIE pass will remove the leftover intrinsic call. - self.dfg.replace_result(instruction_id, original_return_id); - // Replace all uses of the original return value with the constant self.dfg.set_value_from_id(original_return_id, is_within_unconstrained); + + // Now remove the original instruction + self.dfg.remove_instruction(instruction_id); } } } diff --git a/noir/noir-repo/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs b/noir/noir-repo/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs index 2e672e3d0d5..20cddcf43b4 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/hir/comptime/interpreter/builtin.rs @@ -1,6 +1,6 @@ use std::rc::Rc; -use acvm::{acir::BlackBoxFunc, AcirField, FieldElement}; +use acvm::{AcirField, FieldElement}; use builtin_helpers::{ block_expression_to_value, byte_array_type, check_argument_count, check_function_not_yet_resolved, check_one_argument, check_three_arguments, @@ -238,9 +238,6 @@ impl<'local, 'context> Interpreter<'local, 'context> { "unresolved_type_is_field" => unresolved_type_is_field(interner, arguments, location), "unresolved_type_is_unit" => unresolved_type_is_unit(interner, arguments, location), "zeroed" => zeroed(return_type, location.span), - blackbox if BlackBoxFunc::is_valid_black_box_func_name(blackbox) => { - self.call_foreign(blackbox, arguments, return_type, location) - } _ => { let item = format!("Comptime evaluation for builtin function '{name}'"); Err(InterpreterError::Unimplemented { item, location }) diff --git a/noir/noir-repo/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs b/noir/noir-repo/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs index e7953aab5a4..eff48ce22a6 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/hir/def_collector/dc_mod.rs @@ -500,6 +500,9 @@ impl<'a> ModCollector<'a> { .def_interner .push_function_definition(func_id, modifiers, trait_id.0, location); + let referenced = ReferenceId::Function(func_id); + context.def_interner.add_definition_location(referenced, Some(trait_id.0)); + if !trait_item.doc_comments.is_empty() { context.def_interner.set_doc_comments( ReferenceId::Function(func_id), @@ -1222,7 +1225,11 @@ pub(crate) fn collect_trait_impl_items( for item in std::mem::take(&mut trait_impl.items) { match item.item.kind { - TraitImplItemKind::Function(impl_method) => { + TraitImplItemKind::Function(mut impl_method) => { + // Regardless of what visibility was on the source code, treat it as public + // (a warning is produced during parsing for this) + impl_method.def.visibility = ItemVisibility::Public; + let func_id = interner.push_empty_fn(); let location = Location::new(impl_method.span(), file_id); interner.push_function(func_id, &impl_method.def, module, location); diff --git a/noir/noir-repo/compiler/noirc_frontend/src/parser/errors.rs b/noir/noir-repo/compiler/noirc_frontend/src/parser/errors.rs index 7cb8731593b..32cacf5e4ed 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/parser/errors.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/parser/errors.rs @@ -71,6 +71,8 @@ pub enum ParserErrorReason { PatternInTraitFunctionParameter, #[error("Patterns aren't allowed in a trait impl's associated constants")] PatternInAssociatedConstant, + #[error("Visibility is ignored on a trait method")] + TraitVisibilityIgnored, #[error("Visibility is ignored on a trait impl method")] TraitImplVisibilityIgnored, #[error("comptime keyword is deprecated")] @@ -183,11 +185,8 @@ impl ParserError { } pub fn is_warning(&self) -> bool { - matches!( - self.reason(), - Some(ParserErrorReason::ExperimentalFeature(_)) - | Some(ParserErrorReason::MissingSafetyComment) - ) + let diagnostic: Diagnostic = self.into(); + diagnostic.is_warning() } } @@ -264,6 +263,9 @@ impl<'a> From<&'a ParserError> for Diagnostic { ParserErrorReason::ExperimentalFeature(_) => { Diagnostic::simple_warning(reason.to_string(), "".into(), error.span) } + ParserErrorReason::TraitVisibilityIgnored => { + Diagnostic::simple_warning(reason.to_string(), "".into(), error.span) + } ParserErrorReason::TraitImplVisibilityIgnored => { Diagnostic::simple_warning(reason.to_string(), "".into(), error.span) } diff --git a/noir/noir-repo/compiler/noirc_frontend/src/parser/parser/impls.rs b/noir/noir-repo/compiler/noirc_frontend/src/parser/parser/impls.rs index 8e6b3bae0e9..278c20e1e27 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/parser/parser/impls.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/parser/parser/impls.rs @@ -245,7 +245,7 @@ impl<'a> Parser<'a> { let noir_function = self.parse_function( attributes, - ItemVisibility::Public, + modifiers.visibility, modifiers.comptime.is_some(), modifiers.unconstrained.is_some(), true, // allow_self @@ -482,7 +482,7 @@ mod tests { panic!("Expected function"); }; assert_eq!(function.def.name.to_string(), "foo"); - assert_eq!(function.def.visibility, ItemVisibility::Public); + assert_eq!(function.def.visibility, ItemVisibility::Private); } #[test] diff --git a/noir/noir-repo/compiler/noirc_frontend/src/parser/parser/traits.rs b/noir/noir-repo/compiler/noirc_frontend/src/parser/parser/traits.rs index e03b629e9ea..6f6a9bab960 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/parser/parser/traits.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/parser/parser/traits.rs @@ -225,6 +225,10 @@ impl<'a> Parser<'a> { false, // allow mut ); + if modifiers.visibility != ItemVisibility::Private { + self.push_error(ParserErrorReason::TraitVisibilityIgnored, modifiers.visibility_span); + } + if !self.eat_keyword(Keyword::Fn) { self.modifiers_not_followed_by_an_item(modifiers); return None; @@ -285,7 +289,11 @@ mod tests { use crate::{ ast::{NoirTrait, NoirTraitImpl, TraitItem}, parser::{ - parser::{parse_program, tests::expect_no_errors, ParserErrorReason}, + parser::{ + parse_program, + tests::{expect_no_errors, get_single_error, get_source_with_error_span}, + ParserErrorReason, + }, ItemKind, }, }; @@ -513,7 +521,19 @@ mod tests { } #[test] - fn parse_trait_inheirtance() { + fn parse_trait_function_with_visibility() { + let src = " + trait Foo { pub fn foo(); } + ^^^ + "; + let (src, span) = get_source_with_error_span(src); + let (_module, errors) = parse_program(&src); + let error = get_single_error(&errors, span); + assert!(error.to_string().contains("Visibility is ignored on a trait method")); + } + + #[test] + fn parse_trait_inheritance() { let src = "trait Foo: Bar + Baz {}"; let noir_trait = parse_trait_no_errors(src); assert_eq!(noir_trait.bounds.len(), 2); diff --git a/noir/noir-repo/compiler/noirc_printable_type/Cargo.toml b/noir/noir-repo/compiler/noirc_printable_type/Cargo.toml index 8d0574aad64..a1eae750b1f 100644 --- a/noir/noir-repo/compiler/noirc_printable_type/Cargo.toml +++ b/noir/noir-repo/compiler/noirc_printable_type/Cargo.toml @@ -13,10 +13,6 @@ workspace = true [dependencies] acvm.workspace = true -iter-extended.workspace = true serde.workspace = true -serde_json.workspace = true -thiserror.workspace = true -jsonrpc.workspace = true [dev-dependencies] diff --git a/noir/noir-repo/compiler/noirc_printable_type/src/lib.rs b/noir/noir-repo/compiler/noirc_printable_type/src/lib.rs index 6ae187da27f..eb74d2470fb 100644 --- a/noir/noir-repo/compiler/noirc_printable_type/src/lib.rs +++ b/noir/noir-repo/compiler/noirc_printable_type/src/lib.rs @@ -1,10 +1,13 @@ +#![forbid(unsafe_code)] +#![warn(unused_crate_dependencies, unused_extern_crates)] +#![warn(unreachable_pub)] +#![warn(clippy::semicolon_if_nothing_returned)] + use std::{collections::BTreeMap, str}; -use acvm::{acir::AcirField, brillig_vm::brillig::ForeignCallParam}; -use iter_extended::vecmap; +use acvm::AcirField; use serde::{Deserialize, Serialize}; -use thiserror::Error; #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[serde(tag = "kind", rename_all = "lowercase")] @@ -66,96 +69,23 @@ pub enum PrintableValueDisplay { Plain(PrintableValue, PrintableType), FmtString(String, Vec<(PrintableValue, PrintableType)>), } - -#[derive(Debug, Error)] -pub enum ForeignCallError { - #[error("No handler could be found for foreign call `{0}`")] - NoHandler(String), - - #[error("Foreign call inputs needed for execution are missing")] - MissingForeignCallInputs, - - #[error("Could not parse PrintableType argument. {0}")] - ParsingError(#[from] serde_json::Error), - - #[error("Failed calling external resolver. {0}")] - ExternalResolverError(#[from] jsonrpc::Error), - - #[error("Assert message resolved after an unsatisified constrain. {0}")] - ResolvedAssertMessage(String), -} - -impl TryFrom<&[ForeignCallParam]> for PrintableValueDisplay { - type Error = ForeignCallError; - - fn try_from(foreign_call_inputs: &[ForeignCallParam]) -> Result { - let (is_fmt_str, foreign_call_inputs) = - foreign_call_inputs.split_last().ok_or(ForeignCallError::MissingForeignCallInputs)?; - - if is_fmt_str.unwrap_field().is_one() { - convert_fmt_string_inputs(foreign_call_inputs) - } else { - convert_string_inputs(foreign_call_inputs) +impl std::fmt::Display for PrintableValueDisplay { + fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Plain(value, typ) => { + let output_string = to_string(value, typ).ok_or(std::fmt::Error)?; + write!(fmt, "{output_string}") + } + Self::FmtString(template, values) => { + let mut values_iter = values.iter(); + write_template_replacing_interpolations(template, fmt, || { + values_iter.next().and_then(|(value, typ)| to_string(value, typ)) + }) + } } } } -fn convert_string_inputs( - foreign_call_inputs: &[ForeignCallParam], -) -> Result, ForeignCallError> { - // Fetch the PrintableType from the foreign call input - // The remaining input values should hold what is to be printed - let (printable_type_as_values, input_values) = - foreign_call_inputs.split_last().ok_or(ForeignCallError::MissingForeignCallInputs)?; - let printable_type = fetch_printable_type(printable_type_as_values)?; - - // We must use a flat map here as each value in a struct will be in a separate input value - let mut input_values_as_fields = input_values.iter().flat_map(|param| param.fields()); - - let value = decode_value(&mut input_values_as_fields, &printable_type); - - Ok(PrintableValueDisplay::Plain(value, printable_type)) -} - -fn convert_fmt_string_inputs( - foreign_call_inputs: &[ForeignCallParam], -) -> Result, ForeignCallError> { - let (message, input_and_printable_types) = - foreign_call_inputs.split_first().ok_or(ForeignCallError::MissingForeignCallInputs)?; - - let message_as_fields = message.fields(); - let message_as_string = decode_string_value(&message_as_fields); - - let (num_values, input_and_printable_types) = input_and_printable_types - .split_first() - .ok_or(ForeignCallError::MissingForeignCallInputs)?; - - let mut output = Vec::new(); - let num_values = num_values.unwrap_field().to_u128() as usize; - - let types_start_at = input_and_printable_types.len() - num_values; - let mut input_iter = - input_and_printable_types[0..types_start_at].iter().flat_map(|param| param.fields()); - for printable_type in input_and_printable_types.iter().skip(types_start_at) { - let printable_type = fetch_printable_type(printable_type)?; - let value = decode_value(&mut input_iter, &printable_type); - - output.push((value, printable_type)); - } - - Ok(PrintableValueDisplay::FmtString(message_as_string, output)) -} - -fn fetch_printable_type( - printable_type: &ForeignCallParam, -) -> Result { - let printable_type_as_fields = printable_type.fields(); - let printable_type_as_string = decode_string_value(&printable_type_as_fields); - let printable_type: PrintableType = serde_json::from_str(&printable_type_as_string)?; - - Ok(printable_type) -} - fn to_string(value: &PrintableValue, typ: &PrintableType) -> Option { let mut output = String::new(); match (value, typ) { @@ -193,7 +123,7 @@ fn to_string(value: &PrintableValue, typ: &PrintableType) -> Op (PrintableValue::Vec { array_elements, is_slice }, PrintableType::Array { typ, .. }) | (PrintableValue::Vec { array_elements, is_slice }, PrintableType::Slice { typ }) => { if *is_slice { - output.push('&') + output.push('&'); } output.push('['); let mut values = array_elements.iter().peekable(); @@ -253,23 +183,6 @@ fn to_string(value: &PrintableValue, typ: &PrintableType) -> Op Some(output) } -impl std::fmt::Display for PrintableValueDisplay { - fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::Plain(value, typ) => { - let output_string = to_string(value, typ).ok_or(std::fmt::Error)?; - write!(fmt, "{output_string}") - } - Self::FmtString(template, values) => { - let mut values_iter = values.iter(); - write_template_replacing_interpolations(template, fmt, || { - values_iter.next().and_then(|(value, typ)| to_string(value, typ)) - }) - } - } - } -} - fn write_template_replacing_interpolations( template: &str, fmt: &mut std::fmt::Formatter<'_>, @@ -346,94 +259,11 @@ fn format_field_string(field: F) -> String { "0x".to_owned() + &trimmed_field } -/// Assumes that `field_iterator` contains enough field elements in order to decode the [PrintableType] -pub fn decode_value( - field_iterator: &mut impl Iterator, - typ: &PrintableType, -) -> PrintableValue { - match typ { - PrintableType::Field - | PrintableType::SignedInteger { .. } - | PrintableType::UnsignedInteger { .. } - | PrintableType::Boolean => { - let field_element = field_iterator.next().unwrap(); - - PrintableValue::Field(field_element) - } - PrintableType::Array { length, typ } => { - let length = *length as usize; - let mut array_elements = Vec::with_capacity(length); - for _ in 0..length { - array_elements.push(decode_value(field_iterator, typ)); - } - - PrintableValue::Vec { array_elements, is_slice: false } - } - PrintableType::Slice { typ } => { - let length = field_iterator - .next() - .expect("not enough data to decode variable array length") - .to_u128() as usize; - let mut array_elements = Vec::with_capacity(length); - for _ in 0..length { - array_elements.push(decode_value(field_iterator, typ)); - } - - PrintableValue::Vec { array_elements, is_slice: true } - } - PrintableType::Tuple { types } => PrintableValue::Vec { - array_elements: vecmap(types, |typ| decode_value(field_iterator, typ)), - is_slice: false, - }, - PrintableType::String { length } => { - let field_elements: Vec = field_iterator.take(*length as usize).collect(); - - PrintableValue::String(decode_string_value(&field_elements)) - } - PrintableType::Struct { fields, .. } => { - let mut struct_map = BTreeMap::new(); - - for (field_key, param_type) in fields { - let field_value = decode_value(field_iterator, param_type); - - struct_map.insert(field_key.to_owned(), field_value); - } - - PrintableValue::Struct(struct_map) - } - PrintableType::Function { env, .. } => { - let field_element = field_iterator.next().unwrap(); - let func_ref = PrintableValue::Field(field_element); - // we want to consume the fields from the environment, but for now they are not actually printed - decode_value(field_iterator, env); - func_ref - } - PrintableType::MutableReference { typ } => { - // we decode the reference, but it's not really used for printing - decode_value(field_iterator, typ) - } - PrintableType::Unit => PrintableValue::Field(F::zero()), - } -} - -pub fn decode_string_value(field_elements: &[F]) -> String { - // TODO: Replace with `into` when Char is supported - let string_as_slice = vecmap(field_elements, |e| { - let mut field_as_bytes = e.to_be_bytes(); - let char_byte = field_as_bytes.pop().unwrap(); // A character in a string is represented by a u8, thus we just want the last byte of the element - assert!(field_as_bytes.into_iter().all(|b| b == 0)); // Assert that the rest of the field element's bytes are empty - char_byte - }); - - let final_string = str::from_utf8(&string_as_slice).unwrap(); - final_string.to_owned() -} - #[cfg(test)] mod tests { use acvm::FieldElement; - use crate::{PrintableType, PrintableValue, PrintableValueDisplay}; + use super::{PrintableType, PrintableValue, PrintableValueDisplay}; #[test] fn printable_value_display_to_string_without_interpolations() { diff --git a/noir/noir-repo/compiler/wasm/Cargo.toml b/noir/noir-repo/compiler/wasm/Cargo.toml index 9951b23f609..5cde0dfbbcf 100644 --- a/noir/noir-repo/compiler/wasm/Cargo.toml +++ b/noir/noir-repo/compiler/wasm/Cargo.toml @@ -17,9 +17,9 @@ workspace = true crate-type = ["cdylib"] [dependencies] + acvm = { workspace = true, features = ["bn254"] } fm.workspace = true -nargo.workspace = true noirc_driver.workspace = true noirc_frontend = { workspace = true, features = ["bn254"] } noirc_errors.workspace = true @@ -33,6 +33,10 @@ gloo-utils.workspace = true tracing-subscriber.workspace = true tracing-web.workspace = true +# Cannot use the `rpc` feature because the HTTP dependency wouldn't compile to Wasm. +# We could use `path` if `rpc` was a default feature, but we made it opt-in so we don't get any problems when publishing the workspace. +nargo.workspace = true + # This is an unused dependency, we are adding it # so that we can enable the js feature in getrandom. getrandom = { workspace = true, features = ["js"] } diff --git a/noir/noir-repo/compiler/wasm/package.json b/noir/noir-repo/compiler/wasm/package.json index 946ba8dc699..84250dfa7da 100644 --- a/noir/noir-repo/compiler/wasm/package.json +++ b/noir/noir-repo/compiler/wasm/package.json @@ -3,7 +3,7 @@ "contributors": [ "The Noir Team " ], - "version": "1.0.0-beta.0", + "version": "1.0.0-beta.1", "license": "(MIT OR Apache-2.0)", "main": "dist/main.js", "types": "./dist/types/src/index.d.cts", diff --git a/noir/noir-repo/cspell.json b/noir/noir-repo/cspell.json index 9a4bca1e339..ed9f7427c6f 100644 --- a/noir/noir-repo/cspell.json +++ b/noir/noir-repo/cspell.json @@ -126,6 +126,7 @@ "jmpifs", "jmps", "jsdoc", + "jsonrpsee", "Jubjub", "keccak", "keccakf", @@ -166,6 +167,7 @@ "nomicfoundation", "noncanonical", "nouner", + "oneshot", "overflowing", "pedersen", "peekable", @@ -202,6 +204,7 @@ "Secpr", "signedness", "signorecello", + "smallvec", "smol", "splitn", "srem", diff --git a/noir/noir-repo/deny.toml b/noir/noir-repo/deny.toml index 661c8095281..48628fb0045 100644 --- a/noir/noir-repo/deny.toml +++ b/noir/noir-repo/deny.toml @@ -66,14 +66,19 @@ exceptions = [ # so we prefer to not have dependencies using it # https://tldrlegal.com/license/creative-commons-cc0-1.0-universal { allow = ["CC0-1.0"], name = "more-asserts" }, - { allow = ["CC0-1.0"], name = "jsonrpc" }, { allow = ["CC0-1.0"], name = "notify" }, { allow = ["CC0-1.0"], name = "tiny-keccak" }, { allow = ["MPL-2.0"], name = "sized-chunks" }, { allow = ["MPL-2.0"], name = "webpki-roots" }, { allow = ["CDDL-1.0"], name = "inferno" }, + { allow = ["OpenSSL"], name = "ring" }, ] +[[licenses.clarify]] +crate = "ring" +expression = "ISC" +license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }] + # This section is considered when running `cargo deny check sources`. # More documentation about the 'sources' section can be found here: # https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html diff --git a/noir/noir-repo/docs/docs/explainers/explainer-writing-noir.md b/noir/noir-repo/docs/docs/explainers/explainer-writing-noir.md index 3ce4245dc45..202bf76a827 100644 --- a/noir/noir-repo/docs/docs/explainers/explainer-writing-noir.md +++ b/noir/noir-repo/docs/docs/explainers/explainer-writing-noir.md @@ -140,6 +140,18 @@ Use arrays and indices that are known at compile time where possible. Using `assert_constant(i);` before an index, `i`, is used in an array will give a compile error if `i` is NOT known at compile time. ::: +### Reduce what is inside loops and conditional logic + +Putting less logic inside an `if` (`else`, etc) paths, or inside a loop, translates to less gates required to represent the program. The compiler should mostly take care of this. + +A loop duplicates the gates for each iteration of the loop, or put another way, "unrolls" the loop. Any calculations/calls that are unchanged in the loop should be calculated once before, and the result used in the loop. + +An `if` statement is "flattened" and gates created for each path even if execution uses only one path. Furthermore, there are additional operations required for each path. Sometimes this can have a multiplying effect on the operations in the `if` and `else` etc. + +:::tip +Only have essential computation inside conditional logic and loops, and calculate anything else once (before, or after, depending). +::: + ### Leverage unconstrained execution Constrained verification can leverage unconstrained execution, this is especially useful for operations that are represented by many gates. diff --git a/noir/noir-repo/docs/docs/noir/concepts/data_types/strings.md b/noir/noir-repo/docs/docs/noir/concepts/data_types/strings.md index 1fdee42425e..b2257e8bdbb 100644 --- a/noir/noir-repo/docs/docs/noir/concepts/data_types/strings.md +++ b/noir/noir-repo/docs/docs/noir/concepts/data_types/strings.md @@ -77,3 +77,38 @@ let s = r#"Simon says "hello world""#; // Any number of hashes may be used (>= 1) as long as the string also terminates with the same number of hashes let s = r#####"One "#, Two "##, Three "###, Four "####, Five will end the string."#####; ``` + +## Format strings + +A format string begins with the letter `f` and allows inserting the value of local and global variables in it. + +Example: + +```rust +let four = 2 + 2; +let s = f"Two plus two is: {four}"; +println(s); +``` + +The output of the above program is: + +```text +Two plus two is: 4 +``` + +To insert the value of a local or global variable, put it inside `{...}` in the string. + +If you need to write the `{` or `}` characters, use `{{` and `}}` respectively: + +```rust +let four = 2 + 2; + +// Prints "This is not expanded: {four}" +println(f"This is not expanded: {{four}}"); +``` + +More complex expressions are not allowed inside `{...}`: + +```rust +let s = f"Two plus two is: {2 + 2}" // Error: invalid format string +``` \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/cspell.json b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/cspell.json new file mode 100644 index 00000000000..c60b0a597b1 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/cspell.json @@ -0,0 +1,5 @@ +{ + "words": [ + "Cryptdoku" + ] +} diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/explainer-oracle.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/explainer-oracle.md new file mode 100644 index 00000000000..821e1f95c04 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/explainer-oracle.md @@ -0,0 +1,57 @@ +--- +title: Oracles +description: This guide provides an in-depth understanding of how Oracles work in Noir programming. Learn how to use outside calculations in your programs, constrain oracles, and understand their uses and limitations. +keywords: + - Noir Programming + - Oracles + - JSON-RPC + - Foreign Call Handlers + - Constrained Functions + - Blockchain Programming +sidebar_position: 1 +--- + +If you've seen "The Matrix" you may recall "The Oracle" as Gloria Foster smoking cigarettes and baking cookies. While she appears to "know things", she is actually providing a calculation of a pre-determined future. Noir Oracles are similar, in a way. They don't calculate the future (yet), but they allow you to use outside calculations in your programs. + +![matrix oracle prediction](@site/static/img/memes/matrix_oracle.jpeg) + +A Noir program is usually self-contained. You can pass certain inputs to it, and it will generate a deterministic output for those inputs. But what if you wanted to defer some calculation to an outside process or source? + +Oracles are functions that provide this feature. + +## Use cases + +An example usage for Oracles is proving something on-chain. For example, proving that the ETH-USDC quote was below a certain target at a certain block time. Or even making more complex proofs like proving the ownership of an NFT as an anonymous login method. + +Another interesting use case is to defer expensive calculations to be made outside of the Noir program, and then constraining the result; similar to the use of [unconstrained functions](../noir/concepts//unconstrained.md). + +In short, anything that can be constrained in a Noir program but needs to be fetched from an external source is a great candidate to be used in oracles. + +## Constraining oracles + +Just like in The Matrix, Oracles are powerful. But with great power, comes great responsibility. Just because you're using them in a Noir program doesn't mean they're true. Noir has no superpowers. If you want to prove that Portugal won the Euro Cup 2016, you're still relying on potentially untrusted information. + +To give a concrete example, Alice wants to login to the [NounsDAO](https://nouns.wtf/) forum with her username "noir_nouner" by proving she owns a noun without revealing her ethereum address. Her Noir program could have an oracle call like this: + +```rust +#[oracle(getNoun)] +unconstrained fn get_noun(address: Field) -> Field +``` + +This oracle could naively resolve with the number of Nouns she possesses. However, it is useless as a trusted source, as the oracle could resolve to anything Alice wants. In order to make this oracle call actually useful, Alice would need to constrain the response from the oracle, by proving her address and the noun count belongs to the state tree of the contract. + +In short, **Oracles don't prove anything. Your Noir program does.** + +:::danger + +If you don't constrain the return of your oracle, you could be clearly opening an attack vector on your Noir program. Make double-triple sure that the return of an oracle call is constrained! + +::: + +## How to use Oracles + +On CLI, Nargo resolves oracles by making JSON RPC calls, which means it would require an RPC node to be running. + +In JavaScript, NoirJS accepts and resolves arbitrary call handlers (that is, not limited to JSON) as long as they match the expected types the developer defines. Refer to [Foreign Call Handler](../reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md) to learn more about NoirJS's call handling. + +If you want to build using oracles, follow through to the [oracle guide](../how_to/how-to-oracles.md) for a simple example on how to do that. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/explainer-recursion.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/explainer-recursion.md new file mode 100644 index 00000000000..df8529ef4e0 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/explainer-recursion.md @@ -0,0 +1,176 @@ +--- +title: Recursive proofs +description: Explore the concept of recursive proofs in Zero-Knowledge programming. Understand how recursion works in Noir, a language for writing smart contracts on the EVM blockchain. Learn through practical examples like Alice and Bob's guessing game, Charlie's recursive merkle tree, and Daniel's reusable components. Discover how to use recursive proofs to optimize computational resources and improve efficiency. + +keywords: + [ + "Recursive Proofs", + "Zero-Knowledge Programming", + "Noir", + "EVM Blockchain", + "Smart Contracts", + "Recursion in Noir", + "Alice and Bob Guessing Game", + "Recursive Merkle Tree", + "Reusable Components", + "Optimizing Computational Resources", + "Improving Efficiency", + "Verification Key", + "Aggregation", + "Recursive zkSNARK schemes", + "PLONK", + "Proving and Verification Keys" + ] +sidebar_position: 1 +pagination_next: how_to/how-to-recursion +--- + +In programming, we tend to think of recursion as something calling itself. A classic example would be the calculation of the factorial of a number: + +```js +function factorial(n) { + if (n === 0 || n === 1) { + return 1; + } else { + return n * factorial(n - 1); + } +} +``` + +In this case, while `n` is not `1`, this function will keep calling itself until it hits the base case, bubbling up the result on the call stack: + +```md + Is `n` 1? <--------- + /\ / + / \ n = n -1 + / \ / + Yes No -------- +``` + +In Zero-Knowledge, recursion has some similarities. + +It is not a Noir function calling itself, but a proof being used as an input to another circuit. In short, you verify one proof *inside* another proof, returning the proof that both proofs are valid. + +This means that, given enough computational resources, you can prove the correctness of any arbitrary number of proofs in a single proof. This could be useful to design state channels (for which a common example would be [Bitcoin's Lightning Network](https://en.wikipedia.org/wiki/Lightning_Network)), to save on gas costs by settling one proof on-chain, or simply to make business logic less dependent on a consensus mechanism. + +## Examples + +Let us look at some of these examples + +### Alice and Bob - Guessing game + +Alice and Bob are friends, and they like guessing games. They want to play a guessing game online, but for that, they need a trusted third-party that knows both of their secrets and finishes the game once someone wins. + +So, they use zero-knowledge proofs. Alice tries to guess Bob's number, and Bob will generate a ZK proof stating whether she succeeded or failed. + +This ZK proof can go on a smart contract, revealing the winner and even giving prizes. However, this means every turn needs to be verified on-chain. This incurs some cost and waiting time that may simply make the game too expensive or time-consuming to be worth it. + +As a solution, Alice proposes the following: "what if Bob generates his proof, and instead of sending it on-chain, I verify it *within* my own proof before playing my own turn?". + +She can then generate a proof that she verified his proof, and so on. + +```md + Did you fail? <-------------------------- + / \ / + / \ n = n -1 + / \ / + Yes No / + | | / + | | / + | You win / + | / + | / +Generate proof of that / + + / + my own guess ---------------- +``` + +### Charlie - Recursive merkle tree + +Charlie is a concerned citizen, and wants to be sure his vote in an election is accounted for. He votes with a ZK proof, but he has no way of knowing that his ZK proof was included in the total vote count! + +If the vote collector puts all of the votes into a [Merkle tree](https://en.wikipedia.org/wiki/Merkle_tree), everyone can prove the verification of two proofs within one proof, as such: + +```md + abcd + __________|______________ + | | + ab cd + _____|_____ ______|______ + | | | | + alice bob charlie daniel +``` + +Doing this recursively allows us to arrive on a final proof `abcd` which if true, verifies the correctness of all the votes. + +### Daniel - Reusable components + +Daniel has a big circuit and a big headache. A part of his circuit is a setup phase that finishes with some assertions that need to be made. But that section alone takes most of the proving time, and is largely independent of the rest of the circuit. + +He might find it more efficient to generate a proof for that setup phase separately, and verify that proof recursively in the actual business logic section of his circuit. This will allow for parallelization of both proofs, which results in a considerable speedup. + +## What params do I need + +As you can see in the [recursion reference](noir/standard_library/recursion.mdx), a simple recursive proof requires: + +- The proof to verify +- The Verification Key of the circuit that generated the proof +- A hash of this verification key, as it's needed for some backends +- The public inputs for the proof + +:::info + +Recursive zkSNARK schemes do not necessarily "verify a proof" in the sense that you expect a true or false to be spit out by the verifier. Rather an aggregation object is built over the public inputs. + +So, taking the example of Alice and Bob and their guessing game: + +- Alice makes her guess. Her proof is *not* recursive: it doesn't verify any proof within it! It's just a standard `assert(x != y)` circuit +- Bob verifies Alice's proof and makes his own guess. In this circuit, he doesn't exactly *prove* the verification of Alice's proof. Instead, he *aggregates* his proof to Alice's proof. The actual verification is done when the full proof is verified, for example when using `nargo verify` or through the verifier smart contract. + +We can imagine recursive proofs a [relay race](https://en.wikipedia.org/wiki/Relay_race). The first runner doesn't have to receive the baton from anyone else, as he/she already starts with it. But when his/her turn is over, the next runner needs to receive it, run a bit more, and pass it along. Even though every runner could theoretically verify the baton mid-run (why not? 🏃🔍), only at the end of the race does the referee verify that the whole race is valid. + +::: + +## Some architecture + +As with everything in computer science, there's no one-size-fits all. But there are some patterns that could help understanding and implementing them. To give three examples: + +### Adding some logic to a proof verification + +This would be an approach for something like our guessing game, where proofs are sent back and forth and are verified by each opponent. This circuit would be divided in two sections: + +- A `recursive verification` section, which would be just the call to `std::verify_proof`, and that would be skipped on the first move (since there's no proof to verify) +- A `guessing` section, which is basically the logic part where the actual guessing happens + +In such a situation, and assuming Alice is first, she would skip the first part and try to guess Bob's number. Bob would then verify her proof on the first section of his run, and try to guess Alice's number on the second part, and so on. + +### Aggregating proofs + +In some one-way interaction situations, recursion would allow for aggregation of simple proofs that don't need to be immediately verified on-chain or elsewhere. + +To give a practical example, a barman wouldn't need to verify a "proof-of-age" on-chain every time he serves alcohol to a customer. Instead, the architecture would comprise two circuits: + +- A `main`, non-recursive circuit with some logic +- A `recursive` circuit meant to verify two proofs in one proof + +The customer's proofs would be intermediate, and made on their phones, and the barman could just verify them locally. He would then aggregate them into a final proof sent on-chain (or elsewhere) at the end of the day. + +### Recursively verifying different circuits + +Nothing prevents you from verifying different circuits in a recursive proof, for example: + +- A `circuit1` circuit +- A `circuit2` circuit +- A `recursive` circuit + +In this example, a regulator could verify that taxes were paid for a specific purchase by aggregating both a `payer` circuit (proving that a purchase was made and taxes were paid), and a `receipt` circuit (proving that the payment was received) + +## How fast is it + +At the time of writing, verifying recursive proofs is surprisingly fast. This is because most of the time is spent on generating the verification key that will be used to generate the next proof. So you are able to cache the verification key and reuse it later. + +Currently, Noir JS packages don't expose the functionality of loading proving and verification keys, but that feature exists in the underlying `bb.js` package. + +## How can I try it + +Learn more about using recursion in Nargo and NoirJS in the [how-to guide](../how_to/how-to-recursion.md) and see a full example in [noir-examples](https://github.com/noir-lang/noir-examples). diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/explainer-writing-noir.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/explainer-writing-noir.md new file mode 100644 index 00000000000..3ce4245dc45 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/explainers/explainer-writing-noir.md @@ -0,0 +1,177 @@ +--- +title: Thinking in Circuits +description: Considerations when writing Noir programs +keywords: [Noir, programming, rust] +tags: [Optimization] +sidebar_position: 0 +--- + + +This article intends to set you up with key concepts essential for writing more viable applications that use zero knowledge proofs, namely around efficient circuits. + +## Context - 'Efficient' is subjective + +When writing a web application for a performant computer with high-speed internet connection, writing efficient code sometimes is seen as an afterthought only if needed. Large multiplications running at the innermost of nested loops may not even be on a dev's radar. +When writing firmware for a battery-powered microcontroller, you think of cpu cycles as rations to keep within a product's power budget. + +> Code is written to create applications that perform specific tasks within specific constraints + +And these constraints differ depending on where the compiled code is execute. + +### The Ethereum Virtual Machine (EVM) + +In scenarios where extremely low gas costs are required for an Ethereum application to be viable/competitive, Ethereum smart contract developers get into what is colloquially known as: "*gas golfing*". Finding the lowest execution cost of their compiled code (EVM bytecode) to achieve a specific task. + +The equivalent optimization task when writing zk circuits is affectionately referred to as "*gate golfing*", finding the lowest gate representation of the compiled Noir code. + +### Coding for circuits - a paradigm shift + +In zero knowledge cryptography, code is compiled to "circuits" consisting of arithmetic gates, and gate count is the significant cost. Depending on the proving system this is linearly proportionate to proving time, and so from a product point this should be kept as low as possible. + +Whilst writing efficient code for web apps and Solidity has a few key differences, writing efficient circuits have a different set of considerations. It is a bit of a paradigm shift, like writing code for GPUs for the first time... + +For example, drawing a circle at (0, 0) of radius `r`: +- For a single CPU thread, +``` +for theta in 0..2*pi { + let x = r * cos(theta); + let y = r * sin(theta); + draw(x, y); +} // note: would do 0 - pi/2 and draw +ve/-ve x and y. +``` + +- For GPUs (simultaneous parallel calls with x, y across image), +``` +if (x^2 + y^2 = r^2) { + draw(x, y); +} +``` + +([Related](https://www.youtube.com/watch?v=-P28LKWTzrI)) + +Whilst this CPU -> GPU does not translate to circuits exactly, it is intended to exemplify the difference in intuition when coding for different machine capabilities/constraints. + +### Context Takeaway + +For those coming from a primarily web app background, this article will explain what you need to consider when writing circuits. Furthermore, for those experienced writing efficient machine code, prepare to shift what you think is efficient 😬 + +## Translating from Rust + +For some applications using Noir, existing code might be a convenient starting point to then proceed to optimize the gate count of. + +:::note +Many valuable functions and algorithms have been written in more established languages (C/C++), and converted to modern ones (like Rust). +::: + +Fortunately for Noir developers, when needing a particular function a Rust implementation can be readily compiled into Noir with some key changes. While the compiler does a decent amount of optimizations, it won't be able to change code that has been optimized for clock-cycles into code optimized for arithmetic gates. + +A few things to do when converting Rust code to Noir: +- `println!` is not a macro, use `println` function (same for `assert_eq`) +- No early `return` in function. Use constrain via assertion instead +- No passing by reference. Remove `&` operator to pass by value (copy) +- No boolean operators (`&&`, `||`). Use bitwise operators (`&`, `|`) with boolean values +- No type `usize`. Use types `u8`, `u32`, `u64`, ... +- `main` return must be public, `pub` +- No `const`, use `global` +- Noir's LSP is your friend, so error message should be informative enough to resolve syntax issues. + +## Writing efficient Noir for performant products + +The following points help refine our understanding over time. + +:::note +A Noir program makes a statement that can be verified. +::: + +It compiles to a structure that represents the calculation, and can assert results within the calculation at any stage (via the `constrain` keyword). + +A Noir program compiles to an Abstract Circuit Intermediate Representation which is: + - Conceptually a tree structure + - Leaves (inputs) are the `Field` type + - Nodes contain arithmetic operations to combine them (gates) + - The root is the final result (return value) + +:::tip +The command `nargo info` shows the programs circuit size, and is useful to compare the value of changes made. +You can dig deeper and use the `--print-acir` param to take a closer look at individual ACIR opcodes, and the proving backend to see its gate count (eg for barretenberg, `bb gates -b ./target/program.json`). +::: + +### Use the `Field` type + +Since the native type of values in circuits are `Field`s, using them for variables in Noir means less gates converting them under the hood. +Some things to be mindful of when using a Field type for a regular integer value: +- A variable of type `Field` can be cast `as` an integer type (eg `u8`, `u64`) + - Note: this retains only the bits of the integer type. Eg a Field value of 260 as a `u8` becomes 4 +- For Field types arithmetic operations meaningfully overflow/underflow, yet for integer types they are checked according to their size +- Comparisons and bitwise operations do not exist for `Field`s, cast to an appropriately sized integer type when you need to + +:::tip +Where possible, use `Field` type for values. Using smaller value types, and bit-packing strategies, will result in MORE gates +::: + + +### Use Arithmetic over non-arithmetic operations + +Since circuits are made of arithmetic gates, the cost of arithmetic operations tends to be one gate. Whereas for procedural code, they represent several clock cycles. + +Inversely, non-arithmetic operators are achieved with multiple gates, vs 1 clock cycle for procedural code. + +| (cost\op) | arithmetic
(`*`, `+`) | bit-wise ops
(eg `<`, `\|`, `>>`) | +| - | - | - | +| **cycles** | 10+ | 1 | +| **gates** | 1 | 10+ | + +Bit-wise operations (e.g. bit shifts `<<` and `>>`), albeit commonly used in general programming and especially for clock cycle optimizations, are on the contrary expensive in gates when performed within circuits. + +Translate away from bit shifts when writing constrained functions for the best performance. + +On the flip side, feel free to use bit shifts in unconstrained functions and tests if necessary, as they are executed outside of circuits and does not induce performance hits. + +### Use static over dynamic values + +Another general theme that manifests in different ways is that static reads are represented with less gates than dynamic ones. + +Reading from read-only memory (ROM) adds less gates than random-access memory (RAM), 2 vs ~3.25 due to the additional bounds checks. Arrays of fixed length (albeit used at a lower capacity), will generate less gates than dynamic storage. + +Related to this, if an index used to access an array is not known at compile time (ie unknown until run time), then ROM will be converted to RAM, expanding the gate count. + +:::tip +Use arrays and indices that are known at compile time where possible. +Using `assert_constant(i);` before an index, `i`, is used in an array will give a compile error if `i` is NOT known at compile time. +::: + +### Leverage unconstrained execution + +Constrained verification can leverage unconstrained execution, this is especially useful for operations that are represented by many gates. +Use an [unconstrained function](../noir/concepts/unconstrained.md) to perform gate-heavy calculations, then verify and constrain the result. + +Eg division generates more gates than multiplication, so calculating the quotient in an unconstrained function then constraining the product for the quotient and divisor (+ any remainder) equals the dividend will be more efficient. + +Use ` if is_unconstrained() { /`, to conditionally execute code if being called in an unconstrained vs constrained way. + +## Advanced + +Unless you're well into the depth of gate optimization, this advanced section can be ignored. + +### Combine arithmetic operations + +A Noir program can be honed further by combining arithmetic operators in a way that makes the most of each constraint of the backend proving system. This is in scenarios where the backend might not be doing this perfectly. + +Eg Barretenberg backend (current default for Noir) is a width-4 PLONKish constraint system +$ w_1*w_2*q_m + w_1*q_1 + w_2*q_2 + w_3*q_3 + w_4*q_4 + q_c = 0 $ + +Here we see there is one occurrence of witness 1 and 2 ($w_1$, $w_2$) being multiplied together, with addition to witnesses 1-4 ($w_1$ .. $w_4$) multiplied by 4 corresponding circuit constants ($q_1$ .. $q_4$) (plus a final circuit constant, $q_c$). + +Use `nargo info --print-acir`, to inspect the ACIR opcodes (and the proving system for gates), and it may present opportunities to amend the order of operations and reduce the number of constraints. + +#### Variable as witness vs expression + +If you've come this far and really know what you're doing at the equation level, a temporary lever (that will become unnecessary/useless over time) is: `std::as_witness`. This informs the compiler to save a variable as a witness not an expression. + +The compiler will mostly be correct and optimal, but this may help some near term edge cases that are yet to optimize. +Note: When used incorrectly it will create **less** efficient circuits (higher gate count). + +## References +- Guillaume's ["`Cryptdoku`" talk](https://www.youtube.com/watch?v=MrQyzuogxgg) (Jun'23) +- Tips from Tom, Jake and Zac. +- [Idiomatic Noir](https://www.vlayer.xyz/blog/idiomatic-noir-part-1-collections) blog post diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/noir_installation.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/noir_installation.md new file mode 100644 index 00000000000..05f036d4f6d --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/noir_installation.md @@ -0,0 +1,106 @@ +--- +title: Standalone Noir Installation +description: There are different ways to install Nargo, the one-stop shop and command-line tool for developing Noir programs. This guide explains how to specify which version to install when using noirup, and using WSL for windows. +keywords: [ + Installation + Nargo + Noirup + Binaries + Compiling from Source + WSL for Windows + macOS + Linux + Nix + Direnv + Uninstalling Nargo + ] +sidebar_position: 2 +--- + +Noirup is the endorsed method for installing Nargo, streamlining the process of fetching binaries or compiling from source. It supports a range of options to cater to your specific needs, from nightly builds and specific versions to compiling from various sources. + +### Installing Noirup + +First, ensure you have `noirup` installed: + +```sh +curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash +``` + +### Fetching Binaries + +With `noirup`, you can easily switch between different Nargo versions, including nightly builds: + +- **Nightly Version**: Install the latest nightly build. + + ```sh + noirup --version nightly + ``` + +- **Specific Version**: Install a specific version of Nargo. + + ```sh + noirup --version + ``` + +### Compiling from Source + +`noirup` also enables compiling Nargo from various sources: + +- **From a Specific Branch**: Install from the latest commit on a branch. + + ```sh + noirup --branch + ``` + +- **From a Fork**: Install from the main branch of a fork. + + ```sh + noirup --repo + ``` + +- **From a Specific Branch in a Fork**: Install from a specific branch in a fork. + + ```sh + noirup --repo --branch + ``` + +- **From a Specific Pull Request**: Install from a specific PR. + + ```sh + noirup --pr + ``` + +- **From a Specific Commit**: Install from a specific commit. + + ```sh + noirup -C + ``` + +- **From Local Source**: Compile and install from a local directory. + + ```sh + noirup --path ./path/to/local/source + ``` + +## Installation on Windows + +The default backend for Noir (Barretenberg) doesn't provide Windows binaries at this time. For that reason, Noir cannot be installed natively. However, it is available by using Windows Subsystem for Linux (WSL). + +Step 1: Follow the instructions [here](https://learn.microsoft.com/en-us/windows/wsl/install) to install and run WSL. + +step 2: Follow the [Noirup instructions](#installing-noirup). + +## Setting up shell completions + +Once `nargo` is installed, you can [set up shell completions for it](setting_up_shell_completions.md). + +## Uninstalling Nargo + +If you installed Nargo with `noirup`, you can uninstall Nargo by removing the files in `~/.nargo`, `~/nargo`, and `~/noir_cache`. This ensures that all installed binaries, configurations, and cache related to Nargo are fully removed from your system. + +```bash +rm -r ~/.nargo +rm -r ~/nargo +rm -r ~/noir_cache +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/project_breakdown.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/project_breakdown.md new file mode 100644 index 00000000000..e442e377040 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/project_breakdown.md @@ -0,0 +1,159 @@ +--- +title: Project Breakdown +description: + Learn about the anatomy of a Nargo project, including the purpose of the Prover TOML + file, and how to prove and verify your program. +keywords: + [Nargo, Nargo project, Prover.toml, proof verification, private asset transfer] +sidebar_position: 1 +--- + +This section breaks down our hello world program from the previous section. + +## Anatomy of a Nargo Project + +Upon creating a new project with `nargo new` and building the in/output files with `nargo check` +commands, you would get a minimal Nargo project of the following structure: + + - src + - Prover.toml + - Nargo.toml + +The source directory _src_ holds the source code for your Noir program. By default only a _main.nr_ +file will be generated within it. + +### Prover.toml + +_Prover.toml_ is used for specifying the input values for executing and proving the program. You can specify `toml` files with different names by using the `--prover-name` or `-p` flags, see the [Prover](#provertoml) section below. Optionally you may specify expected output values for prove-time checking as well. + +### Nargo.toml + +_Nargo.toml_ contains the environmental options of your project. It contains a "package" section and a "dependencies" section. + +Example Nargo.toml: + +```toml +[package] +name = "noir_starter" +type = "bin" +authors = ["Alice"] +compiler_version = "0.9.0" +description = "Getting started with Noir" +entry = "circuit/main.nr" +license = "MIT" + +[dependencies] +ecrecover = {tag = "v0.9.0", git = "https://github.com/colinnielsen/ecrecover-noir.git"} +``` + +Nargo.toml for a [workspace](../noir/modules_packages_crates/workspaces.md) will look a bit different. For example: + +```toml +[workspace] +members = ["crates/a", "crates/b"] +default-member = "crates/a" +``` + +#### Package section + +The package section defines a number of fields including: + +- `name` (**required**) - the name of the package +- `type` (**required**) - can be "bin", "lib", or "contract" to specify whether its a binary, library or Aztec contract +- `authors` (optional) - authors of the project +- `compiler_version` - specifies the version of the compiler to use. This is enforced by the compiler and follow's [Rust's versioning](https://doc.rust-lang.org/cargo/reference/manifest.html#the-version-field), so a `compiler_version = 0.18.0` will enforce Nargo version 0.18.0, `compiler_version = ^0.18.0` will enforce anything above 0.18.0 but below 0.19.0, etc. For more information, see how [Rust handles these operators](https://docs.rs/semver/latest/semver/enum.Op.html) +- `description` (optional) +- `entry` (optional) - a relative filepath to use as the entry point into your package (overrides the default of `src/lib.nr` or `src/main.nr`) +- `backend` (optional) +- `license` (optional) +- `expression_width` (optional) - Sets the default backend expression width. This field will override the default backend expression width specified by the Noir compiler (currently set to width 4). + +#### Dependencies section + +This is where you will specify any dependencies for your project. See the [Dependencies page](../noir/modules_packages_crates/dependencies.md) for more info. + +`./proofs/` and `./contract/` directories will not be immediately visible until you create a proof or +verifier contract respectively. + +### main.nr + +The _main.nr_ file contains a `main` method, this method is the entry point into your Noir program. + +In our sample program, _main.nr_ looks like this: + +```rust +fn main(x : Field, y : Field) { + assert(x != y); +} +``` + +The parameters `x` and `y` can be seen as the API for the program and must be supplied by the prover. Since neither `x` nor `y` is marked as public, the verifier does not supply any inputs, when verifying the proof. + +The prover supplies the values for `x` and `y` in the _Prover.toml_ file. + +As for the program body, `assert` ensures that the condition to be satisfied (e.g. `x != y`) is constrained by the proof of the execution of said program (i.e. if the condition was not met, the verifier would reject the proof as an invalid proof). + +### Prover.toml + +The _Prover.toml_ file is a file which the prover uses to supply the inputs to the Noir program (both private and public). + +In our hello world program the _Prover.toml_ file looks like this: + +```toml +x = "1" +y = "2" +``` + +When the command `nargo execute` is executed, nargo will execute the Noir program using the inputs specified in `Prover.toml`, aborting if it finds that these do not satisfy the constraints defined by `main`. In this example, `x` and `y` must satisfy the inequality constraint `assert(x != y)`. + +If an output name is specified such as `nargo execute foo`, the witness generated by this execution will be written to `./target/foo.gz`. This can then be used to generate a proof of the execution. + +#### Arrays of Structs + +The following code shows how to pass an array of structs to a Noir program to generate a proof. + +```rust +// main.nr +struct Foo { + bar: Field, + baz: Field, +} + +fn main(foos: [Foo; 3]) -> pub Field { + foos[2].bar + foos[2].baz +} +``` + +Prover.toml: + +```toml +[[foos]] # foos[0] +bar = 0 +baz = 0 + +[[foos]] # foos[1] +bar = 0 +baz = 0 + +[[foos]] # foos[2] +bar = 1 +baz = 2 +``` + +#### Custom toml files + +You can specify a `toml` file with a different name to use for execution by using the `--prover-name` or `-p` flags. + +This command looks for proof inputs in the default **Prover.toml** and generates the witness and saves it at `./target/foo.gz`: + +```bash +nargo execute foo +``` + +This command looks for proof inputs in the custom **OtherProver.toml** and generates the witness and saves it at `./target/bar.gz`: + +```bash +nargo execute -p OtherProver bar +``` + +Now that you understand the concepts, you'll probably want some editor feedback while you are writing more complex code. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/quick_start.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/quick_start.md new file mode 100644 index 00000000000..7deeae12fd9 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/quick_start.md @@ -0,0 +1,126 @@ +--- +title: Quick Start +tags: [] +sidebar_position: 0 +--- + +## Installation + +### Noir + +The easiest way to develop with Noir is using Nargo the CLI tool. It provides you the ability to start new projects, compile, execute and test Noir programs from the terminal. + +You can use `noirup` the installation script to quickly install and update Nargo: + +```bash +curl -L https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash +noirup +``` + +Once installed, you can [set up shell completions for the `nargo` command](setting_up_shell_completions). + +### Proving backend + +After installing Noir, we install a proving backend to work with our Noir programs. + +Proving backends provide you the abilities to generate proofs, verify proofs, generate smart contracts and more for your Noir programs. + +Different proving backends provide different tools for working with Noir programs, here we will use the [Barretenberg proving backend](https://github.com/AztecProtocol/aztec-packages/tree/master/barretenberg) developed by Aztec Labs as an example. + +You can use the `bbup` installation script to quickly install and update BB, Barretenberg's CLI tool: + +You can find the full list of proving backends compatible with Noir in Awesome Noir. + +```bash +curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/barretenberg/bbup/install | bash +bbup +``` + +For the full list of proving backends compatible with Noir, visit [Awesome Noir](https://github.com/noir-lang/awesome-noir/?tab=readme-ov-file#proving-backends). + +## Nargo + +Nargo provides the ability to initiate and execute Noir projects. Let's initialize the traditional `hello_world`: + +```sh +nargo new hello_world +``` + +Two files will be created. + +- `src/main.nr` contains a simple boilerplate circuit +- `Nargo.toml` contains environmental options, such as name, author, dependencies, and others. + +Glancing at _main.nr_ , we can see that inputs in Noir are private by default, but can be labeled public using the keyword `pub`. This means that we will _assert_ that we know a value `x` which is different from `y` without revealing `x`: + +```rust +fn main(x : Field, y : pub Field) { + assert(x != y); +} +``` + +To learn more about private and public values, check the [Data Types](../noir/concepts/data_types/index.md) section. + +### Compiling and executing + +We can now use `nargo` to generate a _Prover.toml_ file, where our input values will be specified: + +```sh +cd hello_world +nargo check + +Let's feed some valid values into this file: + +```toml +x = "1" +y = "2" +``` + +We're now ready to compile and execute our Noir program. By default the `nargo execute` command will do both, and generate the `witness` that we need to feed to our proving backend: + +```sh +nargo execute +``` + +The witness corresponding to this execution will then be written to the file _./target/witness-name.gz_. + +The command also automatically compiles your Noir program if it was not already / was edited, which you may notice the compiled artifacts being written to the file _./target/hello_world.json_. + +With circuit compiled and witness generated, we're ready to prove. + +## Proving backend + +Different proving backends may provide different tools and commands to work with Noir programs. Here Barretenberg's `bb` CLI tool is used as an example: + +```sh +bb prove -b ./target/hello_world.json -w ./target/hello_world.gz -o ./target/proof +``` + +:::tip + +Naming can be confusing, specially as you pass them to the `bb` commands. If unsure, it won't hurt to delete the target folder and start anew to make sure you're using the most recent versions of the compiled circuit and witness. + +::: + +The proof is now generated in the `target` folder. To verify it we first need to compute the verification key from the compiled circuit, and use it to verify: + +```sh +bb write_vk -b ./target/hello_world.json -o ./target/vk +bb verify -k ./target/vk -p ./target/proof +``` + +:::info + +Notice that in order to verify a proof, the verifier knows nothing but the circuit, which is compiled and used to generate the verification key. This is obviously quite important: private inputs remain private. + +As for the public inputs, you may have noticed they haven't been specified. This behavior varies with each particular backend, but barretenberg typically attaches them to the proof. You can see them by parsing and splitting it. For example for if your public inputs are 32 bytes: + +```bash +head -c 32 ./target/proof | od -An -v -t x1 | tr -d $' \n' +``` + +::: + +Congratulations, you have now created and verified a proof for your very first Noir program! + +In the [next section](./project_breakdown.md), we will go into more detail on each step performed. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/setting_up_shell_completions.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/setting_up_shell_completions.md new file mode 100644 index 00000000000..0447321cbab --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/getting_started/setting_up_shell_completions.md @@ -0,0 +1,87 @@ +--- +title: Setting up shell completions +tags: [] +sidebar_position: 3 +--- + +The `nargo` binary provides a command to generate shell completions: + +```bash +nargo generate-completion-script [shell] +``` + +where `shell` must be one of `bash`, `elvish`, `fish`, `powershell`, and `zsh`. + +Below we explain how to install them in some popular shells. + +## Installing Zsh Completions + +If you have `oh-my-zsh` installed, you might already have a directory of automatically loading completion scripts — `.oh-my-zsh/completions`. +If not, first create it: + +```bash +mkdir -p ~/.oh-my-zsh/completions` +``` + +Then copy the completion script to that directory: + +```bash +nargo generate-completion-script zsh > ~/.oh-my-zsh/completions/_nargo +``` + +Without `oh-my-zsh`, you’ll need to add a path for completion scripts to your function path, and turn on completion script auto-loading. +First, add these lines to `~/.zshrc`: + +```bash +fpath=(~/.zsh/completions $fpath) +autoload -U compinit +compinit +``` + +Next, create a directory at `~/.zsh/completions`: + +```bash +mkdir -p ~/.zsh/completions +``` + +Then copy the completion script to that directory: + +```bash +nargo generate-completion-script zsh > ~/.zsh/completions/_nargo +``` + +## Installing Bash Completions + +If you have [bash-completion](https://github.com/scop/bash-completion) installed, you can just copy the completion script to the `/usr/local/etc/bash_completion.d` directory: + +```bash +nargo generate-completion-script bash > /usr/local/etc/bash_completion.d/nargo +``` + +Without `bash-completion`, you’ll need to source the completion script directly. +First create a directory such as `~/.bash_completions/`: + +```bash +mkdir ~/.bash_completions/ +``` + +Copy the completion script to that directory: + +```bash +nargo generate-completion-script bash > ~/.bash_completions/nargo.bash +``` + +Then add the following line to `~/.bash_profile` or `~/.bashrc`: + + +```bash +source ~/.bash_completions/nargo.bash +``` + +## Installing Fish Completions + +Copy the completion script to any path listed in the environment variable `$fish_completion_path`. For example, a typical location is `~/.config/fish/completions/nargo.fish`: + +```bash +nargo generate-completion-script fish > ~/.config/fish/completions/nargo.fish +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/_category_.json b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/_category_.json new file mode 100644 index 00000000000..23b560f610b --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/_category_.json @@ -0,0 +1,5 @@ +{ + "position": 1, + "collapsible": true, + "collapsed": true +} diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/debugger/_category_.json b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/debugger/_category_.json new file mode 100644 index 00000000000..cc2cbb1c253 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/debugger/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Debugging", + "position": 5, + "collapsible": true, + "collapsed": true +} diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/debugger/debugging_with_the_repl.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/debugger/debugging_with_the_repl.md new file mode 100644 index 00000000000..1d64dae3f37 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/debugger/debugging_with_the_repl.md @@ -0,0 +1,164 @@ +--- +title: Using the REPL Debugger +description: + Step-by-step guide on how to debug your Noir circuits with the REPL Debugger. +keywords: + [ + Nargo, + Noir CLI, + Noir Debugger, + REPL, + ] +sidebar_position: 1 +--- + +#### Pre-requisites + +In order to use the REPL debugger, first you need to install recent enough versions of Nargo and vscode-noir. + +## Debugging a simple circuit + +Let's debug a simple circuit: + +```rust +fn main(x : Field, y : pub Field) { + assert(x != y); +} +``` + +To start the REPL debugger, using a terminal, go to a Noir circuit's home directory. Then: + +`$ nargo debug` + +You should be seeing this in your terminal: + +``` +[main] Starting debugger +At ~/noir-examples/recursion/circuits/main/src/main.nr:1:9 + 1 -> fn main(x : Field, y : pub Field) { + 2 assert(x != y); + 3 } +> +``` + +The debugger displays the current Noir code location, and it is now waiting for us to drive it. + +Let's first take a look at the available commands. For that we'll use the `help` command. + +``` +> help +Available commands: + + opcodes display ACIR opcodes + into step into to the next opcode + next step until a new source location is reached + out step until a new source location is reached + and the current stack frame is finished + break LOCATION:OpcodeLocation add a breakpoint at an opcode location + over step until a new source location is reached + without diving into function calls + restart restart the debugging session + delete LOCATION:OpcodeLocation delete breakpoint at an opcode location + witness show witness map + witness index:u32 display a single witness from the witness map + witness index:u32 value:String update a witness with the given value + memset index:usize value:String update a memory cell with the given + value + continue continue execution until the end of the + program + vars show variable values available at this point + in execution + stacktrace display the current stack trace + memory show memory (valid when executing unconstrained code) + step step to the next ACIR opcode + +Other commands: + + help Show this help message + quit Quit repl + +``` + +Some commands operate only for unconstrained functions, such as `memory` and `memset`. If you try to use them while execution is paused at an ACIR opcode, the debugger will simply inform you that you are not executing unconstrained code: + +``` +> memory +Unconstrained VM memory not available +> +``` + +Before continuing, we can take a look at the initial witness map: + +``` +> witness +_0 = 1 +_1 = 2 +> +``` + +Cool, since `x==1`, `y==2`, and we want to check that `x != y`, our circuit should succeed. At this point we could intervene and use the witness setter command to change one of the witnesses. Let's set `y=3`, then back to 2, so we don't affect the expected result: + +``` +> witness +_0 = 1 +_1 = 2 +> witness 1 3 +_1 = 3 +> witness +_0 = 1 +_1 = 3 +> witness 1 2 +_1 = 2 +> witness +_0 = 1 +_1 = 2 +> +``` + +Now we can inspect the current state of local variables. For that we use the `vars` command. + +``` +> vars +> +``` + +We currently have no vars in context, since we are at the entry point of the program. Let's use `next` to execute until the next point in the program. + +``` +> vars +> next +At ~/noir-examples/recursion/circuits/main/src/main.nr:1:20 + 1 -> fn main(x : Field, y : pub Field) { + 2 assert(x != y); + 3 } +> vars +x:Field = 0x01 +``` + +As a result of stepping, the variable `x`, whose initial value comes from the witness map, is now in context and returned by `vars`. + +``` +> next + 1 fn main(x : Field, y : pub Field) { + 2 -> assert(x != y); + 3 } +> vars +y:Field = 0x02 +x:Field = 0x01 +``` + +Stepping again we can finally see both variables and their values. And now we can see that the next assertion should succeed. + +Let's continue to the end: + +``` +> continue +(Continuing execution...) +Finished execution +> q +[main] Circuit witness successfully solved +``` + +Upon quitting the debugger after a solved circuit, the resulting circuit witness gets saved, equivalent to what would happen if we had run the same circuit with `nargo execute`. + +We just went through the basics of debugging using Noir REPL debugger. For a comprehensive reference, check out [the reference page](../../reference/debugger/debugger_repl.md). diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/debugger/debugging_with_vs_code.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/debugger/debugging_with_vs_code.md new file mode 100644 index 00000000000..8bda93324f5 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/debugger/debugging_with_vs_code.md @@ -0,0 +1,68 @@ +--- +title: Using the VS Code Debugger +description: + Step-by-step guide on how to debug your Noir circuits with the VS Code Debugger configuration and features. +keywords: + [ + Nargo, + Noir CLI, + Noir Debugger, + VS Code, + IDE, + ] +sidebar_position: 0 +--- + +This guide will show you how to use VS Code with the vscode-noir extension to debug a Noir project. + +#### Pre-requisites + +- Nargo +- vscode-noir +- A Noir project with a `Nargo.toml`, `Prover.toml` and at least one Noir (`.nr`) containing an entry point function (typically `main`). + +## Running the debugger + +The easiest way to start debugging is to open the file you want to debug, and press `F5`. This will cause the debugger to launch, using your `Prover.toml` file as input. + +You should see something like this: + +![Debugger launched](@site/static/img/debugger/1-started.png) + +Let's inspect the state of the program. For that, we open VS Code's _Debug pane_. Look for this icon: + +![Debug pane icon](@site/static/img/debugger/2-icon.png) + +You will now see two categories of variables: Locals and Witness Map. + +![Debug pane expanded](@site/static/img/debugger/3-debug-pane.png) + +1. **Locals**: variables of your program. At this point in execution this section is empty, but as we step through the code it will get populated by `x`, `result`, `digest`, etc. + +2. **Witness map**: these are initially populated from your project's `Prover.toml` file. In this example, they will be used to populate `x` and `result` at the beginning of the `main` function. + +Most of the time you will probably be focusing mostly on locals, as they represent the high level state of your program. + +You might be interested in inspecting the witness map in case you are trying to solve a really low level issue in the compiler or runtime itself, so this concerns mostly advanced or niche users. + +Let's step through the program, by using the debugger buttons or their corresponding keyboard shortcuts. + +![Debugger buttons](@site/static/img/debugger/4-debugger-buttons.png) + +Now we can see in the variables pane that there's values for `digest`, `result` and `x`. + +![Inspecting locals](@site/static/img/debugger/5-assert.png) + +We can also inspect the values of variables by directly hovering on them on the code. + +![Hover locals](@site/static/img/debugger/6-hover.png) + +Let's set a break point at the `keccak256` function, so we can continue execution up to the point when it's first invoked without having to go one step at a time. + +We just need to click the to the right of the line number 18. Once the breakpoint appears, we can click the `continue` button or use its corresponding keyboard shortcut (`F5` by default). + +![Breakpoint](@site/static/img/debugger/7-break.png) + +Now we are debugging the `keccak256` function, notice the _Call Stack pane_ at the lower right. This lets us inspect the current call stack of our process. + +That covers most of the current debugger functionalities. Check out [the reference](../../reference/debugger/debugger_vscode.md) for more details on how to configure the debugger. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/how-to-oracles.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/how-to-oracles.md new file mode 100644 index 00000000000..0bb8743e361 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/how-to-oracles.md @@ -0,0 +1,275 @@ +--- +title: How to use Oracles +description: Learn how to use oracles in your Noir program with examples in both Nargo and NoirJS. This guide also covers writing a JSON RPC server and providing custom foreign call handlers for NoirJS. +keywords: + - Noir Programming + - Oracles + - Nargo + - NoirJS + - JSON RPC Server + - Foreign Call Handlers +sidebar_position: 1 +--- + +This guide shows you how to use oracles in your Noir program. For the sake of clarity, it assumes that: + +- You have read the [explainer on Oracles](../explainers/explainer-oracle.md) and are comfortable with the concept. +- You have a Noir program to add oracles to. You can create one using the [vite-hardhat starter](https://github.com/noir-lang/noir-starter/tree/main/vite-hardhat) as a boilerplate. +- You understand the concept of a JSON-RPC server. Visit the [JSON-RPC website](https://www.jsonrpc.org/) if you need a refresher. +- You are comfortable with server-side JavaScript (e.g. Node.js, managing packages, etc.). + +## Rundown + +This guide has 3 major steps: + +1. How to modify our Noir program to make use of oracle calls as unconstrained functions +2. How to write a JSON RPC Server to resolve these oracle calls with Nargo +3. How to use them in Nargo and how to provide a custom resolver in NoirJS + +## Step 1 - Modify your Noir program + +An oracle is defined in a Noir program by defining two methods: + +- An unconstrained method - This tells the compiler that it is executing an [unconstrained function](../noir/concepts//unconstrained.md). +- A decorated oracle method - This tells the compiler that this method is an RPC call. + +An example of an oracle that returns a `Field` would be: + +```rust +#[oracle(getSqrt)] +unconstrained fn sqrt(number: Field) -> Field { } + +unconstrained fn get_sqrt(number: Field) -> Field { + sqrt(number) +} +``` + +In this example, we're wrapping our oracle function in an unconstrained method, and decorating it with `oracle(getSqrt)`. We can then call the unconstrained function as we would call any other function: + +```rust +fn main(input: Field) { + let sqrt = get_sqrt(input); +} +``` + +In the next section, we will make this `getSqrt` (defined on the `sqrt` decorator) be a method of the RPC server Noir will use. + +:::danger + +As explained in the [Oracle Explainer](../explainers/explainer-oracle.md), this `main` function is unsafe unless you constrain its return value. For example: + +```rust +fn main(input: Field) { + let sqrt = get_sqrt(input); + assert(sqrt.pow_32(2) as u64 == input as u64); // <---- constrain the return of an oracle! +} +``` + +::: + +:::info + +Currently, oracles only work with single params or array params. For example: + +```rust +#[oracle(getSqrt)] +unconstrained fn sqrt([Field; 2]) -> [Field; 2] { } +``` + +::: + +## Step 2 - Write an RPC server + +Brillig will call *one* RPC server. Most likely you will have to write your own, and you can do it in whatever language you prefer. In this guide, we will do it in Javascript. + +Let's use the above example of an oracle that consumes an array with two `Field` and returns their square roots: + +```rust +#[oracle(getSqrt)] +unconstrained fn sqrt(input: [Field; 2]) -> [Field; 2] { } + +unconstrained fn get_sqrt(input: [Field; 2]) -> [Field; 2] { + sqrt(input) +} + +fn main(input: [Field; 2]) { + let sqrt = get_sqrt(input); + assert(sqrt[0].pow_32(2) as u64 == input[0] as u64); + assert(sqrt[1].pow_32(2) as u64 == input[1] as u64); +} + +#[test] +fn test() { + let input = [4, 16]; + main(input); +} +``` + +:::info + +Why square root? + +In general, computing square roots is computationally more expensive than multiplications, which takes a toll when speaking about ZK applications. In this case, instead of calculating the square root in Noir, we are using our oracle to offload that computation to be made in plain. In our circuit we can simply multiply the two values. + +::: + +Now, we should write the correspondent RPC server, starting with the [default JSON-RPC 2.0 boilerplate](https://www.npmjs.com/package/json-rpc-2.0#example): + +```js +import { JSONRPCServer } from "json-rpc-2.0"; +import express from "express"; +import bodyParser from "body-parser"; + +const app = express(); +app.use(bodyParser.json()); + +const server = new JSONRPCServer(); +app.post("/", (req, res) => { + const jsonRPCRequest = req.body; + server.receive(jsonRPCRequest).then((jsonRPCResponse) => { + if (jsonRPCResponse) { + res.json(jsonRPCResponse); + } else { + res.sendStatus(204); + } + }); +}); + +app.listen(5555); +``` + +Now, we will add our `getSqrt` method, as expected by the `#[oracle(getSqrt)]` decorator in our Noir code. It maps through the params array and returns their square roots: + +```js +server.addMethod("resolve_foreign_call", async (params) => { + if (params[0].function !== "getSqrt") { + throw Error("Unexpected foreign call") + }; + const values = params[0].inputs[0].map((field) => { + return `${Math.sqrt(parseInt(field, 16))}`; + }); + return { values: [values] }; +}); +``` + +If you're using Typescript, the following types may be helpful in understanding the expected return value and making sure they're easy to follow: + +```js +export type ForeignCallSingle = string; + +export type ForeignCallArray = string[]; + +export type ForeignCallResult = { + values: (ForeignCallSingle | ForeignCallArray)[]; +}; +``` + +:::info Multidimensional Arrays + +If the Oracle function is returning an array containing other arrays, such as `[['1','2],['3','4']]`, you need to provide the values in JSON as flattened values. In the previous example, it would be `['1', '2', '3', '4']`. In the Noir program, the Oracle signature can use a nested type, the flattened values will be automatically converted to the nested type. + +::: + +## Step 3 - Usage with Nargo + +Using the [`nargo` CLI tool](../reference/nargo_commands.md), you can use oracles in the `nargo test` and `nargo execute` commands by passing a value to `--oracle-resolver`. For example: + +```bash +nargo test --oracle-resolver http://localhost:5555 +``` + +This tells `nargo` to use your RPC Server URL whenever it finds an oracle decorator. + +## Step 4 - Usage with NoirJS + +In a JS environment, an RPC server is not strictly necessary, as you may want to resolve your oracles without needing any JSON call at all. NoirJS simply expects that you pass a callback function when you generate proofs, and that callback function can be anything. + +For example, if your Noir program expects the host machine to provide CPU pseudo-randomness, you could simply pass it as the `foreignCallHandler`. You don't strictly need to create an RPC server to serve pseudo-randomness, as you may as well get it directly in your app: + +```js +const foreignCallHandler = (name, inputs) => crypto.randomBytes(16) // etc + +await noir.execute(inputs, foreignCallHandler) +``` + +As one can see, in NoirJS, the [`foreignCallHandler`](../reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md) function simply means "a callback function that returns a value of type [`ForeignCallOutput`](../reference/NoirJS/noir_js/type-aliases/ForeignCallOutput.md). It doesn't have to be an RPC call like in the case for Nargo. + +:::tip + +Does this mean you don't have to write an RPC server like in [Step #2](#step-2---write-an-rpc-server)? + +You don't technically have to, but then how would you run `nargo test`? To use both `Nargo` and `NoirJS` in your development flow, you will have to write a JSON RPC server. + +::: + +In this case, let's make `foreignCallHandler` call the JSON RPC Server we created in [Step #2](#step-2---write-an-rpc-server), by making it a JSON RPC Client. + +For example, using the same `getSqrt` program in [Step #1](#step-1---modify-your-noir-program) (comments in the code): + +```js +import { JSONRPCClient } from "json-rpc-2.0"; + +// declaring the JSONRPCClient +const client = new JSONRPCClient((jsonRPCRequest) => { +// hitting the same JSON RPC Server we coded above + return fetch("http://localhost:5555", { + method: "POST", + headers: { + "content-type": "application/json", + }, + body: JSON.stringify(jsonRPCRequest), + }).then((response) => { + if (response.status === 200) { + return response + .json() + .then((jsonRPCResponse) => client.receive(jsonRPCResponse)); + } else if (jsonRPCRequest.id !== undefined) { + return Promise.reject(new Error(response.statusText)); + } + }); +}); + +// declaring a function that takes the name of the foreign call (getSqrt) and the inputs +const foreignCallHandler = async (name, input) => { + const inputs = input[0].map((i) => i.toString("hex")) + // notice that the "inputs" parameter contains *all* the inputs + // in this case we to make the RPC request with the first parameter "numbers", which would be input[0] + const oracleReturn = await client.request("resolve_foreign_call", [ + { + function: name, + inputs: [inputs] + }, + ]); + return [oracleReturn.values[0]]; +}; + +// the rest of your NoirJS code +const input = { input: [4, 16] }; +const { witness } = await noir.execute(input, foreignCallHandler); +``` + +:::tip + +If you're in a NoirJS environment running your RPC server together with a frontend app, you'll probably hit a familiar problem in full-stack development: requests being blocked by [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) policy. For development only, you can simply install and use the [`cors` npm package](https://www.npmjs.com/package/cors) to get around the problem: + +```bash +yarn add cors +``` + +and use it as a middleware: + +```js +import cors from "cors"; + +const app = express(); +app.use(cors()) +``` + +::: + +## Conclusion + +Hopefully by the end of this guide, you should be able to: + +- Write your own logic around Oracles and how to write a JSON RPC server to make them work with your Nargo commands. +- Provide custom foreign call handlers for NoirJS. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/how-to-recursion.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/how-to-recursion.md new file mode 100644 index 00000000000..399e4d4b38a --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/how-to-recursion.md @@ -0,0 +1,172 @@ +--- +title: How to use recursion on NoirJS +description: Learn how to implement recursion with NoirJS, a powerful tool for creating smart contracts on the EVM blockchain. This guide assumes familiarity with NoirJS, solidity verifiers, and the Barretenberg proving backend. Discover how to generate both final and intermediate proofs using `noir_js` and `bb.js`. +keywords: + [ + "NoirJS", + "EVM blockchain", + "smart contracts", + "recursion", + "solidity verifiers", + "Barretenberg backend", + "noir_js", + "intermediate proofs", + "final proofs", + "nargo compile", + "json import", + "recursive circuit", + "recursive app" + ] +sidebar_position: 1 +--- + +This guide shows you how to use recursive proofs in your NoirJS app. For the sake of clarity, it is assumed that: + +- You already have a NoirJS app. If you don't, please visit the [NoirJS tutorial](../tutorials/noirjs_app.md) and the [reference](../reference/NoirJS/noir_js/index.md). +- You are familiar with what are recursive proofs and you have read the [recursion explainer](../explainers/explainer-recursion.md) +- You already built a recursive circuit following [the reference](../noir/standard_library/recursion.mdx), and understand how it works. + +It is also assumed that you're not using `noir_wasm` for compilation, and instead you've used [`nargo compile`](../reference/nargo_commands.md) to generate the `json` you're now importing into your project. However, the guide should work just the same if you're using `noir_wasm`. + +:::info + +As you've read in the [explainer](../explainers/explainer-recursion.md), a recursive proof is an intermediate proof. This means that it doesn't necessarily generate the final step that makes it verifiable in a smart contract. However, it is easy to verify within another circuit. + +::: + +In a standard recursive app, you're also dealing with at least two circuits. For the purpose of this guide, we will assume the following: + +- `main`: a circuit of type `assert(x != y)`, which we want to embed in another circuit recursively. For example when proving with the `bb` tool, we can use the `--recursive` CLI option to tell the backend that it should generate proofs that are friendly for verification within another circuit. +- `recursive`: a circuit that verifies `main` + +For a full example of how recursive proofs work, please refer to the [noir-examples](https://github.com/noir-lang/noir-examples) repository. We will *not* be using it as a reference for this guide. + +## Step 1: Setup + +In a common NoirJS app, you need to instantiate a backend with something like `const backend = new Backend(circuit)`. Then you feed it to the `noir_js` interface. + +For recursion, this doesn't happen, and the only need for `noir_js` is only to `execute` a circuit and get its witness and return value. Everything else is not interfaced, so it needs to happen on the `backend` object. + +It is also recommended that you instantiate the backend with as many threads as possible, to allow for maximum concurrency: + +```js +const backend = new UltraPlonkBackend(circuit, { threads: 8 }, { recursive: true }) +``` + +:::tip +You can use the [`os.cpus()`](https://nodejs.org/api/os.html#oscpus) object in `nodejs` or [`navigator.hardwareConcurrency`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/hardwareConcurrency) on the browser to make the most out of those glorious cpu cores +::: + +## Step 2: Generating the witness and the proof for `main` + +After instantiating the backend, you should also instantiate `noir_js`. We will use it to execute the circuit and get the witness. + +```js +const noir = new Noir(circuit) +const { witness } = noir.execute(input) +``` + +With this witness, you are now able to generate the intermediate proof for the main circuit: + +```js +const { proof, publicInputs } = await backend.generateProof(witness) +``` + +:::warning + +Always keep in mind what is actually happening on your development process, otherwise you'll quickly become confused about what circuit we are actually running and why! + +In this case, you can imagine that Alice (running the `main` circuit) is proving something to Bob (running the `recursive` circuit), and Bob is verifying her proof within his proof. + +With this in mind, it becomes clear that our intermediate proof is the one *meant to be verified within another circuit*, so it must be Alice's. Actually, the only final proof in this theoretical scenario would be the last one, sent on-chain. + +::: + +## Step 3 - Verification and proof artifacts + +Optionally, you are able to verify the intermediate proof: + +```js +const verified = await backend.verifyProof({ proof, publicInputs }) +``` + +This can be useful to make sure our intermediate proof was correctly generated. But the real goal is to do it within another circuit. For that, we need to generate recursive proof artifacts that will be passed to the circuit that is verifying the proof we just generated. Instead of passing the proof and verification key as a byte array, we pass them as fields which makes it cheaper to verify in a circuit: + +```js +const { proofAsFields, vkAsFields, vkHash } = await backend.generateRecursiveProofArtifacts( { publicInputs, proof }, publicInputsCount) +``` + +This call takes the public inputs and the proof, but also the public inputs count. While this is easily retrievable by simply counting the `publicInputs` length, the backend interface doesn't currently abstract it away. + +:::info + +The `proofAsFields` has a constant size `[Field; 93]` and verification keys in Barretenberg are always `[Field; 114]`. + +::: + +:::warning + +One common mistake is to forget *who* makes this call. + +In a situation where Alice is generating the `main` proof, if she generates the proof artifacts and sends them to Bob, which gladly takes them as true, this would mean Alice could prove anything! + +Instead, Bob needs to make sure *he* extracts the proof artifacts, using his own instance of the `main` circuit backend. This way, Alice has to provide a valid proof for the correct `main` circuit. + +::: + +## Step 4 - Recursive proof generation + +With the artifacts, generating a recursive proof is no different from a normal proof. You simply use the `backend` (with the recursive circuit) to generate it: + +```js +const recursiveInputs = { + verification_key: vkAsFields, // array of length 114 + proof: proofAsFields, // array of length 93 + size of public inputs + publicInputs: [mainInput.y], // using the example above, where `y` is the only public input + key_hash: vkHash, +} + +const { witness, returnValue } = noir.execute(recursiveInputs) // we're executing the recursive circuit now! +const { proof, publicInputs } = backend.generateProof(witness) +const verified = backend.verifyProof({ proof, publicInputs }) +``` + +You can obviously chain this proof into another proof. In fact, if you're using recursive proofs, you're probably interested of using them this way! + +:::tip + +Managing circuits and "who does what" can be confusing. To make sure your naming is consistent, you can keep them in an object. For example: + +```js +const circuits = { + main: mainJSON, + recursive: recursiveJSON +} +const backends = { + main: new BarretenbergBackend(circuits.main), + recursive: new BarretenbergBackend(circuits.recursive) +} +const noir_programs = { + main: new Noir(circuits.main), + recursive: new Noir(circuits.recursive) +} +``` + +This allows you to neatly call exactly the method you want without conflicting names: + +```js +// Alice runs this 👇 +const { witness: mainWitness } = await noir_programs.main.execute(input) +const proof = await backends.main.generateProof(mainWitness) + +// Bob runs this 👇 +const verified = await backends.main.verifyProof(proof) +const { proofAsFields, vkAsFields, vkHash } = await backends.main.generateRecursiveProofArtifacts( + proof, + numPublicInputs, +); +const { witness: recursiveWitness } = await noir_programs.recursive.execute(recursiveInputs) +const recursiveProof = await backends.recursive.generateProof(recursiveWitness); +``` + +::: diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/how-to-solidity-verifier.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/how-to-solidity-verifier.mdx new file mode 100644 index 00000000000..da36b60920d --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/how-to-solidity-verifier.mdx @@ -0,0 +1,300 @@ +--- +title: Generate a Solidity Verifier +description: + Learn how to run the verifier as a smart contract on the blockchain. Compile a Solidity verifier + contract for your Noir program and deploy it on any EVM blockchain acting as a verifier smart + contract. Read more to find out +keywords: + [ + solidity verifier, + smart contract, + blockchain, + compiler, + plonk_vk.sol, + EVM blockchain, + verifying Noir programs, + proving backend, + Barretenberg, + ] +sidebar_position: 0 +pagination_next: tutorials/noirjs_app +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +Noir is universal. The witness and the compiled program can be fed into a proving backend such as Aztec's [Barretenberg](https://github.com/AztecProtocol/aztec-packages/tree/master/barretenberg), which can then generate a verifier contract for deployment on blockchains. + +This allows for a powerful feature set, as one can make use of the conciseness and the privacy provided by Noir in an immutable ledger. Applications can range from simple P2P guessing games, to complex private DeFi interactions. + +Although not strictly in the domain of Noir itself, this guide shows how to generate a Solidity Verifier with Barretenberg and deploy it on the [Remix IDE](https://remix.ethereum.org/). It is assumed that: + +- You will be using Barretenberg as your proving backend +- You will be using an EVM blockchain to verify your proof +- You are comfortable with the Solidity programming language and understand how contracts are deployed on the Ethereum network +- You have Noir installed and you have a Noir program. If you don't, [get started](../getting_started/quick_start.md) with Nargo and the example Hello Noir circuit +- You are comfortable navigating RemixIDE. If you aren't or you need a refresher, you can find some video tutorials [here](https://www.youtube.com/channel/UCjTUPyFEr2xDGN6Cg8nKDaA) that could help you. + +## Rundown + +Generating a Solidity Verifier with Barretenberg contract is actually a one-command process. However, compiling it and deploying it can have some caveats. Here's the rundown of this guide: + +1. How to generate a solidity smart contract +2. How to compile the smart contract in the RemixIDE +3. How to deploy it to a testnet + +:::info[Which proving system to use?] + +Barretenberg currently provides two provers: `UltraPlonk` and `UltraHonk`. In a nutshell, `UltraHonk` is faster and uses less RAM, but its verifier contract is much more expensive. `UltraPlonk` is optimized for on-chain verification, but proving is more expensive. + +In any case, we provide instructions for both. Choose your poison ☠️ + +::: + +## Step 1 - Generate a contract + +This is by far the most straightforward step. Just run: + +```sh +nargo compile +``` + +This will compile your source code into a Noir build artifact to be stored in the `./target` directory. From here on, it's Barretenberg's work. You can generate the smart contract using the commands: + + + + +```sh +bb write_vk_ultra_keccak_honk -b ./target/.json +bb contract_ultra_honk +``` + + + + +```sh +bb write_vk -b ./target/.json +bb contract +``` + + + + +replacing `` with the name of your Noir project. A `Verifier.sol` contract is now in the target folder and can be deployed to any EVM blockchain acting as a verifier smart contract. + +You can find more information about `bb` and the default Noir proving backend on [this page](../getting_started/quick_start.md#proving-backend). + + +## Step 2 - Compiling + +We will mostly skip the details of RemixIDE, as the UI can change from version to version. For now, we can just open +
Remix and create a blank workspace. + +![Create Workspace](@site/static/img/how-tos/solidity_verifier_1.png) + +We will create a new file to contain the contract Nargo generated, and copy-paste its content. + +:::warning + +You'll likely see a warning advising you to not trust pasted code. While it is an important warning, it is irrelevant in the context of this guide and can be ignored. We will not be deploying anywhere near a mainnet. + +::: + +To compile our the verifier, we can navigate to the compilation tab: + +![Compilation Tab](@site/static/img/how-tos/solidity_verifier_2.png) + +Remix should automatically match a suitable compiler version. However, hitting the "Compile" button will most likely tell you the contract is too big to deploy on mainnet, or complain about a stack too deep: + +![Contract code too big](@site/static/img/how-tos/solidity_verifier_6.png) +![Stack too deep](@site/static/img/how-tos/solidity_verifier_8.png) + +To avoid this, you can just use some optimization. Open the "Advanced Configurations" tab and enable optimization. The default 200 runs will suffice. + +![Compilation success](@site/static/img/how-tos/solidity_verifier_4.png) + +## Step 3 - Deploying + +At this point we should have a compiled contract ready to deploy. If we navigate to the deploy section in Remix, we will see many different environments we can deploy to. The steps to deploy on each environment would be out-of-scope for this guide, so we will just use the default Remix VM. + +Looking closely, we will notice that our "Solidity Verifier" is composed on multiple contracts working together. Remix will take care of the dependencies for us so we can simply deploy the Verifier contract by selecting it and hitting "deploy": + + + + +![Deploying HonkVerifier](@site/static/img/how-tos/solidity_verifier_7.png) + + + + +![Deploying PlonkVerifier](@site/static/img/how-tos/solidity_verifier_9.png) + + + + +A contract will show up in the "Deployed Contracts" section. + +## Step 4 - Verifying + +To verify a proof using the Solidity verifier contract, we call the `verify` function: + +```solidity +function verify(bytes calldata _proof, bytes32[] calldata _publicInputs) external view returns (bool) +``` + +First generate a proof with `bb`. We need a `Prover.toml` file for our inputs. Run: + +```bash +nargo check +``` + +This will generate a `Prover.toml` you can fill with the values you want to prove. We can now execute the circuit with `nargo` and then use the proving backend to prove: + + + + +```bash +nargo execute +bb prove_ultra_keccak_honk -b ./target/.json -w ./target/ -o ./target/proof +``` + +:::tip[Public inputs] +Barretenberg attaches the public inputs to the proof, which in this case it's not very useful. If you're up for some JS, `bb.js` has [a method for it](https://github.com/AztecProtocol/aztec-packages/blob/master/barretenberg/ts/src/proof/index.ts), but in the CLI you can use this ugly snippet: + +```bash +cat ./target/proof | od -An -v -t x1 | tr -d $' \n' | sed 's/^.\{8\}//' | (read hex; echo "${hex:0:192}${hex:256}") +``` + +Beautiful. This assumes a circuit with one public input (32 bytes, for Barretenberg). For more inputs, you can just increment `hex:256` with 32 more bytes for each public input. + +::: + + + + +```bash +nargo execute +bb prove -b ./target/.json -w ./target/ -o ./target/proof +``` + + +:::tip[Public inputs] +Barretenberg attaches the public inputs to the proof, which in this case it's not very useful. If you're up for some JS, `bb.js` has [a method for it](https://github.com/AztecProtocol/aztec-packages/blob/master/barretenberg/ts/src/proof/index.ts), but in the CLI you can use this ugly snippet: + +```bash +tail -c +33 ./target/proof | od -An -v -t x1 | tr -d $' \n' +``` + +Beautiful. This assumes a circuit with one public input (32 bytes, for Barretenberg). For more inputs, you can just add 32 more bytes for each public input to the `tail` command. + +::: + + + + +Remix expects that the public inputs will be split into an array of `bytes32` values so `HEX_PUBLIC_INPUTS` needs to be split up into 32 byte chunks which are prefixed with `0x` accordingly. + +A programmatic example of how the `verify` function is called can be seen in the example zk voting application [here](https://github.com/noir-lang/noir-examples/blob/33e598c257e2402ea3a6b68dd4c5ad492bce1b0a/foundry-voting/src/zkVote.sol#L35): + +```solidity +function castVote(bytes calldata proof, uint proposalId, uint vote, bytes32 nullifierHash) public returns (bool) { + // ... + bytes32[] memory publicInputs = new bytes32[](4); + publicInputs[0] = merkleRoot; + publicInputs[1] = bytes32(proposalId); + publicInputs[2] = bytes32(vote); + publicInputs[3] = nullifierHash; + require(verifier.verify(proof, publicInputs), "Invalid proof"); +``` + +:::info[Return Values] + +A circuit doesn't have the concept of a return value. Return values are just syntactic sugar in Noir. + +Under the hood, the return value is passed as an input to the circuit and is checked at the end of the circuit program. + +For example, if you have Noir program like this: + +```rust +fn main( + // Public inputs + pubkey_x: pub Field, + pubkey_y: pub Field, + // Private inputs + priv_key: Field, +) -> pub Field +``` + +the `verify` function will expect the public inputs array (second function parameter) to be of length 3, the two inputs and the return value. + +Passing only two inputs will result in an error such as `PUBLIC_INPUT_COUNT_INVALID(3, 2)`. + +In this case, the inputs parameter to `verify` would be an array ordered as `[pubkey_x, pubkey_y, return]`. + +::: + +:::tip[Structs] + +You can pass structs to the verifier contract. They will be flattened so that the array of inputs is 1-dimensional array. + +For example, consider the following program: + +```rust +struct Type1 { + val1: Field, + val2: Field, +} + +struct Nested { + t1: Type1, + is_true: bool, +} + +fn main(x: pub Field, nested: pub Nested, y: pub Field) { + //... +} +``` + +The order of these inputs would be flattened to: `[x, nested.t1.val1, nested.t1.val2, nested.is_true, y]` + +::: + +The other function you can call is our entrypoint `verify` function, as defined above. + +:::tip + +It's worth noticing that the `verify` function is actually a `view` function. A `view` function does not alter the blockchain state, so it doesn't need to be distributed (i.e. it will run only on the executing node), and therefore doesn't cost any gas. + +This can be particularly useful in some situations. If Alice generated a proof and wants Bob to verify its correctness, Bob doesn't need to run Nargo, NoirJS, or any Noir specific infrastructure. He can simply make a call to the blockchain with the proof and verify it is correct without paying any gas. + +It would be incorrect to say that a Noir proof verification costs any gas at all. However, most of the time the result of `verify` is used to modify state (for example, to update a balance, a game state, etc). In that case the whole network needs to execute it, which does incur gas costs (calldata and execution, but not storage). + +::: + +## A Note on EVM chains + +Noir proof verification requires the ecMul, ecAdd and ecPairing precompiles. Not all EVM chains support EC Pairings, notably some of the ZK-EVMs. This means that you won't be able to use the verifier contract in all of them. You can find an incomplete list of which EVM chains support these precompiles [here](https://www.evmdiff.com/features?feature=precompiles). + +For example, chains like `zkSync ERA` and `Polygon zkEVM` do not currently support these precompiles, so proof verification via Solidity verifier contracts won't work. Here's a quick list of EVM chains that have been tested and are known to work: + +- Optimism +- Arbitrum +- Polygon PoS +- Scroll +- Celo +- BSC +- Blast L2 +- Avalanche C-Chain +- Mode +- Linea +- Moonbeam + +If you test any other chains, please open a PR on this page to update the list. See [this doc](https://github.com/noir-lang/noir-starter/tree/main/with-foundry#testing-on-chain) for more info about testing verifier contracts on different EVM chains. + +## What's next + +Now that you know how to call a Noir Solidity Verifier on a smart contract using Remix, you should be comfortable with using it with some programmatic frameworks, such as [hardhat](https://github.com/noir-lang/noir-starter/tree/main/vite-hardhat) and [foundry](https://github.com/noir-lang/noir-starter/tree/main/with-foundry). + +You can find other tools, examples, boilerplates and libraries in the [awesome-noir](https://github.com/noir-lang/awesome-noir) repository. + +You should also be ready to write and deploy your first NoirJS app and start generating proofs on websites, phones, and NodeJS environments! Head on to the [NoirJS tutorial](../tutorials/noirjs_app.md) to learn how to do that. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/merkle-proof.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/merkle-proof.mdx new file mode 100644 index 00000000000..0a128adb2de --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/merkle-proof.mdx @@ -0,0 +1,48 @@ +--- +title: Prove Merkle Tree Membership +description: + Learn how to use merkle membership proof in Noir to prove that a given leaf is a member of a + merkle tree with a specified root, at a given index. +keywords: + [merkle proof, merkle membership proof, Noir, rust, hash function, Pedersen, sha256, merkle tree] +sidebar_position: 4 +--- + +Let's walk through an example of a merkle membership proof in Noir that proves that a given leaf is +in a merkle tree. + +```rust + +fn main(message : [Field; 62], index : Field, hashpath : [Field; 40], root : Field) { + let leaf = std::hash::hash_to_field(message.as_slice()); + let merkle_root = std::merkle::compute_merkle_root(leaf, index, hashpath); + assert(merkle_root == root); +} + +``` + +The message is hashed using `hash_to_field`. The specific hash function that is being used is chosen +by the backend. The only requirement is that this hash function can heuristically be used as a +random oracle. If only collision resistance is needed, then one can call `std::hash::pedersen_hash` +instead. + +```rust +let leaf = std::hash::hash_to_field(message.as_slice()); +``` + +The leaf is then passed to a compute_merkle_root function with the root, index and hashpath. The returned root can then be asserted to be the same as the provided root. + +```rust +let merkle_root = std::merkle::compute_merkle_root(leaf, index, hashpath); +assert (merkle_root == root); +``` + +> **Note:** It is possible to re-implement the merkle tree implementation without standard library. +> However, for most usecases, it is enough. In general, the standard library will always opt to be +> as conservative as possible, while striking a balance with efficiency. + +An example, the merkle membership proof, only requires a hash function that has collision +resistance, hence a hash function like Pedersen is allowed, which in most cases is more efficient +than the even more conservative sha256. + +[View an example on the starter repo](https://github.com/noir-lang/noir-examples/blob/3ea09545cabfa464124ec2f3ea8e60c608abe6df/stealthdrop/circuits/src/main.nr#L20) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/using-devcontainers.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/using-devcontainers.mdx new file mode 100644 index 00000000000..727ec6ca667 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/how_to/using-devcontainers.mdx @@ -0,0 +1,110 @@ +--- +title: Developer Containers and Codespaces +description: "Learn how to set up a devcontainer in your GitHub repository for a seamless coding experience with Codespaces. Follow our easy 8-step guide to create your own Noir environment without installing Nargo locally." +keywords: ["Devcontainer", "Codespaces", "GitHub", "Noir Environment", "Docker Image", "Development Environment", "Remote Coding", "GitHub Codespaces", "Noir Programming", "Nargo", "VSCode Extensions", "Noirup"] +sidebar_position: 1 +--- + +Adding a developer container configuration file to your Noir project is one of the easiest way to unlock coding in browser. + +## What's a devcontainer after all? + +A [Developer Container](https://containers.dev/) (devcontainer for short) is a Docker image that comes preloaded with tools, extensions, and other tools you need to quickly get started or continue a project, without having to install Nargo locally. Think of it as a development environment in a box. + +There are many advantages to this: + +- It's platform and architecture agnostic +- You don't need to have an IDE installed, or Nargo, or use a terminal at all +- It's safer for using on a public machine or public network + +One of the best ways of using devcontainers is... not using your machine at all, for maximum control, performance, and ease of use. +Enter Codespaces. + +## Codespaces + +If a devcontainer is just a Docker image, then what stops you from provisioning a `p3dn.24xlarge` AWS EC2 instance with 92 vCPUs and 768 GiB RAM and using it to prove your 10-gate SNARK proof? + +Nothing! Except perhaps the 30-40$ per hour it will cost you. + +The problem is that provisioning takes time, and I bet you don't want to see the AWS console every time you want to code something real quick. + +Fortunately, there's an easy and free way to get a decent remote machine ready and loaded in less than 2 minutes: Codespaces. [Codespaces is a Github feature](https://github.com/features/codespaces) that allows you to code in a remote machine by using devcontainers, and it's pretty cool: + +- You can start coding Noir in less than a minute +- It uses the resources of a remote machine, so you can code on your grandma's phone if needed be +- It makes it easy to share work with your frens +- It's fully reusable, you can stop and restart whenever you need to + +:::info + +Don't take out your wallet just yet. Free GitHub accounts get about [15-60 hours of coding](https://github.com/features/codespaces) for free per month, depending on the size of your provisioned machine. + +::: + +## Tell me it's _actually_ easy + +It is! + +Github comes with a default codespace and you can use it to code your own devcontainer. That's exactly what we will be doing in this guide. + + + +8 simple steps: + +#### 1. Create a new repository on GitHub. + +#### 2. Click "Start coding with Codespaces". This will use the default image. + +#### 3. Create a folder called `.devcontainer` in the root of your repository. + +#### 4. Create a Dockerfile in that folder, and paste the following code: + +```docker +FROM --platform=linux/amd64 node:lts-bookworm-slim +SHELL ["/bin/bash", "-c"] +RUN apt update && apt install -y curl bash git tar gzip libc++-dev +RUN curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash +ENV PATH="/root/.nargo/bin:$PATH" +RUN noirup +ENTRYPOINT ["nargo"] +``` +#### 5. Create a file called `devcontainer.json` in the same folder, and paste the following code: + +```json +{ + "name": "Noir on Codespaces", + "build": { + "context": ".", + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "extensions": ["noir-lang.vscode-noir"] + } + } +} +``` +#### 6. Commit and push your changes + +This will pull the new image and build it, so it could take a minute or so + +#### 8. Done! +Just wait for the build to finish, and there's your easy Noir environment. + + +Refer to [noir-starter](https://github.com/noir-lang/noir-starter/) as an example of how devcontainers can be used together with codespaces. + + + +## How do I use it? + +Using the codespace is obviously much easier than setting it up. +Just navigate to your repository and click "Code" -> "Open with Codespaces". It should take a few seconds to load, and you're ready to go. + +:::info + +If you really like the experience, you can add a badge to your readme, links to existing codespaces, and more. +Check out the [official docs](https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/setting-up-your-repository/facilitating-quick-creation-and-resumption-of-codespaces) for more info. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/index.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/index.mdx new file mode 100644 index 00000000000..5c116a73b3f --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/index.mdx @@ -0,0 +1,76 @@ +--- +title: Noir Lang +hide_title: true +description: + Learn about the public alpha release of Noir, a domain specific language heavily influenced by Rust that compiles to + an intermediate language which can be compiled to an arithmetic circuit or a rank-1 constraint system. +keywords: + [Noir, + Domain Specific Language, + Rust, + Intermediate Language, + Arithmetic Circuit, + Rank-1 Constraint System, + Ethereum Developers, + Protocol Developers, + Blockchain Developers, + Proving System, + Smart Contract Language] +sidebar_position: 0 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import ThemedImage from '@theme/ThemedImage'; +import useBaseUrl from '@docusaurus/useBaseUrl'; + + + +Noir is an open-source Domain-Specific Language for safe and seamless construction of privacy-preserving Zero-Knowledge programs, requiring no previous knowledge on the underlying mathematics or cryptography. + +ZK programs are programs that can generate short proofs of statements without revealing all inputs to the statements. You can read more about Zero-Knowledge Proofs [here](https://dev.to/spalladino/a-beginners-intro-to-coding-zero-knowledge-proofs-c56). + +## What's new about Noir? + +Noir works differently from most ZK languages by taking a two-pronged path. First, it compiles the program to an adaptable intermediate language known as ACIR. From there, depending on a given project's needs, ACIR can be further compiled into an arithmetic circuit for integration with the proving backend. + +:::info + +Noir is backend agnostic, which means it makes no assumptions on which proving backend powers the ZK proof. Being the language that powers [Aztec Contracts](https://docs.aztec.network/developers/contracts/main), it defaults to Aztec's Barretenberg proving backend. + +However, the ACIR output can be transformed to be compatible with other PLONK-based backends, or into a [rank-1 constraint system](https://www.rareskills.io/post/rank-1-constraint-system) suitable for backends such as Arkwork's Marlin. + +::: + +## Who is Noir for? + +Noir can be used both in complex cloud-based backends and in user's smartphones, requiring no knowledge on the underlying math or cryptography. From authorization systems that keep a password in the user's device, to complex on-chain verification of recursive proofs, Noir is designed to abstract away complexity without any significant overhead. Here are some examples of situations where Noir can be used: + + + + Noir Logo + + Aztec Contracts leverage Noir to allow for the storage and execution of private information. Writing an Aztec Contract is as easy as writing Noir, and Aztec developers can easily interact with the network storage and execution through the [Aztec.nr](https://docs.aztec.network/developers/contracts/main) library. + + + Soliditry Verifier Example + Noir can auto-generate Solidity verifier contracts that verify Noir proofs. This allows for non-interactive verification of proofs containing private information in an immutable system. This feature powers a multitude of use-case scenarios, from P2P chess tournaments, to [Aztec Layer-2 Blockchain](https://docs.aztec.network/) + + + Aztec Labs developed NoirJS, an easy interface to generate and verify Noir proofs in a Javascript environment. This allows for Noir to be used in webpages, mobile apps, games, and any other environment supporting JS execution in a standalone manner. + + + + +## Libraries + +Noir is meant to be easy to extend by simply importing Noir libraries just like in Rust. +The [awesome-noir repo](https://github.com/noir-lang/awesome-noir#libraries) is a collection of libraries developed by the Noir community. +Writing a new library is easy and makes code be composable and easy to reuse. See the section on [dependencies](noir/modules_packages_crates/dependencies.md) for more information. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/migration_notes.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/migration_notes.md new file mode 100644 index 00000000000..6bd740024e5 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/migration_notes.md @@ -0,0 +1,105 @@ +--- +title: Migration notes +description: Read about migration notes from previous versions, which could solve problems while updating +keywords: [Noir, notes, migration, updating, upgrading] +--- + +Noir is in full-speed development. Things break fast, wild, and often. This page attempts to leave some notes on errors you might encounter when upgrading and how to resolve them until proper patches are built. + +### `backend encountered an error: libc++.so.1` + +Depending on your OS, you may encounter the following error when running `nargo prove` for the first time: + +```text +The backend encountered an error: "/home/codespace/.nargo/backends/acvm-backend-barretenberg/backend_binary: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory\n" +``` + +Install the `libc++-dev` library with: + +```bash +sudo apt install libc++-dev +``` + +## ≥0.19 + +### Enforcing `compiler_version` + +From this version on, the compiler will check for the `compiler_version` field in `Nargo.toml`, and will error if it doesn't match the current Nargo version in use. + +To update, please make sure this field in `Nargo.toml` matches the output of `nargo --version`. + +## ≥0.14 + +The index of the [for loops](noir/concepts/control_flow.md#loops) is now of type `u64` instead of `Field`. An example refactor would be: + +```rust +for i in 0..10 { + let i = i as Field; +} +``` + +## ≥v0.11.0 and Nargo backend + +From this version onwards, Nargo starts managing backends through the `nargo backend` command. Upgrading to the versions per usual steps might lead to: + +### `backend encountered an error` + +This is likely due to the existing locally installed version of proving backend (e.g. barretenberg) is incompatible with the version of Nargo in use. + +To fix the issue: + +1. Uninstall the existing backend + +```bash +nargo backend uninstall acvm-backend-barretenberg +``` + +You may replace _acvm-backend-barretenberg_ with the name of your backend listed in `nargo backend ls` or in ~/.nargo/backends. + +2. Reinstall a compatible version of the proving backend. + +If you are using the default barretenberg backend, simply run: + +``` +nargo prove +``` + +with your Noir program. + +This will trigger the download and installation of the latest version of barretenberg compatible with your Nargo in use. + +### `backend encountered an error: illegal instruction` + +On certain Intel-based systems, an `illegal instruction` error may arise due to incompatibility of barretenberg with certain CPU instructions. + +To fix the issue: + +1. Uninstall the existing backend + +```bash +nargo backend uninstall acvm-backend-barretenberg +``` + +You may replace _acvm-backend-barretenberg_ with the name of your backend listed in `nargo backend ls` or in ~/.nargo/backends. + +2. Reinstall a compatible version of the proving backend. + +If you are using the default barretenberg backend, simply run: + +``` +nargo backend install acvm-backend-barretenberg https://github.com/noir-lang/barretenberg-js-binary/raw/master/run-bb.tar.gz +``` + +This downloads and installs a specific bb.js based version of barretenberg binary from GitHub. + +The gzipped file is running [this bash script](https://github.com/noir-lang/barretenberg-js-binary/blob/master/run-bb-js.sh), where we need to gzip it as the Nargo currently expect the backend to be zipped up. + +Then run: + +``` +DESIRED_BINARY_VERSION=0.8.1 nargo info +``` + +This overrides the bb native binary with a bb.js node application instead, which should be compatible with most if not all hardware. This does come with the drawback of being generally slower than native binary. + +0.8.1 indicates bb.js version 0.8.1, so if you change that it will update to a different version or the default version in the script if none was supplied. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/_category_.json b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/_category_.json new file mode 100644 index 00000000000..7da08f8a8c5 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Concepts", + "position": 0, + "collapsible": true, + "collapsed": true +} \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/assert.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/assert.md new file mode 100644 index 00000000000..2132de42072 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/assert.md @@ -0,0 +1,78 @@ +--- +title: Assert Function +description: + Learn about the `assert` and `static_assert` functions in Noir, which can be used to explicitly + constrain the predicate or comparison expression that follows to be true, and what happens if + the expression is false at runtime or compile-time, respectively. +keywords: [Noir programming language, assert statement, predicate expression, comparison expression] +sidebar_position: 4 +--- + +Noir includes a special `assert` function which will explicitly constrain the predicate/comparison +expression that follows to be true. If this expression is false at runtime, the program will fail to +be proven. Example: + +```rust +fn main(x : Field, y : Field) { + assert(x == y); +} +``` + +> Assertions only work for predicate operations, such as `==`. If there's any ambiguity on the operation, the program will fail to compile. For example, it is unclear if `assert(x + y)` would check for `x + y == 0` or simply would return `true`. + +You can optionally provide a message to be logged when the assertion fails: + +```rust +assert(x == y, "x and y are not equal"); +``` + +Aside string literals, the optional message can be a format string or any other type supported as input for Noir's [print](../standard_library/logging.md) functions. This feature lets you incorporate runtime variables into your failed assertion logs: + +```rust +assert(x == y, f"Expected x == y, but got {x} == {y}"); +``` + +Using a variable as an assertion message directly: + +```rust +struct myStruct { + myField: Field +} + +let s = myStruct { myField: y }; +assert(s.myField == x, s); +``` + +There is also a special `static_assert` function that behaves like `assert`, +but that runs at compile-time. + +```rust +fn main(xs: [Field; 3]) { + let x = 2 + 2; + let y = 4; + static_assert(x == y, "expected 2 + 2 to equal 4"); + + // This passes since the length of `xs` is known at compile-time + static_assert(xs.len() == 3, "expected the input to have 3 elements"); +} +``` + +This function fails when passed a dynamic (run-time) argument: + +```rust +fn main(x : Field, y : Field) { + // this fails because `x` is not known at compile-time + static_assert(x == 2, "expected x to be known at compile-time and equal to 2"); + + let mut example_slice = &[]; + if y == 4 { + example_slice = example_slice.push_back(0); + } + + // This fails because the length of `example_slice` is not known at + // compile-time + let error_message = "expected an empty slice, known at compile-time"; + static_assert(example_slice.len() == 0, error_message); +} +``` + diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/comments.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/comments.md new file mode 100644 index 00000000000..b51a85f5c94 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/comments.md @@ -0,0 +1,33 @@ +--- +title: Comments +description: + Learn how to write comments in Noir programming language. A comment is a line of code that is + ignored by the compiler, but it can be read by programmers. Single-line and multi-line comments + are supported in Noir. +keywords: [Noir programming language, comments, single-line comments, multi-line comments] +sidebar_position: 10 +--- + +A comment is a line in your codebase which the compiler ignores, however it can be read by +programmers. + +Here is a single line comment: + +```rust +// This is a comment and is ignored +``` + +`//` is used to tell the compiler to ignore the rest of the line. + +Noir also supports multi-line block comments. Start a block comment with `/*` and end the block with `*/`. + +Noir does not natively support doc comments. You may be able to use [Rust doc comments](https://doc.rust-lang.org/reference/comments.html) in your code to leverage some Rust documentation build tools with Noir code. + +```rust +/* + This is a block comment describing a complex function. +*/ +fn main(x : Field, y : pub Field) { + assert(x != y); +} +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/comptime.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/comptime.md new file mode 100644 index 00000000000..353d6dbc681 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/comptime.md @@ -0,0 +1,565 @@ +--- +title: Compile-time Code & Metaprogramming +description: Learn how to use metaprogramming in Noir to create macros or derive your own traits +keywords: [Noir, comptime, compile-time, metaprogramming, macros, quote, unquote] +sidebar_position: 15 +--- + +## Overview + +Metaprogramming in Noir is comprised of three parts: +1. `comptime` code +2. Quoting and unquoting +3. The metaprogramming API in `std::meta` + +Each of these are explained in more detail in the next sections but the wide picture is that +`comptime` allows us to write code which runs at compile-time. In this `comptime` code we +can quote and unquote snippets of the program, manipulate them, and insert them in other +parts of the program. Comptime functions which do this are said to be macros. Additionally, +there's a compile-time API of built-in types and functions provided by the compiler which allows +for greater analysis and modification of programs. + +--- + +## Comptime + +`comptime` is a new keyword in Noir which marks an item as executing or existing at compile-time. It can be used in several ways: + +- `comptime fn` to define functions which execute exclusively during compile-time. +- `comptime global` to define a global variable which is evaluated at compile-time. + - Unlike runtime globals, `comptime global`s can be mutable. +- `comptime { ... }` to execute a block of statements during compile-time. +- `comptime let` to define a variable whose value is evaluated at compile-time. +- `comptime for` to run a for loop at compile-time. Syntax sugar for `comptime { for .. }`. + +### Scoping + +Note that while in a `comptime` context, any runtime variables _local to the current function_ are never visible. + +### Evaluating + +Evaluation rules of `comptime` follows the normal unconstrained evaluation rules for other Noir code. There are a few things to note though: + +- Certain built-in functions may not be available, although more may be added over time. +- Evaluation order of `comptime {}` blocks within global items is currently unspecified. For example, given the following two functions we can't guarantee +which `println` will execute first. The ordering of the two printouts will be arbitrary, but should be stable across multiple compilations with the same `nargo` version as long as the program is also unchanged. + +```rust +fn one() { + comptime { println("one"); } +} + +fn two() { + comptime { println("two"); } +} +``` + +- Since evaluation order is unspecified, care should be taken when using mutable globals so that they do not rely on a particular ordering. +For example, using globals to generate unique ids should be fine but relying on certain ids always being produced (especially after edits to the program) should be avoided. +- Although the ordering of comptime code is usually unspecified, there are cases where it is: + - Dependencies of a crate will always be evaluated before the dependent crate. + - Any attributes on a function will be run before the function body is resolved. This is to allow the attribute to modify the function if necessary. Note that if the + function itself was called at compile-time previously, it will already be resolved and cannot be modified. To prevent accidentally calling functions you wish to modify + at compile-time, it may be helpful to sort your `comptime` annotation functions into a different submodule crate along with any dependencies they require. + - Unlike raw `comptime {}` blocks, attributes on top-level items in the program do have a set evaluation order. Attributes within a module are evaluated top-down, and attributes + in different modules are evaluated submodule-first. Sibling modules to the same parent module are evaluated in order of the module declarations (`mod foo; mod bar;`) in their + parent module. + +### Lowering + +When a `comptime` value is used in runtime code it must be lowered into a runtime value. This means replacing the expression with the literal that it evaluated to. For example, the code: + +```rust +struct Foo { array: [Field; 2], len: u32 } + +fn main() { + println(comptime { + let mut foo = std::mem::zeroed::(); + foo.array[0] = 4; + foo.len = 1; + foo + }); +} +``` + +will be converted to the following after `comptime` expressions are evaluated: + +```rust +struct Foo { array: [Field; 2], len: u32 } + +fn main() { + println(Foo { array: [4, 0], len: 1 }); +} +``` + +Not all types of values can be lowered. For example, references, `Type`s, and `TypeDefinition`s (among other types) cannot be lowered at all. + +```rust +fn main() { + // There's nothing we could inline here to create a Type value at runtime + // let _ = get_type!(); +} + +comptime fn get_type() -> Type { ... } +``` + +Values of certain types may also change type when they are lowered. For example, a comptime format string will already be +formatted, and thus lowers into a runtime string instead: + +```rust +fn main() { + let foo = comptime { + let i = 2; + f"i = {i}" + }; + assert_eq(foo, "i = 2"); +} +``` + +--- + +## (Quasi) Quote + +Macros in Noir are `comptime` functions which return code as a value which is inserted into the call site when it is lowered there. +A code value in this case is of type `Quoted` and can be created by a `quote { ... }` expression. +More specifically, the code value `quote` creates is a token stream - a representation of source code as a series of words, numbers, string literals, or operators. +For example, the expression `quote { Hi "there reader"! }` would quote three tokens: the word "hi", the string "there reader", and an exclamation mark. +You'll note that snippets that would otherwise be invalid syntax can still be quoted. + +When a `Quoted` value is used in runtime code, it is lowered into a `quote { ... }` expression. Since this expression is only valid +in compile-time code however, we'd get an error if we tried this. Instead, we can use macro insertion to insert each token into the +program at that point, and parse it as an expression. To do this, we have to add a `!` after the function name returning the `Quoted` value. +If the value was created locally and there is no function returning it, `std::meta::unquote!(_)` can be used instead. +Calling such a function at compile-time without `!` will just return the `Quoted` value to be further manipulated. For example: + +```rust title="quote-example" showLineNumbers +comptime fn quote_one() -> Quoted { + quote { 1 } + } + + #[test] + fn returning_versus_macro_insertion() { + comptime { + // let _a: Quoted = quote { 1 }; + let _a: Quoted = quote_one(); + + // let _b: Field = 1; + let _b: Field = quote_one!(); + + // Since integers default to fields, if we + // want a different type we have to explicitly cast + // let _c: i32 = 1 as i32; + let _c: i32 = quote_one!() as i32; + } + } +``` +> Source code: noir_stdlib/src/meta/mod.nr#L120-L140 + + +For those familiar with quoting from other languages (primarily lisps), Noir's `quote` is actually a _quasiquote_. +This means we can escape the quoting by using the unquote operator to splice values in the middle of quoted code. + +In addition to curly braces, you can also use square braces for the quote operator: + +```rust +comptime { + let q1 = quote { 1 }; + let q2 = quote [ 2 ]; + assert_eq(q1, q2); + + // Square braces can be used to quote mismatched curly braces if needed + let _ = quote[}]; +} +``` + +--- + +## Unquote + +The unquote operator `$` is usable within a `quote` expression. +It takes a variable as an argument, evaluates the variable, and splices the resulting value into the quoted token stream at that point. For example, + +```rust +comptime { + let x = 1 + 2; + let y = quote { $x + 4 }; +} +``` + +The value of `y` above will be the token stream containing `3`, `+`, and `4`. We can also use this to combine `Quoted` values into larger token streams: + +```rust +comptime { + let x = quote { 1 + 2 }; + let y = quote { $x + 4 }; +} +``` + +The value of `y` above is now the token stream containing five tokens: `1 + 2 + 4`. + +Note that to unquote something, a variable name _must_ follow the `$` operator in a token stream. +If it is an expression (even a parenthesized one), it will do nothing. Most likely a parse error will be given when the macro is later unquoted. + +Unquoting can also be avoided by escaping the `$` with a backslash: + +```rust +comptime { + let x = quote { 1 + 2 }; + + // y contains the four tokens: `$x + 4` + let y = quote { \$x + 4 }; +} +``` + +### Combining Tokens + +Note that `Quoted` is internally a series of separate tokens, and that all unquoting does is combine these token vectors. +This means that code which appears to append like a string actually appends like a vector internally: + +```rust +comptime { + let x = 3; + let q = quote { foo$x }; // This is [foo, 3], not [foo3] + + // Spaces are ignored in general, they're never part of a token + assert_eq(q, quote { foo 3 }); +} +``` + +If you do want string semantics, you can use format strings then convert back to a `Quoted` value with `.quoted_contents()`. +Note that formatting a quoted value with multiple tokens will always insert a space between each token. If this is +undesired, you'll need to only operate on quoted values containing a single token. To do this, you can iterate +over each token of a larger quoted value with `.tokens()`: + +```rust title="concatenate-example" showLineNumbers +comptime fn concatenate(q1: Quoted, q2: Quoted) -> Quoted { + assert(q1.tokens().len() <= 1); + assert(q2.tokens().len() <= 1); + + f"{q1}{q2}".quoted_contents() + } + + // The CtString type is also useful for a compile-time string of unbounded size + // so that you can append to it in a loop. + comptime fn double_spaced(q: Quoted) -> CtString { + let mut result = "".as_ctstring(); + + for token in q.tokens() { + if result != "".as_ctstring() { + result = result.append_str(" "); + } + result = result.append_fmtstr(f"{token}"); + } + + result + } + + #[test] + fn concatenate_test() { + comptime { + let result = concatenate(quote {foo}, quote {bar}); + assert_eq(result, quote {foobar}); + + let result = double_spaced(quote {foo bar 3}).as_quoted_str!(); + assert_eq(result, "foo bar 3"); + } + } +``` +> Source code: noir_stdlib/src/meta/mod.nr#L255-L288 + + +--- + +## Attributes + +Attributes provide a way to run a `comptime` function on an item in the program. +When you use an attribute, the function with the same name will be called with that item as an argument: + +```rust +#[my_struct_attribute] +struct Foo {} + +comptime fn my_struct_attribute(s: StructDefinition) { + println("Called my_struct_attribute!"); +} + +#[my_function_attribute] +fn foo() {} + +comptime fn my_function_attribute(f: FunctionDefinition) { + println("Called my_function_attribute!"); +} +``` + +Anything returned from one of these functions will be inserted at top-level along with the original item. +Note that expressions are not valid at top-level so you'll get an error trying to return `3` or similar just as if you tried to write a program containing `3; struct Foo {}`. +You can insert other top-level items such as trait impls, structs, or functions this way though. +For example, this is the mechanism used to insert additional trait implementations into the program when deriving a trait impl from a struct: + +```rust title="derive-field-count-example" showLineNumbers +trait FieldCount { + fn field_count() -> u32; + } + + #[derive_field_count] + struct Bar { + x: Field, + y: [Field; 2], + } + + comptime fn derive_field_count(s: StructDefinition) -> Quoted { + let typ = s.as_type(); + let field_count = s.fields().len(); + quote { + impl FieldCount for $typ { + fn field_count() -> u32 { + $field_count + } + } + } + } +``` +> Source code: noir_stdlib/src/meta/mod.nr#L142-L164 + + +### Calling annotations with additional arguments + +Arguments may optionally be given to attributes. +When this is done, these additional arguments are passed to the attribute function after the item argument. + +```rust title="annotation-arguments-example" showLineNumbers +#[assert_field_is_type(quote { i32 }.as_type())] + struct MyStruct { + my_field: i32, + } + + comptime fn assert_field_is_type(s: StructDefinition, typ: Type) { + // Assert the first field in `s` has type `typ` + let fields = s.fields(); + assert_eq(fields[0].1, typ); + } +``` +> Source code: noir_stdlib/src/meta/mod.nr#L166-L177 + + +We can also take any number of arguments by adding the `varargs` attribute: + +```rust title="annotation-varargs-example" showLineNumbers +#[assert_three_args(1, 2, 3)] + struct MyOtherStruct { + my_other_field: u32, + } + + #[varargs] + comptime fn assert_three_args(_s: StructDefinition, args: [Field]) { + assert_eq(args.len(), 3); + } +``` +> Source code: noir_stdlib/src/meta/mod.nr#L179-L189 + + +### Attribute Evaluation Order + +Unlike the evaluation order of stray `comptime {}` blocks within functions, attributes have a well-defined evaluation +order. Within a module, attributes are evaluated top to bottom. Between modules, attributes in child modules are evaluated +first. Attributes in sibling modules are resolved following the `mod foo; mod bar;` declaration order within their parent +modules. + +```rust +mod foo; // attributes in foo are run first +mod bar; // followed by attributes in bar + +// followed by any attributes in the parent module +#[derive(Eq)] +struct Baz {} +``` + +Note that because of this evaluation order, you may get an error trying to derive a trait for a struct whose fields +have not yet had the trait derived already: + +```rust +// Error! `Bar` field of `Foo` does not (yet) implement Eq! +#[derive(Eq)] +struct Foo { + bar: Bar +} + +#[derive(Eq)] +struct Bar {} +``` + +In this case, the issue can be resolved by rearranging the structs. + +--- + +## Comptime API + +Although `comptime`, `quote`, and unquoting provide a flexible base for writing macros, +Noir's true metaprogramming ability comes from being able to interact with the compiler through a compile-time API. +This API can be accessed through built-in functions in `std::meta` as well as on methods of several `comptime` types. + +The following is an incomplete list of some `comptime` types along with some useful methods on them. You can see more in the standard library [Metaprogramming section](../standard_library/meta). + +- `Quoted`: A token stream +- `Type`: The type of a Noir type + - `fn implements(self, constraint: TraitConstraint) -> bool` + - Returns true if `self` implements the given trait constraint +- `Expr`: A syntactically valid expression. Can be used to recur on a program's parse tree to inspect how it is structured. + - Methods: + - `fn as_function_call(self) -> Option<(Expr, [Expr])>` + - If this is a function call expression, return `(function, arguments)` + - `fn as_block(self) -> Option<[Expr]>` + - If this is a block, return each statement in the block +- `FunctionDefinition`: A function definition + - Methods: + - `fn parameters(self) -> [(Quoted, Type)]` + - Returns a slice of `(name, type)` pairs for each parameter +- `StructDefinition`: A struct definition + - Methods: + - `fn as_type(self) -> Type` + - Returns this `StructDefinition` as a `Type`. Any generics are kept as-is + - `fn generics(self) -> [Quoted]` + - Return the name of each generic on this struct + - `fn fields(self) -> [(Quoted, Type)]` + - Return the name and type of each field +- `TraitConstraint`: A trait constraint such as `From` +- `TypedExpr`: A type-checked expression. +- `UnresolvedType`: A syntactic notation that refers to a Noir type that hasn't been resolved yet + +There are many more functions available by exploring the `std::meta` module and its submodules. +Using these methods is the key to writing powerful metaprogramming libraries. + +### `#[use_callers_scope]` + +Since certain functions such as `Quoted::as_type`, `Expression::as_type`, or `Quoted::as_trait_constraint` will attempt +to resolve their contents in a particular scope - it can be useful to change the scope they resolve in. By default +these functions will resolve in the current function's scope which is usually the attribute function they are called in. +If you're working on a library however, this may be a completely different module or crate to the item you're trying to +use the attribute on. If you want to be able to use `Quoted::as_type` to refer to types local to the caller's scope for +example, you can annotate your attribute function with `#[use_callers_scope]`. This will ensure your attribute, and any +closures it uses, can refer to anything in the caller's scope. `#[use_callers_scope]` also works recursively. So if both +your attribute function and a helper function it calls use it, then they can both refer to the same original caller. + +--- + +## Example: Derive + +Using all of the above, we can write a `derive` macro that behaves similarly to Rust's but is not built into the language. +From the user's perspective it will look like this: + +```rust +// Example usage +#[derive(Default, Eq, Ord)] +struct MyStruct { my_field: u32 } +``` + +To implement `derive` we'll have to create a `comptime` function that accepts +a variable amount of traits. + +```rust title="derive_example" showLineNumbers +// These are needed for the unconstrained hashmap we're using to store derive functions +use crate::collections::umap::UHashMap; +use crate::hash::BuildHasherDefault; +use crate::hash::poseidon2::Poseidon2Hasher; + +// A derive function is one that given a struct definition can +// create us a quoted trait impl from it. +pub type DeriveFunction = fn(StructDefinition) -> Quoted; + +// We'll keep a global HANDLERS map to keep track of the derive handler for each trait +comptime mut global HANDLERS: UHashMap> = + UHashMap::default(); + +// Given a struct and a slice of traits to derive, create trait impls for each. +// This function is as simple as iterating over the slice, checking if we have a trait +// handler registered for the given trait, calling it, and appending the result. +#[varargs] +pub comptime fn derive(s: StructDefinition, traits: [TraitDefinition]) -> Quoted { + let mut result = quote {}; + + for trait_to_derive in traits { + let handler = HANDLERS.get(trait_to_derive); + assert(handler.is_some(), f"No derive function registered for `{trait_to_derive}`"); + + let trait_impl = handler.unwrap()(s); + result = quote { $result $trait_impl }; + } + + result +} +``` +> Source code: noir_stdlib/src/meta/mod.nr#L31-L64 + + +Registering a derive function could be done as follows: + +```rust title="derive_via" showLineNumbers +// To register a handler for a trait, just add it to our handlers map +pub comptime fn derive_via(t: TraitDefinition, f: DeriveFunction) { + HANDLERS.insert(t, f); +} +``` +> Source code: noir_stdlib/src/meta/mod.nr#L66-L73 + + +```rust title="big-derive-usage-example" showLineNumbers +// Finally, to register a handler we call the above function as an annotation + // with our handler function. + #[derive_via(derive_do_nothing)] + trait DoNothing { + fn do_nothing(self); + } + + comptime fn derive_do_nothing(s: StructDefinition) -> Quoted { + // This is simplified since we don't handle generics or where clauses! + // In a real example we'd likely also need to introduce each of + // `s.generics()` as well as a trait constraint for each generic + // to ensure they also implement the trait. + let typ = s.as_type(); + quote { + impl DoNothing for $typ { + fn do_nothing(self) { + // Traits can't tell us what to do + println("something"); + } + } + } + } + + // Since `DoNothing` is a simple trait which: + // 1. Only has one method + // 2. Does not have any generics on the trait itself + // We can use `std::meta::make_trait_impl` to help us out. + // This helper function will generate our impl for us along with any + // necessary where clauses and still provides a flexible interface + // for us to work on each field on the struct. + comptime fn derive_do_nothing_alt(s: StructDefinition) -> Quoted { + let trait_name = quote { DoNothing }; + let method_signature = quote { fn do_nothing(self) }; + + // Call `do_nothing` recursively on each field in the struct + let for_each_field = |field_name| quote { self.$field_name.do_nothing(); }; + + // Some traits like Eq want to join each field expression with something like `&`. + // We don't need that here + let join_fields_with = quote {}; + + // The body function is a spot to insert any extra setup/teardown needed. + // We'll insert our println here. Since we recur on each field, we should see + // one println for the struct itself, followed by a println for every field (recursively). + let body = |body| quote { + println("something"); + $body + }; + crate::meta::make_trait_impl( + s, + trait_name, + method_signature, + for_each_field, + join_fields_with, + body, + ) + } +``` +> Source code: noir_stdlib/src/meta/mod.nr#L191-L249 + diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/control_flow.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/control_flow.md new file mode 100644 index 00000000000..b365bb22728 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/control_flow.md @@ -0,0 +1,79 @@ +--- +title: Control Flow +description: + Learn how to use loops and if expressions in the Noir programming language. Discover the syntax + and examples for for loops and if-else statements. +keywords: [Noir programming language, loops, for loop, if-else statements, Rust syntax] +sidebar_position: 2 +--- + +## If Expressions + +Noir supports `if-else` statements. The syntax is most similar to Rust's where it is not required +for the statement's conditional to be surrounded by parentheses. + +```rust +let a = 0; +let mut x: u32 = 0; + +if a == 0 { + if a != 0 { + x = 6; + } else { + x = 2; + } +} else { + x = 5; + assert(x == 5); +} +assert(x == 2); +``` + +## Loops + +Noir has one kind of loop: the `for` loop. `for` loops allow you to repeat a block of code multiple +times. + +The following block of code between the braces is run 10 times. + +```rust +for i in 0..10 { + // do something +} +``` + +Alternatively, `start..=end` can be used for a range that is inclusive on both ends. + +The index for loops is of type `u64`. + +### Break and Continue + +In unconstrained code, `break` and `continue` are also allowed in `for` loops. These are only allowed +in unconstrained code since normal constrained code requires that Noir knows exactly how many iterations +a loop may have. `break` and `continue` can be used like so: + +```rust +for i in 0 .. 10 { + println("Iteration start") + + if i == 2 { + continue; + } + + if i == 5 { + break; + } + + println(i); +} +println("Loop end") +``` + +When used, `break` will end the current loop early and jump to the statement after the for loop. In the example +above, the `break` will stop the loop and jump to the `println("Loop end")`. + +`continue` will stop the current iteration of the loop, and jump to the start of the next iteration. In the example +above, `continue` will jump to `println("Iteration start")` when used. Note that the loop continues as normal after this. +The iteration variable `i` is still increased by one as normal when `continue` is used. + +`break` and `continue` cannot currently be used to jump out of more than a single loop at a time. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_bus.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_bus.mdx new file mode 100644 index 00000000000..e55e58622ce --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_bus.mdx @@ -0,0 +1,23 @@ +--- +title: Data Bus +sidebar_position: 13 +--- +import Experimental from '@site/src/components/Notes/_experimental.mdx'; + + + +The data bus is an optimization that the backend can use to make recursion more efficient. +In order to use it, you must define some inputs of the program entry points (usually the `main()` +function) with the `call_data` modifier, and the return values with the `return_data` modifier. +These modifiers are incompatible with `pub` and `mut` modifiers. + +## Example + +```rust +fn main(mut x: u32, y: call_data u32, z: call_data [u32;4] ) -> return_data u32 { + let a = z[x]; + a+y +} +``` + +As a result, both call_data and return_data will be treated as private inputs and encapsulated into a read-only array each, for the backend to process. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/_category_.json b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/_category_.json new file mode 100644 index 00000000000..5d694210bbf --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/_category_.json @@ -0,0 +1,5 @@ +{ + "position": 0, + "collapsible": true, + "collapsed": true +} diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/arrays.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/arrays.md new file mode 100644 index 00000000000..289145a8c4d --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/arrays.md @@ -0,0 +1,276 @@ +--- +title: Arrays +description: + Dive into the Array data type in Noir. Grasp its methods, practical examples, and best practices for efficiently using Arrays in your Noir code. +keywords: + [ + noir, + array type, + methods, + examples, + indexing, + ] +sidebar_position: 4 +--- + +An array is one way of grouping together values into one compound type. Array types can be inferred +or explicitly specified via the syntax `[; ]`: + +```rust +fn main(x : Field, y : Field) { + let my_arr = [x, y]; + let your_arr: [Field; 2] = [x, y]; +} +``` + +Here, both `my_arr` and `your_arr` are instantiated as an array containing two `Field` elements. + +Array elements can be accessed using indexing: + +```rust +fn main() { + let a = [1, 2, 3, 4, 5]; + + let first = a[0]; + let second = a[1]; +} +``` + +All elements in an array must be of the same type (i.e. homogeneous). That is, an array cannot group +a `Field` value and a `u8` value together for example. + +You can write mutable arrays, like: + +```rust +fn main() { + let mut arr = [1, 2, 3, 4, 5]; + assert(arr[0] == 1); + + arr[0] = 42; + assert(arr[0] == 42); +} +``` + +You can instantiate a new array of a fixed size with the same value repeated for each element. The following example instantiates an array of length 32 where each element is of type Field and has the value 0. + +```rust +let array: [Field; 32] = [0; 32]; +``` + +Like in Rust, arrays in Noir are a fixed size. However, if you wish to convert an array to a [slice](./slices.mdx), you can just call `as_slice` on your array: + +```rust +let array: [Field; 32] = [0; 32]; +let sl = array.as_slice() +``` + +You can define multidimensional arrays: + +```rust +let array : [[Field; 2]; 2]; +let element = array[0][0]; +``` + +However, multidimensional slices are not supported. For example, the following code will error at compile time: + +```rust +let slice : [[Field]] = &[]; +``` + +## Types + +You can create arrays of primitive types or structs. There is not yet support for nested arrays +(arrays of arrays) or arrays of structs that contain arrays. + +## Methods + +For convenience, the STD provides some ready-to-use, common methods for arrays. +Each of these functions are located within the generic impl `impl [T; N] {`. +So anywhere `self` appears, it refers to the variable `self: [T; N]`. + +### len + +Returns the length of an array + +```rust +fn len(self) -> Field +``` + +example + +```rust +fn main() { + let array = [42, 42]; + assert(array.len() == 2); +} +``` + +### sort + +Returns a new sorted array. The original array remains untouched. Notice that this function will +only work for arrays of fields or integers, not for any arbitrary type. This is because the sorting +logic it uses internally is optimized specifically for these values. If you need a sort function to +sort any type, you should use the function `sort_via` described below. + +```rust +fn sort(self) -> [T; N] +``` + +example + +```rust +fn main() { + let arr = [42, 32]; + let sorted = arr.sort(); + assert(sorted == [32, 42]); +} +``` + +### sort_via + +Sorts the array with a custom comparison function. The ordering function must return true if the first argument should be sorted to be before the second argument or is equal to the second argument. + +Using this method with an operator like `<` that does not return `true` for equal values will result in an assertion failure for arrays with equal elements. + +```rust +fn sort_via(self, ordering: fn(T, T) -> bool) -> [T; N] +``` + +example + +```rust +fn main() { + let arr = [42, 32] + let sorted_ascending = arr.sort_via(|a, b| a <= b); + assert(sorted_ascending == [32, 42]); // verifies + + let sorted_descending = arr.sort_via(|a, b| a >= b); + assert(sorted_descending == [32, 42]); // does not verify +} +``` + +### map + +Applies a function to each element of the array, returning a new array containing the mapped elements. + +```rust +fn map(self, f: fn(T) -> U) -> [U; N] +``` + +example + +```rust +let a = [1, 2, 3]; +let b = a.map(|a| a * 2); // b is now [2, 4, 6] +``` + +### fold + +Applies a function to each element of the array, returning the final accumulated value. The first +parameter is the initial value. + +```rust +fn fold(self, mut accumulator: U, f: fn(U, T) -> U) -> U +``` + +This is a left fold, so the given function will be applied to the accumulator and first element of +the array, then the second, and so on. For a given call the expected result would be equivalent to: + +```rust +let a1 = [1]; +let a2 = [1, 2]; +let a3 = [1, 2, 3]; + +let f = |a, b| a - b; +a1.fold(10, f) //=> f(10, 1) +a2.fold(10, f) //=> f(f(10, 1), 2) +a3.fold(10, f) //=> f(f(f(10, 1), 2), 3) +``` + +example: + +```rust + +fn main() { + let arr = [2, 2, 2, 2, 2]; + let folded = arr.fold(0, |a, b| a + b); + assert(folded == 10); +} + +``` + +### reduce + +Same as fold, but uses the first element as the starting element. + +Requires `self` to be non-empty. + +```rust +fn reduce(self, f: fn(T, T) -> T) -> T +``` + +example: + +```rust +fn main() { + let arr = [2, 2, 2, 2, 2]; + let reduced = arr.reduce(|a, b| a + b); + assert(reduced == 10); +} +``` + +### all + +Returns true if all the elements satisfy the given predicate + +```rust +fn all(self, predicate: fn(T) -> bool) -> bool +``` + +example: + +```rust +fn main() { + let arr = [2, 2, 2, 2, 2]; + let all = arr.all(|a| a == 2); + assert(all); +} +``` + +### any + +Returns true if any of the elements satisfy the given predicate + +```rust +fn any(self, predicate: fn(T) -> bool) -> bool +``` + +example: + +```rust +fn main() { + let arr = [2, 2, 2, 2, 5]; + let any = arr.any(|a| a == 5); + assert(any); +} +``` + +### as_str_unchecked + +Converts a byte array of type `[u8; N]` to a string. Note that this performs no UTF-8 validation - +the given array is interpreted as-is as a string. + +```rust +impl [u8; N] { + pub fn as_str_unchecked(self) -> str +} +``` + +example: + +```rust +fn main() { + let hi = [104, 105].as_str_unchecked(); + assert_eq(hi, "hi"); +} +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/booleans.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/booleans.md new file mode 100644 index 00000000000..2507af710e7 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/booleans.md @@ -0,0 +1,28 @@ +--- +title: Booleans +description: + Delve into the Boolean data type in Noir. Understand its methods, practical examples, and best practices for using Booleans in your Noir programs. +keywords: + [ + noir, + boolean type, + methods, + examples, + logical operations, + ] +sidebar_position: 2 +--- + + +The `bool` type in Noir has two possible values: `true` and `false`: + +```rust +fn main() { + let t = true; + let f: bool = false; +} +``` + +The boolean type is most commonly used in conditionals like `if` expressions and `assert` +statements. More about conditionals is covered in the [Control Flow](../control_flow.md) and +[Assert Function](../assert.md) sections. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/fields.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/fields.md new file mode 100644 index 00000000000..6739d6500dd --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/fields.md @@ -0,0 +1,246 @@ +--- +title: Fields +description: + Dive deep into the Field data type in Noir. Understand its methods, practical examples, and best practices to effectively use Fields in your Noir programs. +keywords: + [ + noir, + field type, + methods, + examples, + best practices, + ] +sidebar_position: 0 +--- + +The field type corresponds to the native field type of the proving backend. + +The size of a Noir field depends on the elliptic curve's finite field for the proving backend +adopted. For example, a field would be a 254-bit integer when paired with the default backend that +spans the Grumpkin curve. + +Fields support integer arithmetic and are often used as the default numeric type in Noir: + +```rust +fn main(x : Field, y : Field) { + let z = x + y; +} +``` + +`x`, `y` and `z` are all private fields in this example. Using the `let` keyword we defined a new +private value `z` constrained to be equal to `x + y`. + +If proving efficiency is of priority, fields should be used as a default for solving problems. +Smaller integer types (e.g. `u64`) incur extra range constraints. + +## Methods + +After declaring a Field, you can use these common methods on it: + +### to_le_bits + +Transforms the field into an array of bits, Little Endian. + +```rust title="to_le_bits" showLineNumbers +pub fn to_le_bits(self: Self) -> [u1; N] {} +``` +> Source code: noir_stdlib/src/field/mod.nr#L32-L34 + + +example: + +```rust title="to_le_bits_example" showLineNumbers +fn test_to_le_bits() { + let field = 2; + let bits: [u1; 8] = field.to_le_bits(); + assert_eq(bits, [0, 1, 0, 0, 0, 0, 0, 0]); + } +``` +> Source code: noir_stdlib/src/field/mod.nr#L277-L283 + + + +### to_be_bits + +Transforms the field into an array of bits, Big Endian. + +```rust title="to_be_bits" showLineNumbers +pub fn to_be_bits(self: Self) -> [u1; N] {} +``` +> Source code: noir_stdlib/src/field/mod.nr#L48-L50 + + +example: + +```rust title="to_be_bits_example" showLineNumbers +fn test_to_be_bits() { + let field = 2; + let bits: [u1; 8] = field.to_be_bits(); + assert_eq(bits, [0, 0, 0, 0, 0, 0, 1, 0]); + } +``` +> Source code: noir_stdlib/src/field/mod.nr#L268-L274 + + + +### to_le_bytes + +Transforms into an array of bytes, Little Endian + +```rust title="to_le_bytes" showLineNumbers +pub fn to_le_bytes(self: Self) -> [u8; N] { +``` +> Source code: noir_stdlib/src/field/mod.nr#L61-L63 + + +example: + +```rust title="to_le_bytes_example" showLineNumbers +fn test_to_le_bytes() { + let field = 2; + let bytes: [u8; 8] = field.to_le_bytes(); + assert_eq(bytes, [2, 0, 0, 0, 0, 0, 0, 0]); + assert_eq(Field::from_le_bytes::<8>(bytes), field); + } +``` +> Source code: noir_stdlib/src/field/mod.nr#L296-L303 + + +### to_be_bytes + +Transforms into an array of bytes, Big Endian + +```rust title="to_be_bytes" showLineNumbers +pub fn to_be_bytes(self: Self) -> [u8; N] { +``` +> Source code: noir_stdlib/src/field/mod.nr#L94-L96 + + +example: + +```rust title="to_be_bytes_example" showLineNumbers +fn test_to_be_bytes() { + let field = 2; + let bytes: [u8; 8] = field.to_be_bytes(); + assert_eq(bytes, [0, 0, 0, 0, 0, 0, 0, 2]); + assert_eq(Field::from_be_bytes::<8>(bytes), field); + } +``` +> Source code: noir_stdlib/src/field/mod.nr#L286-L293 + + + +### to_le_radix + +Decomposes into an array over the specified base, Little Endian + +```rust title="to_le_radix" showLineNumbers +pub fn to_le_radix(self: Self, radix: u32) -> [u8; N] { + // Brillig does not need an immediate radix + if !crate::runtime::is_unconstrained() { + crate::assert_constant(radix); + } + self.__to_le_radix(radix) + } +``` +> Source code: noir_stdlib/src/field/mod.nr#L118-L126 + + + +example: + +```rust title="to_le_radix_example" showLineNumbers +fn test_to_le_radix() { + let field = 2; + let bytes: [u8; 8] = field.to_le_radix(256); + assert_eq(bytes, [2, 0, 0, 0, 0, 0, 0, 0]); + assert_eq(Field::from_le_bytes::<8>(bytes), field); + } +``` +> Source code: noir_stdlib/src/field/mod.nr#L316-L323 + + + +### to_be_radix + +Decomposes into an array over the specified base, Big Endian + +```rust title="to_be_radix" showLineNumbers +pub fn to_be_radix(self: Self, radix: u32) -> [u8; N] { + // Brillig does not need an immediate radix + if !crate::runtime::is_unconstrained() { + crate::assert_constant(radix); + } + self.__to_be_radix(radix) + } +``` +> Source code: noir_stdlib/src/field/mod.nr#L128-L136 + + +example: + +```rust title="to_be_radix_example" showLineNumbers +fn test_to_be_radix() { + let field = 2; + let bytes: [u8; 8] = field.to_be_radix(256); + assert_eq(bytes, [0, 0, 0, 0, 0, 0, 0, 2]); + assert_eq(Field::from_be_bytes::<8>(bytes), field); + } +``` +> Source code: noir_stdlib/src/field/mod.nr#L306-L313 + + + +### pow_32 + +Returns the value to the power of the specified exponent + +```rust +fn pow_32(self, exponent: Field) -> Field +``` + +example: + +```rust +fn main() { + let field = 2 + let pow = field.pow_32(4); + assert(pow == 16); +} +``` + +### assert_max_bit_size + +Adds a constraint to specify that the field can be represented with `bit_size` number of bits + +```rust title="assert_max_bit_size" showLineNumbers +pub fn assert_max_bit_size(self) { +``` +> Source code: noir_stdlib/src/field/mod.nr#L10-L12 + + +example: + +```rust +fn main() { + let field = 2 + field.assert_max_bit_size::<32>(); +} +``` + +### sgn0 + +Parity of (prime) Field element, i.e. sgn0(x mod p) = 0 if x ∈ \{0, ..., p-1\} is even, otherwise sgn0(x mod p) = 1. + +```rust +fn sgn0(self) -> u1 +``` + + +### lt + +Returns true if the field is less than the other field + +```rust +pub fn lt(self, another: Field) -> bool +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/function_types.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/function_types.md new file mode 100644 index 00000000000..f6121af17e2 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/function_types.md @@ -0,0 +1,26 @@ +--- +title: Function types +sidebar_position: 10 +--- + +Noir supports higher-order functions. The syntax for a function type is as follows: + +```rust +fn(arg1_type, arg2_type, ...) -> return_type +``` + +Example: + +```rust +fn assert_returns_100(f: fn() -> Field) { // f takes no args and returns a Field + assert(f() == 100); +} + +fn main() { + assert_returns_100(|| 100); // ok + assert_returns_100(|| 150); // fails +} +``` + +A function type also has an optional capture environment - this is necessary to support closures. +See [Lambdas](../lambdas.md) for more details. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/index.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/index.md new file mode 100644 index 00000000000..0f2db2b2d75 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/index.md @@ -0,0 +1,126 @@ +--- +title: Data Types +description: + Get a clear understanding of the two categories of Noir data types - primitive types and compound + types. Learn about their characteristics, differences, and how to use them in your Noir + programming. +keywords: + [ + noir, + data types, + primitive types, + compound types, + private types, + public types, + ] +--- + +Every value in Noir has a type, which determines which operations are valid for it. + +All values in Noir are fundamentally composed of `Field` elements. For a more approachable +developing experience, abstractions are added on top to introduce different data types in Noir. + +Noir has two category of data types: primitive types (e.g. `Field`, integers, `bool`) and compound +types that group primitive types (e.g. arrays, tuples, structs). Each value can either be private or +public. + +## Private & Public Types + +A **private value** is known only to the Prover, while a **public value** is known by both the +Prover and Verifier. Mark values as `private` when the value should only be known to the prover. All +primitive types (including individual fields of compound types) in Noir are private by default, and +can be marked public when certain values are intended to be revealed to the Verifier. + +> **Note:** For public values defined in Noir programs paired with smart contract verifiers, once +> the proofs are verified on-chain the values can be considered known to everyone that has access to +> that blockchain. + +Public data types are treated no differently to private types apart from the fact that their values +will be revealed in proofs generated. Simply changing the value of a public type will not change the +circuit (where the same goes for changing values of private types as well). + +_Private values_ are also referred to as _witnesses_ sometimes. + +> **Note:** The terms private and public when applied to a type (e.g. `pub Field`) have a different +> meaning than when applied to a function (e.g. `pub fn foo() {}`). +> +> The former is a visibility modifier for the Prover to interpret if a value should be made known to +> the Verifier, while the latter is a visibility modifier for the compiler to interpret if a +> function should be made accessible to external Noir programs like in other languages. + +### pub Modifier + +All data types in Noir are private by default. Types are explicitly declared as public using the +`pub` modifier: + +```rust +fn main(x : Field, y : pub Field) -> pub Field { + x + y +} +``` + +In this example, `x` is **private** while `y` and `x + y` (the return value) are **public**. Note +that visibility is handled **per variable**, so it is perfectly valid to have one input that is +private and another that is public. + +> **Note:** Public types can only be declared through parameters on `main`. + +## Type Aliases + +A type alias is a new name for an existing type. Type aliases are declared with the keyword `type`: + +```rust +type Id = u8; + +fn main() { + let id: Id = 1; + let zero: u8 = 0; + assert(zero + 1 == id); +} +``` + +Type aliases can also be used with [generics](../generics.md): + +```rust +type Id = Size; + +fn main() { + let id: Id = 1; + let zero: u32 = 0; + assert(zero + 1 == id); +} +``` + +Type aliases can even refer to other aliases. An error will be issued if they form a cycle: + +```rust +// Ok! +type A = B; +type B = Field; + +type Bad1 = Bad2; + +// error: Dependency cycle found +type Bad2 = Bad1; +// ^^^^^^^^^^^ 'Bad2' recursively depends on itself: Bad2 -> Bad1 -> Bad2 +``` + +By default, like functions, type aliases are private to the module they exist in. You can use `pub` +to make the type alias public or `pub(crate)` to make it public to just its crate: + +```rust +// This type alias is now public +pub type Id = u8; +``` + +## Wildcard Type +Noir can usually infer the type of the variable from the context, so specifying the type of a variable is only required when it cannot be inferred. However, specifying a complex type can be tedious, especially when it has multiple generic arguments. Often some of the generic types can be inferred from the context, and Noir only needs a hint to properly infer the other types. We can partially specify a variable's type by using `_` as a marker, indicating where we still want the compiler to infer the type. + +```rust +let a: [_; 4] = foo(b); +``` + + +### BigInt + +You can achieve BigInt functionality using the [Noir BigInt](https://github.com/shuklaayush/noir-bigint) library. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/integers.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/integers.md new file mode 100644 index 00000000000..41a823646dd --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/integers.md @@ -0,0 +1,167 @@ +--- +title: Integers +description: Explore the Integer data type in Noir. Learn about its methods, see real-world examples, and grasp how to efficiently use Integers in your Noir code. +keywords: [noir, integer types, methods, examples, arithmetic] +sidebar_position: 1 +--- + +An integer type is a range constrained field type. +The Noir frontend supports both unsigned and signed integer types. +The allowed sizes are 1, 8, 16, 32 and 64 bits. + +:::info + +When an integer is defined in Noir without a specific type, it will default to `Field`. + +The one exception is for loop indices which default to `u64` since comparisons on `Field`s are not possible. + +::: + +## Unsigned Integers + +An unsigned integer type is specified first with the letter `u` (indicating its unsigned nature) followed by its bit size (e.g. `8`): + +```rust +fn main() { + let x: u8 = 1; + let y: u8 = 1; + let z = x + y; + assert (z == 2); +} +``` + +The bit size determines the maximum value the integer type can store. For example, a `u8` variable can store a value in the range of 0 to 255 (i.e. $\\2^{8}-1\\$). + +## Signed Integers + +A signed integer type is specified first with the letter `i` (which stands for integer) followed by its bit size (e.g. `8`): + +```rust +fn main() { + let x: i8 = -1; + let y: i8 = -1; + let z = x + y; + assert (z == -2); +} +``` + +The bit size determines the maximum and minimum range of value the integer type can store. For example, an `i8` variable can store a value in the range of -128 to 127 (i.e. $\\-2^{7}\\$ to $\\2^{7}-1\\$). + + +```rust +fn main(x: i16, y: i16) { + // modulo + let c = x % y; + let c = x % -13; +} +``` + +Modulo operation is defined for negative integers thanks to integer division, so that the equality `x = (x/y)*y + (x%y)` holds. + +## 128 bits Unsigned Integers + +The built-in structure `U128` allows you to use 128-bit unsigned integers almost like a native integer type. However, there are some differences to keep in mind: +- You cannot cast between a native integer and `U128` +- There is a higher performance cost when using `U128`, compared to a native type. + +Conversion between unsigned integer types and U128 are done through the use of `from_integer` and `to_integer` functions. `from_integer` also accepts the `Field` type as input. + +```rust +fn main() { + let x = U128::from_integer(23); + let y = U128::from_hex("0x7"); + let z = x + y; + assert(z.to_integer() == 30); +} +``` + +`U128` is implemented with two 64 bits limbs, representing the low and high bits, which explains the performance cost. You should expect `U128` to be twice more costly for addition and four times more costly for multiplication. +You can construct a U128 from its limbs: +```rust +fn main(x: u64, y: u64) { + let z = U128::from_u64s_be(x,y); + assert(z.hi == x as Field); + assert(z.lo == y as Field); +} +``` + +Note that the limbs are stored as Field elements in order to avoid unnecessary conversions. +Apart from this, most operations will work as usual: + +```rust +fn main(x: U128, y: U128) { + // multiplication + let c = x * y; + // addition and subtraction + let c = c - x + y; + // division + let c = x / y; + // bit operation; + let c = x & y | y; + // bit shift + let c = x << y; + // comparisons; + let c = x < y; + let c = x == y; +} +``` + +## Overflows + +Computations that exceed the type boundaries will result in overflow errors. This happens with both signed and unsigned integers. For example, attempting to prove: + +```rust +fn main(x: u8, y: u8) { + let z = x + y; +} +``` + +With: + +```toml +x = "255" +y = "1" +``` + +Would result in: + +``` +$ nargo execute +error: Assertion failed: 'attempt to add with overflow' +┌─ ~/src/main.nr:9:13 +│ +│ let z = x + y; +│ ----- +│ += Call stack: + ... +``` + +A similar error would happen with signed integers: + +```rust +fn main() { + let x: i8 = -118; + let y: i8 = -11; + let z = x + y; +} +``` + +### Wrapping methods + +Although integer overflow is expected to error, some use-cases rely on wrapping. For these use-cases, the standard library provides `wrapping` variants of certain common operations: + +```rust +fn wrapping_add(x: T, y: T) -> T; +fn wrapping_sub(x: T, y: T) -> T; +fn wrapping_mul(x: T, y: T) -> T; +``` + +Example of how it is used: + +```rust + +fn main(x: u8, y: u8) -> pub u8 { + std::wrapping_add(x, y) +} +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/references.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/references.md new file mode 100644 index 00000000000..a5293d11cfb --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/references.md @@ -0,0 +1,23 @@ +--- +title: References +sidebar_position: 9 +--- + +Noir supports first-class references. References are a bit like pointers: they point to a specific address that can be followed to access the data stored at that address. You can use Rust-like syntax to use pointers in Noir: the `&` operator references the variable, the `*` operator dereferences it. + +Example: + +```rust +fn main() { + let mut x = 2; + + // you can reference x as &mut and pass it to multiplyBy2 + multiplyBy2(&mut x); +} + +// you can access &mut here +fn multiplyBy2(x: &mut Field) { + // and dereference it with * + *x = *x * 2; +} +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/slices.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/slices.mdx new file mode 100644 index 00000000000..cfee564a302 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/slices.mdx @@ -0,0 +1,358 @@ +--- +title: Slices +description: Explore the Slice data type in Noir. Understand its methods, see real-world examples, and learn how to effectively use Slices in your Noir programs. +keywords: [noir, slice type, methods, examples, subarrays] +sidebar_position: 5 +--- + +import Experimental from '@site/src/components/Notes/_experimental.mdx'; + + + +A slice is a dynamically-sized view into a sequence of elements. They can be resized at runtime, but because they don't own the data, they cannot be returned from a circuit. You can treat slices as arrays without a constrained size. + +```rust +fn main() -> pub u32 { + let mut slice: [Field] = &[0; 2]; + + let mut new_slice = slice.push_back(6); + new_slice.len() +} +``` + +To write a slice literal, use a preceding ampersand as in: `&[0; 2]` or +`&[1, 2, 3]`. + +It is important to note that slices are not references to arrays. In Noir, +`&[..]` is more similar to an immutable, growable vector. + +View the corresponding test file [here][test-file]. + +[test-file]: https://github.com/noir-lang/noir/blob/f387ec1475129732f72ba294877efdf6857135ac/crates/nargo_cli/tests/test_data_ssa_refactor/slices/src/main.nr + +## Methods + +For convenience, the STD provides some ready-to-use, common methods for slices: + +### push_back + +Pushes a new element to the end of the slice, returning a new slice with a length one greater than the original unmodified slice. + +```rust +fn push_back(_self: [T], _elem: T) -> [T] +``` + +example: + +```rust +fn main() -> pub Field { + let mut slice: [Field] = &[0; 2]; + + let mut new_slice = slice.push_back(6); + new_slice.len() +} +``` + +View the corresponding test file [here][test-file]. + +### push_front + +Returns a new array with the specified element inserted at index 0. The existing elements indexes are incremented by 1. + +```rust +fn push_front(_self: Self, _elem: T) -> Self +``` + +Example: + +```rust +let mut new_slice: [Field] = &[]; +new_slice = new_slice.push_front(20); +assert(new_slice[0] == 20); // returns true +``` + +View the corresponding test file [here][test-file]. + +### pop_front + +Returns a tuple of two items, the first element of the array and the rest of the array. + +```rust +fn pop_front(_self: Self) -> (T, Self) +``` + +Example: + +```rust +let (first_elem, rest_of_slice) = slice.pop_front(); +``` + +View the corresponding test file [here][test-file]. + +### pop_back + +Returns a tuple of two items, the beginning of the array with the last element omitted and the last element. + +```rust +fn pop_back(_self: Self) -> (Self, T) +``` + +Example: + +```rust +let (popped_slice, last_elem) = slice.pop_back(); +``` + +View the corresponding test file [here][test-file]. + +### append + +Loops over a slice and adds it to the end of another. + +```rust +fn append(mut self, other: Self) -> Self +``` + +Example: + +```rust +let append = &[1, 2].append(&[3, 4, 5]); +``` + +### insert + +Inserts an element at a specified index and shifts all following elements by 1. + +```rust +fn insert(_self: Self, _index: Field, _elem: T) -> Self +``` + +Example: + +```rust +new_slice = rest_of_slice.insert(2, 100); +assert(new_slice[2] == 100); +``` + +View the corresponding test file [here][test-file]. + +### remove + +Remove an element at a specified index, shifting all elements after it to the left, returning the altered slice and the removed element. + +```rust +fn remove(_self: Self, _index: Field) -> (Self, T) +``` + +Example: + +```rust +let (remove_slice, removed_elem) = slice.remove(3); +``` + +### len + +Returns the length of a slice + +```rust +fn len(self) -> Field +``` + +Example: + +```rust +fn main() { + let slice = &[42, 42]; + assert(slice.len() == 2); +} +``` + +### as_array + +Converts this slice into an array. + +Make sure to specify the size of the resulting array. +Panics if the resulting array length is different than the slice's length. + +```rust +fn as_array(self) -> [T; N] +``` + +Example: + +```rust +fn main() { + let slice = &[5, 6]; + + // Always specify the length of the resulting array! + let array: [Field; 2] = slice.as_array(); + + assert(array[0] == slice[0]); + assert(array[1] == slice[1]); +} +``` + +### map + +Applies a function to each element of the slice, returning a new slice containing the mapped elements. + +```rust +fn map(self, f: fn[Env](T) -> U) -> [U] +``` + +example + +```rust +let a = &[1, 2, 3]; +let b = a.map(|a| a * 2); // b is now &[2, 4, 6] +``` + +### fold + +Applies a function to each element of the slice, returning the final accumulated value. The first +parameter is the initial value. + +```rust +fn fold(self, mut accumulator: U, f: fn[Env](U, T) -> U) -> U +``` + +This is a left fold, so the given function will be applied to the accumulator and first element of +the slice, then the second, and so on. For a given call the expected result would be equivalent to: + +```rust +let a1 = &[1]; +let a2 = &[1, 2]; +let a3 = &[1, 2, 3]; + +let f = |a, b| a - b; +a1.fold(10, f) //=> f(10, 1) +a2.fold(10, f) //=> f(f(10, 1), 2) +a3.fold(10, f) //=> f(f(f(10, 1), 2), 3) +``` + +example: + +```rust + +fn main() { + let slice = &[2, 2, 2, 2, 2]; + let folded = slice.fold(0, |a, b| a + b); + assert(folded == 10); +} + +``` + +### reduce + +Same as fold, but uses the first element as the starting element. + +```rust +fn reduce(self, f: fn[Env](T, T) -> T) -> T +``` + +example: + +```rust +fn main() { + let slice = &[2, 2, 2, 2, 2]; + let reduced = slice.reduce(|a, b| a + b); + assert(reduced == 10); +} +``` + +### filter + +Returns a new slice containing only elements for which the given predicate returns true. + +```rust +fn filter(self, f: fn[Env](T) -> bool) -> Self +``` + +example: + +```rust +fn main() { + let slice = &[1, 2, 3, 4, 5]; + let odds = slice.filter(|x| x % 2 == 1); + assert_eq(odds, &[1, 3, 5]); +} +``` + +### join + +Flatten each element in the slice into one value, separated by `separator`. + +Note that although slices implement `Append`, `join` cannot be used on slice +elements since nested slices are prohibited. + +```rust +fn join(self, separator: T) -> T where T: Append +``` + +example: + +```rust +struct Accumulator { + total: Field, +} + +// "Append" two accumulators by adding them +impl Append for Accumulator { + fn empty() -> Self { + Self { total: 0 } + } + + fn append(self, other: Self) -> Self { + Self { total: self.total + other.total } + } +} + +fn main() { + let slice = &[1, 2, 3, 4, 5].map(|total| Accumulator { total }); + + let result = slice.join(Accumulator::empty()); + assert_eq(result, Accumulator { total: 15 }); + + // We can use a non-empty separator to insert additional elements to sum: + let separator = Accumulator { total: 10 }; + let result = slice.join(separator); + assert_eq(result, Accumulator { total: 55 }); +} +``` + +### all + +Returns true if all the elements satisfy the given predicate + +```rust +fn all(self, predicate: fn[Env](T) -> bool) -> bool +``` + +example: + +```rust +fn main() { + let slice = &[2, 2, 2, 2, 2]; + let all = slice.all(|a| a == 2); + assert(all); +} +``` + +### any + +Returns true if any of the elements satisfy the given predicate + +```rust +fn any(self, predicate: fn[Env](T) -> bool) -> bool +``` + +example: + +```rust +fn main() { + let slice = &[2, 2, 2, 2, 5]; + let any = slice.any(|a| a == 5); + assert(any); +} + +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/strings.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/strings.md new file mode 100644 index 00000000000..b2257e8bdbb --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/strings.md @@ -0,0 +1,114 @@ +--- +title: Strings +description: + Discover the String data type in Noir. Learn about its methods, see real-world examples, and understand how to effectively manipulate and use Strings in Noir. +keywords: + [ + noir, + string type, + methods, + examples, + concatenation, + ] +sidebar_position: 3 +--- + + +The string type is a fixed length value defined with `str`. + +You can use strings in `assert()` functions or print them with +`println()`. See more about [Logging](../../standard_library/logging.md). + +```rust + +fn main(message : pub str<11>, hex_as_string : str<4>) { + println(message); + assert(message == "hello world"); + assert(hex_as_string == "0x41"); +} +``` + +You can convert a `str` to a byte array by calling `as_bytes()` +or a vector by calling `as_bytes_vec()`. + +```rust +fn main() { + let message = "hello world"; + let message_bytes = message.as_bytes(); + let mut message_vec = message.as_bytes_vec(); + assert(message_bytes.len() == 11); + assert(message_bytes[0] == 104); + assert(message_bytes[0] == message_vec.get(0)); +} +``` + +## Escape characters + +You can use escape characters for your strings: + +| Escape Sequence | Description | +|-----------------|-----------------| +| `\r` | Carriage Return | +| `\n` | Newline | +| `\t` | Tab | +| `\0` | Null Character | +| `\"` | Double Quote | +| `\\` | Backslash | + +Example: + +```rust +let s = "Hello \"world" // prints "Hello "world" +let s = "hey \tyou"; // prints "hey you" +``` + +## Raw strings + +A raw string begins with the letter `r` and is optionally delimited by a number of hashes `#`. + +Escape characters are *not* processed within raw strings. All contents are interpreted literally. + +Example: + +```rust +let s = r"Hello world"; +let s = r#"Simon says "hello world""#; + +// Any number of hashes may be used (>= 1) as long as the string also terminates with the same number of hashes +let s = r#####"One "#, Two "##, Three "###, Four "####, Five will end the string."#####; +``` + +## Format strings + +A format string begins with the letter `f` and allows inserting the value of local and global variables in it. + +Example: + +```rust +let four = 2 + 2; +let s = f"Two plus two is: {four}"; +println(s); +``` + +The output of the above program is: + +```text +Two plus two is: 4 +``` + +To insert the value of a local or global variable, put it inside `{...}` in the string. + +If you need to write the `{` or `}` characters, use `{{` and `}}` respectively: + +```rust +let four = 2 + 2; + +// Prints "This is not expanded: {four}" +println(f"This is not expanded: {{four}}"); +``` + +More complex expressions are not allowed inside `{...}`: + +```rust +let s = f"Two plus two is: {2 + 2}" // Error: invalid format string +``` \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/structs.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/structs.md new file mode 100644 index 00000000000..29951ae843a --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/structs.md @@ -0,0 +1,96 @@ +--- +title: Structs +description: + Explore the Struct data type in Noir. Learn about its methods, see real-world examples, and grasp how to effectively define and use Structs in your Noir programs. +keywords: + [ + noir, + struct type, + methods, + examples, + data structures, + ] +sidebar_position: 8 +--- + +A struct also allows for grouping multiple values of different types. Unlike tuples, we can also +name each field. + +> **Note:** The usage of _field_ here refers to each element of the struct and is unrelated to the +> field type of Noir. + +Defining a struct requires giving it a name and listing each field within as `: ` pairs: + +```rust +struct Animal { + hands: Field, + legs: Field, + eyes: u8, +} +``` + +An instance of a struct can then be created with actual values in `: ` pairs in any +order. Struct fields are accessible using their given names: + +```rust +fn main() { + let legs = 4; + + let dog = Animal { + eyes: 2, + hands: 0, + legs, + }; + + let zero = dog.hands; +} +``` + +Structs can also be destructured in a pattern, binding each field to a new variable: + +```rust +fn main() { + let Animal { hands, legs: feet, eyes } = get_octopus(); + + let ten = hands + feet + eyes as u8; +} + +fn get_octopus() -> Animal { + let octopus = Animal { + hands: 0, + legs: 8, + eyes: 2, + }; + + octopus +} +``` + +The new variables can be bound with names different from the original struct field names, as +showcased in the `legs --> feet` binding in the example above. + +### Visibility + +By default, like functions, structs are private to the module they exist in. You can use `pub` +to make the struct public or `pub(crate)` to make it public to just its crate: + +```rust +// This struct is now public +pub struct Animal { + hands: Field, + legs: Field, + eyes: u8, +} +``` + +The same applies to struct fields: by default they are private to the module they exist in, +but they can be made `pub` or `pub(crate)`: + +```rust +// This struct is now public +pub struct Animal { + hands: Field, // private to its module + pub(crate) legs: Field, // accessible from the entire crate + pub eyes: u8, // accessible from anywhere +} +``` \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/tuples.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/tuples.md new file mode 100644 index 00000000000..2ec5c9c4113 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/data_types/tuples.md @@ -0,0 +1,48 @@ +--- +title: Tuples +description: + Dive into the Tuple data type in Noir. Understand its methods, practical examples, and best practices for efficiently using Tuples in your Noir code. +keywords: + [ + noir, + tuple type, + methods, + examples, + multi-value containers, + ] +sidebar_position: 7 +--- + +A tuple collects multiple values like an array, but with the added ability to collect values of +different types: + +```rust +fn main() { + let tup: (u8, u64, Field) = (255, 500, 1000); +} +``` + +One way to access tuple elements is via destructuring using pattern matching: + +```rust +fn main() { + let tup = (1, 2); + + let (one, two) = tup; + + let three = one + two; +} +``` + +Another way to access tuple elements is via direct member access, using a period (`.`) followed by +the index of the element we want to access. Index `0` corresponds to the first tuple element, `1` to +the second and so on: + +```rust +fn main() { + let tup = (5, 6, 7, 8); + + let five = tup.0; + let eight = tup.3; +} +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/functions.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/functions.md new file mode 100644 index 00000000000..f656cdfd97a --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/functions.md @@ -0,0 +1,226 @@ +--- +title: Functions +description: + Learn how to declare functions and methods in Noir, a programming language with Rust semantics. + This guide covers parameter declaration, return types, call expressions, and more. +keywords: [Noir, Rust, functions, methods, parameter declaration, return types, call expressions] +sidebar_position: 1 +--- + +Functions in Noir follow the same semantics of Rust, though Noir does not support early returns. + +To declare a function the `fn` keyword is used. + +```rust +fn foo() {} +``` + +By default, functions are visible only within the package they are defined. To make them visible outside of that package (for example, as part of a [library](../modules_packages_crates/crates_and_packages.md#libraries)), you should mark them as `pub`: + +```rust +pub fn foo() {} +``` + +You can also restrict the visibility of the function to only the crate it was defined in, by specifying `pub(crate)`: + +```rust +pub(crate) fn foo() {} //foo can only be called within its crate +``` + +All parameters in a function must have a type and all types are known at compile time. The parameter +is pre-pended with a colon and the parameter type. Multiple parameters are separated using a comma. + +```rust +fn foo(x : Field, y : Field){} +``` + +The return type of a function can be stated by using the `->` arrow notation. The function below +states that the foo function must return a `Field`. If the function returns no value, then the arrow +is omitted. + +```rust +fn foo(x : Field, y : Field) -> Field { + x + y +} +``` + +Note that a `return` keyword is unneeded in this case - the last expression in a function's body is +returned. + +## Main function + +If you're writing a binary, the `main` function is the starting point of your program. You can pass all types of expressions to it, as long as they have a fixed size at compile time: + +```rust +fn main(x : Field) // this is fine: passing a Field +fn main(x : [Field; 2]) // this is also fine: passing a Field with known size at compile-time +fn main(x : (Field, bool)) // 👌: passing a (Field, bool) tuple means size 2 +fn main(x : str<5>) // this is fine, as long as you pass a string of size 5 + +fn main(x : Vec) // can't compile, has variable size +fn main(x : [Field]) // can't compile, has variable size +fn main(....// i think you got it by now +``` + +Keep in mind [tests](../../tooling/testing.md) don't differentiate between `main` and any other function. The following snippet passes tests, but won't compile or prove: + +```rust +fn main(x : [Field]) { + assert(x[0] == 1); +} + +#[test] +fn test_one() { + main(&[1, 2]); +} +``` + +```bash +$ nargo test +[testing] Running 1 test functions +[testing] Testing test_one... ok +[testing] All tests passed + +$ nargo check +The application panicked (crashed). +Message: Cannot have variable sized arrays as a parameter to main +``` + +## Call Expressions + +Calling a function in Noir is executed by using the function name and passing in the necessary +arguments. + +Below we show how to call the `foo` function from the `main` function using a call expression: + +```rust +fn main(x : Field, y : Field) { + let z = foo(x); +} + +fn foo(x : Field) -> Field { + x + x +} +``` + +## Methods + +You can define methods in Noir on any struct type in scope. + +```rust +struct MyStruct { + foo: Field, + bar: Field, +} + +impl MyStruct { + fn new(foo: Field) -> MyStruct { + MyStruct { + foo, + bar: 2, + } + } + + fn sum(self) -> Field { + self.foo + self.bar + } +} + +fn main() { + let s = MyStruct::new(40); + assert(s.sum() == 42); +} +``` + +Methods are just syntactic sugar for functions, so if we wanted to we could also call `sum` as +follows: + +```rust +assert(MyStruct::sum(s) == 42); +``` + +It is also possible to specialize which method is chosen depending on the [generic](./generics.md) type that is used. In this example, the `foo` function returns different values depending on its type: + +```rust +struct Foo {} + +impl Foo { + fn foo(self) -> Field { 1 } +} + +impl Foo { + fn foo(self) -> Field { 2 } +} + +fn main() { + let f1: Foo = Foo{}; + let f2: Foo = Foo{}; + assert(f1.foo() + f2.foo() == 3); +} +``` + +Also note that impls with the same method name defined in them cannot overlap. For example, if we already have `foo` defined for `Foo` and `Foo` like we do above, we cannot also define `foo` in an `impl Foo` since it would be ambiguous which version of `foo` to choose. + +```rust +// Including this impl in the same project as the above snippet would +// cause an overlapping impls error +impl Foo { + fn foo(self) -> Field { 3 } +} +``` + +## Lambdas + +Lambdas are anonymous functions. They follow the syntax of Rust - `|arg1, arg2, ..., argN| return_expression`. + +```rust +let add_50 = |val| val + 50; +assert(add_50(100) == 150); +``` + +See [Lambdas](./lambdas.md) for more details. + +## Attributes + +Attributes are metadata that can be applied to a function, using the following syntax: `#[attribute(value)]`. + +Supported attributes include: + +- **builtin**: the function is implemented by the compiler, for efficiency purposes. +- **deprecated**: mark the function as _deprecated_. Calling the function will generate a warning: `warning: use of deprecated function` +- **field**: Used to enable conditional compilation of code depending on the field size. See below for more details +- **oracle**: mark the function as _oracle_; meaning it is an external unconstrained function, implemented in noir_js. See [Unconstrained](./unconstrained.md) and [NoirJS](../../reference/NoirJS/noir_js/index.md) for more details. +- **test**: mark the function as unit tests. See [Tests](../../tooling/testing.md) for more details + +### Field Attribute + +The field attribute defines which field the function is compatible for. The function is conditionally compiled, under the condition that the field attribute matches the Noir native field. +The field can be defined implicitly, by using the name of the elliptic curve usually associated to it - for instance bn254, bls12_381 - or explicitly by using the field (prime) order, in decimal or hexadecimal form. +As a result, it is possible to define multiple versions of a function with each version specialized for a different field attribute. This can be useful when a function requires different parameters depending on the underlying elliptic curve. + +Example: we define the function `foo()` three times below. Once for the default Noir bn254 curve, once for the field $\mathbb F_{23}$, which will normally never be used by Noir, and once again for the bls12_381 curve. + +```rust +#[field(bn254)] +fn foo() -> u32 { + 1 +} + +#[field(23)] +fn foo() -> u32 { + 2 +} + +// This commented code would not compile as foo would be defined twice because it is the same field as bn254 +// #[field(21888242871839275222246405745257275088548364400416034343698204186575808495617)] +// fn foo() -> u32 { +// 2 +// } + +#[field(bls12_381)] +fn foo() -> u32 { + 3 +} +``` + +If the field name is not known to Noir, it will discard the function. Field names are case insensitive. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/generics.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/generics.md new file mode 100644 index 00000000000..c180a0ce7e6 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/generics.md @@ -0,0 +1,251 @@ +--- +title: Generics +description: Learn how to use Generics in Noir +keywords: [Noir, Rust, generics, functions, structs] +sidebar_position: 7 +--- + +Generics allow you to use the same functions with multiple different concrete data types. You can +read more about the concept of generics in the Rust documentation +[here](https://doc.rust-lang.org/book/ch10-01-syntax.html). + +Here is a trivial example showing the identity function that supports any type. In Rust, it is +common to refer to the most general type as `T`. We follow the same convention in Noir. + +```rust +fn id(x: T) -> T { + x +} +``` + +## Numeric Generics + +If we want to be generic over array lengths (which are type-level integers), we can use numeric +generics. Using these looks similar to using regular generics, but introducing them into scope +requires declaring them with `let MyGenericName: IntegerType`. This can be done anywhere a normal +generic is declared. Instead of types, these generics resolve to integers at compile-time. +Here's an example of a struct that is generic over the size of the array it contains internally: + +```rust +struct BigInt { + limbs: [u32; N], +} + +impl BigInt { + // `N` is in scope of all methods in the impl + fn first(first: BigInt, second: BigInt) -> Self { + assert(first.limbs != second.limbs); + first + + fn second(first: BigInt, second: Self) -> Self { + assert(first.limbs != second.limbs); + second + } +} +``` + +## In Structs + +Generics are useful for specifying types in structs. For example, we can specify that a field in a +struct will be of a certain generic type. In this case `value` is of type `T`. + +```rust +struct RepeatedValue { + value: T, + count: Field, +} + +impl RepeatedValue { + fn print(self) { + for _i in 0 .. self.count { + println(self.value); + } + } +} + +fn main() { + let repeated = RepeatedValue { value: "Hello!", count: 2 }; + repeated.print(); +} +``` + +The `print` function will print `Hello!` an arbitrary number of times, twice in this case. + +## Calling functions on generic parameters + +Since a generic type `T` can represent any type, how can we call functions on the underlying type? +In other words, how can we go from "any type `T`" to "any type `T` that has certain methods available?" + +This is what [traits](../concepts/traits.md) are for in Noir. Here's an example of a function generic over +any type `T` that implements the `Eq` trait for equality: + +```rust +fn first_element_is_equal(array1: [T; N], array2: [T; N]) -> bool + where T: Eq +{ + if (array1.len() == 0) | (array2.len() == 0) { + true + } else { + array1[0] == array2[0] + } +} + +fn main() { + assert(first_element_is_equal([1, 2, 3], [1, 5, 6])); + + // We can use first_element_is_equal for arrays of any type + // as long as we have an Eq impl for the types we pass in + let array = [MyStruct::new(), MyStruct::new()]; + assert(array_eq(array, array, MyStruct::eq)); +} + +impl Eq for MyStruct { + fn eq(self, other: MyStruct) -> bool { + self.foo == other.foo + } +} +``` + +You can find more details on traits and trait implementations on the [traits page](../concepts/traits.md). + +## Manually Specifying Generics with the Turbofish Operator + +There are times when the compiler cannot reasonably infer what type should be used for a generic, or when the developer themselves may want to manually distinguish generic type parameters. This is where the `::<>` turbofish operator comes into play. + +The `::<>` operator can follow a variable or path and can be used to manually specify generic arguments within the angle brackets. +The name "turbofish" comes from that `::<>` looks like a little fish. + +Examples: +```rust +fn main() { + let mut slice = []; + slice = slice.push_back(1); + slice = slice.push_back(2); + // Without turbofish a type annotation would be needed on the left hand side + let array = slice.as_array::<2>(); +} +``` + + +```rust +trait MyTrait { + fn ten() -> Self; +} + +impl MyTrait for Field { + fn ten() -> Self { 10 } +} + +struct Foo { + inner: T +} + +impl Foo { + fn generic_method(_self: Self) -> U where U: MyTrait { + U::ten() + } +} + +fn example() { + let foo: Foo = Foo { inner: 1 }; + // Using a type other than `Field` here (e.g. u32) would fail as + // there is no matching impl for `u32: MyTrait`. + // + // Substituting the `10` on the left hand side of this assert + // with `10 as u32` would also fail with a type mismatch as we + // are expecting a `Field` from the right hand side. + assert(10 as u32 == foo.generic_method::()); +} +``` + +## Arithmetic Generics + +In addition to numeric generics, Noir also allows a limited form of arithmetic on generics. +When you have a numeric generic such as `N`, you can use the following operators on it in a +type position: `+`, `-`, `*`, `/`, and `%`. + +Note that type checking arithmetic generics is a best effort guess from the compiler and there +are many cases of types that are equal that the compiler may not see as such. For example, +we know that `T * (N + M)` should be equal to `T*N + T*M` but the compiler does not currently +apply the distributive law and thus sees these as different types. + +Even with this limitation though, the compiler can handle common cases decently well: + +```rust +trait Serialize { + fn serialize(self) -> [Field; N]; +} + +impl Serialize<1> for Field { + fn serialize(self) -> [Field; 1] { + [self] + } +} + +impl Serialize for [T; N] + where T: Serialize { .. } + +impl Serialize for (T, U) + where T: Serialize, U: Serialize { .. } + +fn main() { + let data = (1, [2, 3, 4]); + assert_eq(data.serialize().len(), 4); +} +``` + +Note that if there is any over or underflow the types will fail to unify: + +```rust title="underflow-example" showLineNumbers +fn pop(array: [Field; N]) -> [Field; N - 1] { + let mut result: [Field; N - 1] = std::mem::zeroed(); + for i in 0..N - 1 { + result[i] = array[i]; + } + result +} + +fn main() { + // error: Could not determine array length `(0 - 1)` + pop([]); +} +``` +> Source code: test_programs/compile_failure/arithmetic_generics_underflow/src/main.nr#L1-L14 + + +This also applies if there is underflow in an intermediate calculation: + +```rust title="intermediate-underflow-example" showLineNumbers +fn main() { + // From main it looks like there's nothing sketchy going on + seems_fine([]); +} + +// Since `seems_fine` says it can receive and return any length N +fn seems_fine(array: [Field; N]) -> [Field; N] { + // But inside `seems_fine` we pop from the array which + // requires the length to be greater than zero. + + // error: Could not determine array length `(0 - 1)` + push_zero(pop(array)) +} + +fn pop(array: [Field; N]) -> [Field; N - 1] { + let mut result: [Field; N - 1] = std::mem::zeroed(); + for i in 0..N - 1 { + result[i] = array[i]; + } + result +} + +fn push_zero(array: [Field; N]) -> [Field; N + 1] { + let mut result: [Field; N + 1] = std::mem::zeroed(); + for i in 0..N { + result[i] = array[i]; + } + // index N is already zeroed + result +} +``` +> Source code: test_programs/compile_failure/arithmetic_generics_intermediate_underflow/src/main.nr#L1-L32 + diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/globals.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/globals.md new file mode 100644 index 00000000000..c64b6c53746 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/globals.md @@ -0,0 +1,82 @@ +--- +title: Global Variables +description: + Learn about global variables in Noir. Discover how + to declare, modify, and use them in your programs. +keywords: [noir programming language, globals, global variables, constants] +sidebar_position: 8 +--- + +## Globals + + +Noir supports global variables. The global's type must be specified by the user: + +```rust +global N: Field = 5; + +global TUPLE: (Field, Field) = (3, 2); + +fn main() { + assert(N == 5); + assert(N == TUPLE.0 + TUPLE.1); +} +``` + +:::info + +Globals can be defined as any expression, so long as they don't depend on themselves - otherwise there would be a dependency cycle! For example: + +```rust +global T: u32 = foo(T); // dependency error +``` + +::: + + +If they are initialized to a literal integer, globals can be used to specify an array's length: + +```rust +global N: u32 = 2; + +fn main(y : [Field; N]) { + assert(y[0] == y[1]) +} +``` + +A global from another module can be imported or referenced externally like any other name: + +```rust +global N: Field = 20; + +fn main() { + assert(my_submodule::N != N); +} + +mod my_submodule { + global N: Field = 10; +} +``` + +When a global is used, Noir replaces the name with its definition on each occurrence. +This means globals defined using function calls will repeat the call each time they're used: + +```rust +global RESULT: [Field; 100] = foo(); + +fn foo() -> [Field; 100] { ... } +``` + +This is usually fine since Noir will generally optimize any function call that does not +refer to a program input into a constant. It should be kept in mind however, if the called +function performs side-effects like `println`, as these will still occur on each use. + +### Visibility + +By default, like functions, globals are private to the module they exist in. You can use `pub` +to make the global public or `pub(crate)` to make it public to just its crate: + +```rust +// This global is now public +pub global N: u32 = 5; +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/lambdas.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/lambdas.md new file mode 100644 index 00000000000..be3c7e0b5ca --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/lambdas.md @@ -0,0 +1,81 @@ +--- +title: Lambdas +description: Learn how to use anonymous functions in Noir programming language. +keywords: [Noir programming language, lambda, closure, function, anonymous function] +sidebar_position: 9 +--- + +## Introduction + +Lambdas are anonymous functions. The syntax is `|arg1, arg2, ..., argN| return_expression`. + +```rust +let add_50 = |val| val + 50; +assert(add_50(100) == 150); +``` + +A block can be used as the body of a lambda, allowing you to declare local variables inside it: + +```rust +let cool = || { + let x = 100; + let y = 100; + x + y +} + +assert(cool() == 200); +``` + +## Closures + +Inside the body of a lambda, you can use variables defined in the enclosing function. Such lambdas are called **closures**. In this example `x` is defined inside `main` and is accessed from within the lambda: + +```rust +fn main() { + let x = 100; + let closure = || x + 150; + assert(closure() == 250); +} +``` + +## Passing closures to higher-order functions + +It may catch you by surprise that the following code fails to compile: + +```rust +fn foo(f: fn () -> Field) -> Field { + f() +} + +fn main() { + let (x, y) = (50, 50); + assert(foo(|| x + y) == 100); // error :( +} +``` + +The reason is that the closure's capture environment affects its type - we have a closure that captures two Fields and `foo` +expects a regular function as an argument - those are incompatible. +:::note + +Variables contained within the `||` are the closure's parameters, and the expression that follows it is the closure's body. The capture environment is comprised of any variables used in the closure's body that are not parameters. + +E.g. in |x| x + y, y would be a captured variable, but x would not be, since it is a parameter of the closure. + +::: +The syntax for the type of a closure is `fn[env](args) -> ret_type`, where `env` is the capture environment of the closure - +in this example that's `(Field, Field)`. + +The best solution in our case is to make `foo` generic over the environment type of its parameter, so that it can be called +with closures with any environment, as well as with regular functions: + +```rust +fn foo(f: fn[Env]() -> Field) -> Field { + f() +} + +fn main() { + let (x, y) = (50, 50); + assert(foo(|| x + y) == 100); // compiles fine + assert(foo(|| 60) == 60); // compiles fine +} +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/mutability.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/mutability.md new file mode 100644 index 00000000000..fdeef6a87c5 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/mutability.md @@ -0,0 +1,121 @@ +--- +title: Mutability +description: + Learn about mutable variables in Noir. Discover how + to declare, modify, and use them in your programs. +keywords: [noir programming language, mutability in noir, mutable variables] +sidebar_position: 8 +--- + +Variables in noir can be declared mutable via the `mut` keyword. Mutable variables can be reassigned +to via an assignment expression. + +```rust +let x = 2; +x = 3; // error: x must be mutable to be assigned to + +let mut y = 3; +let y = 4; // OK +``` + +The `mut` modifier can also apply to patterns: + +```rust +let (a, mut b) = (1, 2); +a = 11; // error: a must be mutable to be assigned to +b = 12; // OK + +let mut (c, d) = (3, 4); +c = 13; // OK +d = 14; // OK + +// etc. +let MyStruct { x: mut y } = MyStruct { x: a }; +// y is now in scope +``` + +Note that mutability in noir is local and everything is passed by value, so if a called function +mutates its parameters then the parent function will keep the old value of the parameters. + +```rust +fn main() -> pub Field { + let x = 3; + helper(x); + x // x is still 3 +} + +fn helper(mut x: i32) { + x = 4; +} +``` + +## Non-local mutability + +Non-local mutability can be achieved through the mutable reference type `&mut T`: + +```rust +fn set_to_zero(x: &mut Field) { + *x = 0; +} + +fn main() { + let mut y = 42; + set_to_zero(&mut y); + assert(*y == 0); +} +``` + +When creating a mutable reference, the original variable being referred to (`y` in this +example) must also be mutable. Since mutable references are a reference type, they must +be explicitly dereferenced via `*` to retrieve the underlying value. Note that this yields +a copy of the value, so mutating this copy will not change the original value behind the +reference: + +```rust +fn main() { + let mut x = 1; + let x_ref = &mut x; + + let mut y = *x_ref; + let y_ref = &mut y; + + x = 2; + *x_ref = 3; + + y = 4; + *y_ref = 5; + + assert(x == 3); + assert(*x_ref == 3); + assert(y == 5); + assert(*y_ref == 5); +} +``` + +Note that types in Noir are actually deeply immutable so the copy that occurs when +dereferencing is only a conceptual copy - no additional constraints will occur. + +Mutable references can also be stored within structs. Note that there is also +no lifetime parameter on these unlike rust. This is because the allocated memory +always lasts the entire program - as if it were an array of one element. + +```rust +struct Foo { + x: &mut Field +} + +impl Foo { + fn incr(mut self) { + *self.x += 1; + } +} + +fn main() { + let foo = Foo { x: &mut 0 }; + foo.incr(); + assert(*foo.x == 1); +} +``` + +In general, you should avoid non-local & shared mutability unless it is needed. Sticking +to only local mutability will improve readability and potentially improve compiler optimizations as well. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/ops.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/ops.md new file mode 100644 index 00000000000..c35c36c38a9 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/ops.md @@ -0,0 +1,98 @@ +--- +title: Logical Operations +description: + Learn about the supported arithmetic and logical operations in the Noir programming language. + Discover how to perform operations on private input types, integers, and booleans. +keywords: + [ + Noir programming language, + supported operations, + arithmetic operations, + logical operations, + predicate operators, + bitwise operations, + short-circuiting, + backend, + ] +sidebar_position: 3 +--- + +# Operations + +## Table of Supported Operations + +| Operation | Description | Requirements | +| :-------- | :------------------------------------------------------------: | -------------------------------------: | +| + | Adds two private input types together | Types must be private input | +| - | Subtracts two private input types together | Types must be private input | +| \* | Multiplies two private input types together | Types must be private input | +| / | Divides two private input types together | Types must be private input | +| ^ | XOR two private input types together | Types must be integer | +| & | AND two private input types together | Types must be integer | +| \| | OR two private input types together | Types must be integer | +| \<\< | Left shift an integer by another integer amount | Types must be integer, shift must be u8 | +| >> | Right shift an integer by another integer amount | Types must be integer, shift must be u8 | +| ! | Bitwise not of a value | Type must be integer or boolean | +| \< | returns a bool if one value is less than the other | Upper bound must have a known bit size | +| \<= | returns a bool if one value is less than or equal to the other | Upper bound must have a known bit size | +| > | returns a bool if one value is more than the other | Upper bound must have a known bit size | +| >= | returns a bool if one value is more than or equal to the other | Upper bound must have a known bit size | +| == | returns a bool if one value is equal to the other | Both types must not be constants | +| != | returns a bool if one value is not equal to the other | Both types must not be constants | + +### Predicate Operators + +`<,<=, !=, == , >, >=` are known as predicate/comparison operations because they compare two values. +This differs from the operations such as `+` where the operands are used in _computation_. + +### Bitwise Operations Example + +```rust +fn main(x : Field) { + let y = x as u32; + let z = y & y; +} +``` + +`z` is implicitly constrained to be the result of `y & y`. The `&` operand is used to denote bitwise +`&`. + +> `x & x` would not compile as `x` is a `Field` and not an integer type. + +### Logical Operators + +Noir has no support for the logical operators `||` and `&&`. This is because encoding the +short-circuiting that these operators require can be inefficient for Noir's backend. Instead you can +use the bitwise operators `|` and `&` which operate identically for booleans, just without the +short-circuiting. + +```rust +let my_val = 5; + +let mut flag = 1; +if (my_val > 6) | (my_val == 0) { + flag = 0; +} +assert(flag == 1); + +if (my_val != 10) & (my_val < 50) { + flag = 0; +} +assert(flag == 0); +``` + +### Shorthand operators + +Noir shorthand operators for most of the above operators, namely `+=, -=, *=, /=, %=, &=, |=, ^=, <<=`, and `>>=`. These allow for more concise syntax. For example: + +```rust +let mut i = 0; +i = i + 1; +``` + +could be written as: + +```rust +let mut i = 0; +i += 1; +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/oracles.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/oracles.mdx new file mode 100644 index 00000000000..77a2ac1550a --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/oracles.mdx @@ -0,0 +1,29 @@ +--- +title: Oracles +description: Dive into how Noir supports Oracles via RPC calls, and learn how to declare an Oracle in Noir with our comprehensive guide. +keywords: + - Noir + - Oracles + - RPC Calls + - Unconstrained Functions + - Programming + - Blockchain +sidebar_position: 6 +--- + +import Experimental from '@site/src/components/Notes/_experimental.mdx'; + + + +Noir has support for Oracles via RPC calls. This means Noir will make an RPC call and use the return value for proof generation. + +Since Oracles are not resolved by Noir, they are [`unconstrained` functions](./unconstrained.md) + +You can declare an Oracle through the `#[oracle()]` flag. Example: + +```rust +#[oracle(get_number_sequence)] +unconstrained fn get_number_sequence(_size: Field) -> [Field] {} +``` + +The timeout for when using an external RPC oracle resolver can be set with the `NARGO_FOREIGN_CALL_TIMEOUT` environment variable. This timeout is in units of milliseconds. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/shadowing.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/shadowing.md new file mode 100644 index 00000000000..5ce6130d201 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/shadowing.md @@ -0,0 +1,44 @@ +--- +title: Shadowing +sidebar_position: 12 +--- + +Noir allows for inheriting variables' values and re-declaring them with the same name similar to Rust, known as shadowing. + +For example, the following function is valid in Noir: + +```rust +fn main() { + let x = 5; + + { + let x = x * 2; + assert (x == 10); + } + + assert (x == 5); +} +``` + +In this example, a variable x is first defined with the value 5. + +The local scope that follows shadows the original x, i.e. creates a local mutable x based on the value of the original x. It is given a value of 2 times the original x. + +When we return to the main scope, x once again refers to just the original x, which stays at the value of 5. + +## Temporal mutability + +One way that shadowing is useful, in addition to ergonomics across scopes, is for temporarily mutating variables. + +```rust +fn main() { + let age = 30; + // age = age + 5; // Would error as `age` is immutable by default. + + let mut age = age + 5; // Temporarily mutates `age` with a new value. + + let age = age; // Locks `age`'s mutability again. + + assert (age == 35); +} +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/traits.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/traits.md new file mode 100644 index 00000000000..b6c0a886eb0 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/traits.md @@ -0,0 +1,584 @@ +--- +title: Traits +description: + Traits in Noir can be used to abstract out a common interface for functions across + several data types. +keywords: [noir programming language, traits, interfaces, generic, protocol] +sidebar_position: 14 +--- + +## Overview + +Traits in Noir are a useful abstraction similar to interfaces or protocols in other languages. Each trait defines +the interface of several methods contained within the trait. Types can then implement this trait by providing +implementations for these methods. For example in the program: + +```rust +struct Rectangle { + width: Field, + height: Field, +} + +impl Rectangle { + fn area(self) -> Field { + self.width * self.height + } +} + +fn log_area(r: Rectangle) { + println(r.area()); +} +``` + +We have a function `log_area` to log the area of a `Rectangle`. Now how should we change the program if we want this +function to work on `Triangle`s as well?: + +```rust +struct Triangle { + width: Field, + height: Field, +} + +impl Triangle { + fn area(self) -> Field { + self.width * self.height / 2 + } +} +``` + +Making `log_area` generic over all types `T` would be invalid since not all types have an `area` method. Instead, we can +introduce a new `Area` trait and make `log_area` generic over all types `T` that implement `Area`: + +```rust +trait Area { + fn area(self) -> Field; +} + +fn log_area(shape: T) where T: Area { + println(shape.area()); +} +``` + +We also need to explicitly implement `Area` for `Rectangle` and `Triangle`. We can do that by changing their existing +impls slightly. Note that the parameter types and return type of each of our `area` methods must match those defined +by the `Area` trait. + +```rust +impl Area for Rectangle { + fn area(self) -> Field { + self.width * self.height + } +} + +impl Area for Triangle { + fn area(self) -> Field { + self.width * self.height / 2 + } +} +``` + +Now we have a working program that is generic over any type of Shape that is used! Others can even use this program +as a library with their own types - such as `Circle` - as long as they also implement `Area` for these types. + +## Where Clauses + +As seen in `log_area` above, when we want to create a function or method that is generic over any type that implements +a trait, we can add a where clause to the generic function. + +```rust +fn log_area(shape: T) where T: Area { + println(shape.area()); +} +``` + +It is also possible to apply multiple trait constraints on the same variable at once by combining traits with the `+` +operator. Similarly, we can have multiple trait constraints by separating each with a comma: + +```rust +fn foo(elements: [T], thing: U) where + T: Default + Add + Eq, + U: Bar, +{ + let mut sum = T::default(); + + for element in elements { + sum += element; + } + + if sum == T::default() { + thing.bar(); + } +} +``` + +## Generic Implementations + +You can add generics to a trait implementation by adding the generic list after the `impl` keyword: + +```rust +trait Second { + fn second(self) -> Field; +} + +impl Second for (T, Field) { + fn second(self) -> Field { + self.1 + } +} +``` + +You can also implement a trait for every type this way: + +```rust +trait Debug { + fn debug(self); +} + +impl Debug for T { + fn debug(self) { + println(self); + } +} + +fn main() { + 1.debug(); +} +``` + +### Generic Trait Implementations With Where Clauses + +Where clauses can be placed on trait implementations themselves to restrict generics in a similar way. +For example, while `impl Foo for T` implements the trait `Foo` for every type, `impl Foo for T where T: Bar` +will implement `Foo` only for types that also implement `Bar`. This is often used for implementing generic types. +For example, here is the implementation for array equality: + +```rust +impl Eq for [T; let N: u32] where T: Eq { + // Test if two arrays have the same elements. + // Because both arrays must have length N, we know their lengths already match. + fn eq(self, other: Self) -> bool { + let mut result = true; + + for i in 0 .. self.len() { + // The T: Eq constraint is needed to call == on the array elements here + result &= self[i] == other[i]; + } + + result + } +} +``` + +Where clauses can also be placed on struct implementations. +For example, here is a method utilizing a generic type that implements the equality trait. + +```rust +struct Foo { + a: u32, + b: T, +} + +impl Foo where T: Eq { + fn eq(self, other: Self) -> bool { + (self.a == other.a) & self.b.eq(other.b) + } +} +``` + +## Generic Traits + +Traits themselves can also be generic by placing the generic arguments after the trait name. These generics are in +scope of every item within the trait. + +```rust +trait Into { + // Convert `self` to type `T` + fn into(self) -> T; +} +``` + +When implementing generic traits the generic arguments of the trait must be specified. This is also true anytime +when referencing a generic trait (e.g. in a `where` clause). + +```rust +struct MyStruct { + array: [Field; 2], +} + +impl Into<[Field; 2]> for MyStruct { + fn into(self) -> [Field; 2] { + self.array + } +} + +fn as_array(x: T) -> [Field; 2] + where T: Into<[Field; 2]> +{ + x.into() +} + +fn main() { + let array = [1, 2]; + let my_struct = MyStruct { array }; + + assert_eq(as_array(my_struct), array); +} +``` + +### Associated Types and Constants + +Traits also support associated types and constraints which can be thought of as additional generics that are referred to by name. + +Here's an example of a trait with an associated type `Foo` and a constant `Bar`: + +```rust +trait MyTrait { + type Foo; + + let Bar: u32; +} +``` + +Now when we're implementing `MyTrait` we also have to provide values for `Foo` and `Bar`: + +```rust +impl MyTrait for Field { + type Foo = i32; + + let Bar: u32 = 11; +} +``` + +Since associated constants can also be used in a type position, its values are limited to only other +expression kinds allowed in numeric generics. + +Note that currently all associated types and constants must be explicitly specified in a trait constraint. +If we leave out any, we'll get an error that we're missing one: + +```rust +// Error! Constraint is missing associated constant for `Bar` +fn foo(x: T) where T: MyTrait { + ... +} +``` + +Because all associated types and constants must be explicitly specified, they are essentially named generics, +although this is set to change in the future. Future versions of Noir will allow users to elide associated types +in trait constraints similar to Rust. When this is done, you may still refer to their value with the `::AssociatedType` +syntax: + +```rust +// Only valid in future versions of Noir: +fn foo(x: T) where T: MyTrait { + let _: ::Foo = ...; +} +``` + +The type as trait syntax is possible in Noir today but is less useful when each type must be explicitly specified anyway: + +```rust +fn foo(x: T) where T: MyTrait { + // Works, but could just use F directly + let _: >::Foo = ...; + + let _: F = ...; +} +``` + +## Trait Methods With No `self` + +A trait can contain any number of methods, each of which have access to the `Self` type which represents each type +that eventually implements the trait. Similarly, the `self` variable is available as well but is not required to be used. +For example, we can define a trait to create a default value for a type. This trait will need to return the `Self` type +but doesn't need to take any parameters: + +```rust +trait Default { + fn default() -> Self; +} +``` + +Implementing this trait can be done similarly to any other trait: + +```rust +impl Default for Field { + fn default() -> Field { + 0 + } +} + +struct MyType {} + +impl Default for MyType { + fn default() -> Field { + MyType {} + } +} +``` + +However, since there is no `self` parameter, we cannot call it via the method call syntax `object.method()`. +Instead, we'll need to refer to the function directly. This can be done either by referring to the +specific impl `MyType::default()` or referring to the trait itself `Default::default()`. In the later +case, type inference determines the impl that is selected. + +```rust +let my_struct = MyStruct::default(); + +let x: Field = Default::default(); +let result = x + Default::default(); +``` + +:::warning + +```rust +let _ = Default::default(); +``` + +If type inference cannot select which impl to use because of an ambiguous `Self` type, an impl will be +arbitrarily selected. This occurs most often when the result of a trait function call with no parameters +is unused. To avoid this, when calling a trait function with no `self` or `Self` parameters or return type, +always refer to it via the implementation type's namespace - e.g. `MyType::default()`. +This is set to change to an error in future Noir versions. + +::: + +## Default Method Implementations + +A trait can also have default implementations of its methods by giving a body to the desired functions. +Note that this body must be valid for all types that may implement the trait. As a result, the only +valid operations on `self` will be operations valid for any type or other operations on the trait itself. + +```rust +trait Numeric { + fn add(self, other: Self) -> Self; + + // Default implementation of double is (self + self) + fn double(self) -> Self { + self.add(self) + } +} +``` + +When implementing a trait with default functions, a type may choose to implement only the required functions: + +```rust +impl Numeric for Field { + fn add(self, other: Field) -> Field { + self + other + } +} +``` + +Or it may implement the optional methods as well: + +```rust +impl Numeric for u32 { + fn add(self, other: u32) -> u32 { + self + other + } + + fn double(self) -> u32 { + self * 2 + } +} +``` + +## Impl Specialization + +When implementing traits for a generic type it is possible to implement the trait for only a certain combination +of generics. This can be either as an optimization or because those specific generics are required to implement the trait. + +```rust +trait Sub { + fn sub(self, other: Self) -> Self; +} + +struct NonZero { + value: T, +} + +impl Sub for NonZero { + fn sub(self, other: Self) -> Self { + let value = self.value - other.value; + assert(value != 0); + NonZero { value } + } +} +``` + +## Overlapping Implementations + +Overlapping implementations are disallowed by Noir to ensure Noir's decision on which impl to select is never ambiguous. +This means if a trait `Foo` is already implemented +by a type `Bar` for all `T`, then we cannot also have a separate impl for `Bar` (or any other +type argument). Similarly, if there is an impl for all `T` such as `impl Debug for T`, we cannot create +any more impls to `Debug` for other types since it would be ambiguous which impl to choose for any given +method call. + +```rust +trait Trait {} + +// Previous impl defined here +impl Trait for (A, B) {} + +// error: Impl for type `(Field, Field)` overlaps with existing impl +impl Trait for (Field, Field) {} +``` + +## Trait Coherence + +Another restriction on trait implementations is coherence. This restriction ensures other crates cannot create +impls that may overlap with other impls, even if several unrelated crates are used as dependencies in the same +program. + +The coherence restriction is: to implement a trait, either the trait itself or the object type must be declared +in the crate the impl is in. + +In practice this often comes up when using types provided by libraries. If a library provides a type `Foo` that does +not implement a trait in the standard library such as `Default`, you may not `impl Default for Foo` in your own crate. +While restrictive, this prevents later issues or silent changes in the program if the `Foo` library later added its +own impl for `Default`. If you are a user of the `Foo` library in this scenario and need a trait not implemented by the +library your choices are to either submit a patch to the library or use the newtype pattern. + +### The Newtype Pattern + +The newtype pattern gets around the coherence restriction by creating a new wrapper type around the library type +that we cannot create `impl`s for. Since the new wrapper type is defined in our current crate, we can create +impls for any trait we need on it. + +```rust +struct Wrapper { + foo: some_library::Foo, +} + +impl Default for Wrapper { + fn default() -> Wrapper { + Wrapper { + foo: some_library::Foo::new(), + } + } +} +``` + +Since we have an impl for our own type, the behavior of this code will not change even if `some_library` is updated +to provide its own `impl Default for Foo`. The downside of this pattern is that it requires extra wrapping and +unwrapping of values when converting to and from the `Wrapper` and `Foo` types. + +### Trait Inheritance + +Sometimes, you might need one trait to use another trait’s functionality (like "inheritance" in some other languages). In this case, you can specify this relationship by listing any child traits after the parent trait's name and a colon. Now, whenever the parent trait is implemented it will require the child traits to be implemented as well. A parent trait is also called a "super trait." + +```rust +trait Person { + fn name(self) -> String; +} + +// Person is a supertrait of Student. +// Implementing Student requires you to also impl Person. +trait Student: Person { + fn university(self) -> String; +} + +trait Programmer { + fn fav_language(self) -> String; +} + +// CompSciStudent (computer science student) is a subtrait of both Programmer +// and Student. Implementing CompSciStudent requires you to impl both supertraits. +trait CompSciStudent: Programmer + Student { + fn git_username(self) -> String; +} +``` + +### Trait Aliases + +Similar to the proposed Rust feature for [trait aliases](https://github.com/rust-lang/rust/blob/4d215e2426d52ca8d1af166d5f6b5e172afbff67/src/doc/unstable-book/src/language-features/trait-alias.md), +Noir supports aliasing one or more traits and using those aliases wherever +traits would normally be used. + +```rust +trait Foo { + fn foo(self) -> Self; +} + +trait Bar { + fn bar(self) -> Self; +} + +// Equivalent to: +// trait Baz: Foo + Bar {} +// +// impl Baz for T where T: Foo + Bar {} +trait Baz = Foo + Bar; + +// We can use `Baz` to refer to `Foo + Bar` +fn baz(x: T) -> T where T: Baz { + x.foo().bar() +} +``` + +#### Generic Trait Aliases + +Trait aliases can also be generic by placing the generic arguments after the +trait name. These generics are in scope of every item within the trait alias. + +```rust +trait Foo { + fn foo(self) -> Self; +} + +trait Bar { + fn bar(self) -> T; +} + +// Equivalent to: +// trait Baz: Foo + Bar {} +// +// impl Baz for U where U: Foo + Bar {} +trait Baz = Foo + Bar; +``` + +#### Trait Alias Where Clauses + +Trait aliases support where clauses to add trait constraints to any of their +generic arguments, e.g. ensuring `T: Baz` for a trait alias `Qux`. + +```rust +trait Foo { + fn foo(self) -> Self; +} + +trait Bar { + fn bar(self) -> T; +} + +trait Baz { + fn baz(self) -> bool; +} + +// Equivalent to: +// trait Qux: Foo + Bar where T: Baz {} +// +// impl Qux for U where +// U: Foo + Bar, +// T: Baz, +// {} +trait Qux = Foo + Bar where T: Baz; +``` + +Note that while trait aliases support where clauses, +the equivalent traits can fail due to [#6467](https://github.com/noir-lang/noir/issues/6467) + +### Visibility + +By default, like functions, traits and trait aliases are private to the module +they exist in. You can use `pub` to make the trait public or `pub(crate)` to make +it public to just its crate: + +```rust +// This trait is now public +pub trait Trait {} + +// This trait alias is now public +pub trait Baz = Foo + Bar; +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/unconstrained.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/unconstrained.md new file mode 100644 index 00000000000..8e07d719f4b --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/concepts/unconstrained.md @@ -0,0 +1,106 @@ +--- +title: Unconstrained Functions +description: "Learn about what unconstrained functions in Noir are, how to use them and when you'd want to." + +keywords: [Noir programming language, unconstrained, open] +sidebar_position: 5 +--- + +Unconstrained functions are functions which do not constrain any of the included computation and allow for non-deterministic computation. + +## Why? + +Zero-knowledge (ZK) domain-specific languages (DSL) enable developers to generate ZK proofs from their programs by compiling code down to the constraints of an NP complete language (such as R1CS or PLONKish languages). However, the hard bounds of a constraint system can be very limiting to the functionality of a ZK DSL. + +Enabling a circuit language to perform unconstrained execution is a powerful tool. Said another way, unconstrained execution lets developers generate witnesses from code that does not generate any constraints. Being able to execute logic outside of a circuit is critical for both circuit performance and constructing proofs on information that is external to a circuit. + +Fetching information from somewhere external to a circuit can also be used to enable developers to improve circuit efficiency. + +A ZK DSL does not just prove computation, but proves that some computation was handled correctly. Thus, it is necessary that when we switch from performing some operation directly inside of a circuit to inside of an unconstrained environment that the appropriate constraints are still laid down elsewhere in the circuit. + +## Example + +An in depth example might help drive the point home. This example comes from the excellent [post](https://discord.com/channels/1113924620781883405/1124022445054111926/1128747641853972590) by Tom in the Noir Discord. + +Let's look at how we can optimize a function to turn a `u72` into an array of `u8`s. + +```rust +fn main(num: u72) -> pub [u8; 8] { + let mut out: [u8; 8] = [0; 8]; + for i in 0..8 { + out[i] = (num >> (56 - (i * 8)) as u72 & 0xff) as u8; + } + + out +} +``` + +``` +Total ACIR opcodes generated for language PLONKCSat { width: 3 }: 91 +Backend circuit size: 3619 +``` + +A lot of the operations in this function are optimized away by the compiler (all the bit-shifts turn into divisions by constants). However we can save a bunch of gates by casting to u8 a bit earlier. This automatically truncates the bit-shifted value to fit in a u8 which allows us to remove the AND against 0xff. This saves us ~480 gates in total. + +```rust +fn main(num: u72) -> pub [u8; 8] { + let mut out: [u8; 8] = [0; 8]; + for i in 0..8 { + out[i] = (num >> (56 - (i * 8)) as u8; + } + + out +} +``` + +``` +Total ACIR opcodes generated for language PLONKCSat { width: 3 }: 75 +Backend circuit size: 3143 +``` + +Those are some nice savings already but we can do better. This code is all constrained so we're proving every step of calculating out using num, but we don't actually care about how we calculate this, just that it's correct. This is where brillig comes in. + +It turns out that truncating a u72 into a u8 is hard to do inside a snark, each time we do as u8 we lay down 4 ACIR opcodes which get converted into multiple gates. It's actually much easier to calculate num from out than the other way around. All we need to do is multiply each element of out by a constant and add them all together, both relatively easy operations inside a snark. + +We can then run `u72_to_u8` as unconstrained brillig code in order to calculate out, then use that result in our constrained function and assert that if we were to do the reverse calculation we'd get back num. This looks a little like the below: + +```rust +fn main(num: u72) -> pub [u8; 8] { + let out = unsafe { + //@safety: 'out' is properly constrained below in 'assert(num == reconstructed_num);' + u72_to_u8(num) + }; + + let mut reconstructed_num: u72 = 0; + for i in 0..8 { + reconstructed_num += (out[i] as u72 << (56 - (8 * i))); + } + assert(num == reconstructed_num); + out +} + +unconstrained fn u72_to_u8(num: u72) -> [u8; 8] { + let mut out: [u8; 8] = [0; 8]; + for i in 0..8 { + out[i] = (num >> (56 - (i * 8))) as u8; + } + out +} +``` + +``` +Total ACIR opcodes generated for language PLONKCSat { width: 3 }: 78 +Backend circuit size: 2902 +``` + +This ends up taking off another ~250 gates from our circuit! We've ended up with more ACIR opcodes than before but they're easier for the backend to prove (resulting in fewer gates). + +Note that in order to invoke unconstrained functions we need to wrap them in an `unsafe` block, +to make it clear that the call is unconstrained. +Furthermore, a warning is emitted unless the `unsafe` block starts with a `//@safety: ...` comment explaining why it is fine to call the unconstrained function. + +Generally we want to use brillig whenever there's something that's easy to verify but hard to compute within the circuit. For example, if you wanted to calculate a square root of a number it'll be a much better idea to calculate this in brillig and then assert that if you square the result you get back your number. + +## Break and Continue + +In addition to loops over runtime bounds, `break` and `continue` are also available in unconstrained code. See [break and continue](../concepts/control_flow.md#break-and-continue) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/_category_.json b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/_category_.json new file mode 100644 index 00000000000..1debcfe7675 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Modules, Packages and Crates", + "position": 2, + "collapsible": true, + "collapsed": true +} diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/crates_and_packages.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/crates_and_packages.md new file mode 100644 index 00000000000..95ee9f52ab2 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/crates_and_packages.md @@ -0,0 +1,43 @@ +--- +title: Crates and Packages +description: Learn how to use Crates and Packages in your Noir project +keywords: [Nargo, dependencies, package management, crates, package] +sidebar_position: 0 +--- + +## Crates + +A crate is the smallest amount of code that the Noir compiler considers at a time. +Crates can contain modules, and the modules may be defined in other files that get compiled with the crate, as we’ll see in the coming sections. + +### Crate Types + +A Noir crate can come in several forms: binaries, libraries or contracts. + +#### Binaries + +_Binary crates_ are programs which you can compile to an ACIR circuit which you can then create proofs against. Each must have a function called `main` that defines the ACIR circuit which is to be proved. + +#### Libraries + +_Library crates_ don't have a `main` function and they don't compile down to ACIR. Instead they define functionality intended to be shared with multiple projects, and eventually included in a binary crate. + +#### Contracts + +Contract crates are similar to binary crates in that they compile to ACIR which you can create proofs against. They are different in that they do not have a single `main` function, but are a collection of functions to be deployed to the [Aztec network](https://aztec.network). You can learn more about the technical details of Aztec in the [monorepo](https://github.com/AztecProtocol/aztec-packages) or contract [examples](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-projects/noir-contracts/contracts). + +### Crate Root + +Every crate has a root, which is the source file that the compiler starts, this is also known as the root module. The Noir compiler does not enforce any conditions on the name of the file which is the crate root, however if you are compiling via Nargo the crate root must be called `lib.nr` or `main.nr` for library or binary crates respectively. + +## Packages + +A Nargo _package_ is a collection of one of more crates that provides a set of functionality. A package must include a Nargo.toml file. + +A package _must_ contain either a library or a binary crate, but not both. + +### Differences from Cargo Packages + +One notable difference between Rust's Cargo and Noir's Nargo is that while Cargo allows a package to contain an unlimited number of binary crates and a single library crate, Nargo currently only allows a package to contain a single crate. + +In future this restriction may be lifted to allow a Nargo package to contain both a binary and library crate or multiple binary crates. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/dependencies.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/dependencies.md new file mode 100644 index 00000000000..22186b22598 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/dependencies.md @@ -0,0 +1,122 @@ +--- +title: Dependencies +description: + Learn how to specify and manage dependencies in Nargo, allowing you to upload packages to GitHub + and use them easily in your project. +keywords: [Nargo, dependencies, GitHub, package management, versioning] +sidebar_position: 1 +--- + +Nargo allows you to upload packages to GitHub and use them as dependencies. + +## Specifying a dependency + +Specifying a dependency requires a tag to a specific commit and the git url to the url containing +the package. + +Currently, there are no requirements on the tag contents. If requirements are added, it would follow +semver 2.0 guidelines. + +> Note: Without a `tag` , there would be no versioning and dependencies would change each time you +> compile your project. + +For example, to add the [ecrecover-noir library](https://github.com/colinnielsen/ecrecover-noir) to your project, add it to `Nargo.toml`: + +```toml +# Nargo.toml + +[dependencies] +ecrecover = {tag = "v0.8.0", git = "https://github.com/colinnielsen/ecrecover-noir"} +``` + +If the module is in a subdirectory, you can define a subdirectory in your git repository, for example: + +```toml +# Nargo.toml + +[dependencies] +easy_private_token_contract = {tag ="v0.1.0-alpha62", git = "https://github.com/AztecProtocol/aztec-packages", directory = "noir-contracts/contracts/easy_private_token_contract"} +``` + +## Specifying a local dependency + +You can also specify dependencies that are local to your machine. + +For example, this file structure has a library and binary crate + +```tree +├── binary_crate +│   ├── Nargo.toml +│   └── src +│   └── main.nr +└── lib_a + ├── Nargo.toml + └── src + └── lib.nr +``` + +Inside of the binary crate, you can specify: + +```toml +# Nargo.toml + +[dependencies] +lib_a = { path = "../lib_a" } +``` + +## Importing dependencies + +You can import a dependency to a Noir file using the following syntax. For example, to import the +ecrecover-noir library and local lib_a referenced above: + +```rust +use ecrecover; +use lib_a; +``` + +You can also import only the specific parts of dependency that you want to use, like so: + +```rust +use std::hash::sha256; +use std::scalar_mul::fixed_base_embedded_curve; +``` + +Lastly, You can import multiple items in the same line by enclosing them in curly braces: + +```rust +use std::hash::{keccak256, sha256}; +``` + +We don't have a way to consume libraries from inside a [workspace](./workspaces.md) as external dependencies right now. + +Inside a workspace, these are consumed as `{ path = "../to_lib" }` dependencies in Nargo.toml. + +## Dependencies of Dependencies + +Note that when you import a dependency, you also get access to all of the dependencies of that package. + +For example, the [phy_vector](https://github.com/resurgencelabs/phy_vector) library imports an [fraction](https://github.com/resurgencelabs/fraction) library. If you're importing the phy_vector library, then you can access the functions in fractions library like so: + +```rust +use phy_vector; + +fn main(x : Field, y : pub Field) { + //... + let f = phy_vector::fraction::toFraction(true, 2, 1); + //... +} +``` + +## Available Libraries + +Noir does not currently have an official package manager. You can find a list of available Noir libraries in the [awesome-noir repo here](https://github.com/noir-lang/awesome-noir#libraries). + +Some libraries that are available today include: + +- [Standard Library](https://github.com/noir-lang/noir/tree/master/noir_stdlib) - the Noir Standard Library +- [Ethereum Storage Proof Verification](https://github.com/aragonzkresearch/noir-trie-proofs) - a library that contains the primitives necessary for RLP decoding (in the form of look-up table construction) and Ethereum state and storage proof verification (or verification of any trie proof involving 32-byte long keys) +- [BigInt](https://github.com/shuklaayush/noir-bigint) - a library that provides a custom BigUint56 data type, allowing for computations on large unsigned integers +- [ECrecover](https://github.com/colinnielsen/ecrecover-noir/tree/main) - a library to verify an ECDSA signature and return the source Ethereum address +- [Sparse Merkle Tree Verifier](https://github.com/vocdoni/smtverifier-noir/tree/main) - a library for verification of sparse Merkle trees +- [Signed Int](https://github.com/resurgencelabs/signed_int) - a library for accessing a custom Signed Integer data type, allowing access to negative numbers on Noir +- [Fraction](https://github.com/resurgencelabs/fraction) - a library for accessing fractional number data type in Noir, allowing results that aren't whole numbers diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/modules.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/modules.md new file mode 100644 index 00000000000..14aa1f0579a --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/modules.md @@ -0,0 +1,221 @@ +--- +title: Modules +description: + Learn how to organize your files using modules in Noir, following the same convention as Rust's + module system. Examples included. +keywords: [Noir, Rust, modules, organizing files, sub-modules] +sidebar_position: 2 +--- + +Noir's module system follows the same convention as the _newer_ version of Rust's module system. + +## Purpose of Modules + +Modules are used to organize files. Without modules all of your code would need to live in a single +file. In Noir, the compiler does not automatically scan all of your files to detect modules. This +must be done explicitly by the developer. + +## Examples + +### Importing a module in the crate root + +Filename : `src/main.nr` + +```rust +mod foo; + +fn main() { + foo::hello_world(); +} +``` + +Filename : `src/foo.nr` + +```rust +fn from_foo() {} +``` + +In the above snippet, the crate root is the `src/main.nr` file. The compiler sees the module +declaration `mod foo` which prompts it to look for a foo.nr file. + +Visually this module hierarchy looks like the following : + +``` +crate + ├── main + │ + └── foo + └── from_foo + +``` + +The module filename may also be the name of the module as a directory with the contents in a +file named `mod.nr` within that directory. The above example can alternatively be expressed like this: + +Filename : `src/main.nr` + +```rust +mod foo; + +fn main() { + foo::hello_world(); +} +``` + +Filename : `src/foo/mod.nr` + +```rust +fn from_foo() {} +``` + +Note that it's an error to have both files `src/foo.nr` and `src/foo/mod.nr` in the filesystem. + +### Importing a module throughout the tree + +All modules are accessible from the `crate::` namespace. + +``` +crate + ├── bar + ├── foo + └── main + +``` + +In the above snippet, if `bar` would like to use functions in `foo`, it can do so by `use crate::foo::function_name`. + +### Sub-modules + +Filename : `src/main.nr` + +```rust +mod foo; + +fn main() { + foo::from_foo(); +} +``` + +Filename : `src/foo.nr` + +```rust +mod bar; +fn from_foo() {} +``` + +Filename : `src/foo/bar.nr` + +```rust +fn from_bar() {} +``` + +In the above snippet, we have added an extra module to the module tree; `bar`. `bar` is a submodule +of `foo` hence we declare bar in `foo.nr` with `mod bar`. Since `foo` is not the crate root, the +compiler looks for the file associated with the `bar` module in `src/foo/bar.nr` + +Visually the module hierarchy looks as follows: + +``` +crate + ├── main + │ + └── foo + ├── from_foo + └── bar + └── from_bar +``` + +Similar to importing a module in the crate root, modules can be placed in a `mod.nr` file, like this: + +Filename : `src/main.nr` + +```rust +mod foo; + +fn main() { + foo::from_foo(); +} +``` + +Filename : `src/foo/mod.nr` + +```rust +mod bar; +fn from_foo() {} +``` + +Filename : `src/foo/bar/mod.nr` + +```rust +fn from_bar() {} +``` + +### Referencing a parent module + +Given a submodule, you can refer to its parent module using the `super` keyword. + +Filename : `src/main.nr` + +```rust +mod foo; + +fn main() { + foo::from_foo(); +} +``` + +Filename : `src/foo.nr` + +```rust +mod bar; + +fn from_foo() {} +``` + +Filename : `src/foo/bar.nr` + +```rust +// Same as bar::from_foo +use super::from_foo; + +fn from_bar() { + from_foo(); // invokes super::from_foo(), which is bar::from_foo() + super::from_foo(); // also invokes bar::from_foo() +} +``` + +### `use` visibility + +`use` declarations are private to the containing module, by default. However, like functions, +they can be marked as `pub` or `pub(crate)`. Such a use declaration serves to _re-export_ a name. +A public `use` declaration can therefore redirect some public name to a different target definition: +even a definition with a private canonical path, inside a different module. + +An example of re-exporting: + +```rust +mod some_module { + pub use foo::{bar, baz}; + mod foo { + pub fn bar() {} + pub fn baz() {} + } +} + +fn main() { + some_module::bar(); + some_module::baz(); +} +``` + +In this example, the module `some_module` re-exports two public names defined in `foo`. + +### Visibility + +By default, like functions, modules are private to the module (or crate) they exist in. You can use `pub` +to make the module public or `pub(crate)` to make it public to just its crate: + +```rust +// This module is now public and can be seen by other crates. +pub mod foo; +``` \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/workspaces.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/workspaces.md new file mode 100644 index 00000000000..2fbf10aec52 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/modules_packages_crates/workspaces.md @@ -0,0 +1,46 @@ +--- +title: Workspaces +sidebar_position: 3 +--- + +Workspaces are a feature of nargo that allow you to manage multiple related Noir packages in a single repository. A workspace is essentially a group of related projects that share common build output directories and configurations. + +Each Noir project (with it's own Nargo.toml file) can be thought of as a package. Each package is expected to contain exactly one "named circuit", being the "name" defined in Nargo.toml with the program logic defined in `./src/main.nr`. + +For a project with the following structure: + +```tree +├── crates +│ ├── a +│ │ ├── Nargo.toml +│ │ └── Prover.toml +│ │ └── src +│ │ └── main.nr +│ └── b +│ ├── Nargo.toml +│ └── Prover.toml +│ └── src +│ └── main.nr +│ +└── Nargo.toml +``` + +You can define a workspace in Nargo.toml like so: + +```toml +[workspace] +members = ["crates/a", "crates/b"] +default-member = "crates/a" +``` + +`members` indicates which packages are included in the workspace. As such, all member packages of a workspace will be processed when the `--workspace` flag is used with various commands or if a `default-member` is not specified. The `--package` option can be used to limit +the scope of some commands to a specific member of the workspace; otherwise these commands run on the package nearest on the path to the +current directory where `nargo` was invoked. + +`default-member` indicates which package various commands process by default. + +Libraries can be defined in a workspace. Inside a workspace, these are consumed as `{ path = "../to_lib" }` dependencies in Nargo.toml. + +Inside a workspace, these are consumed as `{ path = "../to_lib" }` dependencies in Nargo.toml. + +Please note that nesting regular packages is not supported: certain commands work on the workspace level and will use the topmost Nargo.toml file they can find on the path; unless this is a workspace configuration with `members`, the command might run on some unintended package. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/_category_.json b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/_category_.json new file mode 100644 index 00000000000..af04c0933fd --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Standard Library", + "position": 1, + "collapsible": true, + "collapsed": true +} diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/bigint.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/bigint.md new file mode 100644 index 00000000000..2743739e8b1 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/bigint.md @@ -0,0 +1,127 @@ +--- +title: Big Integers +description: How to use big integers from Noir standard library +keywords: + [ + Big Integer, + Noir programming language, + Noir libraries, + ] +--- + +The BigInt module in the standard library exposes some class of integers which do not fit (well) into a Noir native field. It implements modulo arithmetic, modulo a 'big' prime number. + +:::note + +The module can currently be considered as `Field`s with fixed modulo sizes used by a set of elliptic curves, in addition to just the native curve. [More work](https://github.com/noir-lang/noir/issues/510) is needed to achieve arbitrarily sized big integers. + +:::note + +`nargo` can be built with `--profile release-pedantic` to enable extra overflow checks which may affect `BigInt` results in some cases. +Consider the [`noir-bignum`](https://github.com/noir-lang/noir-bignum) library for an optimized alternative approach. + +::: + +Currently 6 classes of integers (i.e 'big' prime numbers) are available in the module, namely: + +- BN254 Fq: Bn254Fq +- BN254 Fr: Bn254Fr +- Secp256k1 Fq: Secpk1Fq +- Secp256k1 Fr: Secpk1Fr +- Secp256r1 Fr: Secpr1Fr +- Secp256r1 Fq: Secpr1Fq + +Where XXX Fq and XXX Fr denote respectively the order of the base and scalar field of the (usual) elliptic curve XXX. +For instance the big integer 'Secpk1Fq' in the standard library refers to integers modulo $2^{256}-2^{32}-977$. + +Feel free to explore the source code for the other primes: + +```rust title="big_int_definition" showLineNumbers +pub struct BigInt { + pointer: u32, + modulus: u32, +} +``` +> Source code: noir_stdlib/src/bigint.nr#L28-L33 + + +## Example usage + +A common use-case is when constructing a big integer from its bytes representation, and performing arithmetic operations on it: + +```rust title="big_int_example" showLineNumbers +fn big_int_example(x: u8, y: u8) { + let a = Secpk1Fq::from_le_bytes(&[x, y, 0, 45, 2]); + let b = Secpk1Fq::from_le_bytes(&[y, x, 9]); + let c = (a + b) * b / a; + let d = c.to_le_bytes(); + println(d[0]); +} +``` +> Source code: test_programs/execution_success/bigint/src/main.nr#L75-L83 + + +## Methods + +The available operations for each big integer are: + +### from_le_bytes + +Construct a big integer from its little-endian bytes representation. Example: + +```rust + // Construct a big integer from a slice of bytes + let a = Secpk1Fq::from_le_bytes(&[x, y, 0, 45, 2]); + // Construct a big integer from an array of 32 bytes + let a = Secpk1Fq::from_le_bytes_32([1;32]); + ``` + +Sure, here's the formatted version of the remaining methods: + +### to_le_bytes + +Return the little-endian bytes representation of a big integer. Example: + +```rust +let bytes = a.to_le_bytes(); +``` + +### add + +Add two big integers. Example: + +```rust +let sum = a + b; +``` + +### sub + +Subtract two big integers. Example: + +```rust +let difference = a - b; +``` + +### mul + +Multiply two big integers. Example: + +```rust +let product = a * b; +``` + +### div + +Divide two big integers. Note that division is field division and not euclidean division. Example: + +```rust +let quotient = a / b; +``` + +### eq + +Compare two big integers. Example: + +```rust +let are_equal = a == b; +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/black_box_fns.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/black_box_fns.md new file mode 100644 index 00000000000..e9392b20a92 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/black_box_fns.md @@ -0,0 +1,31 @@ +--- +title: Black Box Functions +description: Black box functions are functions in Noir that rely on backends implementing support for specialized constraints. +keywords: [noir, black box functions] +--- + +Black box functions are functions in Noir that rely on backends implementing support for specialized constraints. This makes certain zk-snark unfriendly computations cheaper than if they were implemented in Noir. + +The ACVM spec defines a set of blackbox functions which backends will be expected to implement. This allows backends to use optimized implementations of these constraints if they have them, however they may also fallback to less efficient naive implementations if not. + +## Function list + +Here is a list of the current black box functions: + +- [AES128](./cryptographic_primitives/ciphers.mdx#aes128) +- [SHA256](./cryptographic_primitives/hashes.mdx#sha256) +- [Blake2s](./cryptographic_primitives/hashes.mdx#blake2s) +- [Blake3](./cryptographic_primitives/hashes.mdx#blake3) +- [Pedersen Hash](./cryptographic_primitives/hashes.mdx#pedersen_hash) +- [Pedersen Commitment](./cryptographic_primitives/hashes.mdx#pedersen_commitment) +- [ECDSA signature verification](./cryptographic_primitives/ecdsa_sig_verification.mdx) +- [Embedded curve operations (MSM, addition, ...)](./cryptographic_primitives/embedded_curve_ops.mdx) +- AND +- XOR +- RANGE +- [Keccak256](./cryptographic_primitives/hashes.mdx#keccak256) +- [Recursive proof verification](./recursion.mdx) + +Most black box functions are included as part of the Noir standard library, however `AND`, `XOR` and `RANGE` are used as part of the Noir language syntax. For instance, using the bitwise operator `&` will invoke the `AND` black box function. + +You can view the black box functions defined in the ACVM code [here](https://github.com/noir-lang/noir/blob/master/acvm-repo/acir/src/circuit/black_box_functions.rs). diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/bn254.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/bn254.md new file mode 100644 index 00000000000..3294f005dbb --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/bn254.md @@ -0,0 +1,46 @@ +--- +title: Bn254 Field Library +--- + +Noir provides a module in standard library with some optimized functions for bn254 Fr in `std::field::bn254`. + +## decompose + +```rust +fn decompose(x: Field) -> (Field, Field) {} +``` + +Decomposes a single field into two fields, low and high. The low field contains the lower 16 bytes of the input field and the high field contains the upper 16 bytes of the input field. Both field results are range checked to 128 bits. + + +## assert_gt + +```rust +fn assert_gt(a: Field, b: Field) {} +``` + +Asserts that a > b. This will generate less constraints than using `assert(gt(a, b))`. + +## assert_lt + +```rust +fn assert_lt(a: Field, b: Field) {} +``` + +Asserts that a < b. This will generate less constraints than using `assert(lt(a, b))`. + +## gt + +```rust +fn gt(a: Field, b: Field) -> bool {} +``` + +Returns true if a > b. + +## lt + +```rust +fn lt(a: Field, b: Field) -> bool {} +``` + +Returns true if a < b. \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/boundedvec.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/boundedvec.md new file mode 100644 index 00000000000..dad25f26717 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/boundedvec.md @@ -0,0 +1,479 @@ +--- +title: Bounded Vectors +keywords: [noir, vector, bounded vector, slice] +sidebar_position: 1 +--- + +A `BoundedVec` is a growable storage similar to a `Vec` except that it +is bounded with a maximum possible length. Unlike `Vec`, `BoundedVec` is not implemented +via slices and thus is not subject to the same restrictions slices are (notably, nested +slices - and thus nested vectors as well - are disallowed). + +Since a BoundedVec is backed by a normal array under the hood, growing the BoundedVec by +pushing an additional element is also more efficient - the length only needs to be increased +by one. + +For these reasons `BoundedVec` should generally be preferred over `Vec` when there +is a reasonable maximum bound that can be placed on the vector. + +Example: + +```rust +let mut vector: BoundedVec = BoundedVec::new(); +for i in 0..5 { + vector.push(i); +} +assert(vector.len() == 5); +assert(vector.max_len() == 10); +``` + +## Methods + +### new + +```rust +pub fn new() -> Self +``` + +Creates a new, empty vector of length zero. + +Since this container is backed by an array internally, it still needs an initial value +to give each element. To resolve this, each element is zeroed internally. This value +is guaranteed to be inaccessible unless `get_unchecked` is used. + +Example: + +```rust +let empty_vector: BoundedVec = BoundedVec::new(); +assert(empty_vector.len() == 0); +``` + +Note that whenever calling `new` the maximum length of the vector should always be specified +via a type signature: + +```rust title="new_example" showLineNumbers +fn good() -> BoundedVec { + // Ok! MaxLen is specified with a type annotation + let v1: BoundedVec = BoundedVec::new(); + let v2 = BoundedVec::new(); + + // Ok! MaxLen is known from the type of `good`'s return value + v2 +} + +fn bad() { + // Error: Type annotation needed + // The compiler can't infer `MaxLen` from this code. + let mut v3 = BoundedVec::new(); + v3.push(5); +} +``` +> Source code: test_programs/noir_test_success/bounded_vec/src/main.nr#L11-L27 + + +This defaulting of `MaxLen` (and numeric generics in general) to zero may change in future noir versions +but for now make sure to use type annotations when using bounded vectors. Otherwise, you will receive a constraint failure at runtime when the vec is pushed to. + +### get + +```rust +pub fn get(self, index: u64) -> T { +``` + +Retrieves an element from the vector at the given index, starting from zero. + +If the given index is equal to or greater than the length of the vector, this +will issue a constraint failure. + +Example: + +```rust +fn foo(v: BoundedVec) { + let first = v.get(0); + let last = v.get(v.len() - 1); + assert(first != last); +} +``` + +### get_unchecked + +```rust +pub fn get_unchecked(self, index: u64) -> T { +``` + +Retrieves an element from the vector at the given index, starting from zero, without +performing a bounds check. + +Since this function does not perform a bounds check on length before accessing the element, +it is unsafe! Use at your own risk! + +Example: + +```rust title="get_unchecked_example" showLineNumbers +fn sum_of_first_three(v: BoundedVec) -> u32 { + // Always ensure the length is larger than the largest + // index passed to get_unchecked + assert(v.len() > 2); + let first = v.get_unchecked(0); + let second = v.get_unchecked(1); + let third = v.get_unchecked(2); + first + second + third +} +``` +> Source code: test_programs/noir_test_success/bounded_vec/src/main.nr#L54-L64 + + +### set + +```rust +pub fn set(&mut self: Self, index: u64, value: T) { +``` + +Writes an element to the vector at the given index, starting from zero. + +If the given index is equal to or greater than the length of the vector, this will issue a constraint failure. + +Example: + +```rust +fn foo(v: BoundedVec) { + let first = v.get(0); + assert(first != 42); + v.set(0, 42); + let new_first = v.get(0); + assert(new_first == 42); +} +``` + +### set_unchecked + +```rust +pub fn set_unchecked(&mut self: Self, index: u64, value: T) -> T { +``` + +Writes an element to the vector at the given index, starting from zero, without performing a bounds check. + +Since this function does not perform a bounds check on length before accessing the element, it is unsafe! Use at your own risk! + +Example: + +```rust title="set_unchecked_example" showLineNumbers +fn set_unchecked_example() { + let mut vec: BoundedVec = BoundedVec::new(); + vec.extend_from_array([1, 2]); + + // Here we're safely writing within the valid range of `vec` + // `vec` now has the value [42, 2] + vec.set_unchecked(0, 42); + + // We can then safely read this value back out of `vec`. + // Notice that we use the checked version of `get` which would prevent reading unsafe values. + assert_eq(vec.get(0), 42); + + // We've now written past the end of `vec`. + // As this index is still within the maximum potential length of `v`, + // it won't cause a constraint failure. + vec.set_unchecked(2, 42); + println(vec); + + // This will write past the end of the maximum potential length of `vec`, + // it will then trigger a constraint failure. + vec.set_unchecked(5, 42); + println(vec); +} +``` +> Source code: test_programs/noir_test_success/bounded_vec/src/main.nr#L67-L91 + + + +### push + +```rust +pub fn push(&mut self, elem: T) { +``` + +Pushes an element to the end of the vector. This increases the length +of the vector by one. + +Panics if the new length of the vector will be greater than the max length. + +Example: + +```rust title="bounded-vec-push-example" showLineNumbers +let mut v: BoundedVec = BoundedVec::new(); + + v.push(1); + v.push(2); + + // Panics with failed assertion "push out of bounds" + v.push(3); +``` +> Source code: test_programs/noir_test_success/bounded_vec/src/main.nr#L95-L103 + + +### pop + +```rust +pub fn pop(&mut self) -> T +``` + +Pops the element at the end of the vector. This will decrease the length +of the vector by one. + +Panics if the vector is empty. + +Example: + +```rust title="bounded-vec-pop-example" showLineNumbers +let mut v: BoundedVec = BoundedVec::new(); + v.push(1); + v.push(2); + + let two = v.pop(); + let one = v.pop(); + + assert(two == 2); + assert(one == 1); + // error: cannot pop from an empty vector + // let _ = v.pop(); +``` +> Source code: test_programs/noir_test_success/bounded_vec/src/main.nr#L108-L120 + + +### len + +```rust +pub fn len(self) -> u64 { +``` + +Returns the current length of this vector + +Example: + +```rust title="bounded-vec-len-example" showLineNumbers +let mut v: BoundedVec = BoundedVec::new(); + assert(v.len() == 0); + + v.push(100); + assert(v.len() == 1); + + v.push(200); + v.push(300); + v.push(400); + assert(v.len() == 4); + + let _ = v.pop(); + let _ = v.pop(); + assert(v.len() == 2); +``` +> Source code: test_programs/noir_test_success/bounded_vec/src/main.nr#L125-L140 + + +### max_len + +```rust +pub fn max_len(_self: BoundedVec) -> u64 { +``` + +Returns the maximum length of this vector. This is always +equal to the `MaxLen` parameter this vector was initialized with. + +Example: + +```rust title="bounded-vec-max-len-example" showLineNumbers +let mut v: BoundedVec = BoundedVec::new(); + + assert(v.max_len() == 5); + v.push(10); + assert(v.max_len() == 5); +``` +> Source code: test_programs/noir_test_success/bounded_vec/src/main.nr#L145-L151 + + +### storage + +```rust +pub fn storage(self) -> [T; MaxLen] { +``` + +Returns the internal array within this vector. +Since arrays in Noir are immutable, mutating the returned storage array will not mutate +the storage held internally by this vector. + +Note that uninitialized elements may be zeroed out! + +Example: + +```rust title="bounded-vec-storage-example" showLineNumbers +let mut v: BoundedVec = BoundedVec::new(); + + assert(v.storage() == [0, 0, 0, 0, 0]); + + v.push(57); + assert(v.storage() == [57, 0, 0, 0, 0]); +``` +> Source code: test_programs/noir_test_success/bounded_vec/src/main.nr#L156-L163 + + +### extend_from_array + +```rust +pub fn extend_from_array(&mut self, array: [T; Len]) +``` + +Pushes each element from the given array to this vector. + +Panics if pushing each element would cause the length of this vector +to exceed the maximum length. + +Example: + +```rust title="bounded-vec-extend-from-array-example" showLineNumbers +let mut vec: BoundedVec = BoundedVec::new(); + vec.extend_from_array([2, 4]); + + assert(vec.len == 2); + assert(vec.get(0) == 2); + assert(vec.get(1) == 4); +``` +> Source code: test_programs/noir_test_success/bounded_vec/src/main.nr#L168-L175 + + +### extend_from_bounded_vec + +```rust +pub fn extend_from_bounded_vec(&mut self, vec: BoundedVec) +``` + +Pushes each element from the other vector to this vector. The length of +the other vector is left unchanged. + +Panics if pushing each element would cause the length of this vector +to exceed the maximum length. + +Example: + +```rust title="bounded-vec-extend-from-bounded-vec-example" showLineNumbers +let mut v1: BoundedVec = BoundedVec::new(); + let mut v2: BoundedVec = BoundedVec::new(); + + v2.extend_from_array([1, 2, 3]); + v1.extend_from_bounded_vec(v2); + + assert(v1.storage() == [1, 2, 3, 0, 0]); + assert(v2.storage() == [1, 2, 3, 0, 0, 0, 0]); +``` +> Source code: test_programs/noir_test_success/bounded_vec/src/main.nr#L180-L189 + + +### from_array + +```rust +pub fn from_array(array: [T; Len]) -> Self +``` + +Creates a new vector, populating it with values derived from an array input. +The maximum length of the vector is determined based on the type signature. + +Example: +```rust +let bounded_vec: BoundedVec = BoundedVec::from_array([1, 2, 3]) +``` + +### from_parts + +```rust +pub fn from_parts(mut array: [T; MaxLen], len: u32) -> Self +``` + +Creates a new BoundedVec from the given array and length. +The given length must be less than or equal to the length of the array. + +This function will zero out any elements at or past index `len` of `array`. +This incurs an extra runtime cost of O(MaxLen). If you are sure your array is +zeroed after that index, you can use `from_parts_unchecked` to remove the extra loop. + +Example: + +```rust title="from-parts" showLineNumbers +let vec: BoundedVec = BoundedVec::from_parts([1, 2, 3, 0], 3); + assert_eq(vec.len(), 3); + + // Any elements past the given length are zeroed out, so these + // two vectors will be completely equal + let vec1: BoundedVec = BoundedVec::from_parts([1, 2, 3, 1], 3); + let vec2: BoundedVec = BoundedVec::from_parts([1, 2, 3, 2], 3); + assert_eq(vec1, vec2); +``` +> Source code: noir_stdlib/src/collections/bounded_vec.nr#L663-L672 + + +### from_parts_unchecked + +```rust +pub fn from_parts_unchecked(array: [T; MaxLen], len: u32) -> Self +``` + +Creates a new BoundedVec from the given array and length. +The given length must be less than or equal to the length of the array. + +This function is unsafe because it expects all elements past the `len` index +of `array` to be zeroed, but does not check for this internally. Use `from_parts` +for a safe version of this function which does zero out any indices past the +given length. Invalidating this assumption can notably cause `BoundedVec::eq` +to give incorrect results since it will check even elements past `len`. + +Example: + +```rust title="from-parts-unchecked" showLineNumbers +let vec: BoundedVec = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3); + assert_eq(vec.len(), 3); + + // invalid use! + let vec1: BoundedVec = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3); + let vec2: BoundedVec = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3); + + // both vectors have length 3 so we'd expect them to be equal, but this + // fails because elements past the length are still checked in eq + assert(vec1 != vec2); +``` +> Source code: noir_stdlib/src/collections/bounded_vec.nr#L677-L688 + + +### map + +```rust +pub fn map(self, f: fn[Env](T) -> U) -> BoundedVec +``` + +Creates a new vector of equal size by calling a closure on each element in this vector. + +Example: + +```rust title="bounded-vec-map-example" showLineNumbers +let vec: BoundedVec = BoundedVec::from_array([1, 2, 3, 4]); + let result = vec.map(|value| value * 2); +``` +> Source code: noir_stdlib/src/collections/bounded_vec.nr#L551-L554 + + +### any + +```rust +pub fn any(self, predicate: fn[Env](T) -> bool) -> bool +``` + +Returns true if the given predicate returns true for any element +in this vector. + +Example: + +```rust title="bounded-vec-any-example" showLineNumbers +let mut v: BoundedVec = BoundedVec::new(); + v.extend_from_array([2, 4, 6]); + + let all_even = !v.any(|elem: u32| elem % 2 != 0); + assert(all_even); +``` +> Source code: test_programs/noir_test_success/bounded_vec/src/main.nr#L256-L262 + diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/hashmap.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/hashmap.md new file mode 100644 index 00000000000..810baad16ba --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/hashmap.md @@ -0,0 +1,587 @@ +--- +title: HashMap +keywords: [noir, map, hash, hashmap] +sidebar_position: 1 +--- + +`HashMap` is used to efficiently store and look up key-value pairs. + +`HashMap` is a bounded type which can store anywhere from zero to `MaxLen` total elements. +Note that due to hash collisions, the actual maximum number of elements stored by any particular +hashmap is likely lower than `MaxLen`. This is true even with cryptographic hash functions since +every hash value will be performed modulo `MaxLen`. + +Example: + +```rust +// Create a mapping from Fields to u32s with a maximum length of 12 +// using a poseidon2 hasher +use std::hash::poseidon2::Poseidon2Hasher; +let mut map: HashMap> = HashMap::default(); + +map.insert(1, 2); +map.insert(3, 4); + +let two = map.get(1).unwrap(); +``` + +## Methods + +### default + +```rust title="default" showLineNumbers +impl Default for HashMap +where + B: BuildHasher + Default, + H: Hasher + Default, +{ + /// Constructs an empty HashMap. + /// + /// Example: + /// + /// ```noir + /// let hashmap: HashMap> = HashMap::default(); + /// assert(hashmap.is_empty()); + /// ``` + fn default() -> Self { +``` +> Source code: noir_stdlib/src/collections/map.nr#L688-L703 + + +Creates a fresh, empty HashMap. + +When using this function, always make sure to specify the maximum size of the hash map. + +This is the same `default` from the `Default` implementation given further below. It is +repeated here for convenience since it is the recommended way to create a hashmap. + +Example: + +```rust title="default_example" showLineNumbers +let hashmap: HashMap> = HashMap::default(); + assert(hashmap.is_empty()); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L208-L211 + + +Because `HashMap` has so many generic arguments that are likely to be the same throughout +your program, it may be helpful to create a type alias: + +```rust title="type_alias" showLineNumbers +type MyMap = HashMap>; +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L202-L204 + + +### with_hasher + +```rust title="with_hasher" showLineNumbers +pub fn with_hasher(_build_hasher: B) -> Self + where + B: BuildHasher, + { +``` +> Source code: noir_stdlib/src/collections/map.nr#L103-L108 + + +Creates a hashmap with an existing `BuildHasher`. This can be used to ensure multiple +hashmaps are created with the same hasher instance. + +Example: + +```rust title="with_hasher_example" showLineNumbers +let my_hasher: BuildHasherDefault = Default::default(); + let hashmap: HashMap> = + HashMap::with_hasher(my_hasher); + assert(hashmap.is_empty()); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L212-L217 + + +### get + +```rust title="get" showLineNumbers +pub fn get(self, key: K) -> Option + where + K: Eq + Hash, + B: BuildHasher, + H: Hasher, + { +``` +> Source code: noir_stdlib/src/collections/map.nr#L472-L479 + + +Retrieves a value from the hashmap, returning `Option::none()` if it was not found. + +Example: + +```rust title="get_example" showLineNumbers +fn get_example(map: HashMap>) { + let x = map.get(12); + + if x.is_some() { + assert(x.unwrap() == 42); + } +} +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L297-L305 + + +### insert + +```rust title="insert" showLineNumbers +pub fn insert(&mut self, key: K, value: V) + where + K: Eq + Hash, + B: BuildHasher, + H: Hasher, + { +``` +> Source code: noir_stdlib/src/collections/map.nr#L514-L521 + + +Inserts a new key-value pair into the map. If the key was already in the map, its +previous value will be overridden with the newly provided one. + +Example: + +```rust title="insert_example" showLineNumbers +let mut map: HashMap> = HashMap::default(); + map.insert(12, 42); + assert(map.len() == 1); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L218-L222 + + +### remove + +```rust title="remove" showLineNumbers +pub fn remove(&mut self, key: K) + where + K: Eq + Hash, + B: BuildHasher, + H: Hasher, + { +``` +> Source code: noir_stdlib/src/collections/map.nr#L570-L577 + + +Removes the given key-value pair from the map. If the key was not already present +in the map, this does nothing. + +Example: + +```rust title="remove_example" showLineNumbers +map.remove(12); + assert(map.is_empty()); + + // If a key was not present in the map, remove does nothing + map.remove(12); + assert(map.is_empty()); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L225-L232 + + +### is_empty + +```rust title="is_empty" showLineNumbers +pub fn is_empty(self) -> bool { +``` +> Source code: noir_stdlib/src/collections/map.nr#L167-L169 + + +True if the length of the hash map is empty. + +Example: + +```rust title="is_empty_example" showLineNumbers +assert(map.is_empty()); + + map.insert(1, 2); + assert(!map.is_empty()); + + map.remove(1); + assert(map.is_empty()); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L233-L241 + + +### len + +```rust title="len" showLineNumbers +pub fn len(self) -> u32 { +``` +> Source code: noir_stdlib/src/collections/map.nr#L431-L433 + + +Returns the current length of this hash map. + +Example: + +```rust title="len_example" showLineNumbers +// This is equivalent to checking map.is_empty() + assert(map.len() == 0); + + map.insert(1, 2); + map.insert(3, 4); + map.insert(5, 6); + assert(map.len() == 3); + + // 3 was already present as a key in the hash map, so the length is unchanged + map.insert(3, 7); + assert(map.len() == 3); + + map.remove(1); + assert(map.len() == 2); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L242-L257 + + +### capacity + +```rust title="capacity" showLineNumbers +pub fn capacity(_self: Self) -> u32 { +``` +> Source code: noir_stdlib/src/collections/map.nr#L453-L455 + + +Returns the maximum capacity of this hashmap. This is always equal to the capacity +specified in the hashmap's type. + +Unlike hashmaps in general purpose programming languages, hashmaps in Noir have a +static capacity that does not increase as the map grows larger. Thus, this capacity +is also the maximum possible element count that can be inserted into the hashmap. +Due to hash collisions (modulo the hashmap length), it is likely the actual maximum +element count will be lower than the full capacity. + +Example: + +```rust title="capacity_example" showLineNumbers +let empty_map: HashMap> = + HashMap::default(); + assert(empty_map.len() == 0); + assert(empty_map.capacity() == 42); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L258-L263 + + +### clear + +```rust title="clear" showLineNumbers +pub fn clear(&mut self) { +``` +> Source code: noir_stdlib/src/collections/map.nr#L123-L125 + + +Clears the hashmap, removing all key-value pairs from it. + +Example: + +```rust title="clear_example" showLineNumbers +assert(!map.is_empty()); + map.clear(); + assert(map.is_empty()); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L264-L268 + + +### contains_key + +```rust title="contains_key" showLineNumbers +pub fn contains_key(self, key: K) -> bool + where + K: Hash + Eq, + B: BuildHasher, + H: Hasher, + { +``` +> Source code: noir_stdlib/src/collections/map.nr#L143-L150 + + +True if the hashmap contains the given key. Unlike `get`, this will not also return +the value associated with the key. + +Example: + +```rust title="contains_key_example" showLineNumbers +if map.contains_key(7) { + let value = map.get(7); + assert(value.is_some()); + } else { + println("No value for key 7!"); + } +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L269-L276 + + +### entries + +```rust title="entries" showLineNumbers +pub fn entries(self) -> BoundedVec<(K, V), N> { +``` +> Source code: noir_stdlib/src/collections/map.nr#L191-L193 + + +Returns a vector of each key-value pair present in the hashmap. + +The length of the returned vector is always equal to the length of the hashmap. + +Example: + +```rust title="entries_example" showLineNumbers +let entries = map.entries(); + + // The length of a hashmap may not be compile-time known, so we + // need to loop over its capacity instead + for i in 0..map.capacity() { + if i < entries.len() { + let (key, value) = entries.get(i); + println(f"{key} -> {value}"); + } + } +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L308-L319 + + +### keys + +```rust title="keys" showLineNumbers +pub fn keys(self) -> BoundedVec { +``` +> Source code: noir_stdlib/src/collections/map.nr#L230-L232 + + +Returns a vector of each key present in the hashmap. + +The length of the returned vector is always equal to the length of the hashmap. + +Example: + +```rust title="keys_example" showLineNumbers +let keys = map.keys(); + + for i in 0..keys.max_len() { + if i < keys.len() { + let key = keys.get_unchecked(i); + let value = map.get(key).unwrap_unchecked(); + println(f"{key} -> {value}"); + } + } +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L320-L330 + + +### values + +```rust title="values" showLineNumbers +pub fn values(self) -> BoundedVec { +``` +> Source code: noir_stdlib/src/collections/map.nr#L267-L269 + + +Returns a vector of each value present in the hashmap. + +The length of the returned vector is always equal to the length of the hashmap. + +Example: + +```rust title="values_example" showLineNumbers +let values = map.values(); + + for i in 0..values.max_len() { + if i < values.len() { + let value = values.get_unchecked(i); + println(f"Found value {value}"); + } + } +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L331-L340 + + +### iter_mut + +```rust title="iter_mut" showLineNumbers +pub fn iter_mut(&mut self, f: fn(K, V) -> (K, V)) + where + K: Eq + Hash, + B: BuildHasher, + H: Hasher, + { +``` +> Source code: noir_stdlib/src/collections/map.nr#L304-L311 + + +Iterates through each key-value pair of the HashMap, setting each key-value pair to the +result returned from the given function. + +Note that since keys can be mutated, the HashMap needs to be rebuilt as it is iterated +through. If this is not desired, use `iter_values_mut` if only values need to be mutated, +or `entries` if neither keys nor values need to be mutated. + +The iteration order is left unspecified. As a result, if two keys are mutated to become +equal, which of the two values that will be present for the key in the resulting map is also unspecified. + +Example: + +```rust title="iter_mut_example" showLineNumbers +// Add 1 to each key in the map, and double the value associated with that key. + map.iter_mut(|k, v| (k + 1, v * 2)); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L344-L347 + + +### iter_keys_mut + +```rust title="iter_keys_mut" showLineNumbers +pub fn iter_keys_mut(&mut self, f: fn(K) -> K) + where + K: Eq + Hash, + B: BuildHasher, + H: Hasher, + { +``` +> Source code: noir_stdlib/src/collections/map.nr#L342-L349 + + +Iterates through the HashMap, mutating each key to the result returned from +the given function. + +Note that since keys can be mutated, the HashMap needs to be rebuilt as it is iterated +through. If only iteration is desired and the keys are not intended to be mutated, +prefer using `entries` instead. + +The iteration order is left unspecified. As a result, if two keys are mutated to become +equal, which of the two values that will be present for the key in the resulting map is also unspecified. + +Example: + +```rust title="iter_keys_mut_example" showLineNumbers +// Double each key, leaving the value associated with that key untouched + map.iter_keys_mut(|k| k * 2); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L348-L351 + + +### iter_values_mut + +```rust title="iter_values_mut" showLineNumbers +pub fn iter_values_mut(&mut self, f: fn(V) -> V) { +``` +> Source code: noir_stdlib/src/collections/map.nr#L374-L376 + + +Iterates through the HashMap, applying the given function to each value and mutating the +value to equal the result. This function is more efficient than `iter_mut` and `iter_keys_mut` +because the keys are untouched and the underlying hashmap thus does not need to be reordered. + +Example: + +```rust title="iter_values_mut_example" showLineNumbers +// Halve each value + map.iter_values_mut(|v| v / 2); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L352-L355 + + +### retain + +```rust title="retain" showLineNumbers +pub fn retain(&mut self, f: fn(K, V) -> bool) { +``` +> Source code: noir_stdlib/src/collections/map.nr#L395-L397 + + +Retains only the key-value pairs for which the given function returns true. +Any key-value pairs for which the function returns false will be removed from the map. + +Example: + +```rust title="retain_example" showLineNumbers +map.retain(|k, v| (k != 0) & (v != 0)); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L280-L282 + + +## Trait Implementations + +### default + +```rust title="default" showLineNumbers +impl Default for HashMap +where + B: BuildHasher + Default, + H: Hasher + Default, +{ + /// Constructs an empty HashMap. + /// + /// Example: + /// + /// ```noir + /// let hashmap: HashMap> = HashMap::default(); + /// assert(hashmap.is_empty()); + /// ``` + fn default() -> Self { +``` +> Source code: noir_stdlib/src/collections/map.nr#L688-L703 + + +Constructs an empty HashMap. + +Example: + +```rust title="default_example" showLineNumbers +let hashmap: HashMap> = HashMap::default(); + assert(hashmap.is_empty()); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L208-L211 + + +### eq + +```rust title="eq" showLineNumbers +impl Eq for HashMap +where + K: Eq + Hash, + V: Eq, + B: BuildHasher, + H: Hasher, +{ + /// Checks if two HashMaps are equal. + /// + /// Example: + /// + /// ```noir + /// let mut map1: HashMap> = HashMap::default(); + /// let mut map2: HashMap> = HashMap::default(); + /// + /// map1.insert(1, 2); + /// map1.insert(3, 4); + /// + /// map2.insert(3, 4); + /// map2.insert(1, 2); + /// + /// assert(map1 == map2); + /// ``` + fn eq(self, other: HashMap) -> bool { +``` +> Source code: noir_stdlib/src/collections/map.nr#L636-L661 + + +Checks if two HashMaps are equal. + +Example: + +```rust title="eq_example" showLineNumbers +let mut map1: HashMap> = HashMap::default(); + let mut map2: HashMap> = HashMap::default(); + + map1.insert(1, 2); + map1.insert(3, 4); + + map2.insert(3, 4); + map2.insert(1, 2); + + assert(map1 == map2); +``` +> Source code: test_programs/execution_success/hashmap/src/main.nr#L283-L294 + diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/index.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/index.md new file mode 100644 index 00000000000..ea84c6d5c21 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/index.md @@ -0,0 +1,5 @@ +--- +title: Containers +description: Container types provided by Noir's standard library for storing and retrieving data +keywords: [containers, data types, vec, hashmap] +--- diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/vec.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/vec.mdx new file mode 100644 index 00000000000..475011922f8 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/containers/vec.mdx @@ -0,0 +1,170 @@ +--- +title: Vectors +description: Delve into the Vec data type in Noir. Learn about its methods, practical examples, and best practices for using Vectors in your Noir code. +keywords: [noir, vector type, methods, examples, dynamic arrays] +sidebar_position: 6 +--- + +import Experimental from '@site/src/components/Notes/_experimental.mdx'; + + + +A vector is a collection type similar to Rust's `Vec` type. In Noir, it is a convenient way to use slices as mutable arrays. + +Example: + +```rust +let mut vector: Vec = Vec::new(); +for i in 0..5 { + vector.push(i); +} +assert(vector.len() == 5); +``` + +## Methods + +### new + +Creates a new, empty vector. + +```rust +pub fn new() -> Self +``` + +Example: + +```rust +let empty_vector: Vec = Vec::new(); +assert(empty_vector.len() == 0); +``` + +### from_slice + +Creates a vector containing each element from a given slice. Mutations to the resulting vector will not affect the original slice. + +```rust +pub fn from_slice(slice: [T]) -> Self +``` + +Example: + +```rust +let slice: [Field] = &[1, 2, 3]; +let vector_from_slice = Vec::from_slice(slice); +assert(vector_from_slice.len() == 3); +``` + +### len + +Returns the number of elements in the vector. + +```rust +pub fn len(self) -> Field +``` + +Example: + +```rust +let empty_vector: Vec = Vec::new(); +assert(empty_vector.len() == 0); +``` + +### get + +Retrieves an element from the vector at a given index. Panics if the index points beyond the vector's end. + +```rust +pub fn get(self, index: Field) -> T +``` + +Example: + +```rust +let vector: Vec = Vec::from_slice(&[10, 20, 30]); +assert(vector.get(1) == 20); +``` + +### set + +```rust +pub fn set(&mut self: Self, index: u64, value: T) { +``` + +Writes an element to the vector at the given index, starting from zero. + +Panics if the index points beyond the vector's end. + +Example: + +```rust +let vector: Vec = Vec::from_slice(&[10, 20, 30]); +assert(vector.get(1) == 20); +vector.set(1, 42); +assert(vector.get(1) == 42); +``` + +### push + +Adds a new element to the vector's end, returning a new vector with a length one greater than the original unmodified vector. + +```rust +pub fn push(&mut self, elem: T) +``` + +Example: + +```rust +let mut vector: Vec = Vec::new(); +vector.push(10); +assert(vector.len() == 1); +``` + +### pop + +Removes an element from the vector's end, returning a new vector with a length one less than the original vector, along with the removed element. Panics if the vector's length is zero. + +```rust +pub fn pop(&mut self) -> T +``` + +Example: + +```rust +let mut vector = Vec::from_slice(&[10, 20]); +let popped_elem = vector.pop(); +assert(popped_elem == 20); +assert(vector.len() == 1); +``` + +### insert + +Inserts an element at a specified index, shifting subsequent elements to the right. + +```rust +pub fn insert(&mut self, index: Field, elem: T) +``` + +Example: + +```rust +let mut vector = Vec::from_slice(&[10, 30]); +vector.insert(1, 20); +assert(vector.get(1) == 20); +``` + +### remove + +Removes an element at a specified index, shifting subsequent elements to the left, and returns the removed element. + +```rust +pub fn remove(&mut self, index: Field) -> T +``` + +Example: + +```rust +let mut vector = Vec::from_slice(&[10, 20, 30]); +let removed_elem = vector.remove(1); +assert(removed_elem == 20); +assert(vector.len() == 2); +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/_category_.json b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/_category_.json new file mode 100644 index 00000000000..5d694210bbf --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/_category_.json @@ -0,0 +1,5 @@ +{ + "position": 0, + "collapsible": true, + "collapsed": true +} diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/ciphers.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/ciphers.mdx new file mode 100644 index 00000000000..d6a5e1a79eb --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/ciphers.mdx @@ -0,0 +1,32 @@ +--- +title: Ciphers +description: + Learn about the implemented ciphers ready to use for any Noir project +keywords: + [ciphers, Noir project, aes128, encrypt] +sidebar_position: 0 +--- + +import BlackBoxInfo from '@site/src/components/Notes/_blackbox'; + +## aes128 + +Given a plaintext as an array of bytes, returns the corresponding aes128 ciphertext (CBC mode). Input padding is automatically performed using PKCS#7, so that the output length is `input.len() + (16 - input.len() % 16)`. + +```rust title="aes128" showLineNumbers +pub fn aes128_encrypt(input: [u8; N], iv: [u8; 16], key: [u8; 16]) -> [u8] {} +``` +> Source code: noir_stdlib/src/aes128.nr#L2-L4 + + +```rust +fn main() { + let input: [u8; 4] = [0, 12, 3, 15] // Random bytes, will be padded to 16 bytes. + let iv: [u8; 16] = [0; 16]; // Initialisation vector + let key: [u8; 16] = [0; 16] // AES key + let ciphertext = std::aes128::aes128_encrypt(inputs.as_bytes(), iv.as_bytes(), key.as_bytes()); // In this case, the output length will be 16 bytes. +} +``` + + + \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/ecdsa_sig_verification.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/ecdsa_sig_verification.mdx new file mode 100644 index 00000000000..8d96027b42c --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/ecdsa_sig_verification.mdx @@ -0,0 +1,98 @@ +--- +title: ECDSA Signature Verification +description: Learn about the cryptographic primitives regarding ECDSA over the secp256k1 and secp256r1 curves +keywords: [cryptographic primitives, Noir project, ecdsa, secp256k1, secp256r1, signatures] +sidebar_position: 3 +--- + +import BlackBoxInfo from '@site/src/components/Notes/_blackbox'; + +Noir supports ECDSA signatures verification over the secp256k1 and secp256r1 curves. + +## ecdsa_secp256k1::verify_signature + +Verifier for ECDSA Secp256k1 signatures. +See ecdsa_secp256k1::verify_signature_slice for a version that accepts slices directly. + +```rust title="ecdsa_secp256k1" showLineNumbers +pub fn verify_signature( + public_key_x: [u8; 32], + public_key_y: [u8; 32], + signature: [u8; 64], + message_hash: [u8; N], +) -> bool +``` +> Source code: noir_stdlib/src/ecdsa_secp256k1.nr#L2-L9 + + +example: + +```rust +fn main(hashed_message : [u8;32], pub_key_x : [u8;32], pub_key_y : [u8;32], signature : [u8;64]) { + let valid_signature = std::ecdsa_secp256k1::verify_signature(pub_key_x, pub_key_y, signature, hashed_message); + assert(valid_signature); +} +``` + + + +## ecdsa_secp256k1::verify_signature_slice + +Verifier for ECDSA Secp256k1 signatures where the message is a slice. + +```rust title="ecdsa_secp256k1_slice" showLineNumbers +pub fn verify_signature_slice( + public_key_x: [u8; 32], + public_key_y: [u8; 32], + signature: [u8; 64], + message_hash: [u8], +) -> bool +``` +> Source code: noir_stdlib/src/ecdsa_secp256k1.nr#L13-L20 + + + + +## ecdsa_secp256r1::verify_signature + +Verifier for ECDSA Secp256r1 signatures. +See ecdsa_secp256r1::verify_signature_slice for a version that accepts slices directly. + +```rust title="ecdsa_secp256r1" showLineNumbers +pub fn verify_signature( + public_key_x: [u8; 32], + public_key_y: [u8; 32], + signature: [u8; 64], + message_hash: [u8; N], +) -> bool +``` +> Source code: noir_stdlib/src/ecdsa_secp256r1.nr#L2-L9 + + +example: + +```rust +fn main(hashed_message : [u8;32], pub_key_x : [u8;32], pub_key_y : [u8;32], signature : [u8;64]) { + let valid_signature = std::ecdsa_secp256r1::verify_signature(pub_key_x, pub_key_y, signature, hashed_message); + assert(valid_signature); +} +``` + + + +## ecdsa_secp256r1::verify_signature + +Verifier for ECDSA Secp256r1 signatures where the message is a slice. + +```rust title="ecdsa_secp256r1_slice" showLineNumbers +pub fn verify_signature_slice( + public_key_x: [u8; 32], + public_key_y: [u8; 32], + signature: [u8; 64], + message_hash: [u8], +) -> bool +``` +> Source code: noir_stdlib/src/ecdsa_secp256r1.nr#L13-L20 + + + diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/embedded_curve_ops.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/embedded_curve_ops.mdx new file mode 100644 index 00000000000..482a36932b9 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/embedded_curve_ops.mdx @@ -0,0 +1,95 @@ +--- +title: Scalar multiplication +description: See how you can perform scalar multiplication in Noir +keywords: [cryptographic primitives, Noir project, scalar multiplication] +sidebar_position: 1 +--- + +import BlackBoxInfo from '@site/src/components/Notes/_blackbox'; + +The following functions perform operations over the embedded curve whose coordinates are defined by the configured noir field. +For the BN254 scalar field, this is BabyJubJub or Grumpkin. + +:::note +Suffixes `_low` and `_high` denote low and high limbs of a scalar. +::: + +## embedded_curve_ops::multi_scalar_mul + +Performs multi scalar multiplication over the embedded curve. +The function accepts arbitrary amount of point-scalar pairs on the input, it multiplies the individual pairs over +the curve and returns a sum of the resulting points. + +Points represented as x and y coordinates [x1, y1, x2, y2, ...], scalars as low and high limbs [low1, high1, low2, high2, ...]. + +```rust title="multi_scalar_mul" showLineNumbers +pub fn multi_scalar_mul( + points: [EmbeddedCurvePoint; N], + scalars: [EmbeddedCurveScalar; N], +) -> EmbeddedCurvePoint +``` +> Source code: noir_stdlib/src/embedded_curve_ops.nr#L103-L108 + + +example + +```rust +fn main(point_x: Field, point_y: Field, scalar_low: Field, scalar_high: Field) { + let point = std::embedded_curve_ops::multi_scalar_mul([point_x, point_y], [scalar_low, scalar_high]); + println(point); +} +``` + +## embedded_curve_ops::fixed_base_scalar_mul + +Performs fixed base scalar multiplication over the embedded curve (multiplies input scalar with a generator point). +The function accepts a single scalar on the input represented as 2 fields. + +```rust title="fixed_base_scalar_mul" showLineNumbers +pub fn fixed_base_scalar_mul(scalar: EmbeddedCurveScalar) -> EmbeddedCurvePoint +``` +> Source code: noir_stdlib/src/embedded_curve_ops.nr#L120-L122 + + +example + +```rust +fn main(scalar_low: Field, scalar_high: Field) { + let point = std::embedded_curve_ops::fixed_base_scalar_mul(scalar_low, scalar_high); + println(point); +} +``` + +## embedded_curve_ops::embedded_curve_add + +Adds two points on the embedded curve. +This function takes two `EmbeddedCurvePoint` structures as parameters, representing points on the curve, and returns a new `EmbeddedCurvePoint` structure that represents their sum. + +### Parameters: +- `point1` (`EmbeddedCurvePoint`): The first point to add. +- `point2` (`EmbeddedCurvePoint`): The second point to add. + +### Returns: +- `EmbeddedCurvePoint`: The resulting point after the addition of `point1` and `point2`. + +```rust title="embedded_curve_add" showLineNumbers +pub fn embedded_curve_add( + point1: EmbeddedCurvePoint, + point2: EmbeddedCurvePoint, +) -> EmbeddedCurvePoint { +``` +> Source code: noir_stdlib/src/embedded_curve_ops.nr#L136-L141 + + +example + +```rust +fn main() { + let point1 = EmbeddedCurvePoint { x: 1, y: 2 }; + let point2 = EmbeddedCurvePoint { x: 3, y: 4 }; + let result = std::embedded_curve_ops::embedded_curve_add(point1, point2); + println!("Resulting Point: ({}, {})", result.x, result.y); +} +``` + + diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/hashes.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/hashes.mdx new file mode 100644 index 00000000000..e010d6d85c2 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/hashes.mdx @@ -0,0 +1,227 @@ +--- +title: Hash methods +description: + Learn about the cryptographic primitives ready to use for any Noir project, including sha256, + blake2s and pedersen +keywords: + [cryptographic primitives, Noir project, sha256, blake2s, pedersen, hash] +sidebar_position: 0 +--- + +import BlackBoxInfo from '@site/src/components/Notes/_blackbox'; + +## sha256 + +Given an array of bytes, returns the resulting sha256 hash. +Specify a message_size to hash only the first `message_size` bytes of the input. + +```rust title="sha256" showLineNumbers +pub fn sha256(input: [u8; N]) -> HASH +``` +> Source code: noir_stdlib/src/hash/sha256.nr#L47-L49 + + +example: +```rust title="sha256_var" showLineNumbers +let digest = std::hash::sha256_var([x as u8], 1); +``` +> Source code: test_programs/execution_success/sha256/src/main.nr#L15-L17 + + +```rust +fn main() { + let x = [163, 117, 178, 149]; // some random bytes + let hash = std::sha256::sha256_var(x, 4); +} +``` + + + + +## blake2s + +Given an array of bytes, returns an array with the Blake2 hash + +```rust title="blake2s" showLineNumbers +pub fn blake2s(input: [u8; N]) -> [u8; 32] +``` +> Source code: noir_stdlib/src/hash/mod.nr#L18-L20 + + +example: + +```rust +fn main() { + let x = [163, 117, 178, 149]; // some random bytes + let hash = std::hash::blake2s(x); +} +``` + + + +## blake3 + +Given an array of bytes, returns an array with the Blake3 hash + +```rust title="blake3" showLineNumbers +pub fn blake3(input: [u8; N]) -> [u8; 32] +``` +> Source code: noir_stdlib/src/hash/mod.nr#L24-L26 + + +example: + +```rust +fn main() { + let x = [163, 117, 178, 149]; // some random bytes + let hash = std::hash::blake3(x); +} +``` + + + +## pedersen_hash + +Given an array of Fields, returns the Pedersen hash. + +```rust title="pedersen_hash" showLineNumbers +pub fn pedersen_hash(input: [Field; N]) -> Field +``` +> Source code: noir_stdlib/src/hash/mod.nr#L49-L51 + + +example: + +```rust title="pedersen-hash" showLineNumbers +fn main(x: Field, y: Field, expected_hash: Field) { + let hash = std::hash::pedersen_hash([x, y]); + assert_eq(hash, expected_hash); +} +``` +> Source code: test_programs/execution_success/pedersen_hash/src/main.nr#L1-L6 + + + + +## pedersen_commitment + +Given an array of Fields, returns the Pedersen commitment. + +```rust title="pedersen_commitment" showLineNumbers +pub fn pedersen_commitment(input: [Field; N]) -> EmbeddedCurvePoint { +``` +> Source code: noir_stdlib/src/hash/mod.nr#L29-L31 + + +example: + +```rust title="pedersen-commitment" showLineNumbers +fn main(x: Field, y: Field, expected_commitment: std::embedded_curve_ops::EmbeddedCurvePoint) { + let commitment = std::hash::pedersen_commitment([x, y]); + assert_eq(commitment.x, expected_commitment.x); + assert_eq(commitment.y, expected_commitment.y); +} +``` +> Source code: test_programs/execution_success/pedersen_commitment/src/main.nr#L1-L7 + + + + +## keccak256 + +Given an array of bytes (`u8`), returns the resulting keccak hash as an array of +32 bytes (`[u8; 32]`). Specify a message_size to hash only the first +`message_size` bytes of the input. + +```rust title="keccak256" showLineNumbers +pub fn keccak256(input: [u8; N], message_size: u32) -> [u8; 32] +``` +> Source code: noir_stdlib/src/hash/mod.nr#L119-L121 + + +example: + +```rust title="keccak256" showLineNumbers +fn main(x: Field, result: [u8; 32]) { + // We use the `as` keyword here to denote the fact that we want to take just the first byte from the x Field + // The padding is taken care of by the program + let digest = std::hash::keccak256([x as u8], 1); + assert(digest == result); + + //#1399: variable message size + let message_size = 4; + let hash_a = std::hash::keccak256([1, 2, 3, 4], message_size); + let hash_b = std::hash::keccak256([1, 2, 3, 4, 0, 0, 0, 0], message_size); + + assert(hash_a == hash_b); + + let message_size_big = 8; + let hash_c = std::hash::keccak256([1, 2, 3, 4, 0, 0, 0, 0], message_size_big); + + assert(hash_a != hash_c); +} +``` +> Source code: test_programs/execution_success/keccak256/src/main.nr#L1-L20 + + + + +## poseidon + +Given an array of Fields, returns a new Field with the Poseidon Hash. Mind that you need to specify +how many inputs are there to your Poseidon function. + +```rust +// example for hash_1, hash_2 accepts an array of length 2, etc +fn hash_1(input: [Field; 1]) -> Field +``` + +example: + +```rust title="poseidon" showLineNumbers +use std::hash::poseidon; + +fn main(x1: [Field; 2], y1: pub Field, x2: [Field; 4], y2: pub Field) { + let hash1 = poseidon::bn254::hash_2(x1); + assert(hash1 == y1); + + let hash2 = poseidon::bn254::hash_4(x2); + assert(hash2 == y2); +} +``` +> Source code: test_programs/execution_success/poseidon_bn254_hash/src/main.nr#L1-L11 + + +## poseidon 2 + +Given an array of Fields, returns a new Field with the Poseidon2 Hash. Contrary to the Poseidon +function, there is only one hash and you can specify a message_size to hash only the first +`message_size` bytes of the input, + +```rust +// example for hashing the first three elements of the input +Poseidon2::hash(input, 3); +``` + +example: + +```rust title="poseidon2" showLineNumbers +use std::hash::poseidon2; + +fn main(inputs: [Field; 4], expected_hash: Field) { + let hash = poseidon2::Poseidon2::hash(inputs, inputs.len()); + assert_eq(hash, expected_hash); +} +``` +> Source code: test_programs/execution_success/poseidon2/src/main.nr#L1-L8 + + +## hash_to_field + +```rust +fn hash_to_field(_input : [Field]) -> Field {} +``` + +Calculates the `blake2s` hash of the inputs and returns the hash modulo the field modulus to return +a value which can be represented as a `Field`. + diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/index.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/index.md new file mode 100644 index 00000000000..650f30165d5 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/cryptographic_primitives/index.md @@ -0,0 +1,14 @@ +--- +title: Cryptographic Primitives +description: + Learn about the cryptographic primitives ready to use for any Noir project +keywords: + [ + cryptographic primitives, + Noir project, + ] +--- + +The Noir team is progressively adding new cryptographic primitives to the standard library. Reach out for news or if you would be interested in adding more of these calculations in Noir. + +Some methods are available thanks to the Aztec backend, not being performed using Noir. When using other backends, these methods may or may not be supplied. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/fmtstr.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/fmtstr.md new file mode 100644 index 00000000000..19809d60261 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/fmtstr.md @@ -0,0 +1,17 @@ +--- +title: fmtstr +--- + +`fmtstr` is the type resulting from using format string (`f"..."`). + +## Methods + +### quoted_contents + +```rust title="quoted_contents" showLineNumbers +pub comptime fn quoted_contents(self) -> Quoted {} +``` +> Source code: noir_stdlib/src/meta/format_string.nr#L3-L5 + + +Returns the format string contents (that is, without the leading and trailing double quotes) as a `Quoted` value. \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/is_unconstrained.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/is_unconstrained.md new file mode 100644 index 00000000000..51bb1bda8f1 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/is_unconstrained.md @@ -0,0 +1,69 @@ +--- +title: Is Unconstrained Function +description: + The is_unconstrained function returns wether the context at that point of the program is unconstrained or not. +keywords: + [ + unconstrained + ] +--- + +It's very common for functions in circuits to take unconstrained hints of an expensive computation and then verify it. This is done by running the hint in an unconstrained context and then verifying the result in a constrained context. + +When a function is marked as unconstrained, any subsequent functions that it calls will also be run in an unconstrained context. However, if we are implementing a library function, other users might call it within an unconstrained context or a constrained one. Generally, in an unconstrained context we prefer just computing the result instead of taking a hint of it and verifying it, since that'd mean doing the same computation twice: + +```rust + +fn my_expensive_computation(){ + ... +} + +unconstrained fn my_expensive_computation_hint(){ + my_expensive_computation() +} + +pub fn external_interface(){ + my_expensive_computation_hint(); + // verify my_expensive_computation: If external_interface is called from unconstrained, this is redundant + ... +} + +``` + +In order to improve the performance in an unconstrained context you can use the function at `std::runtime::is_unconstrained() -> bool`: + + +```rust +use dep::std::runtime::is_unconstrained; + +fn my_expensive_computation(){ + ... +} + +unconstrained fn my_expensive_computation_hint(){ + my_expensive_computation() +} + +pub fn external_interface(){ + if is_unconstrained() { + my_expensive_computation(); + } else { + my_expensive_computation_hint(); + // verify my_expensive_computation + ... + } +} + +``` + +The is_unconstrained result is resolved at compile time, so in unconstrained contexts the compiler removes the else branch, and in constrained contexts the compiler removes the if branch, reducing the amount of compute necessary to run external_interface. + +Note that using `is_unconstrained` in a `comptime` context will also return `true`: + +``` +fn main() { + comptime { + assert(is_unconstrained()); + } +} +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/logging.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/logging.md new file mode 100644 index 00000000000..db75ef9f86f --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/logging.md @@ -0,0 +1,78 @@ +--- +title: Logging +description: + Learn how to use the println statement for debugging in Noir with this tutorial. Understand the + basics of logging in Noir and how to implement it in your code. +keywords: + [ + noir logging, + println statement, + print statement, + debugging in noir, + noir std library, + logging tutorial, + basic logging in noir, + noir logging implementation, + noir debugging techniques, + rust, + ] +--- + +The standard library provides two familiar statements you can use: `println` and `print`. Despite being a limited implementation of rust's `println!` and `print!` macros, these constructs can be useful for debugging. + +You can print the output of both statements in your Noir code by using the `nargo execute` command or the `--show-output` flag when using `nargo test` (provided there are print statements in your tests). + +It is recommended to use `nargo execute` if you want to debug failing constraints with `println` or `print` statements. This is due to every input in a test being a constant rather than a witness, so we issue an error during compilation while we only print during execution (which comes after compilation). Neither `println`, nor `print` are callable for failed constraints caught at compile time. + +Both `print` and `println` are generic functions which can work on integers, fields, strings, and even structs or expressions. Note however, that slices are currently unsupported. For example: + +```rust +struct Person { + age: Field, + height: Field, +} + +fn main(age: Field, height: Field) { + let person = Person { + age: age, + height: height, + }; + println(person); + println(age + height); + println("Hello world!"); +} +``` + +You can print different types in the same statement (including strings) with a type called `fmtstr`. It can be specified in the same way as a normal string, just prepended with an "f" character: + +```rust + let fmt_str = f"i: {i}, j: {j}"; + println(fmt_str); + + let s = myStruct { y: x, x: y }; + println(s); + + println(f"i: {i}, s: {s}"); + + println(x); + println([x, y]); + + let foo = fooStruct { my_struct: s, foo: 15 }; + println(f"s: {s}, foo: {foo}"); + + println(15); // prints 0x0f, implicit Field + println(-1 as u8); // prints 255 + println(-1 as i8); // prints -1 +``` + +Examples shown above are interchangeable between the two `print` statements: + +```rust +let person = Person { age : age, height : height }; + +println(person); +print(person); + +println("Hello world!"); // Prints with a newline at the end of the input +print("Hello world!"); // Prints the input and keeps cursor on the same line +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/mem.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/mem.md new file mode 100644 index 00000000000..1e9102b32dc --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/mem.md @@ -0,0 +1,82 @@ +--- +title: Memory Module +description: + This module contains functions which manipulate memory in a low-level way +keywords: + [ + mem, memory, zeroed, transmute, checked_transmute + ] +--- + +# `std::mem::zeroed` + +```rust +fn zeroed() -> T +``` + +Returns a zeroed value of any type. +This function is generally unsafe to use as the zeroed bit pattern is not guaranteed to be valid for all types. +It can however, be useful in cases when the value is guaranteed not to be used such as in a BoundedVec library implementing a growable vector, up to a certain length, backed by an array. +The array can be initialized with zeroed values which are guaranteed to be inaccessible until the vector is pushed to. +Similarly, enumerations in noir can be implemented using this method by providing zeroed values for the unused variants. + +This function currently supports the following types: + +- Field +- Bool +- Uint +- Array +- Slice +- String +- Tuple +- Functions + +Using it on other types could result in unexpected behavior. + +# `std::mem::checked_transmute` + +```rust +fn checked_transmute(value: T) -> U +``` + +Transmutes a value of one type into the same value but with a new type `U`. + +This function is safe to use since both types are asserted to be equal later during compilation after the concrete values for generic types become known. +This function is useful for cases where the compiler may fail a type check that is expected to pass where +a user knows the two types to be equal. For example, when using arithmetic generics there are cases the compiler +does not see as equal, such as `[Field; N*(A + B)]` and `[Field; N*A + N*B]`, which users may know to be equal. +In these cases, `checked_transmute` can be used to cast the value to the desired type while also preserving safety +by checking this equality once `N`, `A`, `B` are fully resolved. + +Note that since this safety check is performed after type checking rather than during, no error is issued if the function +containing `checked_transmute` is never called. + +# `std::mem::array_refcount` + +```rust +fn array_refcount(array: [T; N]) -> u32 {} +``` + +Returns the internal reference count of an array value in unconstrained code. + +Arrays only have reference count in unconstrained code - using this anywhere +else will return zero. + +This function is mostly intended for debugging compiler optimizations but can also be used +to find where array copies may be happening in unconstrained code by placing it before array +mutations. + +# `std::mem::slice_refcount` + +```rust +fn slice_refcount(slice: [T]) -> u32 {} +``` + +Returns the internal reference count of a slice value in unconstrained code. + +Slices only have reference count in unconstrained code - using this anywhere +else will return zero. + +This function is mostly intended for debugging compiler optimizations but can also be used +to find where slice copies may be happening in unconstrained code by placing it before slice +mutations. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/merkle_trees.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/merkle_trees.md new file mode 100644 index 00000000000..6a9ebf72ada --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/merkle_trees.md @@ -0,0 +1,58 @@ +--- +title: Merkle Trees +description: Learn about Merkle Trees in Noir with this tutorial. Explore the basics of computing a merkle root using a proof, with examples. +keywords: + [ + Merkle trees in Noir, + Noir programming language, + check membership, + computing root from leaf, + Noir Merkle tree implementation, + Merkle tree tutorial, + Merkle tree code examples, + Noir libraries, + pedersen hash., + ] +--- + +## compute_merkle_root + +Returns the root of the tree from the provided leaf and its hash path, using a [Pedersen hash](./cryptographic_primitives/hashes.mdx#pedersen_hash). + +```rust +fn compute_merkle_root(leaf : Field, index : Field, hash_path: [Field]) -> Field +``` + +example: + +```rust +/** + // these values are for this example only + index = "0" + priv_key = "0x000000000000000000000000000000000000000000000000000000616c696365" + secret = "0x1929ea3ab8d9106a899386883d9428f8256cfedb3c4f6b66bf4aa4d28a79988f" + note_hash_path = [ + "0x1e61bdae0f027b1b2159e1f9d3f8d00fa668a952dddd822fda80dc745d6f65cc", + "0x0e4223f3925f98934393c74975142bd73079ab0621f4ee133cee050a3c194f1a", + "0x2fd7bb412155bf8693a3bd2a3e7581a679c95c68a052f835dddca85fa1569a40" + ] + */ +fn main(index: Field, priv_key: Field, secret: Field, note_hash_path: [Field; 3]) { + + let pubkey = std::scalar_mul::fixed_base_embedded_curve(priv_key); + let pubkey_x = pubkey[0]; + let pubkey_y = pubkey[1]; + let note_commitment = std::hash::pedersen(&[pubkey_x, pubkey_y, secret]); + + let root = std::merkle::compute_merkle_root(note_commitment[0], index, note_hash_path.as_slice()); + println(root); +} +``` + +To check merkle tree membership: + +1. Include a merkle root as a program input. +2. Compute the merkle root of a given leaf, index and hash path. +3. Assert the merkle roots are equal. + +For more info about merkle trees, see the Wikipedia [page](https://en.wikipedia.org/wiki/Merkle_tree). diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/ctstring.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/ctstring.md new file mode 100644 index 00000000000..b76f873ca03 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/ctstring.md @@ -0,0 +1,100 @@ +--- +title: CtString +--- + +`std::meta::ctstring` contains methods on the built-in `CtString` type which is +a compile-time, dynamically-sized string type. Compared to `str` and `fmtstr`, +`CtString` is useful because its size does not need to be specified in its type. This +can be used for formatting items at compile-time or general string handling in `comptime` +code. + +Since `fmtstr`s can be converted into `CtString`s, you can make use of their formatting +abilities in CtStrings by formatting in `fmtstr`s then converting the result to a CtString +afterward. + +## Traits + +### AsCtString + +```rust title="as-ctstring" showLineNumbers +pub trait AsCtString { + comptime fn as_ctstring(self) -> CtString; +} +``` +> Source code: noir_stdlib/src/meta/ctstring.nr#L43-L47 + + +Converts an object into a compile-time string. + +Implementations: + +```rust +impl AsCtString for str { ... } +impl AsCtString for fmtstr { ... } +``` + +## Methods + +### new + +```rust title="new" showLineNumbers +pub comptime fn new() -> Self { +``` +> Source code: noir_stdlib/src/meta/ctstring.nr#L4-L6 + + +Creates an empty `CtString`. + +### append_str + +```rust title="append_str" showLineNumbers +pub comptime fn append_str(self, s: str) -> Self { +``` +> Source code: noir_stdlib/src/meta/ctstring.nr#L11-L13 + + +Returns a new CtString with the given str appended onto the end. + +### append_fmtstr + +```rust title="append_fmtstr" showLineNumbers +pub comptime fn append_fmtstr(self, s: fmtstr) -> Self { +``` +> Source code: noir_stdlib/src/meta/ctstring.nr#L17-L19 + + +Returns a new CtString with the given fmtstr appended onto the end. + +### as_quoted_str + +```rust title="as_quoted_str" showLineNumbers +pub comptime fn as_quoted_str(self) -> Quoted { +``` +> Source code: noir_stdlib/src/meta/ctstring.nr#L26-L28 + + +Returns a quoted string literal from this string's contents. + +There is no direct conversion from a `CtString` to a `str` since +the size would not be known. To get around this, this function can +be used in combination with macro insertion (`!`) to insert this string +literal at this function's call site. + +Example: + +```rust title="as_quoted_str_example" showLineNumbers +let my_ctstring = "foo bar".as_ctstring(); + let my_str = my_ctstring.as_quoted_str!(); + + assert_eq(crate::meta::type_of(my_str), quote { str<7> }.as_type()); +``` +> Source code: noir_stdlib/src/meta/ctstring.nr#L92-L97 + + +## Trait Implementations + +```rust +impl Eq for CtString +impl Hash for CtString +impl Append for CtString +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/expr.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/expr.md new file mode 100644 index 00000000000..b6d395c6700 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/expr.md @@ -0,0 +1,380 @@ +--- +title: Expr +--- + +`std::meta::expr` contains methods on the built-in `Expr` type for quoted, syntactically valid expressions. + +## Methods + +### as_array + +```rust title="as_array" showLineNumbers +pub comptime fn as_array(self) -> Option<[Expr]> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L10-L12 + + +If this expression is an array, this returns a slice of each element in the array. + +### as_assert + +```rust title="as_assert" showLineNumbers +pub comptime fn as_assert(self) -> Option<(Expr, Option)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L16-L18 + + +If this expression is an assert, this returns the assert expression and the optional message. + +### as_assert_eq + +```rust title="as_assert_eq" showLineNumbers +pub comptime fn as_assert_eq(self) -> Option<(Expr, Expr, Option)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L23-L25 + + +If this expression is an assert_eq, this returns the left-hand-side and right-hand-side +expressions, together with the optional message. + +### as_assign + +```rust title="as_assign" showLineNumbers +pub comptime fn as_assign(self) -> Option<(Expr, Expr)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L30-L32 + + +If this expression is an assignment, this returns a tuple with the left hand side +and right hand side in order. + +### as_binary_op + +```rust title="as_binary_op" showLineNumbers +pub comptime fn as_binary_op(self) -> Option<(Expr, BinaryOp, Expr)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L37-L39 + + +If this expression is a binary operator operation ` `, +return the left-hand side, operator, and the right-hand side of the operation. + +### as_block + +```rust title="as_block" showLineNumbers +pub comptime fn as_block(self) -> Option<[Expr]> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L44-L46 + + +If this expression is a block `{ stmt1; stmt2; ...; stmtN }`, return +a slice containing each statement. + +### as_bool + +```rust title="as_bool" showLineNumbers +pub comptime fn as_bool(self) -> Option {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L50-L52 + + +If this expression is a boolean literal, return that literal. + +### as_cast + +```rust title="as_cast" showLineNumbers +#[builtin(expr_as_cast)] + pub comptime fn as_cast(self) -> Option<(Expr, UnresolvedType)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L56-L59 + + +If this expression is a cast expression (`expr as type`), returns the casted +expression and the type to cast to. + +### as_comptime + +```rust title="as_comptime" showLineNumbers +pub comptime fn as_comptime(self) -> Option<[Expr]> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L64-L66 + + +If this expression is a `comptime { stmt1; stmt2; ...; stmtN }` block, +return each statement in the block. + +### as_constructor + +```rust title="as_constructor" showLineNumbers +pub comptime fn as_constructor(self) -> Option<(UnresolvedType, [(Quoted, Expr)])> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L71-L73 + + +If this expression is a constructor `Type { field1: expr1, ..., fieldN: exprN }`, +return the type and the fields. + +### as_for + +```rust title="as_for" showLineNumbers +pub comptime fn as_for(self) -> Option<(Quoted, Expr, Expr)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L78-L80 + + +If this expression is a for statement over a single expression, return the identifier, +the expression and the for loop body. + +### as_for_range + +```rust title="as_for" showLineNumbers +pub comptime fn as_for(self) -> Option<(Quoted, Expr, Expr)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L78-L80 + + +If this expression is a for statement over a range, return the identifier, +the range start, the range end and the for loop body. + +### as_function_call + +```rust title="as_function_call" showLineNumbers +pub comptime fn as_function_call(self) -> Option<(Expr, [Expr])> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L92-L94 + + +If this expression is a function call `foo(arg1, ..., argN)`, return +the function and a slice of each argument. + +### as_if + +```rust title="as_if" showLineNumbers +pub comptime fn as_if(self) -> Option<(Expr, Expr, Option)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L100-L102 + + +If this expression is an `if condition { then_branch } else { else_branch }`, +return the condition, then branch, and else branch. If there is no else branch, +`None` is returned for that branch instead. + +### as_index + +```rust title="as_index" showLineNumbers +pub comptime fn as_index(self) -> Option<(Expr, Expr)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L107-L109 + + +If this expression is an index into an array `array[index]`, return the +array and the index. + +### as_integer + +```rust title="as_integer" showLineNumbers +pub comptime fn as_integer(self) -> Option<(Field, bool)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L114-L116 + + +If this expression is an integer literal, return the integer as a field +as well as whether the integer is negative (true) or not (false). + +### as_lambda + +```rust title="as_lambda" showLineNumbers +pub comptime fn as_lambda( + self, + ) -> Option<([(Expr, Option)], Option, Expr)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L120-L124 + + +If this expression is a lambda, returns the parameters, return type and body. + +### as_let + +```rust title="as_let" showLineNumbers +pub comptime fn as_let(self) -> Option<(Expr, Option, Expr)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L129-L131 + + +If this expression is a let statement, returns the let pattern as an `Expr`, +the optional type annotation, and the assigned expression. + +### as_member_access + +```rust title="as_member_access" showLineNumbers +pub comptime fn as_member_access(self) -> Option<(Expr, Quoted)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L136-L138 + + +If this expression is a member access `foo.bar`, return the struct/tuple +expression and the field. The field will be represented as a quoted value. + +### as_method_call + +```rust title="as_method_call" showLineNumbers +pub comptime fn as_method_call(self) -> Option<(Expr, Quoted, [UnresolvedType], [Expr])> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L143-L145 + + +If this expression is a method call `foo.bar::(arg1, ..., argN)`, return +the receiver, method name, a slice of each generic argument, and a slice of each argument. + +### as_repeated_element_array + +```rust title="as_repeated_element_array" showLineNumbers +pub comptime fn as_repeated_element_array(self) -> Option<(Expr, Expr)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L150-L152 + + +If this expression is a repeated element array `[elem; length]`, return +the repeated element and the length expressions. + +### as_repeated_element_slice + +```rust title="as_repeated_element_slice" showLineNumbers +pub comptime fn as_repeated_element_slice(self) -> Option<(Expr, Expr)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L157-L159 + + +If this expression is a repeated element slice `[elem; length]`, return +the repeated element and the length expressions. + +### as_slice + +```rust title="as_slice" showLineNumbers +pub comptime fn as_slice(self) -> Option<[Expr]> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L164-L166 + + +If this expression is a slice literal `&[elem1, ..., elemN]`, +return each element of the slice. + +### as_tuple + +```rust title="as_tuple" showLineNumbers +pub comptime fn as_tuple(self) -> Option<[Expr]> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L171-L173 + + +If this expression is a tuple `(field1, ..., fieldN)`, +return each element of the tuple. + +### as_unary_op + +```rust title="as_unary_op" showLineNumbers +pub comptime fn as_unary_op(self) -> Option<(UnaryOp, Expr)> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L178-L180 + + +If this expression is a unary operation ` `, +return the unary operator as well as the right-hand side expression. + +### as_unsafe + +```rust title="as_unsafe" showLineNumbers +pub comptime fn as_unsafe(self) -> Option<[Expr]> {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L185-L187 + + +If this expression is an `unsafe { stmt1; ...; stmtN }` block, +return each statement inside in a slice. + +### has_semicolon + +```rust title="has_semicolon" showLineNumbers +pub comptime fn has_semicolon(self) -> bool {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L206-L208 + + +`true` if this expression is trailed by a semicolon. E.g. + +``` +comptime { + let expr1 = quote { 1 + 2 }.as_expr().unwrap(); + let expr2 = quote { 1 + 2; }.as_expr().unwrap(); + + assert(expr1.as_binary_op().is_some()); + assert(expr2.as_binary_op().is_some()); + + assert(!expr1.has_semicolon()); + assert(expr2.has_semicolon()); +} +``` + +### is_break + +```rust title="is_break" showLineNumbers +pub comptime fn is_break(self) -> bool {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L212-L214 + + +`true` if this expression is `break`. + +### is_continue + +```rust title="is_continue" showLineNumbers +pub comptime fn is_continue(self) -> bool {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L218-L220 + + +`true` if this expression is `continue`. + +### modify + +```rust title="modify" showLineNumbers +pub comptime fn modify(self, f: fn[Env](Expr) -> Option) -> Expr { +``` +> Source code: noir_stdlib/src/meta/expr.nr#L229-L231 + + +Applies a mapping function to this expression and to all of its sub-expressions. +`f` will be applied to each sub-expression first, then applied to the expression itself. + +This happens recursively for every expression within `self`. + +For example, calling `modify` on `(&[1], &[2, 3])` with an `f` that returns `Option::some` +for expressions that are integers, doubling them, would return `(&[2], &[4, 6])`. + +### quoted + +```rust title="quoted" showLineNumbers +pub comptime fn quoted(self) -> Quoted { +``` +> Source code: noir_stdlib/src/meta/expr.nr#L266-L268 + + +Returns this expression as a `Quoted` value. It's the same as `quote { $self }`. + +### resolve + +```rust title="resolve" showLineNumbers +pub comptime fn resolve(self, in_function: Option) -> TypedExpr {} +``` +> Source code: noir_stdlib/src/meta/expr.nr#L282-L284 + + +Resolves and type-checks this expression and returns the result as a `TypedExpr`. + +The `in_function` argument specifies where the expression is resolved: +- If it's `none`, the expression is resolved in the function where `resolve` was called +- If it's `some`, the expression is resolved in the given function + +If any names used by this expression are not in scope or if there are any type errors, +this will give compiler errors as if the expression was written directly into +the current `comptime` function. \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/function_def.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/function_def.md new file mode 100644 index 00000000000..b7f2ebdb889 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/function_def.md @@ -0,0 +1,166 @@ +--- +title: FunctionDefinition +--- + +`std::meta::function_def` contains methods on the built-in `FunctionDefinition` type representing +a function definition in the source program. + +## Methods + +### add_attribute + +```rust title="add_attribute" showLineNumbers +pub comptime fn add_attribute(self, attribute: str) {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L3-L5 + + +Adds an attribute to the function. This is only valid +on functions in the current crate which have not yet been resolved. +This means any functions called at compile-time are invalid targets for this method. + +### body + +```rust title="body" showLineNumbers +pub comptime fn body(self) -> Expr {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L8-L10 + + +Returns the body of the function as an expression. This is only valid +on functions in the current crate which have not yet been resolved. +This means any functions called at compile-time are invalid targets for this method. + +### has_named_attribute + +```rust title="has_named_attribute" showLineNumbers +pub comptime fn has_named_attribute(self, name: str) -> bool {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L13-L15 + + +Returns true if this function has a custom attribute with the given name. + +### is_unconstrained + +```rust title="is_unconstrained" showLineNumbers +pub comptime fn is_unconstrained(self) -> bool {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L18-L20 + + +Returns true if this function is unconstrained. + +### module + +```rust title="module" showLineNumbers +pub comptime fn module(self) -> Module {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L23-L25 + + +Returns the module where the function is defined. + +### name + +```rust title="name" showLineNumbers +pub comptime fn name(self) -> Quoted {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L28-L30 + + +Returns the name of the function. + +### parameters + +```rust title="parameters" showLineNumbers +pub comptime fn parameters(self) -> [(Quoted, Type)] {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L33-L35 + + +Returns each parameter of the function as a tuple of (parameter pattern, parameter type). + +### return_type + +```rust title="return_type" showLineNumbers +pub comptime fn return_type(self) -> Type {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L38-L40 + + +The return type of the function. + +### set_body + +```rust title="set_body" showLineNumbers +pub comptime fn set_body(self, body: Expr) {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L43-L45 + + +Mutate the function body to a new expression. This is only valid +on functions in the current crate which have not yet been resolved. +This means any functions called at compile-time are invalid targets for this method. + +### set_parameters + +```rust title="set_parameters" showLineNumbers +pub comptime fn set_parameters(self, parameters: [(Quoted, Type)]) {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L48-L50 + + +Mutates the function's parameters to a new set of parameters. This is only valid +on functions in the current crate which have not yet been resolved. +This means any functions called at compile-time are invalid targets for this method. + +Expects a slice of (parameter pattern, parameter type) for each parameter. Requires +each parameter pattern to be a syntactically valid parameter. + +### set_return_type + +```rust title="set_return_type" showLineNumbers +pub comptime fn set_return_type(self, return_type: Type) {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L53-L55 + + +Mutates the function's return type to a new type. This is only valid +on functions in the current crate which have not yet been resolved. +This means any functions called at compile-time are invalid targets for this method. + +### set_return_public + +```rust title="set_return_public" showLineNumbers +pub comptime fn set_return_public(self, public: bool) {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L58-L60 + + +Mutates the function's return visibility to public (if `true` is given) or private (if `false` is given). +This is only valid on functions in the current crate which have not yet been resolved. +This means any functions called at compile-time are invalid targets for this method. + +### set_unconstrained + +```rust title="set_unconstrained" showLineNumbers +pub comptime fn set_unconstrained(self, value: bool) {} +``` +> Source code: noir_stdlib/src/meta/function_def.nr#L66-L68 + + +Mutates the function to be unconstrained (if `true` is given) or not (if `false` is given). +This is only valid on functions in the current crate which have not yet been resolved. +This means any functions called at compile-time are invalid targets for this method. + +## Trait Implementations + +```rust +impl Eq for FunctionDefinition +impl Hash for FunctionDefinition +``` + +Note that each function is assigned a unique ID internally and this is what is used for +equality and hashing. So even functions with identical signatures and bodies may not +be equal in this sense if they were originally different items in the source program. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/index.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/index.md new file mode 100644 index 00000000000..132f4c0216e --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/index.md @@ -0,0 +1,224 @@ +--- +title: Metaprogramming +description: Noir's Metaprogramming API +keywords: [metaprogramming, comptime, macros, macro, quote, unquote] +--- + +`std::meta` is the entry point for Noir's metaprogramming API. This consists of `comptime` functions +and types used for inspecting and modifying Noir programs. + +## Functions + +### type_of + +```rust title="type_of" showLineNumbers +pub comptime fn type_of(x: T) -> Type {} +``` +> Source code: noir_stdlib/src/meta/mod.nr#L27-L29 + + +Returns the type of a variable at compile-time. + +Example: +```rust +comptime { + let x: i32 = 1; + let x_type: Type = std::meta::type_of(x); + + assert_eq(x_type, quote { i32 }.as_type()); +} +``` + +### unquote + +```rust title="unquote" showLineNumbers +pub comptime fn unquote(code: Quoted) -> Quoted { +``` +> Source code: noir_stdlib/src/meta/mod.nr#L19-L21 + + +Unquotes the passed-in token stream where this function was called. + +Example: +```rust +comptime { + let code = quote { 1 + 2 }; + + // let x = 1 + 2; + let x = unquote!(code); +} +``` + +### derive + +```rust title="derive" showLineNumbers +#[varargs] +pub comptime fn derive(s: StructDefinition, traits: [TraitDefinition]) -> Quoted { +``` +> Source code: noir_stdlib/src/meta/mod.nr#L48-L51 + + +Attribute placed on struct definitions. + +Creates a trait impl for each trait passed in as an argument. +To do this, the trait must have a derive handler registered +with `derive_via` beforehand. The traits in the stdlib that +can be derived this way are `Eq`, `Ord`, `Default`, and `Hash`. + +Example: +```rust +#[derive(Eq, Default)] +struct Foo { + x: i32, + y: T, +} + +fn main() { + let foo1 = Foo::default(); + let foo2 = Foo { x: 0, y: &[0] }; + assert_eq(foo1, foo2); +} +``` + +### derive_via + +```rust title="derive_via_signature" showLineNumbers +pub comptime fn derive_via(t: TraitDefinition, f: DeriveFunction) { +``` +> Source code: noir_stdlib/src/meta/mod.nr#L68-L70 + + +Attribute placed on trait definitions. + +Registers a function to create impls for the given trait +when the trait is used in a `derive` call. Users may use +this to register their own functions to enable their traits +to be derived by `derive`. + +Because this function requires a function as an argument which +should produce a trait impl for any given struct, users may find +it helpful to use a function like `std::meta::make_trait_impl` to +help creating these impls. + +Example: +```rust +#[derive_via(derive_do_nothing)] +trait DoNothing { + fn do_nothing(self); +} + +comptime fn derive_do_nothing(s: StructDefinition) -> Quoted { + let typ = s.as_type(); + quote { + impl DoNothing for $typ { + fn do_nothing(self) { + println("Nothing"); + } + } + } +} +``` + +As another example, `derive_eq` in the stdlib is used to derive the `Eq` +trait for any struct. It makes use of `make_trait_impl` to do this: + +```rust title="derive_eq" showLineNumbers +comptime fn derive_eq(s: StructDefinition) -> Quoted { + let signature = quote { fn eq(_self: Self, _other: Self) -> bool }; + let for_each_field = |name| quote { (_self.$name == _other.$name) }; + let body = |fields| { + if s.fields().len() == 0 { + quote { true } + } else { + fields + } + }; + crate::meta::make_trait_impl( + s, + quote { Eq }, + signature, + for_each_field, + quote { & }, + body, + ) +} +``` +> Source code: noir_stdlib/src/cmp.nr#L10-L30 + + +### make_trait_impl + +```rust title="make_trait_impl" showLineNumbers +pub comptime fn make_trait_impl( + s: StructDefinition, + trait_name: Quoted, + function_signature: Quoted, + for_each_field: fn[Env1](Quoted) -> Quoted, + join_fields_with: Quoted, + body: fn[Env2](Quoted) -> Quoted, +) -> Quoted { +``` +> Source code: noir_stdlib/src/meta/mod.nr#L87-L96 + + +A helper function to more easily create trait impls while deriving traits. + +Note that this function only works for traits which: +1. Have only one method +2. Have no generics on the trait itself. + - E.g. Using this on a trait such as `trait Foo { ... }` will result in the + generated impl incorrectly missing the `T` generic. + +If your trait fits these criteria then `make_trait_impl` is likely the easiest +way to write your derive handler. The arguments are as follows: + +- `s`: The struct to make the impl for +- `trait_name`: The name of the trait to derive. E.g. `quote { Eq }`. +- `function_signature`: The signature of the trait method to derive. E.g. `fn eq(self, other: Self) -> bool`. +- `for_each_field`: An operation to be performed on each field. E.g. `|name| quote { (self.$name == other.$name) }`. +- `join_fields_with`: A separator to join each result of `for_each_field` with. + E.g. `quote { & }`. You can also use an empty `quote {}` for no separator. +- `body`: The result of the field operations is passed into this function for any final processing. + This is the place to insert any setup/teardown code the trait requires. If the trait doesn't require + any such code, you can return the body as-is: `|body| body`. + +Example deriving `Hash`: + +```rust title="derive_hash" showLineNumbers +comptime fn derive_hash(s: StructDefinition) -> Quoted { + let name = quote { Hash }; + let signature = quote { fn hash(_self: Self, _state: &mut H) where H: std::hash::Hasher }; + let for_each_field = |name| quote { _self.$name.hash(_state); }; + crate::meta::make_trait_impl( + s, + name, + signature, + for_each_field, + quote {}, + |fields| fields, + ) +} +``` +> Source code: noir_stdlib/src/hash/mod.nr#L140-L154 + + +Example deriving `Ord`: + +```rust title="derive_ord" showLineNumbers +comptime fn derive_ord(s: StructDefinition) -> Quoted { + let signature = quote { fn cmp(_self: Self, _other: Self) -> std::cmp::Ordering }; + let for_each_field = |name| quote { + if result == std::cmp::Ordering::equal() { + result = _self.$name.cmp(_other.$name); + } + }; + let body = |fields| quote { + let mut result = std::cmp::Ordering::equal(); + $fields + result + }; + crate::meta::make_trait_impl(s, quote { Ord }, signature, for_each_field, quote {}, body) +} +``` +> Source code: noir_stdlib/src/cmp.nr#L216-L231 + diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/module.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/module.md new file mode 100644 index 00000000000..f47231972b7 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/module.md @@ -0,0 +1,82 @@ +--- +title: Module +--- + +`std::meta::module` contains methods on the built-in `Module` type which represents a module in the source program. +Note that this type represents a module generally, it isn't limited to only `mod my_submodule { ... }` +declarations in the source program. + +## Methods + +### add_item + +```rust title="add_item" showLineNumbers +pub comptime fn add_item(self, item: Quoted) {} +``` +> Source code: noir_stdlib/src/meta/module.nr#L3-L5 + + +Adds a top-level item (a function, a struct, a global, etc.) to the module. +Adding multiple items in one go is also valid if the `Quoted` value has multiple items in it. +Note that the items are type-checked as if they are inside the module they are being added to. + +### functions + +```rust title="functions" showLineNumbers +pub comptime fn functions(self) -> [FunctionDefinition] {} +``` +> Source code: noir_stdlib/src/meta/module.nr#L18-L20 + + +Returns each function defined in the module. + +### has_named_attribute + +```rust title="has_named_attribute" showLineNumbers +pub comptime fn has_named_attribute(self, name: str) -> bool {} +``` +> Source code: noir_stdlib/src/meta/module.nr#L8-L10 + + +Returns true if this module has a custom attribute with the given name. + +### is_contract + +```rust title="is_contract" showLineNumbers +pub comptime fn is_contract(self) -> bool {} +``` +> Source code: noir_stdlib/src/meta/module.nr#L13-L15 + + +`true` if this module is a contract module (was declared via `contract foo { ... }`). + +### name + +```rust title="name" showLineNumbers +pub comptime fn name(self) -> Quoted {} +``` +> Source code: noir_stdlib/src/meta/module.nr#L28-L30 + + +Returns the name of the module. + +### structs + +```rust title="structs" showLineNumbers +pub comptime fn structs(self) -> [StructDefinition] {} +``` +> Source code: noir_stdlib/src/meta/module.nr#L23-L25 + + +Returns each struct defined in the module. + +## Trait Implementations + +```rust +impl Eq for Module +impl Hash for Module +``` + +Note that each module is assigned a unique ID internally and this is what is used for +equality and hashing. So even modules with identical names and contents may not +be equal in this sense if they were originally different items in the source program. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/op.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/op.md new file mode 100644 index 00000000000..b53208d6507 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/op.md @@ -0,0 +1,244 @@ +--- +title: UnaryOp and BinaryOp +--- + +`std::meta::op` contains the `UnaryOp` and `BinaryOp` types as well as methods on them. +These types are used to represent a unary or binary operator respectively in Noir source code. + +## Types + +### UnaryOp + +Represents a unary operator. One of `-`, `!`, `&mut`, or `*`. + +### Methods + +#### is_minus + +```rust title="is_minus" showLineNumbers +pub fn is_minus(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L24-L26 + + +Returns `true` if this operator is `-`. + +#### is_not + +```rust title="is_not" showLineNumbers +pub fn is_not(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L30-L32 + + +`true` if this operator is `!` + +#### is_mutable_reference + +```rust title="is_mutable_reference" showLineNumbers +pub fn is_mutable_reference(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L36-L38 + + +`true` if this operator is `&mut` + +#### is_dereference + +```rust title="is_dereference" showLineNumbers +pub fn is_dereference(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L42-L44 + + +`true` if this operator is `*` + +#### quoted + +```rust title="unary_quoted" showLineNumbers +pub comptime fn quoted(self) -> Quoted { +``` +> Source code: noir_stdlib/src/meta/op.nr#L48-L50 + + +Returns this operator as a `Quoted` value. + +### Trait Implementations + +```rust +impl Eq for UnaryOp +impl Hash for UnaryOp +``` + +### BinaryOp + +Represents a binary operator. One of `+`, `-`, `*`, `/`, `%`, `==`, `!=`, `<`, `<=`, `>`, `>=`, `&`, `|`, `^`, `>>`, or `<<`. + +### Methods + +#### is_add + +```rust title="is_add" showLineNumbers +pub fn is_add(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L86-L88 + + +`true` if this operator is `+` + +#### is_subtract + +```rust title="is_subtract" showLineNumbers +pub fn is_subtract(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L92-L94 + + +`true` if this operator is `-` + +#### is_multiply + +```rust title="is_multiply" showLineNumbers +pub fn is_multiply(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L98-L100 + + +`true` if this operator is `*` + +#### is_divide + +```rust title="is_divide" showLineNumbers +pub fn is_divide(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L104-L106 + + +`true` if this operator is `/` + +#### is_modulo + +```rust title="is_modulo" showLineNumbers +pub fn is_modulo(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L176-L178 + + +`true` if this operator is `%` + +#### is_equal + +```rust title="is_equal" showLineNumbers +pub fn is_equal(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L110-L112 + + +`true` if this operator is `==` + +#### is_not_equal + +```rust title="is_not_equal" showLineNumbers +pub fn is_not_equal(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L116-L118 + + +`true` if this operator is `!=` + +#### is_less_than + +```rust title="is_less_than" showLineNumbers +pub fn is_less_than(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L122-L124 + + +`true` if this operator is `<` + +#### is_less_than_or_equal + +```rust title="is_less_than_or_equal" showLineNumbers +pub fn is_less_than_or_equal(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L128-L130 + + +`true` if this operator is `<=` + +#### is_greater_than + +```rust title="is_greater_than" showLineNumbers +pub fn is_greater_than(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L134-L136 + + +`true` if this operator is `>` + +#### is_greater_than_or_equal + +```rust title="is_greater_than_or_equal" showLineNumbers +pub fn is_greater_than_or_equal(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L140-L142 + + +`true` if this operator is `>=` + +#### is_and + +```rust title="is_and" showLineNumbers +pub fn is_and(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L146-L148 + + +`true` if this operator is `&` + +#### is_or + +```rust title="is_or" showLineNumbers +pub fn is_or(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L152-L154 + + +`true` if this operator is `|` + +#### is_shift_right + +```rust title="is_shift_right" showLineNumbers +pub fn is_shift_right(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L164-L166 + + +`true` if this operator is `>>` + +#### is_shift_left + +```rust title="is_shift_left" showLineNumbers +pub fn is_shift_left(self) -> bool { +``` +> Source code: noir_stdlib/src/meta/op.nr#L170-L172 + + +`true` if this operator is `<<` + +#### quoted + +```rust title="binary_quoted" showLineNumbers +pub comptime fn quoted(self) -> Quoted { +``` +> Source code: noir_stdlib/src/meta/op.nr#L182-L184 + + +Returns this operator as a `Quoted` value. + +### Trait Implementations + +```rust +impl Eq for BinaryOp +impl Hash for BinaryOp +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/quoted.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/quoted.md new file mode 100644 index 00000000000..d7acf23bc07 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/quoted.md @@ -0,0 +1,141 @@ +--- +title: Quoted +--- + +`std::meta::quoted` contains methods on the built-in `Quoted` type which represents +quoted token streams and is the result of the `quote { ... }` expression. + +## Methods + +### as_expr + +```rust title="as_expr" showLineNumbers +pub comptime fn as_expr(self) -> Option {} +``` +> Source code: noir_stdlib/src/meta/quoted.nr#L6-L8 + + +Parses the quoted token stream as an expression. Returns `Option::none()` if +the expression failed to parse. + +Example: + +```rust title="as_expr_example" showLineNumbers +#[test] + fn test_expr_as_function_call() { + comptime + { + let expr = quote { foo(42) }.as_expr().unwrap(); + let (_function, args) = expr.as_function_call().unwrap(); + assert_eq(args.len(), 1); + assert_eq(args[0].as_integer().unwrap(), (42, false)); + } + } +``` +> Source code: test_programs/noir_test_success/comptime_expr/src/main.nr#L360-L371 + + +### as_module + +```rust title="as_module" showLineNumbers +pub comptime fn as_module(self) -> Option {} +``` +> Source code: noir_stdlib/src/meta/quoted.nr#L11-L13 + + +Interprets this token stream as a module path leading to the name of a module. +Returns `Option::none()` if the module isn't found or this token stream cannot be parsed as a path. + +Example: + +```rust title="as_module_example" showLineNumbers +mod baz { + pub mod qux {} +} + +#[test] +fn as_module_test() { + comptime { + let my_mod = quote { baz::qux }.as_module().unwrap(); + assert_eq(my_mod.name(), quote { qux }); + } +} +``` +> Source code: test_programs/compile_success_empty/comptime_module/src/main.nr#L115-L127 + + +### as_trait_constraint + +```rust title="as_trait_constraint" showLineNumbers +pub comptime fn as_trait_constraint(self) -> TraitConstraint {} +``` +> Source code: noir_stdlib/src/meta/quoted.nr#L16-L18 + + +Interprets this token stream as a trait constraint (without an object type). +Note that this function panics instead of returning `Option::none()` if the token +stream does not parse and resolve to a valid trait constraint. + +Example: + +```rust title="implements_example" showLineNumbers +pub fn function_with_where(_x: T) +where + T: SomeTrait, +{ + comptime { + let t = quote { T }.as_type(); + let some_trait_i32 = quote { SomeTrait }.as_trait_constraint(); + assert(t.implements(some_trait_i32)); + + assert(t.get_trait_impl(some_trait_i32).is_none()); + } +} +``` +> Source code: test_programs/compile_success_empty/comptime_type/src/main.nr#L160-L173 + + +### as_type + +```rust title="as_type" showLineNumbers +pub comptime fn as_type(self) -> Type {} +``` +> Source code: noir_stdlib/src/meta/quoted.nr#L21-L23 + + +Interprets this token stream as a resolved type. Panics if the token +stream doesn't parse to a type or if the type isn't a valid type in scope. + +```rust title="implements_example" showLineNumbers +pub fn function_with_where(_x: T) +where + T: SomeTrait, +{ + comptime { + let t = quote { T }.as_type(); + let some_trait_i32 = quote { SomeTrait }.as_trait_constraint(); + assert(t.implements(some_trait_i32)); + + assert(t.get_trait_impl(some_trait_i32).is_none()); + } +} +``` +> Source code: test_programs/compile_success_empty/comptime_type/src/main.nr#L160-L173 + + +### tokens + +```rust title="tokens" showLineNumbers +pub comptime fn tokens(self) -> [Quoted] {} +``` +> Source code: noir_stdlib/src/meta/quoted.nr#L26-L28 + + +Returns a slice of the individual tokens that form this token stream. + +## Trait Implementations + +```rust +impl Eq for Quoted +impl Hash for Quoted +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/struct_def.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/struct_def.md new file mode 100644 index 00000000000..fd609942f4e --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/struct_def.md @@ -0,0 +1,177 @@ +--- +title: StructDefinition +--- + +`std::meta::struct_def` contains methods on the built-in `StructDefinition` type. +This type corresponds to `struct Name { field1: Type1, ... }` items in the source program. + +## Methods + +### add_attribute + +```rust title="add_attribute" showLineNumbers +pub comptime fn add_attribute(self, attribute: str) {} +``` +> Source code: noir_stdlib/src/meta/struct_def.nr#L3-L5 + + +Adds an attribute to the struct. + +### add_generic + +```rust title="add_generic" showLineNumbers +pub comptime fn add_generic(self, generic_name: str) -> Type {} +``` +> Source code: noir_stdlib/src/meta/struct_def.nr#L8-L10 + + +Adds an generic to the struct. Returns the new generic type. +Errors if the given generic name isn't a single identifier or if +the struct already has a generic with the same name. + +This method should be used carefully, if there is existing code referring +to the struct type it may be checked before this function is called and +see the struct with the original number of generics. This method should +thus be preferred to use on code generated from other macros and structs +that are not used in function signatures. + +Example: + +```rust title="add-generic-example" showLineNumbers +comptime fn add_generic(s: StructDefinition) { + assert_eq(s.generics().len(), 0); + let new_generic = s.add_generic("T"); + + let generics = s.generics(); + assert_eq(generics.len(), 1); + assert_eq(generics[0], new_generic); + } +``` +> Source code: test_programs/compile_success_empty/comptime_struct_definition/src/main.nr#L35-L44 + + +### as_type + +```rust title="as_type" showLineNumbers +pub comptime fn as_type(self) -> Type {} +``` +> Source code: noir_stdlib/src/meta/struct_def.nr#L15-L17 + + +Returns this struct as a type in the source program. If this struct has +any generics, the generics are also included as-is. + +### generics + +```rust title="generics" showLineNumbers +pub comptime fn generics(self) -> [Type] {} +``` +> Source code: noir_stdlib/src/meta/struct_def.nr#L26-L28 + + +Returns each generic on this struct. + +Example: + +``` +#[example] +struct Foo { + bar: [T; 2], + baz: Baz, +} + +comptime fn example(foo: StructDefinition) { + assert_eq(foo.generics().len(), 2); + + // Fails because `T` isn't in scope + // let t = quote { T }.as_type(); + // assert_eq(foo.generics()[0], t); +} +``` + +### fields + +```rust title="fields" showLineNumbers +pub comptime fn fields(self) -> [(Quoted, Type)] {} +``` +> Source code: noir_stdlib/src/meta/struct_def.nr#L33-L35 + + +Returns each field of this struct as a pair of (field name, field type). + +### has_named_attribute + +```rust title="has_named_attribute" showLineNumbers +pub comptime fn has_named_attribute(self, name: str) -> bool {} +``` +> Source code: noir_stdlib/src/meta/struct_def.nr#L20-L22 + + +Returns true if this struct has a custom attribute with the given name. + +### module + +```rust title="module" showLineNumbers +pub comptime fn module(self) -> Module {} +``` +> Source code: noir_stdlib/src/meta/struct_def.nr#L38-L40 + + +Returns the module where the struct is defined. + +### name + +```rust title="name" showLineNumbers +pub comptime fn name(self) -> Quoted {} +``` +> Source code: noir_stdlib/src/meta/struct_def.nr#L43-L45 + + +Returns the name of this struct + +Note that the returned quoted value will be just the struct name, it will +not be the full path to the struct, nor will it include any generics. + +### set_fields + +```rust title="set_fields" showLineNumbers +pub comptime fn set_fields(self, new_fields: [(Quoted, Type)]) {} +``` +> Source code: noir_stdlib/src/meta/struct_def.nr#L52-L54 + + +Sets the fields of this struct to the given fields list where each element +is a pair of the field's name and the field's type. Expects each field name +to be a single identifier. Note that this will override any previous fields +on this struct. If those should be preserved, use `.fields()` to retrieve the +current fields on the struct type and append the new fields from there. + +Example: + +```rust +// Change this struct to: +// struct Foo { +// a: u32, +// b: i8, +// } +#[mangle_fields] +struct Foo { x: Field } + +comptime fn mangle_fields(s: StructDefinition) { + s.set_fields(&[ + (quote { a }, quote { u32 }.as_type()), + (quote { b }, quote { i8 }.as_type()), + ]); +} +``` + +## Trait Implementations + +```rust +impl Eq for StructDefinition +impl Hash for StructDefinition +``` + +Note that each struct is assigned a unique ID internally and this is what is used for +equality and hashing. So even structs with identical generics and fields may not +be equal in this sense if they were originally different items in the source program. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/trait_constraint.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/trait_constraint.md new file mode 100644 index 00000000000..3106f732b5a --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/trait_constraint.md @@ -0,0 +1,17 @@ +--- +title: TraitConstraint +--- + +`std::meta::trait_constraint` contains methods on the built-in `TraitConstraint` type which represents +a trait constraint that can be used to search for a trait implementation. This is similar +syntactically to just the trait itself, but can also contain generic arguments. E.g. `Eq`, `Default`, +`BuildHasher`. + +This type currently has no public methods but it can be used alongside `Type` in `implements` or `get_trait_impl`. + +## Trait Implementations + +```rust +impl Eq for TraitConstraint +impl Hash for TraitConstraint +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/trait_def.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/trait_def.md new file mode 100644 index 00000000000..e661d3af7f1 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/trait_def.md @@ -0,0 +1,26 @@ +--- +title: TraitDefinition +--- + +`std::meta::trait_def` contains methods on the built-in `TraitDefinition` type. This type +represents trait definitions such as `trait Foo { .. }` at the top-level of a program. + +## Methods + +### as_trait_constraint + +```rust title="as_trait_constraint" showLineNumbers +pub comptime fn as_trait_constraint(_self: Self) -> TraitConstraint {} +``` +> Source code: noir_stdlib/src/meta/trait_def.nr#L6-L8 + + +Converts this trait into a trait constraint. If there are any generics on this +trait, they will be kept as-is without instantiating or replacing them. + +## Trait Implementations + +```rust +impl Eq for TraitDefinition +impl Hash for TraitDefinition +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/trait_impl.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/trait_impl.md new file mode 100644 index 00000000000..a527617c1e6 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/trait_impl.md @@ -0,0 +1,60 @@ +--- +title: TraitImpl +--- + +`std::meta::trait_impl` contains methods on the built-in `TraitImpl` type which represents a trait +implementation such as `impl Foo for Bar { ... }`. + +## Methods + +### trait_generic_args + +```rust title="trait_generic_args" showLineNumbers +pub comptime fn trait_generic_args(self) -> [Type] {} +``` +> Source code: noir_stdlib/src/meta/trait_impl.nr#L3-L5 + + +Returns any generic arguments on the trait of this trait implementation, if any. + +```rs +impl Foo for Bar { ... } + +comptime { + let bar_type = quote { Bar }.as_type(); + let foo = quote { Foo }.as_trait_constraint(); + + let my_impl: TraitImpl = bar_type.get_trait_impl(foo).unwrap(); + + let generics = my_impl.trait_generic_args(); + assert_eq(generics.len(), 2); + + assert_eq(generics[0], quote { i32 }.as_type()); + assert_eq(generics[1], quote { Field }.as_type()); +} +``` + +### methods + +```rust title="methods" showLineNumbers +pub comptime fn methods(self) -> [FunctionDefinition] {} +``` +> Source code: noir_stdlib/src/meta/trait_impl.nr#L8-L10 + + +Returns each method in this trait impl. + +Example: + +```rs +comptime { + let i32_type = quote { i32 }.as_type(); + let eq = quote { Eq }.as_trait_constraint(); + + let impl_eq_for_i32: TraitImpl = i32_type.get_trait_impl(eq).unwrap(); + let methods = impl_eq_for_i32.methods(); + + assert_eq(methods.len(), 1); + assert_eq(methods[0].name(), quote { eq }); +} +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/typ.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/typ.md new file mode 100644 index 00000000000..3a85a739a4c --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/typ.md @@ -0,0 +1,264 @@ +--- +title: Type +--- + +`std::meta::typ` contains methods on the built-in `Type` type used for representing +a type in the source program. + +## Functions + +```rust title="fresh_type_variable" showLineNumbers +pub comptime fn fresh_type_variable() -> Type {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L57-L59 + + +Creates and returns an unbound type variable. This is a special kind of type internal +to type checking which will type check with any other type. When it is type checked +against another type it will also be set to that type. For example, if `a` is a type +variable and we have the type equality `(a, i32) = (u8, i32)`, the compiler will set +`a` equal to `u8`. + +Unbound type variables will often be rendered as `_` while printing them. Bound type +variables will appear as the type they are bound to. + +This can be used in conjunction with functions which internally perform type checks +such as `Type::implements` or `Type::get_trait_impl` to potentially grab some of the types used. + +Note that calling `Type::implements` or `Type::get_trait_impl` on a type variable will always +fail. + +Example: + +```rust title="serialize-setup" showLineNumbers +trait Serialize {} + +impl Serialize<1> for Field {} + +impl Serialize for [T; N] +where + T: Serialize, +{} + +impl Serialize for (T, U) +where + T: Serialize, + U: Serialize, +{} +``` +> Source code: test_programs/compile_success_empty/comptime_type/src/main.nr#L14-L29 + +```rust title="fresh-type-variable-example" showLineNumbers +let typevar1 = std::meta::typ::fresh_type_variable(); + let constraint = quote { Serialize<$typevar1> }.as_trait_constraint(); + let field_type = quote { Field }.as_type(); + + // Search for a trait impl (binding typevar1 to 1 when the impl is found): + assert(field_type.implements(constraint)); + + // typevar1 should be bound to the "1" generic now: + assert_eq(typevar1.as_constant().unwrap(), 1); + + // If we want to do the same with a different type, we need to + // create a new type variable now that `typevar1` is bound + let typevar2 = std::meta::typ::fresh_type_variable(); + let constraint = quote { Serialize<$typevar2> }.as_trait_constraint(); + let array_type = quote { [(Field, Field); 5] }.as_type(); + assert(array_type.implements(constraint)); + + // Now typevar2 should be bound to the serialized pair size 2 times the array length 5 + assert_eq(typevar2.as_constant().unwrap(), 10); +``` +> Source code: test_programs/compile_success_empty/comptime_type/src/main.nr#L129-L149 + + +## Methods + +### as_array + +```rust title="as_array" showLineNumbers +pub comptime fn as_array(self) -> Option<(Type, Type)> {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L76-L78 + + +If this type is an array, return a pair of (element type, size type). + +Example: + +```rust +comptime { + let array_type = quote { [Field; 3] }.as_type(); + let (field_type, three_type) = array_type.as_array().unwrap(); + + assert(field_type.is_field()); + assert_eq(three_type.as_constant().unwrap(), 3); +} +``` + +### as_constant + +```rust title="as_constant" showLineNumbers +pub comptime fn as_constant(self) -> Option {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L83-L85 + + +If this type is a constant integer (such as the `3` in the array type `[Field; 3]`), +return the numeric constant. + +### as_integer + +```rust title="as_integer" showLineNumbers +pub comptime fn as_integer(self) -> Option<(bool, u8)> {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L90-L92 + + +If this is an integer type, return a boolean which is `true` +if the type is signed, as well as the number of bits of this integer type. + +### as_mutable_reference + +```rust title="as_mutable_reference" showLineNumbers +comptime fn as_mutable_reference(self) -> Option {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L96-L98 + + +If this is a mutable reference type `&mut T`, returns the mutable type `T`. + +### as_slice + +```rust title="as_slice" showLineNumbers +pub comptime fn as_slice(self) -> Option {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L102-L104 + + +If this is a slice type, return the element type of the slice. + +### as_str + +```rust title="as_str" showLineNumbers +pub comptime fn as_str(self) -> Option {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L108-L110 + + +If this is a `str` type, returns the length `N` as a type. + +### as_struct + +```rust title="as_struct" showLineNumbers +pub comptime fn as_struct(self) -> Option<(StructDefinition, [Type])> {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L114-L116 + + +If this is a struct type, returns the struct in addition to +any generic arguments on this type. + +### as_tuple + +```rust title="as_tuple" showLineNumbers +pub comptime fn as_tuple(self) -> Option<[Type]> {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L120-L122 + + +If this is a tuple type, returns each element type of the tuple. + +### get_trait_impl + +```rust title="get_trait_impl" showLineNumbers +pub comptime fn get_trait_impl(self, constraint: TraitConstraint) -> Option {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L143-L145 + + +Retrieves the trait implementation that implements the given +trait constraint for this type. If the trait constraint is not +found, `None` is returned. Note that since the concrete trait implementation +for a trait constraint specified in a `where` clause is unknown, +this function will return `None` in these cases. If you only want to know +whether a type implements a trait, use `implements` instead. + +Example: + +```rust +comptime { + let field_type = quote { Field }.as_type(); + let default = quote { Default }.as_trait_constraint(); + + let the_impl: TraitImpl = field_type.get_trait_impl(default).unwrap(); + assert(the_impl.methods().len(), 1); +} +``` + +### implements + +```rust title="implements" showLineNumbers +pub comptime fn implements(self, constraint: TraitConstraint) -> bool {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L166-L168 + + +`true` if this type implements the given trait. Note that unlike +`get_trait_impl` this will also return true for any `where` constraints +in scope. + +Example: + +```rust +fn foo() where T: Default { + comptime { + let field_type = quote { Field }.as_type(); + let default = quote { Default }.as_trait_constraint(); + assert(field_type.implements(default)); + + let t = quote { T }.as_type(); + assert(t.implements(default)); + } +} +``` + +### is_bool + +```rust title="is_bool" showLineNumbers +pub comptime fn is_bool(self) -> bool {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L172-L174 + + +`true` if this type is `bool`. + +### is_field + +```rust title="is_field" showLineNumbers +pub comptime fn is_field(self) -> bool {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L178-L180 + + +`true` if this type is `Field`. + +### is_unit + +```rust title="is_unit" showLineNumbers +comptime fn is_unit(self) -> bool {} +``` +> Source code: noir_stdlib/src/meta/typ.nr#L184-L186 + + +`true` if this type is the unit `()` type. + +## Trait Implementations + +```rust +impl Eq for Type +impl Hash for Type +``` +Note that this is syntactic equality, this is not the same as whether two types will type check +to be the same type. Unless type inference or generics are being used however, users should not +typically have to worry about this distinction unless `std::meta::typ::fresh_type_variable` is used. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/typed_expr.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/typed_expr.md new file mode 100644 index 00000000000..0db7dbfef61 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/typed_expr.md @@ -0,0 +1,27 @@ +--- +title: TypedExpr +--- + +`std::meta::typed_expr` contains methods on the built-in `TypedExpr` type for resolved and type-checked expressions. + +## Methods + +### get_type + +```rust title="as_function_definition" showLineNumbers +pub comptime fn as_function_definition(self) -> Option {} +``` +> Source code: noir_stdlib/src/meta/typed_expr.nr#L7-L9 + + +If this expression refers to a function definitions, returns it. Otherwise returns `Option::none()`. + +### get_type + +```rust title="get_type" showLineNumbers +pub comptime fn get_type(self) -> Option {} +``` +> Source code: noir_stdlib/src/meta/typed_expr.nr#L13-L15 + + +Returns the type of the expression, or `Option::none()` if there were errors when the expression was previously resolved. \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/unresolved_type.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/unresolved_type.md new file mode 100644 index 00000000000..2826ec5ec0f --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/meta/unresolved_type.md @@ -0,0 +1,57 @@ +--- +title: UnresolvedType +--- + +`std::meta::unresolved_type` contains methods on the built-in `UnresolvedType` type for the syntax of types. + +## Methods + +### as_mutable_reference + +```rust title="as_mutable_reference" showLineNumbers +comptime fn as_mutable_reference(self) -> Option {} +``` +> Source code: noir_stdlib/src/meta/unresolved_type.nr#L8-L10 + + +If this is a mutable reference type `&mut T`, returns the mutable type `T`. + +### as_slice + +```rust title="as_slice" showLineNumbers +comptime fn as_slice(self) -> Option {} +``` +> Source code: noir_stdlib/src/meta/unresolved_type.nr#L14-L16 + + +If this is a slice `&[T]`, returns the element type `T`. + +### is_bool + +```rust title="is_bool" showLineNumbers +comptime fn is_bool(self) -> bool {} +``` +> Source code: noir_stdlib/src/meta/unresolved_type.nr#L20-L22 + + +Returns `true` if this type is `bool`. + +### is_field + +```rust title="is_field" showLineNumbers +pub comptime fn is_field(self) -> bool {} +``` +> Source code: noir_stdlib/src/meta/unresolved_type.nr#L26-L28 + + +Returns true if this type refers to the Field type. + +### is_unit + +```rust title="is_unit" showLineNumbers +comptime fn is_unit(self) -> bool {} +``` +> Source code: noir_stdlib/src/meta/unresolved_type.nr#L32-L34 + + +Returns true if this type is the unit `()` type. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/options.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/options.md new file mode 100644 index 00000000000..a1bd4e1de5f --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/options.md @@ -0,0 +1,101 @@ +--- +title: Option Type +--- + +The `Option` type is a way to express that a value might be present (`Some(T))` or absent (`None`). It's a safer way to handle potential absence of values, compared to using nulls in many other languages. + +```rust +struct Option { + None, + Some(T), +} +``` + +The `Option` type, already imported into your Noir program, can be used directly: + +```rust +fn main() { + let none = Option::none(); + let some = Option::some(3); +} +``` + +See [this test](https://github.com/noir-lang/noir/blob/5cbfb9c4a06c8865c98ff2b594464b037d821a5c/crates/nargo_cli/tests/test_data/option/src/main.nr) for a more comprehensive set of examples of each of the methods described below. + +## Methods + +### none + +Constructs a none value. + +### some + +Constructs a some wrapper around a given value. + +### is_none + +Returns true if the Option is None. + +### is_some + +Returns true of the Option is Some. + +### unwrap + +Asserts `self.is_some()` and returns the wrapped value. + +### unwrap_unchecked + +Returns the inner value without asserting `self.is_some()`. This method can be useful within an if condition when we already know that `option.is_some()`. If the option is None, there is no guarantee what value will be returned, only that it will be of type T for an `Option`. + +### unwrap_or + +Returns the wrapped value if `self.is_some()`. Otherwise, returns the given default value. + +### unwrap_or_else + +Returns the wrapped value if `self.is_some()`. Otherwise, calls the given function to return a default value. + +### expect + +Asserts `self.is_some()` with a provided custom message and returns the contained `Some` value. The custom message is expected to be a format string. + +### map + +If self is `Some(x)`, this returns `Some(f(x))`. Otherwise, this returns `None`. + +### map_or + +If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns the given default value. + +### map_or_else + +If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns `default()`. + +### and + +Returns None if self is None. Otherwise, this returns `other`. + +### and_then + +If self is None, this returns None. Otherwise, this calls the given function with the Some value contained within self, and returns the result of that call. In some languages this function is called `flat_map` or `bind`. + +### or + +If self is Some, return self. Otherwise, return `other`. + +### or_else + +If self is Some, return self. Otherwise, return `default()`. + +### xor + +If only one of the two Options is Some, return that option. Otherwise, if both options are Some or both are None, None is returned. + +### filter + +Returns `Some(x)` if self is `Some(x)` and `predicate(x)` is true. Otherwise, this returns `None`. + +### flatten + +Flattens an `Option>` into a `Option`. This returns `None` if the outer Option is None. Otherwise, this returns the inner Option. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/recursion.mdx b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/recursion.mdx new file mode 100644 index 00000000000..fcb36278060 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/recursion.mdx @@ -0,0 +1,67 @@ +--- +title: Recursive Proofs +description: Learn about how to write recursive proofs in Noir. +keywords: [recursion, recursive proofs, verification_key, verify_proof] +--- + +import BlackBoxInfo from '@site/src/components/Notes/_blackbox'; + +Noir supports recursively verifying proofs, meaning you verify the proof of a Noir program in another Noir program. This enables creating proofs of arbitrary size by doing step-wise verification of smaller components of a large proof. + +Read [the explainer on recursion](../../explainers/explainer-recursion.md) to know more about this function and the [guide on how to use it.](../../how_to/how-to-recursion.md) + +## Verifying Recursive Proofs + +```rust +#[foreign(recursive_aggregation)] +pub fn verify_proof(verification_key: [Field], proof: [Field], public_inputs: [Field], key_hash: Field) {} +``` + + + +## Example usage + +```rust + +fn main( + verification_key : [Field; 114], + proof : [Field; 93], + public_inputs : [Field; 1], + key_hash : Field, + proof_b : [Field; 93], +) { + std::verify_proof( + verification_key, + proof, + public_inputs, + key_hash + ); + + std::verify_proof( + verification_key, + proof_b, + public_inputs, + key_hash + ); +} +``` + +You can see a full example of recursive proofs in [this example recursion demo repo](https://github.com/noir-lang/noir-examples/tree/master/recursion). + +## Parameters + +### `verification_key` + +The verification key for the zk program that is being verified. + +### `proof` + +The proof for the zk program that is being verified. + +### `public_inputs` + +These represent the public inputs of the proof we are verifying. + +### `key_hash` + +A key hash is used to check the validity of the verification key. The circuit implementing this opcode can use this hash to ensure that the key provided to the circuit matches the key produced by the circuit creator. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/traits.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/traits.md new file mode 100644 index 00000000000..ee20f9cd949 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/noir/standard_library/traits.md @@ -0,0 +1,628 @@ +--- +title: Traits +description: Noir's stdlib provides a few commonly used traits. +keywords: [traits, trait, interface, protocol, default, add, eq] +--- + +## `std::default` + +### `std::default::Default` + +```rust title="default-trait" showLineNumbers +pub trait Default { + fn default() -> Self; +} +``` +> Source code: noir_stdlib/src/default.nr#L4-L8 + + +Constructs a default value of a type. + +Implementations: +```rust +impl Default for Field { .. } + +impl Default for i8 { .. } +impl Default for i16 { .. } +impl Default for i32 { .. } +impl Default for i64 { .. } + +impl Default for u8 { .. } +impl Default for u16 { .. } +impl Default for u32 { .. } +impl Default for u64 { .. } + +impl Default for () { .. } +impl Default for bool { .. } + +impl Default for [T; N] + where T: Default { .. } + +impl Default for [T] { .. } + +impl Default for (A, B) + where A: Default, B: Default { .. } + +impl Default for (A, B, C) + where A: Default, B: Default, C: Default { .. } + +impl Default for (A, B, C, D) + where A: Default, B: Default, C: Default, D: Default { .. } + +impl Default for (A, B, C, D, E) + where A: Default, B: Default, C: Default, D: Default, E: Default { .. } +``` + +For primitive integer types, the return value of `default` is `0`. Container +types such as arrays are filled with default values of their element type, +except slices whose length is unknown and thus defaulted to zero. + +--- + +## `std::convert` + +### `std::convert::From` + +```rust title="from-trait" showLineNumbers +pub trait From { + fn from(input: T) -> Self; +} +``` +> Source code: noir_stdlib/src/convert.nr#L1-L5 + + +The `From` trait defines how to convert from a given type `T` to the type on which the trait is implemented. + +The Noir standard library provides a number of implementations of `From` between primitive types. +```rust title="from-impls" showLineNumbers +// Unsigned integers + +impl From for u32 { + fn from(value: u8) -> u32 { + value as u32 + } +} + +impl From for u64 { + fn from(value: u8) -> u64 { + value as u64 + } +} +impl From for u64 { + fn from(value: u32) -> u64 { + value as u64 + } +} + +impl From for Field { + fn from(value: u8) -> Field { + value as Field + } +} +impl From for Field { + fn from(value: u32) -> Field { + value as Field + } +} +impl From for Field { + fn from(value: u64) -> Field { + value as Field + } +} + +// Signed integers + +impl From for i32 { + fn from(value: i8) -> i32 { + value as i32 + } +} + +impl From for i64 { + fn from(value: i8) -> i64 { + value as i64 + } +} +impl From for i64 { + fn from(value: i32) -> i64 { + value as i64 + } +} + +// Booleans +impl From for u8 { + fn from(value: bool) -> u8 { + value as u8 + } +} +impl From for u32 { + fn from(value: bool) -> u32 { + value as u32 + } +} +impl From for u64 { + fn from(value: bool) -> u64 { + value as u64 + } +} +impl From for i8 { + fn from(value: bool) -> i8 { + value as i8 + } +} +impl From for i32 { + fn from(value: bool) -> i32 { + value as i32 + } +} +impl From for i64 { + fn from(value: bool) -> i64 { + value as i64 + } +} +impl From for Field { + fn from(value: bool) -> Field { + value as Field + } +} +``` +> Source code: noir_stdlib/src/convert.nr#L28-L119 + + +#### When to implement `From` + +As a general rule of thumb, `From` may be implemented in the [situations where it would be suitable in Rust](https://doc.rust-lang.org/std/convert/trait.From.html#when-to-implement-from): + +- The conversion is *infallible*: Noir does not provide an equivalent to Rust's `TryFrom`, if the conversion can fail then provide a named method instead. +- The conversion is *lossless*: semantically, it should not lose or discard information. For example, `u32: From` can losslessly convert any `u16` into a valid `u32` such that the original `u16` can be recovered. On the other hand, `u16: From` should not be implemented as `2**16` is a `u32` which cannot be losslessly converted into a `u16`. +- The conversion is *value-preserving*: the conceptual kind and meaning of the resulting value is the same, even though the Noir type and technical representation might be different. While it's possible to infallibly and losslessly convert a `u8` into a `str<2>` hex representation, `4u8` and `"04"` are too different for `str<2>: From` to be implemented. +- The conversion is *obvious*: it's the only reasonable conversion between the two types. If there's ambiguity on how to convert between them such that the same input could potentially map to two different values then a named method should be used. For instance rather than implementing `U128: From<[u8; 16]>`, the methods `U128::from_le_bytes` and `U128::from_be_bytes` are used as otherwise the endianness of the array would be ambiguous, resulting in two potential values of `U128` from the same byte array. + +One additional recommendation specific to Noir is: +- The conversion is *efficient*: it's relatively cheap to convert between the two types. Due to being a ZK DSL, it's more important to avoid unnecessary computation compared to Rust. If the implementation of `From` would encourage users to perform unnecessary conversion, resulting in additional proving time, then it may be preferable to expose functionality such that this conversion may be avoided. + +### `std::convert::Into` + +The `Into` trait is defined as the reciprocal of `From`. It should be easy to convince yourself that if we can convert to type `A` from type `B`, then it's possible to convert type `B` into type `A`. + +For this reason, implementing `From` on a type will automatically generate a matching `Into` implementation. One should always prefer implementing `From` over `Into` as implementing `Into` will not generate a matching `From` implementation. + +```rust title="into-trait" showLineNumbers +pub trait Into { + fn into(self) -> T; +} + +impl Into for U +where + T: From, +{ + fn into(self) -> T { + T::from(self) + } +} +``` +> Source code: noir_stdlib/src/convert.nr#L13-L26 + + +`Into` is most useful when passing function arguments where the types don't quite match up with what the function expects. In this case, the compiler has enough type information to perform the necessary conversion by just appending `.into()` onto the arguments in question. + +--- + +## `std::cmp` + +### `std::cmp::Eq` + +```rust title="eq-trait" showLineNumbers +pub trait Eq { + fn eq(self, other: Self) -> bool; +} +``` +> Source code: noir_stdlib/src/cmp.nr#L4-L8 + + +Returns `true` if `self` is equal to `other`. Implementing this trait on a type +allows the type to be used with `==` and `!=`. + +Implementations: +```rust +impl Eq for Field { .. } + +impl Eq for i8 { .. } +impl Eq for i16 { .. } +impl Eq for i32 { .. } +impl Eq for i64 { .. } + +impl Eq for u8 { .. } +impl Eq for u16 { .. } +impl Eq for u32 { .. } +impl Eq for u64 { .. } + +impl Eq for () { .. } +impl Eq for bool { .. } + +impl Eq for [T; N] + where T: Eq { .. } + +impl Eq for [T] + where T: Eq { .. } + +impl Eq for (A, B) + where A: Eq, B: Eq { .. } + +impl Eq for (A, B, C) + where A: Eq, B: Eq, C: Eq { .. } + +impl Eq for (A, B, C, D) + where A: Eq, B: Eq, C: Eq, D: Eq { .. } + +impl Eq for (A, B, C, D, E) + where A: Eq, B: Eq, C: Eq, D: Eq, E: Eq { .. } +``` + +### `std::cmp::Ord` + +```rust title="ord-trait" showLineNumbers +pub trait Ord { + fn cmp(self, other: Self) -> Ordering; +} +``` +> Source code: noir_stdlib/src/cmp.nr#L210-L214 + + +`a.cmp(b)` compares two values returning `Ordering::less()` if `a < b`, +`Ordering::equal()` if `a == b`, or `Ordering::greater()` if `a > b`. +Implementing this trait on a type allows `<`, `<=`, `>`, and `>=` to be +used on values of the type. + +`std::cmp` also provides `max` and `min` functions for any type which implements the `Ord` trait. + +Implementations: + +```rust +impl Ord for u8 { .. } +impl Ord for u16 { .. } +impl Ord for u32 { .. } +impl Ord for u64 { .. } + +impl Ord for i8 { .. } +impl Ord for i16 { .. } +impl Ord for i32 { .. } + +impl Ord for i64 { .. } + +impl Ord for () { .. } +impl Ord for bool { .. } + +impl Ord for [T; N] + where T: Ord { .. } + +impl Ord for [T] + where T: Ord { .. } + +impl Ord for (A, B) + where A: Ord, B: Ord { .. } + +impl Ord for (A, B, C) + where A: Ord, B: Ord, C: Ord { .. } + +impl Ord for (A, B, C, D) + where A: Ord, B: Ord, C: Ord, D: Ord { .. } + +impl Ord for (A, B, C, D, E) + where A: Ord, B: Ord, C: Ord, D: Ord, E: Ord { .. } +``` + +--- + +## `std::ops` + +### `std::ops::Add`, `std::ops::Sub`, `std::ops::Mul`, and `std::ops::Div` + +These traits abstract over addition, subtraction, multiplication, and division respectively. +Implementing these traits for a given type will also allow that type to be used with the corresponding operator +for that trait (`+` for Add, etc) in addition to the normal method names. + +```rust title="add-trait" showLineNumbers +pub trait Add { + fn add(self, other: Self) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/arith.nr#L1-L5 + +```rust title="sub-trait" showLineNumbers +pub trait Sub { + fn sub(self, other: Self) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/arith.nr#L60-L64 + +```rust title="mul-trait" showLineNumbers +pub trait Mul { + fn mul(self, other: Self) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/arith.nr#L119-L123 + +```rust title="div-trait" showLineNumbers +pub trait Div { + fn div(self, other: Self) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/arith.nr#L178-L182 + + +The implementations block below is given for the `Add` trait, but the same types that implement +`Add` also implement `Sub`, `Mul`, and `Div`. + +Implementations: +```rust +impl Add for Field { .. } + +impl Add for i8 { .. } +impl Add for i16 { .. } +impl Add for i32 { .. } +impl Add for i64 { .. } + +impl Add for u8 { .. } +impl Add for u16 { .. } +impl Add for u32 { .. } +impl Add for u64 { .. } +``` + +### `std::ops::Rem` + +```rust title="rem-trait" showLineNumbers +pub trait Rem { + fn rem(self, other: Self) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/arith.nr#L237-L241 + + +`Rem::rem(a, b)` is the remainder function returning the result of what is +left after dividing `a` and `b`. Implementing `Rem` allows the `%` operator +to be used with the implementation type. + +Unlike other numeric traits, `Rem` is not implemented for `Field`. + +Implementations: +```rust +impl Rem for u8 { fn rem(self, other: u8) -> u8 { self % other } } +impl Rem for u16 { fn rem(self, other: u16) -> u16 { self % other } } +impl Rem for u32 { fn rem(self, other: u32) -> u32 { self % other } } +impl Rem for u64 { fn rem(self, other: u64) -> u64 { self % other } } + +impl Rem for i8 { fn rem(self, other: i8) -> i8 { self % other } } +impl Rem for i16 { fn rem(self, other: i16) -> i16 { self % other } } +impl Rem for i32 { fn rem(self, other: i32) -> i32 { self % other } } +impl Rem for i64 { fn rem(self, other: i64) -> i64 { self % other } } +``` + +### `std::ops::Neg` + +```rust title="neg-trait" showLineNumbers +pub trait Neg { + fn neg(self) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/arith.nr#L290-L294 + + +`Neg::neg` is equivalent to the unary negation operator `-`. + +Implementations: +```rust title="neg-trait-impls" showLineNumbers +impl Neg for Field { + fn neg(self) -> Field { + -self + } +} + +impl Neg for i8 { + fn neg(self) -> i8 { + -self + } +} +impl Neg for i16 { + fn neg(self) -> i16 { + -self + } +} +impl Neg for i32 { + fn neg(self) -> i32 { + -self + } +} +impl Neg for i64 { + fn neg(self) -> i64 { + -self + } +} +``` +> Source code: noir_stdlib/src/ops/arith.nr#L296-L323 + + +### `std::ops::Not` + +```rust title="not-trait" showLineNumbers +pub trait Not { + fn not(self: Self) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/bit.nr#L1-L5 + + +`Not::not` is equivalent to the unary bitwise NOT operator `!`. + +Implementations: +```rust title="not-trait-impls" showLineNumbers +impl Not for bool { + fn not(self) -> bool { + !self + } +} + +impl Not for u64 { + fn not(self) -> u64 { + !self + } +} +impl Not for u32 { + fn not(self) -> u32 { + !self + } +} +impl Not for u16 { + fn not(self) -> u16 { + !self + } +} +impl Not for u8 { + fn not(self) -> u8 { + !self + } +} +impl Not for u1 { + fn not(self) -> u1 { + !self + } +} + +impl Not for i8 { + fn not(self) -> i8 { + !self + } +} +impl Not for i16 { + fn not(self) -> i16 { + !self + } +} +impl Not for i32 { + fn not(self) -> i32 { + !self + } +} +impl Not for i64 { + fn not(self) -> i64 { + !self + } +} +``` +> Source code: noir_stdlib/src/ops/bit.nr#L7-L60 + + +### `std::ops::{ BitOr, BitAnd, BitXor }` + +```rust title="bitor-trait" showLineNumbers +pub trait BitOr { + fn bitor(self, other: Self) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/bit.nr#L62-L66 + +```rust title="bitand-trait" showLineNumbers +pub trait BitAnd { + fn bitand(self, other: Self) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/bit.nr#L121-L125 + +```rust title="bitxor-trait" showLineNumbers +pub trait BitXor { + fn bitxor(self, other: Self) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/bit.nr#L180-L184 + + +Traits for the bitwise operations `|`, `&`, and `^`. + +Implementing `BitOr`, `BitAnd` or `BitXor` for a type allows the `|`, `&`, or `^` operator respectively +to be used with the type. + +The implementations block below is given for the `BitOr` trait, but the same types that implement +`BitOr` also implement `BitAnd` and `BitXor`. + +Implementations: +```rust +impl BitOr for bool { fn bitor(self, other: bool) -> bool { self | other } } + +impl BitOr for u8 { fn bitor(self, other: u8) -> u8 { self | other } } +impl BitOr for u16 { fn bitor(self, other: u16) -> u16 { self | other } } +impl BitOr for u32 { fn bitor(self, other: u32) -> u32 { self | other } } +impl BitOr for u64 { fn bitor(self, other: u64) -> u64 { self | other } } + +impl BitOr for i8 { fn bitor(self, other: i8) -> i8 { self | other } } +impl BitOr for i16 { fn bitor(self, other: i16) -> i16 { self | other } } +impl BitOr for i32 { fn bitor(self, other: i32) -> i32 { self | other } } +impl BitOr for i64 { fn bitor(self, other: i64) -> i64 { self | other } } +``` + +### `std::ops::{ Shl, Shr }` + +```rust title="shl-trait" showLineNumbers +pub trait Shl { + fn shl(self, other: u8) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/bit.nr#L239-L243 + +```rust title="shr-trait" showLineNumbers +pub trait Shr { + fn shr(self, other: u8) -> Self; +} +``` +> Source code: noir_stdlib/src/ops/bit.nr#L292-L296 + + +Traits for a bit shift left and bit shift right. + +Implementing `Shl` for a type allows the left shift operator (`<<`) to be used with the implementation type. +Similarly, implementing `Shr` allows the right shift operator (`>>`) to be used with the type. + +Note that bit shifting is not currently implemented for signed types. + +The implementations block below is given for the `Shl` trait, but the same types that implement +`Shl` also implement `Shr`. + +Implementations: +```rust +impl Shl for u8 { fn shl(self, other: u8) -> u8 { self << other } } +impl Shl for u16 { fn shl(self, other: u16) -> u16 { self << other } } +impl Shl for u32 { fn shl(self, other: u32) -> u32 { self << other } } +impl Shl for u64 { fn shl(self, other: u64) -> u64 { self << other } } +``` + +--- + +## `std::append` + +### `std::append::Append` + +`Append` can abstract over types that can be appended to - usually container types: + +```rust title="append-trait" showLineNumbers +pub trait Append { + fn empty() -> Self; + fn append(self, other: Self) -> Self; +} +``` +> Source code: noir_stdlib/src/append.nr#L9-L14 + + +`Append` requires two methods: + +- `empty`: Constructs an empty value of `Self`. +- `append`: Append two values together, returning the result. + +Additionally, it is expected that for any implementation: + +- `T::empty().append(x) == x` +- `x.append(T::empty()) == x` + +Implementations: +```rust +impl Append for [T] +impl Append for Quoted +``` diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/.nojekyll b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/.nojekyll new file mode 100644 index 00000000000..e2ac6616add --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/classes/Noir.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/classes/Noir.md new file mode 100644 index 00000000000..ead255bc504 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/classes/Noir.md @@ -0,0 +1,52 @@ +# Noir + +## Constructors + +### new Noir(circuit) + +```ts +new Noir(circuit): Noir +``` + +#### Parameters + +| Parameter | Type | +| :------ | :------ | +| `circuit` | `CompiledCircuit` | + +#### Returns + +[`Noir`](Noir.md) + +## Methods + +### execute() + +```ts +execute(inputs, foreignCallHandler?): Promise +``` + +#### Parameters + +| Parameter | Type | +| :------ | :------ | +| `inputs` | `InputMap` | +| `foreignCallHandler`? | [`ForeignCallHandler`](../type-aliases/ForeignCallHandler.md) | + +#### Returns + +`Promise`\<`object`\> + +#### Description + +Allows to execute a circuit to get its witness and return value. + +#### Example + +```typescript +async execute(inputs) +``` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/and.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/and.md new file mode 100644 index 00000000000..c783283e396 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/and.md @@ -0,0 +1,22 @@ +# and() + +```ts +and(lhs, rhs): string +``` + +Performs a bitwise AND operation between `lhs` and `rhs` + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `lhs` | `string` | | +| `rhs` | `string` | | + +## Returns + +`string` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/blake2s256.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/blake2s256.md new file mode 100644 index 00000000000..7882d0da8d5 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/blake2s256.md @@ -0,0 +1,21 @@ +# blake2s256() + +```ts +blake2s256(inputs): Uint8Array +``` + +Calculates the Blake2s256 hash of the input bytes + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `inputs` | `Uint8Array` | | + +## Returns + +`Uint8Array` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/ecdsa_secp256k1_verify.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/ecdsa_secp256k1_verify.md new file mode 100644 index 00000000000..5e3cd53e9d3 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/ecdsa_secp256k1_verify.md @@ -0,0 +1,28 @@ +# ecdsa\_secp256k1\_verify() + +```ts +ecdsa_secp256k1_verify( + hashed_msg, + public_key_x_bytes, + public_key_y_bytes, + signature): boolean +``` + +Verifies a ECDSA signature over the secp256k1 curve. + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `hashed_msg` | `Uint8Array` | | +| `public_key_x_bytes` | `Uint8Array` | | +| `public_key_y_bytes` | `Uint8Array` | | +| `signature` | `Uint8Array` | | + +## Returns + +`boolean` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/ecdsa_secp256r1_verify.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/ecdsa_secp256r1_verify.md new file mode 100644 index 00000000000..0b20ff68957 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/ecdsa_secp256r1_verify.md @@ -0,0 +1,28 @@ +# ecdsa\_secp256r1\_verify() + +```ts +ecdsa_secp256r1_verify( + hashed_msg, + public_key_x_bytes, + public_key_y_bytes, + signature): boolean +``` + +Verifies a ECDSA signature over the secp256r1 curve. + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `hashed_msg` | `Uint8Array` | | +| `public_key_x_bytes` | `Uint8Array` | | +| `public_key_y_bytes` | `Uint8Array` | | +| `signature` | `Uint8Array` | | + +## Returns + +`boolean` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/xor.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/xor.md new file mode 100644 index 00000000000..8d762b895d3 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/functions/xor.md @@ -0,0 +1,22 @@ +# xor() + +```ts +xor(lhs, rhs): string +``` + +Performs a bitwise XOR operation between `lhs` and `rhs` + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `lhs` | `string` | | +| `rhs` | `string` | | + +## Returns + +`string` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/index.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/index.md new file mode 100644 index 00000000000..4de7a696991 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/index.md @@ -0,0 +1,47 @@ +# noir_js + +## Exports + +### Classes + +| Class | Description | +| :------ | :------ | +| [Noir](classes/Noir.md) | - | + +### Type Aliases + +| Type alias | Description | +| :------ | :------ | +| [ErrorWithPayload](type-aliases/ErrorWithPayload.md) | - | +| [ForeignCallHandler](type-aliases/ForeignCallHandler.md) | A callback which performs an foreign call and returns the response. | +| [ForeignCallInput](type-aliases/ForeignCallInput.md) | - | +| [ForeignCallOutput](type-aliases/ForeignCallOutput.md) | - | +| [WitnessMap](type-aliases/WitnessMap.md) | - | + +### Functions + +| Function | Description | +| :------ | :------ | +| [and](functions/and.md) | Performs a bitwise AND operation between `lhs` and `rhs` | +| [blake2s256](functions/blake2s256.md) | Calculates the Blake2s256 hash of the input bytes | +| [ecdsa\_secp256k1\_verify](functions/ecdsa_secp256k1_verify.md) | Verifies a ECDSA signature over the secp256k1 curve. | +| [ecdsa\_secp256r1\_verify](functions/ecdsa_secp256r1_verify.md) | Verifies a ECDSA signature over the secp256r1 curve. | +| [xor](functions/xor.md) | Performs a bitwise XOR operation between `lhs` and `rhs` | + +## References + +### CompiledCircuit + +Renames and re-exports [InputMap](index.md#inputmap) + +## Variables + +### InputMap + +```ts +InputMap: any; +``` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ErrorWithPayload.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ErrorWithPayload.md new file mode 100644 index 00000000000..e8c2f4aef3d --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ErrorWithPayload.md @@ -0,0 +1,15 @@ +# ErrorWithPayload + +```ts +type ErrorWithPayload: ExecutionError & object; +``` + +## Type declaration + +| Member | Type | Description | +| :------ | :------ | :------ | +| `decodedAssertionPayload` | `any` | - | + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md new file mode 100644 index 00000000000..812b8b16481 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md @@ -0,0 +1,24 @@ +# ForeignCallHandler + +```ts +type ForeignCallHandler: (name, inputs) => Promise; +``` + +A callback which performs an foreign call and returns the response. + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | The identifier for the type of foreign call being performed. | +| `inputs` | [`ForeignCallInput`](ForeignCallInput.md)[] | An array of hex encoded inputs to the foreign call. | + +## Returns + +`Promise`\<[`ForeignCallOutput`](ForeignCallOutput.md)[]\> + +outputs - An array of hex encoded outputs containing the results of the foreign call. + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ForeignCallInput.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ForeignCallInput.md new file mode 100644 index 00000000000..dd95809186a --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ForeignCallInput.md @@ -0,0 +1,9 @@ +# ForeignCallInput + +```ts +type ForeignCallInput: string[]; +``` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ForeignCallOutput.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ForeignCallOutput.md new file mode 100644 index 00000000000..b71fb78a946 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/ForeignCallOutput.md @@ -0,0 +1,9 @@ +# ForeignCallOutput + +```ts +type ForeignCallOutput: string | string[]; +``` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/WitnessMap.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/WitnessMap.md new file mode 100644 index 00000000000..258c46f9d0c --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/type-aliases/WitnessMap.md @@ -0,0 +1,9 @@ +# WitnessMap + +```ts +type WitnessMap: Map; +``` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/typedoc-sidebar.cjs b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/typedoc-sidebar.cjs new file mode 100644 index 00000000000..4796b5abaa8 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_js/typedoc-sidebar.cjs @@ -0,0 +1,4 @@ +// @ts-check +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ +const typedocSidebar = { items: [{"type":"category","label":"Classes","items":[{"type":"doc","id":"reference/NoirJS/noir_js/classes/Noir","label":"Noir"}]},{"type":"category","label":"Type Aliases","items":[{"type":"doc","id":"reference/NoirJS/noir_js/type-aliases/ErrorWithPayload","label":"ErrorWithPayload"},{"type":"doc","id":"reference/NoirJS/noir_js/type-aliases/ForeignCallHandler","label":"ForeignCallHandler"},{"type":"doc","id":"reference/NoirJS/noir_js/type-aliases/ForeignCallInput","label":"ForeignCallInput"},{"type":"doc","id":"reference/NoirJS/noir_js/type-aliases/ForeignCallOutput","label":"ForeignCallOutput"},{"type":"doc","id":"reference/NoirJS/noir_js/type-aliases/WitnessMap","label":"WitnessMap"}]},{"type":"category","label":"Functions","items":[{"type":"doc","id":"reference/NoirJS/noir_js/functions/and","label":"and"},{"type":"doc","id":"reference/NoirJS/noir_js/functions/blake2s256","label":"blake2s256"},{"type":"doc","id":"reference/NoirJS/noir_js/functions/ecdsa_secp256k1_verify","label":"ecdsa_secp256k1_verify"},{"type":"doc","id":"reference/NoirJS/noir_js/functions/ecdsa_secp256r1_verify","label":"ecdsa_secp256r1_verify"},{"type":"doc","id":"reference/NoirJS/noir_js/functions/xor","label":"xor"}]}]}; +module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/.nojekyll b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/.nojekyll new file mode 100644 index 00000000000..e2ac6616add --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/compile.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/compile.md new file mode 100644 index 00000000000..6faf763b37f --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/compile.md @@ -0,0 +1,51 @@ +# compile() + +```ts +compile( + fileManager, + projectPath?, + logFn?, +debugLogFn?): Promise +``` + +Compiles a Noir project + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `fileManager` | `FileManager` | The file manager to use | +| `projectPath`? | `string` | The path to the project inside the file manager. Defaults to the root of the file manager | +| `logFn`? | `LogFn` | A logging function. If not provided, console.log will be used | +| `debugLogFn`? | `LogFn` | A debug logging function. If not provided, logFn will be used | + +## Returns + +`Promise`\<[`ProgramCompilationArtifacts`](../index.md#programcompilationartifacts)\> + +## Example + +```typescript +// Node.js + +import { compile_program, createFileManager } from '@noir-lang/noir_wasm'; + +const fm = createFileManager(myProjectPath); +const myCompiledCode = await compile_program(fm); +``` + +```typescript +// Browser + +import { compile_program, createFileManager } from '@noir-lang/noir_wasm'; + +const fm = createFileManager('/'); +for (const path of files) { + await fm.writeFile(path, await getFileAsStream(path)); +} +const myCompiledCode = await compile_program(fm); +``` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/compile_contract.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/compile_contract.md new file mode 100644 index 00000000000..7d0b39a43ef --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/compile_contract.md @@ -0,0 +1,51 @@ +# compile\_contract() + +```ts +compile_contract( + fileManager, + projectPath?, + logFn?, +debugLogFn?): Promise +``` + +Compiles a Noir project + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `fileManager` | `FileManager` | The file manager to use | +| `projectPath`? | `string` | The path to the project inside the file manager. Defaults to the root of the file manager | +| `logFn`? | `LogFn` | A logging function. If not provided, console.log will be used | +| `debugLogFn`? | `LogFn` | A debug logging function. If not provided, logFn will be used | + +## Returns + +`Promise`\<[`ContractCompilationArtifacts`](../index.md#contractcompilationartifacts)\> + +## Example + +```typescript +// Node.js + +import { compile_contract, createFileManager } from '@noir-lang/noir_wasm'; + +const fm = createFileManager(myProjectPath); +const myCompiledCode = await compile_contract(fm); +``` + +```typescript +// Browser + +import { compile_contract, createFileManager } from '@noir-lang/noir_wasm'; + +const fm = createFileManager('/'); +for (const path of files) { + await fm.writeFile(path, await getFileAsStream(path)); +} +const myCompiledCode = await compile_contract(fm); +``` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/createFileManager.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/createFileManager.md new file mode 100644 index 00000000000..7e65c1d69c7 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/createFileManager.md @@ -0,0 +1,21 @@ +# createFileManager() + +```ts +createFileManager(dataDir): FileManager +``` + +Creates a new FileManager instance based on fs in node and memfs in the browser (via webpack alias) + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `dataDir` | `string` | root of the file system | + +## Returns + +`FileManager` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/inflateDebugSymbols.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/inflateDebugSymbols.md new file mode 100644 index 00000000000..fcea9275341 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/functions/inflateDebugSymbols.md @@ -0,0 +1,21 @@ +# inflateDebugSymbols() + +```ts +inflateDebugSymbols(debugSymbols): any +``` + +Decompresses and decodes the debug symbols + +## Parameters + +| Parameter | Type | Description | +| :------ | :------ | :------ | +| `debugSymbols` | `string` | The base64 encoded debug symbols | + +## Returns + +`any` + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/index.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/index.md new file mode 100644 index 00000000000..b6e0f9d1bc0 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/index.md @@ -0,0 +1,49 @@ +# noir_wasm + +## Exports + +### Functions + +| Function | Description | +| :------ | :------ | +| [compile](functions/compile.md) | Compiles a Noir project | +| [compile\_contract](functions/compile_contract.md) | Compiles a Noir project | +| [createFileManager](functions/createFileManager.md) | Creates a new FileManager instance based on fs in node and memfs in the browser (via webpack alias) | +| [inflateDebugSymbols](functions/inflateDebugSymbols.md) | Decompresses and decodes the debug symbols | + +## References + +### compile\_program + +Renames and re-exports [compile](functions/compile.md) + +## Interfaces + +### ContractCompilationArtifacts + +The compilation artifacts of a given contract. + +#### Properties + +| Property | Type | Description | +| :------ | :------ | :------ | +| `contract` | `ContractArtifact` | The compiled contract. | +| `warnings` | `unknown`[] | Compilation warnings. | + +*** + +### ProgramCompilationArtifacts + +The compilation artifacts of a given program. + +#### Properties + +| Property | Type | Description | +| :------ | :------ | :------ | +| `name` | `string` | not part of the compilation output, injected later | +| `program` | `ProgramArtifact` | The compiled contract. | +| `warnings` | `unknown`[] | Compilation warnings. | + +*** + +Generated using [typedoc-plugin-markdown](https://www.npmjs.com/package/typedoc-plugin-markdown) and [TypeDoc](https://typedoc.org/) diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/typedoc-sidebar.cjs b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/typedoc-sidebar.cjs new file mode 100644 index 00000000000..e0870710349 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/NoirJS/noir_wasm/typedoc-sidebar.cjs @@ -0,0 +1,4 @@ +// @ts-check +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ +const typedocSidebar = { items: [{"type":"doc","id":"reference/NoirJS/noir_wasm/index","label":"API"},{"type":"category","label":"Functions","items":[{"type":"doc","id":"reference/NoirJS/noir_wasm/functions/compile","label":"compile"},{"type":"doc","id":"reference/NoirJS/noir_wasm/functions/compile_contract","label":"compile_contract"},{"type":"doc","id":"reference/NoirJS/noir_wasm/functions/createFileManager","label":"createFileManager"},{"type":"doc","id":"reference/NoirJS/noir_wasm/functions/inflateDebugSymbols","label":"inflateDebugSymbols"}]}]}; +module.exports = typedocSidebar.items; \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/_category_.json b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/_category_.json new file mode 100644 index 00000000000..5b6a20a609a --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/_category_.json @@ -0,0 +1,5 @@ +{ + "position": 4, + "collapsible": true, + "collapsed": true +} diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/_category_.json b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/_category_.json new file mode 100644 index 00000000000..27869205ad3 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/_category_.json @@ -0,0 +1,6 @@ +{ + "label": "Debugger", + "position": 1, + "collapsible": true, + "collapsed": true +} diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/debugger_known_limitations.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/debugger_known_limitations.md new file mode 100644 index 00000000000..936d416ac4b --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/debugger_known_limitations.md @@ -0,0 +1,59 @@ +--- +title: Known limitations +description: + An overview of known limitations of the current version of the Noir debugger +keywords: + [ + Nargo, + Noir Debugger, + VS Code, + ] +sidebar_position: 2 +--- + +# Debugger Known Limitations + +There are currently some limits to what the debugger can observe. + +## Mutable references + +The debugger is currently blind to any state mutated via a mutable reference. For example, in: + +``` +let mut x = 1; +let y = &mut x; +*y = 2; +``` + +The update on `x` will not be observed by the debugger. That means, when running `vars` from the debugger REPL, or inspecting the _local variables_ pane in the VS Code debugger, `x` will appear with value 1 despite having executed `*y = 2;`. + +## Variables of type function or mutable references are opaque + +When inspecting variables, any variable of type `Function` or `MutableReference` will render its value as `<>` or `<>`. + +## Debugger instrumentation affects resulting ACIR + +In order to make the state of local variables observable, the debugger compiles Noir circuits interleaving foreign calls that track any mutations to them. While this works (except in the cases described above) and doesn't introduce any behavior changes, it does as a side effect produce bigger bytecode. In particular, when running the command `opcodes` on the REPL debugger, you will notice Unconstrained VM blocks that look like this: + +``` +... +5 BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [], q_c: 2 }), Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(2))], q_c: 0 })] + | outputs=[] + 5.0 | Mov { destination: RegisterIndex(2), source: RegisterIndex(0) } + 5.1 | Mov { destination: RegisterIndex(3), source: RegisterIndex(1) } + 5.2 | Const { destination: RegisterIndex(0), value: Value { inner: 0 } } + 5.3 | Const { destination: RegisterIndex(1), value: Value { inner: 0 } } + 5.4 | Mov { destination: RegisterIndex(2), source: RegisterIndex(2) } + 5.5 | Mov { destination: RegisterIndex(3), source: RegisterIndex(3) } + 5.6 | Call { location: 8 } + 5.7 | Stop + 5.8 | ForeignCall { function: "__debug_var_assign", destinations: [], inputs: [RegisterIndex(RegisterIndex(2)), RegisterIndex(RegisterIndex(3))] } +... +``` + +If you are interested in debugging/inspecting compiled ACIR without these synthetic changes, you can invoke the REPL debugger with the `--skip-instrumentation` flag or launch the VS Code debugger with the `skipConfiguration` property set to true in its launch configuration. You can find more details about those in the [Debugger REPL reference](debugger_repl.md) and the [VS Code Debugger reference](debugger_vscode.md). + +:::note +Skipping debugger instrumentation means you won't be able to inspect values of local variables. +::: + diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/debugger_repl.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/debugger_repl.md new file mode 100644 index 00000000000..46e2011304e --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/debugger_repl.md @@ -0,0 +1,360 @@ +--- +title: REPL Debugger +description: + Noir Debugger REPL options and commands. +keywords: + [ + Nargo, + Noir CLI, + Noir Debugger, + REPL, + ] +sidebar_position: 1 +--- + +## Running the REPL debugger + +`nargo debug [OPTIONS] [WITNESS_NAME]` + +Runs the Noir REPL debugger. If a `WITNESS_NAME` is provided the debugger writes the resulting execution witness to a `WITNESS_NAME` file. + +### Options + +| Option | Description | +| --------------------- | ------------------------------------------------------------ | +| `-p, --prover-name ` | The name of the toml file which contains the inputs for the prover [default: Prover]| +| `--package ` | The name of the package to debug | +| `--print-acir` | Display the ACIR for compiled circuit | +| `--deny-warnings` | Treat all warnings as errors | +| `--silence-warnings` | Suppress warnings | +| `-h, --help` | Print help | + +None of these options are required. + +:::note +Since the debugger starts by compiling the target package, all Noir compiler options are also available. Check out the [compiler reference](../nargo_commands.md#nargo-compile) to learn more about the compiler options. +::: + +## REPL commands + +Once the debugger is running, it accepts the following commands. + +#### `help` (h) + +Displays the menu of available commands. + +``` +> help +Available commands: + + opcodes display ACIR opcodes + into step into to the next opcode + next step until a new source location is reached + out step until a new source location is reached + and the current stack frame is finished + break LOCATION:OpcodeLocation add a breakpoint at an opcode location + over step until a new source location is reached + without diving into function calls + restart restart the debugging session + delete LOCATION:OpcodeLocation delete breakpoint at an opcode location + witness show witness map + witness index:u32 display a single witness from the witness map + witness index:u32 value:String update a witness with the given value + memset index:usize value:String update a memory cell with the given + value + continue continue execution until the end of the + program + vars show variable values available at this point + in execution + stacktrace display the current stack trace + memory show memory (valid when executing unconstrained code) value + step step to the next ACIR opcode + +Other commands: + + help Show this help message + quit Quit repl + +``` + +### Stepping through programs + +#### `next` (n) + +Step until the next Noir source code location. While other commands, such as [`into`](#into-i) and [`step`](#step-s), allow for finer grained control of the program's execution at the opcode level, `next` is source code centric. For example: + +``` +3 ... +4 fn main(x: u32) { +5 assert(entry_point(x) == 2); +6 swap_entry_point(x, x + 1); +7 -> assert(deep_entry_point(x) == 4); +8 multiple_values_entry_point(x); +9 } +``` + + +Using `next` here would cause the debugger to jump to the definition of `deep_entry_point` (if available). + +If you want to step over `deep_entry_point` and go straight to line 8, use [the `over` command](#over) instead. + +#### `over` + +Step until the next source code location, without diving into function calls. For example: + +``` +3 ... +4 fn main(x: u32) { +5 assert(entry_point(x) == 2); +6 swap_entry_point(x, x + 1); +7 -> assert(deep_entry_point(x) == 4); +8 multiple_values_entry_point(x); +9 } +``` + + +Using `over` here would cause the debugger to execute until line 8 (`multiple_values_entry_point(x);`). + +If you want to step into `deep_entry_point` instead, use [the `next` command](#next-n). + +#### `out` + +Step until the end of the current function call. For example: + +``` + 3 ... + 4 fn main(x: u32) { + 5 assert(entry_point(x) == 2); + 6 swap_entry_point(x, x + 1); + 7 -> assert(deep_entry_point(x) == 4); + 8 multiple_values_entry_point(x); + 9 } + 10 + 11 unconstrained fn returns_multiple_values(x: u32) -> (u32, u32, u32, u32) { + 12 ... + ... + 55 + 56 unconstrained fn deep_entry_point(x: u32) -> u32 { + 57 -> level_1(x + 1) + 58 } + +``` + +Running `out` here will resume execution until line 8. + +#### `step` (s) + +Skips to the next ACIR code. A compiled Noir program is a sequence of ACIR opcodes. However, an unconstrained VM opcode denotes the start of an unconstrained code block, to be executed by the unconstrained VM. For example (redacted for brevity): + +``` +0 BLACKBOX::RANGE [(_0, num_bits: 32)] [ ] +1 -> BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })] outputs=[Simple(Witness(1))] + 1.0 | Mov { destination: RegisterIndex(2), source: RegisterIndex(0) } + 1.1 | Const { destination: RegisterIndex(0), value: Value { inner: 0 } } + 1.2 | Const { destination: RegisterIndex(1), value: Value { inner: 0 } } + 1.3 | Mov { destination: RegisterIndex(2), source: RegisterIndex(2) } + 1.4 | Call { location: 7 } + ... + 1.43 | Return +2 EXPR [ (1, _1) -2 ] +``` + +The `->` here shows the debugger paused at an ACIR opcode: `BRILLIG`, at index 1, which denotes an unconstrained code block is about to start. + +Using the `step` command at this point would result in the debugger stopping at ACIR opcode 2, `EXPR`, skipping unconstrained computation steps. + +Use [the `into` command](#into-i) instead if you want to follow unconstrained computation step by step. + +#### `into` (i) + +Steps into the next opcode. A compiled Noir program is a sequence of ACIR opcodes. However, a BRILLIG opcode denotes the start of an unconstrained code block, to be executed by the unconstrained VM. For example (redacted for brevity): + +``` +0 BLACKBOX::RANGE [(_0, num_bits: 32)] [ ] +1 -> BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })] outputs=[Simple(Witness(1))] + 1.0 | Mov { destination: RegisterIndex(2), source: RegisterIndex(0) } + 1.1 | Const { destination: RegisterIndex(0), value: Value { inner: 0 } } + 1.2 | Const { destination: RegisterIndex(1), value: Value { inner: 0 } } + 1.3 | Mov { destination: RegisterIndex(2), source: RegisterIndex(2) } + 1.4 | Call { location: 7 } + ... + 1.43 | Return +2 EXPR [ (1, _1) -2 ] +``` + +The `->` here shows the debugger paused at an ACIR opcode: `BRILLIG`, at index 1, which denotes an unconstrained code block is about to start. + +Using the `into` command at this point would result in the debugger stopping at opcode 1.0, `Mov ...`, allowing the debugger user to follow unconstrained computation step by step. + +Use [the `step` command](#step-s) instead if you want to skip to the next ACIR code directly. + +#### `continue` (c) + +Continues execution until the next breakpoint, or the end of the program. + +#### `restart` (res) + +Interrupts execution, and restarts a new debugging session from scratch. + +#### `opcodes` (o) + +Display the program's ACIR opcode sequence. For example: + +``` +0 BLACKBOX::RANGE [(_0, num_bits: 32)] [ ] +1 -> BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })] outputs=[Simple(Witness(1))] + 1.0 | Mov { destination: RegisterIndex(2), source: RegisterIndex(0) } + 1.1 | Const { destination: RegisterIndex(0), value: Value { inner: 0 } } + 1.2 | Const { destination: RegisterIndex(1), value: Value { inner: 0 } } + 1.3 | Mov { destination: RegisterIndex(2), source: RegisterIndex(2) } + 1.4 | Call { location: 7 } + ... + 1.43 | Return +2 EXPR [ (1, _1) -2 ] +``` + +### Breakpoints + +#### `break [Opcode]` (or shorthand `b [Opcode]`) + +Sets a breakpoint on the specified opcode index. To get a list of the program opcode numbers, see [the `opcode` command](#opcodes-o). For example: + +``` +0 BLACKBOX::RANGE [(_0, num_bits: 32)] [ ] +1 -> BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })] outputs=[Simple(Witness(1))] + 1.0 | Mov { destination: RegisterIndex(2), source: RegisterIndex(0) } + 1.1 | Const { destination: RegisterIndex(0), value: Value { inner: 0 } } + 1.2 | Const { destination: RegisterIndex(1), value: Value { inner: 0 } } + 1.3 | Mov { destination: RegisterIndex(2), source: RegisterIndex(2) } + 1.4 | Call { location: 7 } + ... + 1.43 | Return +2 EXPR [ (1, _1) -2 ] +``` + +In this example, issuing a `break 1.2` command adds break on opcode 1.2, as denoted by the `*` character: + +``` +0 BLACKBOX::RANGE [(_0, num_bits: 32)] [ ] +1 -> BRILLIG inputs=[Single(Expression { mul_terms: [], linear_combinations: [(1, Witness(0))], q_c: 0 })] outputs=[Simple(Witness(1))] + 1.0 | Mov { destination: RegisterIndex(2), source: RegisterIndex(0) } + 1.1 | Const { destination: RegisterIndex(0), value: Value { inner: 0 } } + 1.2 | * Const { destination: RegisterIndex(1), value: Value { inner: 0 } } + 1.3 | Mov { destination: RegisterIndex(2), source: RegisterIndex(2) } + 1.4 | Call { location: 7 } + ... + 1.43 | Return +2 EXPR [ (1, _1) -2 ] +``` + +Running [the `continue` command](#continue-c) at this point would cause the debugger to execute the program until opcode 1.2. + +#### `delete [Opcode]` (or shorthand `d [Opcode]`) + +Deletes a breakpoint at an opcode location. Usage is analogous to [the `break` command](#). + +### Variable inspection + +#### vars + +Show variable values available at this point in execution. + +:::note +The ability to inspect variable values from the debugger depends on compilation to be run in a special debug instrumentation mode. This instrumentation weaves variable tracing code with the original source code. + +So variable value inspection comes at the expense of making the resulting ACIR bytecode bigger and harder to understand and optimize. + +If you find this compromise unacceptable, you can run the debugger with the flag `--skip-debug-instrumentation`. This will compile your circuit without any additional debug information, so the resulting ACIR bytecode will be identical to the one produced by standard Noir compilation. However, if you opt for this, the `vars` command will not be available while debugging. +::: + + +### Stacktrace + +#### `stacktrace` + +Displays the current stack trace. + + +### Witness map + +#### `witness` (w) + +Show witness map. For example: + +``` +_0 = 0 +_1 = 2 +_2 = 1 +``` + +#### `witness [Witness Index]` + +Display a single witness from the witness map. For example: + +``` +> witness 1 +_1 = 2 +``` + +#### `witness [Witness Index] [New value]` + +Overwrite the given index with a new value. For example: + +``` +> witness 1 3 +_1 = 3 +``` + + +### Unconstrained VM memory + +#### `memory` + +Show unconstrained VM memory state. For example: + +``` +> memory +At opcode 1.13: Store { destination_pointer: RegisterIndex(0), source: RegisterIndex(3) } +... +> registers +0 = 0 +1 = 10 +2 = 0 +3 = 1 +4 = 1 +5 = 2³² +6 = 1 +> into +At opcode 1.14: Const { destination: RegisterIndex(5), value: Value { inner: 1 } } +... +> memory +0 = 1 +> +``` + +In the example above: we start with clean memory, then step through a `Store` opcode which stores the value of register 3 (1) into the memory address stored in register 0 (0). Thus now `memory` shows memory address 0 contains value 1. + +:::note +This command is only functional while the debugger is executing unconstrained code. +::: + +#### `memset [Memory address] [New value]` + +Update a memory cell with the given value. For example: + +``` +> memory +0 = 1 +> memset 0 2 +> memory +0 = 2 +> memset 1 4 +> memory +0 = 2 +1 = 4 +> +``` + +:::note +This command is only functional while the debugger is executing unconstrained code. +::: \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/debugger_vscode.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/debugger_vscode.md new file mode 100644 index 00000000000..c027332b3b0 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/debugger/debugger_vscode.md @@ -0,0 +1,82 @@ +--- +title: VS Code Debugger +description: + VS Code Debugger configuration and features. +keywords: + [ + Nargo, + Noir CLI, + Noir Debugger, + VS Code, + IDE, + ] +sidebar_position: 0 +--- + +# VS Code Noir Debugger Reference + +The Noir debugger enabled by the vscode-noir extension ships with default settings such that the most common scenario should run without any additional configuration steps. + +These defaults can nevertheless be overridden by defining a launch configuration file. This page provides a reference for the properties you can override via a launch configuration file, as well as documenting the Nargo `dap` command, which is a dependency of the VS Code Noir debugger. + + +## Creating and editing launch configuration files + +To create a launch configuration file from VS Code, open the _debug pane_, and click on _create a launch.json file_. + +![Creating a launch configuration file](@site/static/img/debugger/ref1-create-launch.png) + +A `launch.json` file will be created, populated with basic defaults. + +### Noir Debugger launch.json properties + +#### projectFolder + +_String, optional._ + +Absolute path to the Nargo project to debug. By default, it is dynamically determined by looking for the nearest `Nargo.toml` file to the active file at the moment of launching the debugger. + +#### proverName + +_String, optional._ + +Name of the prover input to use. Defaults to `Prover`, which looks for a file named `Prover.toml` at the `projectFolder`. + +#### generateAcir + +_Boolean, optional._ + +If true, generate ACIR opcodes instead of unconstrained opcodes which will be closer to release binaries but less convenient for debugging. Defaults to `false`. + +#### skipInstrumentation + +_Boolean, optional._ + +Skips variables debugging instrumentation of code, making debugging less convenient but the resulting binary smaller and closer to production. Defaults to `false`. + +:::note +Skipping instrumentation causes the debugger to be unable to inspect local variables. +::: + +## `nargo dap [OPTIONS]` + +When run without any option flags, it starts the Nargo Debug Adapter Protocol server, which acts as the debugging backend for the VS Code Noir Debugger. + +All option flags are related to preflight checks. The Debug Adapter Protocol specifies how errors are to be informed from a running DAP server, but it doesn't specify mechanisms to communicate server initialization errors between the DAP server and its client IDE. + +Thus `nargo dap` ships with a _preflight check_ mode. If flag `--preflight-check` and the rest of the `--preflight-*` flags are provided, Nargo will run the same initialization routine except it will not start the DAP server. + +`vscode-noir` will then run `nargo dap` in preflight check mode first before a debugging session starts. If the preflight check ends in error, vscode-noir will present stderr and stdout output from this process through its own Output pane in VS Code. This makes it possible for users to diagnose what pieces of configuration might be wrong or missing in case of initialization errors. + +If the preflight check succeeds, `vscode-noir` proceeds to start the DAP server normally but running `nargo dap` without any additional flags. + +### Options + +| Option | Description | +| --------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `--preflight-check` | If present, dap runs in preflight check mode. | +| `--preflight-project-folder ` | Absolute path to the project to debug for preflight check. | +| `--preflight-prover-name ` | Name of prover file to use for preflight check | +| `--preflight-generate-acir` | Optional. If present, compile in ACIR mode while running preflight check. | +| `--preflight-skip-instrumentation` | Optional. If present, compile without introducing debug instrumentation while running preflight check. | +| `-h, --help` | Print help. | diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/nargo_commands.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/nargo_commands.md new file mode 100644 index 00000000000..9ca8252f121 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/nargo_commands.md @@ -0,0 +1,520 @@ +--- +title: Nargo +description: + Noir CLI Commands for Noir Prover and Verifier to create, execute, prove and verify programs, + generate Solidity verifier smart contract and compile into JSON file containing ACIR + representation and ABI of circuit. +keywords: + [ + Nargo, + Noir CLI, + Noir Prover, + Noir Verifier, + generate Solidity verifier, + compile JSON file, + ACIR representation, + ABI of circuit, + TypeScript, + ] +sidebar_position: 0 +--- + +# Command-Line Help for `nargo` + +This document contains the help content for the `nargo` command-line program. + +**Command Overview:** + +* [`nargo`↴](#nargo) +* [`nargo check`↴](#nargo-check) +* [`nargo fmt`↴](#nargo-fmt) +* [`nargo compile`↴](#nargo-compile) +* [`nargo new`↴](#nargo-new) +* [`nargo init`↴](#nargo-init) +* [`nargo execute`↴](#nargo-execute) +* [`nargo debug`↴](#nargo-debug) +* [`nargo test`↴](#nargo-test) +* [`nargo info`↴](#nargo-info) +* [`nargo lsp`↴](#nargo-lsp) +* [`nargo generate-completion-script`↴](#nargo-generate-completion-script) + +## `nargo` + +Noir's package manager + +**Usage:** `nargo ` + +###### **Subcommands:** + +* `check` — Checks the constraint system for errors +* `fmt` — Format the Noir files in a workspace +* `compile` — Compile the program and its secret execution trace into ACIR format +* `new` — Create a Noir project in a new directory +* `init` — Create a Noir project in the current directory +* `execute` — Executes a circuit to calculate its return value +* `debug` — Executes a circuit in debug mode +* `test` — Run the tests for this program +* `info` — Provides detailed information on each of a program's function (represented by a single circuit) +* `lsp` — Starts the Noir LSP server +* `generate-completion-script` — Generates a shell completion script for your favorite shell + +###### **Options:** + + + + +## `nargo check` + +Checks the constraint system for errors + +**Usage:** `nargo check [OPTIONS]` + +###### **Options:** + +* `--package ` — The name of the package to run the command on. By default run on the first one found moving up along the ancestors of the current directory +* `--workspace` — Run on all packages in the workspace + + Possible values: `true`, `false` + +* `--overwrite` — Force overwrite of existing files + + Possible values: `true`, `false` + +* `--expression-width ` — Specify the backend expression width that should be targeted +* `--bounded-codegen` — Generate ACIR with the target backend expression width. The default is to generate ACIR without a bound and split expressions after code generation. Activating this flag can sometimes provide optimizations for certain programs + + Default value: `false` + + Possible values: `true`, `false` + +* `--force` — Force a full recompilation + + Possible values: `true`, `false` + +* `--print-acir` — Display the ACIR for compiled circuit + + Possible values: `true`, `false` + +* `--deny-warnings` — Treat all warnings as errors + + Possible values: `true`, `false` + +* `--silence-warnings` — Suppress warnings + + Possible values: `true`, `false` + +* `--debug-comptime-in-file ` — Enable printing results of comptime evaluation: provide a path suffix for the module to debug, e.g. "package_name/src/main.nr" +* `--skip-underconstrained-check` — Flag to turn off the compiler check for under constrained values. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + +* `--skip-brillig-constraints-check` — Flag to turn off the compiler check for missing Brillig call constrains. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + + + + +## `nargo fmt` + +Format the Noir files in a workspace + +**Usage:** `nargo fmt [OPTIONS]` + +###### **Options:** + +* `--check` — Run noirfmt in check mode + + Possible values: `true`, `false` + +* `--package ` — The name of the package to run the command on. By default run on the first one found moving up along the ancestors of the current directory +* `--workspace` — Run on all packages in the workspace + + Possible values: `true`, `false` + + + + +## `nargo compile` + +Compile the program and its secret execution trace into ACIR format + +**Usage:** `nargo compile [OPTIONS]` + +###### **Options:** + +* `--package ` — The name of the package to run the command on. By default run on the first one found moving up along the ancestors of the current directory +* `--workspace` — Run on all packages in the workspace + + Possible values: `true`, `false` + +* `--expression-width ` — Specify the backend expression width that should be targeted +* `--bounded-codegen` — Generate ACIR with the target backend expression width. The default is to generate ACIR without a bound and split expressions after code generation. Activating this flag can sometimes provide optimizations for certain programs + + Default value: `false` + + Possible values: `true`, `false` + +* `--force` — Force a full recompilation + + Possible values: `true`, `false` + +* `--print-acir` — Display the ACIR for compiled circuit + + Possible values: `true`, `false` + +* `--deny-warnings` — Treat all warnings as errors + + Possible values: `true`, `false` + +* `--silence-warnings` — Suppress warnings + + Possible values: `true`, `false` + +* `--debug-comptime-in-file ` — Enable printing results of comptime evaluation: provide a path suffix for the module to debug, e.g. "package_name/src/main.nr" +* `--skip-underconstrained-check` — Flag to turn off the compiler check for under constrained values. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + +* `--skip-brillig-constraints-check` — Flag to turn off the compiler check for missing Brillig call constrains. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + + + + +## `nargo new` + +Create a Noir project in a new directory + +**Usage:** `nargo new [OPTIONS] ` + +###### **Arguments:** + +* `` — The path to save the new project + +###### **Options:** + +* `--name ` — Name of the package [default: package directory name] +* `--lib` — Use a library template + + Possible values: `true`, `false` + +* `--bin` — Use a binary template [default] + + Possible values: `true`, `false` + +* `--contract` — Use a contract template + + Possible values: `true`, `false` + + + + +## `nargo init` + +Create a Noir project in the current directory + +**Usage:** `nargo init [OPTIONS]` + +###### **Options:** + +* `--name ` — Name of the package [default: current directory name] +* `--lib` — Use a library template + + Possible values: `true`, `false` + +* `--bin` — Use a binary template [default] + + Possible values: `true`, `false` + +* `--contract` — Use a contract template + + Possible values: `true`, `false` + + + + +## `nargo execute` + +Executes a circuit to calculate its return value + +**Usage:** `nargo execute [OPTIONS] [WITNESS_NAME]` + +###### **Arguments:** + +* `` — Write the execution witness to named file + +Defaults to the name of the package being executed. + +###### **Options:** + +* `-p`, `--prover-name ` — The name of the toml file which contains the inputs for the prover + + Default value: `Prover` +* `--package ` — The name of the package to run the command on. By default run on the first one found moving up along the ancestors of the current directory +* `--workspace` — Run on all packages in the workspace + + Possible values: `true`, `false` + +* `--expression-width ` — Specify the backend expression width that should be targeted +* `--bounded-codegen` — Generate ACIR with the target backend expression width. The default is to generate ACIR without a bound and split expressions after code generation. Activating this flag can sometimes provide optimizations for certain programs + + Default value: `false` + + Possible values: `true`, `false` + +* `--force` — Force a full recompilation + + Possible values: `true`, `false` + +* `--print-acir` — Display the ACIR for compiled circuit + + Possible values: `true`, `false` + +* `--deny-warnings` — Treat all warnings as errors + + Possible values: `true`, `false` + +* `--silence-warnings` — Suppress warnings + + Possible values: `true`, `false` + +* `--debug-comptime-in-file ` — Enable printing results of comptime evaluation: provide a path suffix for the module to debug, e.g. "package_name/src/main.nr" +* `--skip-underconstrained-check` — Flag to turn off the compiler check for under constrained values. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + +* `--skip-brillig-constraints-check` — Flag to turn off the compiler check for missing Brillig call constrains. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + +* `--oracle-resolver ` — JSON RPC url to solve oracle calls + + + +## `nargo debug` + +Executes a circuit in debug mode + +**Usage:** `nargo debug [OPTIONS] [WITNESS_NAME]` + +###### **Arguments:** + +* `` — Write the execution witness to named file + +###### **Options:** + +* `-p`, `--prover-name ` — The name of the toml file which contains the inputs for the prover + + Default value: `Prover` +* `--package ` — The name of the package to execute +* `--expression-width ` — Specify the backend expression width that should be targeted +* `--bounded-codegen` — Generate ACIR with the target backend expression width. The default is to generate ACIR without a bound and split expressions after code generation. Activating this flag can sometimes provide optimizations for certain programs + + Default value: `false` + + Possible values: `true`, `false` + +* `--force` — Force a full recompilation + + Possible values: `true`, `false` + +* `--print-acir` — Display the ACIR for compiled circuit + + Possible values: `true`, `false` + +* `--deny-warnings` — Treat all warnings as errors + + Possible values: `true`, `false` + +* `--silence-warnings` — Suppress warnings + + Possible values: `true`, `false` + +* `--debug-comptime-in-file ` — Enable printing results of comptime evaluation: provide a path suffix for the module to debug, e.g. "package_name/src/main.nr" +* `--skip-underconstrained-check` — Flag to turn off the compiler check for under constrained values. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + +* `--skip-brillig-constraints-check` — Flag to turn off the compiler check for missing Brillig call constrains. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + +* `--acir-mode` — Force ACIR output (disabling instrumentation) + + Possible values: `true`, `false` + +* `--skip-instrumentation ` — Disable vars debug instrumentation (enabled by default) + + Possible values: `true`, `false` + + + + +## `nargo test` + +Run the tests for this program + +**Usage:** `nargo test [OPTIONS] [TEST_NAME]` + +###### **Arguments:** + +* `` — If given, only tests with names containing this string will be run + +###### **Options:** + +* `--show-output` — Display output of `println` statements + + Possible values: `true`, `false` + +* `--exact` — Only run tests that match exactly + + Possible values: `true`, `false` + +* `--package ` — The name of the package to run the command on. By default run on the first one found moving up along the ancestors of the current directory +* `--workspace` — Run on all packages in the workspace + + Possible values: `true`, `false` + +* `--expression-width ` — Specify the backend expression width that should be targeted +* `--bounded-codegen` — Generate ACIR with the target backend expression width. The default is to generate ACIR without a bound and split expressions after code generation. Activating this flag can sometimes provide optimizations for certain programs + + Default value: `false` + + Possible values: `true`, `false` + +* `--force` — Force a full recompilation + + Possible values: `true`, `false` + +* `--print-acir` — Display the ACIR for compiled circuit + + Possible values: `true`, `false` + +* `--deny-warnings` — Treat all warnings as errors + + Possible values: `true`, `false` + +* `--silence-warnings` — Suppress warnings + + Possible values: `true`, `false` + +* `--debug-comptime-in-file ` — Enable printing results of comptime evaluation: provide a path suffix for the module to debug, e.g. "package_name/src/main.nr" +* `--skip-underconstrained-check` — Flag to turn off the compiler check for under constrained values. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + +* `--skip-brillig-constraints-check` — Flag to turn off the compiler check for missing Brillig call constrains. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + +* `--oracle-resolver ` — JSON RPC url to solve oracle calls +* `--test-threads ` — Number of threads used for running tests in parallel + + Default value: `4` +* `--format ` — Configure formatting of output + + Possible values: + - `pretty`: + Print verbose output + - `terse`: + Display one character per test + - `json`: + Output a JSON Lines document + +* `-q`, `--quiet` — Display one character per test instead of one line + + Possible values: `true`, `false` + + + + +## `nargo info` + +Provides detailed information on each of a program's function (represented by a single circuit) + +Current information provided per circuit: 1. The number of ACIR opcodes 2. Counts the final number gates in the circuit used by a backend + +**Usage:** `nargo info [OPTIONS]` + +###### **Options:** + +* `--package ` — The name of the package to run the command on. By default run on the first one found moving up along the ancestors of the current directory +* `--workspace` — Run on all packages in the workspace + + Possible values: `true`, `false` + +* `--profile-execution` + + Possible values: `true`, `false` + +* `-p`, `--prover-name ` — The name of the toml file which contains the inputs for the prover + + Default value: `Prover` +* `--expression-width ` — Specify the backend expression width that should be targeted +* `--bounded-codegen` — Generate ACIR with the target backend expression width. The default is to generate ACIR without a bound and split expressions after code generation. Activating this flag can sometimes provide optimizations for certain programs + + Default value: `false` + + Possible values: `true`, `false` + +* `--force` — Force a full recompilation + + Possible values: `true`, `false` + +* `--print-acir` — Display the ACIR for compiled circuit + + Possible values: `true`, `false` + +* `--deny-warnings` — Treat all warnings as errors + + Possible values: `true`, `false` + +* `--silence-warnings` — Suppress warnings + + Possible values: `true`, `false` + +* `--debug-comptime-in-file ` — Enable printing results of comptime evaluation: provide a path suffix for the module to debug, e.g. "package_name/src/main.nr" +* `--skip-underconstrained-check` — Flag to turn off the compiler check for under constrained values. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + +* `--skip-brillig-constraints-check` — Flag to turn off the compiler check for missing Brillig call constrains. Warning: This can improve compilation speed but can also lead to correctness errors. This check should always be run on production code + + Possible values: `true`, `false` + + + + +## `nargo lsp` + +Starts the Noir LSP server + +Starts an LSP server which allows IDEs such as VS Code to display diagnostics in Noir source. + +VS Code Noir Language Support: https://marketplace.visualstudio.com/items?itemName=noir-lang.vscode-noir + +**Usage:** `nargo lsp` + + + +## `nargo generate-completion-script` + +Generates a shell completion script for your favorite shell + +**Usage:** `nargo generate-completion-script ` + +###### **Arguments:** + +* `` — The shell to generate completions for. One of: bash, elvish, fish, powershell, zsh + + + +
+ + + This document was generated automatically by + clap-markdown. + + diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/noir_codegen.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/noir_codegen.md new file mode 100644 index 00000000000..e4c362f9610 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/reference/noir_codegen.md @@ -0,0 +1,116 @@ +--- +title: Noir Codegen for TypeScript +description: Learn how to use Noir codegen to generate TypeScript bindings +keywords: [Nargo, Noir, compile, TypeScript] +sidebar_position: 3 +--- + +When using TypeScript, it is extra work to interpret Noir program outputs in a type-safe way. Third party libraries may exist for popular Noir programs, but they are either hard to find or unmaintained. + +Now you can generate TypeScript bindings for your Noir programs in two steps: + +1. Exporting Noir functions using `nargo export` +2. Using the TypeScript module `noir_codegen` to generate TypeScript binding + +**Note:** you can only export functions from a Noir *library* (not binary or contract program types). + +## Installation + +### Your TypeScript project + +If you don't already have a TypeScript project you can add the module with `yarn` (or `npm`), then initialize it: + +```bash +yarn add typescript -D +npx tsc --init +``` + +### Add TypeScript module - `noir_codegen` + +The following command will add the module to your project's devDependencies: + +```bash +yarn add @noir-lang/noir_codegen -D +``` + +### Nargo library + +Make sure you have Nargo, v0.25.0 or greater, installed. If you don't, follow the [installation guide](../getting_started/noir_installation.md). + +If you're in a new project, make a `circuits` folder and create a new Noir library: + +```bash +mkdir circuits && cd circuits +nargo new --lib myNoirLib +``` + +## Usage + +### Export ABI of specified functions + +First go to the `.nr` files in your Noir library, and add the `#[export]` macro to each function that you want to use in TypeScript. + +```rust +#[export] +fn your_function(... +``` + +From your Noir library (where `Nargo.toml` is), run the following command: + +```bash +nargo export +``` + +You will now have an `export` directory with a .json file per exported function. + +You can also specify the directory of Noir programs using `--program-dir`, for example: + +```bash +nargo export --program-dir=./circuits/myNoirLib +``` + +### Generate TypeScript bindings from exported functions + +To use the `noir-codegen` package we added to the TypeScript project: + +```bash +yarn noir-codegen ./export/your_function.json +``` + +This creates an `exports` directory with an `index.ts` file containing all exported functions. + +**Note:** adding `--out-dir` allows you to specify an output dir for your TypeScript bindings to go. Eg: + +```bash +yarn noir-codegen ./export/*.json --out-dir ./path/to/output/dir +``` + +## Example .nr function to .ts output + +Consider a Noir library with this function: + +```rust +#[export] +fn not_equal(x: Field, y: Field) -> bool { + x != y +} +``` + +After the export and codegen steps, you should have an `index.ts` like: + +```typescript +export type Field = string; + + +export const is_equal_circuit: CompiledCircuit = +{"abi":{"parameters":[{"name":"x","type":{"kind":"field"},"visibility":"private"},{"name":"y","type":{"kind":"field"},"visibility":"private"}],"return_type":{"abi_type":{"kind":"boolean"},"visibility":"private"}},"bytecode":"H4sIAAAAAAAA/7WUMQ7DIAxFQ0Krrr2JjSGYLVcpKrn/CaqqDQN12WK+hPBgmWd/wEyHbF1SS923uhOs3pfoChI+wKXMAXzIKyNj4PB0TFTYc0w5RUjoqeAeEu1wqK0F54RGkWvW44LPzExnlkbMEs4JNZmN8PxS42uHv82T8a3Jeyn2Ks+VLPcO558HmyLMCDOXAXXtpPt4R/Rt9T36ss6dS9HGPx/eG17nGegKBQAA"}; + +export async function is_equal(x: Field, y: Field, foreignCallHandler?: ForeignCallHandler): Promise { + const program = new Noir(is_equal_circuit); + const args: InputMap = { x, y }; + const { returnValue } = await program.execute(args, foreignCallHandler); + return returnValue as boolean; +} +``` + +Now the `is_equal()` function and relevant types are readily available for use in TypeScript. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tooling/debugger.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tooling/debugger.md new file mode 100644 index 00000000000..200b5fc423a --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tooling/debugger.md @@ -0,0 +1,26 @@ +--- +title: Debugger +description: Learn about the Noir Debugger, in its REPL or VS Code versions. +keywords: [Nargo, VSCode, Visual Studio Code, REPL, Debugger] +sidebar_position: 2 +--- + +# Noir Debugger + +There are currently two ways of debugging Noir programs: + +1. From VS Code, via the [vscode-noir](https://github.com/noir-lang/vscode-noir) extension. You can install it via the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=noir-lang.vscode-noir). +2. Via the REPL debugger, which ships with Nargo. + +In order to use either version of the debugger, you will need to install recent enough versions of Noir, [Nargo](../getting_started/noir_installation.md) and vscode-noir: + +- Noir & Nargo ≥0.28.0 +- Noir's VS Code extension ≥0.0.11 + +:::info +At the moment, the debugger supports debugging binary projects, but not contracts. +::: + +We cover the VS Code Noir debugger more in depth in [its VS Code debugger how-to guide](../how_to/debugger/debugging_with_vs_code.md) and [the reference](../reference/debugger/debugger_vscode.md). + +The REPL debugger is discussed at length in [the REPL debugger how-to guide](../how_to/debugger/debugging_with_the_repl.md) and [the reference](../reference/debugger/debugger_repl.md). diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tooling/language_server.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tooling/language_server.md new file mode 100644 index 00000000000..81e0356ef8a --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tooling/language_server.md @@ -0,0 +1,43 @@ +--- +title: Language Server +description: Learn about the Noir Language Server, how to install the components, and configuration that may be required. +keywords: [Nargo, Language Server, LSP, VSCode, Visual Studio Code] +sidebar_position: 0 +--- + +This section helps you install and configure the Noir Language Server. + +The Language Server Protocol (LSP) has two components, the [Server](#language-server) and the [Client](#language-client). Below we describe each in the context of Noir. + +## Language Server + +The Server component is provided by the Nargo command line tool that you installed at the beginning of this guide. +As long as Nargo is installed and you've used it to run other commands in this guide, it should be good to go! + +If you'd like to verify that the `nargo lsp` command is available, you can run `nargo --help` and look for `lsp` in the list of commands. If you see it, you're using a version of Noir with LSP support. + +## Language Client + +The Client component is usually an editor plugin that launches the Server. It communicates LSP messages between the editor and the Server. For example, when you save a file, the Client will alert the Server, so it can try to compile the project and report any errors. + +Currently, Noir provides a Language Client for Visual Studio Code via the [vscode-noir](https://github.com/noir-lang/vscode-noir) extension. You can install it via the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=noir-lang.vscode-noir). + +> **Note:** Noir's Language Server Protocol support currently assumes users' VSCode workspace root to be the same as users' Noir project root (i.e. where Nargo.toml lies). +> +> If LSP features seem to be missing / malfunctioning, make sure you are opening your Noir project directly (instead of as a sub-folder) in your VSCode instance. + +When your language server is running correctly and the VSCode plugin is installed, you should see handy codelens buttons for compilation, measuring circuit size, execution, and tests: + +![Compile and Execute](@site/static/img/codelens_compile_execute.png) +![Run test](@site/static/img/codelens_run_test.png) + +You should also see your tests in the `testing` panel: + +![Testing panel](@site/static/img/codelens_testing_panel.png) + +### Configuration + +- **Noir: Enable LSP** - If checked, the extension will launch the Language Server via `nargo lsp` and communicate with it. +- **Noir: Nargo Flags** - Additional flags may be specified if you require them to be added when the extension calls `nargo lsp`. +- **Noir: Nargo Path** - An absolute path to a Nargo binary with the `lsp` command. This may be useful if Nargo is not within the `PATH` of your editor. +- **Noir > Trace: Server** - Setting this to `"messages"` or `"verbose"` will log LSP messages between the Client and Server. Useful for debugging. diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tooling/testing.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tooling/testing.md new file mode 100644 index 00000000000..866677da567 --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tooling/testing.md @@ -0,0 +1,79 @@ +--- +title: Testing in Noir +description: Learn how to use Nargo to test your Noir program in a quick and easy way +keywords: [Nargo, testing, Noir, compile, test] +sidebar_position: 1 +--- + +You can test your Noir programs using Noir circuits. + +Nargo will automatically compile and run any functions which have the decorator `#[test]` on them if +you run `nargo test`. + +For example if you have a program like: + +```rust +fn add(x: u64, y: u64) -> u64 { + x + y +} +#[test] +fn test_add() { + assert(add(2,2) == 4); + assert(add(0,1) == 1); + assert(add(1,0) == 1); +} +``` + +Running `nargo test` will test that the `test_add` function can be executed while satisfying all +the constraints which allows you to test that add returns the expected values. Test functions can't +have any arguments currently. + +### Test fail + +You can write tests that are expected to fail by using the decorator `#[test(should_fail)]`. For example: + +```rust +fn add(x: u64, y: u64) -> u64 { + x + y +} +#[test(should_fail)] +fn test_add() { + assert(add(2,2) == 5); +} +``` + +You can be more specific and make it fail with a specific reason by using `should_fail_with = ""`: + +```rust +fn main(african_swallow_avg_speed : Field) { + assert(african_swallow_avg_speed == 65, "What is the airspeed velocity of an unladen swallow"); +} + +#[test] +fn test_king_arthur() { + main(65); +} + +#[test(should_fail_with = "What is the airspeed velocity of an unladen swallow")] +fn test_bridgekeeper() { + main(32); +} +``` + +The string given to `should_fail_with` doesn't need to exactly match the failure reason, it just needs to be a substring of it: + +```rust +fn main(african_swallow_avg_speed : Field) { + assert(african_swallow_avg_speed == 65, "What is the airspeed velocity of an unladen swallow"); +} + +#[test] +fn test_king_arthur() { + main(65); +} + +#[test(should_fail_with = "airspeed velocity")] +fn test_bridgekeeper() { + main(32); +} +``` \ No newline at end of file diff --git a/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tutorials/noirjs_app.md b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tutorials/noirjs_app.md new file mode 100644 index 00000000000..8967ee005ce --- /dev/null +++ b/noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.1/tutorials/noirjs_app.md @@ -0,0 +1,306 @@ +--- +title: Building a web app with Noir and Barretenberg +description: Learn how to setup a new app that uses Noir to generate and verify zero-knowledge SNARK proofs in a typescript or javascript environment. +keywords: [how to, guide, javascript, typescript, noir, barretenberg, zero-knowledge, proofs, app] +sidebar_position: 0 +pagination_next: noir/concepts/data_types/index +--- + +NoirJS is a Typescript package meant to work both in a browser and a server environment. + +In this tutorial, we will combine NoirJS with Aztec's Barretenberg backend to build a simple web app. From here, you should get an idea on how to proceed with your own Noir projects! + +You can find the complete app code for this guide [here](https://github.com/noir-lang/tiny-noirjs-app). + +## Dependencies + +Before we start, we want to make sure we have Node installed. For convenience (and speed), we can just install [Bun](https://bun.sh) as our package manager, and Node will work out-of-the-box: + +```bash +curl -fsSL https://bun.sh/install | bash +``` + +Let's go barebones. Doing the bare minimum is not only simple, but also allows you to easily adapt it to almost any frontend framework. + +Barebones means we can immediately start with the dependencies even on an empty folder 😈: + +```bash +bun i @noir-lang/noir_wasm@1.0.0-beta.0 @noir-lang/noir_js@1.0.0-beta.0 @aztec/bb.js@0.63.1 +``` + +Wait, what are these dependencies? + +- `noir_wasm` is the `wasm` version of the Noir compiler. Although most developers prefer to use `nargo` for compiling, there's nothing wrong with `noir_wasm`. We like `noir_wasm`. +- `noir_js` is the main Noir package. It will execute our program, and generate the witness that will be sent to the backend. +- `bb.js` is the Typescript interface for Aztec's Barretenberg proving backend. It also uses the `wasm` version in order to run on the browser. + +:::info + +In this guide, we will install versions pinned to 1.0.0-beta.0. These work with Barretenberg version 0.63.1, so we are using that one version too. Feel free to try with older or later versions, though! + +::: + +## Setting up our Noir program + +ZK is a powerful technology. An app that reveals computational correctness but doesn't reveal some of its inputs is almost unbelievable, yet Noir makes it as easy as a single line of code. + +:::tip + +It's not just you. We also enjoy syntax highlighting. [Check out the Language Server](../tooling/language_server.md) + +::: + +All you need is a `main.nr` and a `Nargo.toml` file. You can follow the [noirup](../getting_started/noir_installation.md) installation and just run `noirup -v 1.0.0-beta.0`, or just create them by hand: + +```bash +mkdir -p circuit/src +touch circuit/src/main.nr circuit/Nargo.toml +``` + +To make our program interesting, let's give it a real use-case scenario: Bob wants to prove he is older than 18, without disclosing his age. Open `main.nr` and write: + +```rust +fn main(age: u8) { + assert(age >= 18); +} +``` + +This program accepts a private input called age, and simply proves this number is higher than 18. But to run this code, we need to give the compiler a `Nargo.toml` with at least a name and a type: + +```toml +[package] +name = "circuit" +type = "bin" +``` + +This is all that we need to get started with Noir. + +![my heart is ready for you, noir.js](@site/static/img/memes/titanic.jpeg) + +## Setting up our app + +Remember when apps only had one `html` and one `js` file? Well, that's enough for Noir webapps. Let's create them: + +```bash +touch index.html index.js +``` + +And add something useful to our HTML file: + +```html + + + + + + +

Noir app

+
+ + +
+
+

Logs

+

Proof

+
+ + +``` + +It _could_ be a beautiful UI... Depending on which universe you live in. In any case, we're using some scary CSS to make two boxes that will show cool things on the screen. + +As for the JS, real madmen could just `console.log` everything, but let's say we want to see things happening (the true initial purpose of JS... right?). Here's some boilerplate for that. Just paste it in `index.js`: + +```js +const show = (id, content) => { + const container = document.getElementById(id); + container.appendChild(document.createTextNode(content)); + container.appendChild(document.createElement("br")); +}; + +document.getElementById("submit").addEventListener("click", async () => { + try { + // noir goes here + } catch { + show("logs", "Oh 💔"); + } +}); + +``` + +:::info + +At this point in the tutorial, your folder structure should look like this: + +```tree +. +└── circuit + └── src + └── main.nr + Nargo.toml + index.js + package.json + index.html + ...etc +``` + +::: + +## Compile compile compile + +Finally we're up for something cool. But before we can execute a Noir program, we need to compile it into ACIR: an abstract representation. Here's where `noir_wasm` comes in. + +`noir_wasm` expects a filesystem so it can resolve dependencies. While we could use the `public` folder, let's just import those using the nice `?url` syntax provided by vite. At the top of the file: + +```js +import { compile, createFileManager } from "@noir-lang/noir_wasm" + +import main from "./circuit/src/main.nr?url"; +import nargoToml from "./circuit/Nargo.toml?url"; +``` + +Compiling on the browser is common enough that `createFileManager` already gives us a nice in-memory filesystem we can use. So all we need to compile is fetching these files, writing them to our filesystem, and compile. Add this function: + +```js +export async function getCircuit() { + const fm = createFileManager("/"); + const { body } = await fetch(main); + const { body: nargoTomlBody } = await fetch(nargoToml); + + fm.writeFile("./src/main.nr", body); + fm.writeFile("./Nargo.toml", nargoTomlBody); + return await compile(fm); +} +``` + +:::tip + +As you can imagine, with `node` it's all conveniently easier since you get native access to `fs`... + +::: + +## Some more JS + +We're starting with the good stuff now. We want to execute our circuit to get the witness, and then feed that witness to Barretenberg. Luckily, both packages are quite easy to work with. Let's import them at the top of the file: + +```js +import { UltraHonkBackend } from '@aztec/bb.js'; +import { Noir } from '@noir-lang/noir_js'; +``` + +And instantiate them inside our try-catch block: + +```ts +// try { +const { program } = await getCircuit(); +const noir = new Noir(program); +const backend = new UltraHonkBackend(program.bytecode); +// } +``` + +:::warning + +WASMs are not always easy to work with. In our case, `vite` likes serving them with the wrong MIME type. There are different fixes but we found the easiest one is just YOLO instantiating the WASMs manually. Paste this at the top of the file, just below the other imports, and it will work just fine: + +```js +import initNoirC from "@noir-lang/noirc_abi"; +import initACVM from "@noir-lang/acvm_js"; +import acvm from "@noir-lang/acvm_js/web/acvm_js_bg.wasm?url"; +import noirc from "@noir-lang/noirc_abi/web/noirc_abi_wasm_bg.wasm?url"; +await Promise.all([initACVM(fetch(acvm)), initNoirC(fetch(noirc))]); +``` + +::: + +## Executing and proving + +Now for the app itself. We're capturing whatever is in the input when people press the submit button. Inside our `try` block, let's just grab that input and get its value. Noir will gladly execute it, and give us a witness: + +```js +const age = document.getElementById("age").value; +show("logs", "Generating witness... ⏳"); +const { witness } = await noir.execute({ age }); +show("logs", "Generated witness... ✅"); + +``` + +:::note + +For the remainder of the tutorial, everything will be happening inside the `try` block + +::: + +Now we're ready to prove stuff! Let's feed some inputs to our circuit and calculate the proof: + +```js +show("logs", "Generating proof... ⏳"); +const proof = await backend.generateProof(witness); +show("logs", "Generated proof... ✅"); +show("results", proof.proof); +``` + +Our program is technically **done** . You're probably eager to see stuff happening! To serve this in a convenient way, we can use a bundler like `vite` by creating a `vite.config.js` file: + +```bash +touch vite.config.js +``` + +`vite` helps us with a little catch: `bb.js` in particular uses top-level awaits which aren't supported everywhere. So we can add this to the `vite.config.js` to make the bundler optimize them: + +```js +export default { optimizeDeps: { esbuildOptions: { target: "esnext" } } }; +``` + +This should be enough for vite. We don't even need to install it, just run: + +```bash +bunx vite +``` + +If it doesn't open a browser for you, just visit `localhost:5173`. You should now see the worst UI ever, with an ugly input. + +![Noir Webapp UI](@site/static/img/tutorials/noirjs_webapp/webapp1.png) + +Now, our circuit requires a private input `fn main(age: u8)`, and fails if it is less than 18. Let's see if it works. Submit any number above 18 (as long as it fits in 8 bits) and you should get a valid proof. Otherwise the proof won't even generate correctly. + +By the way, if you're human, you shouldn't be able to understand anything on the "proof" box. That's OK. We like you, human ❤️. + +## Verifying + +Time to celebrate, yes! But we shouldn't trust machines so blindly. Let's add these lines to see our proof being verified: + +```js +show('logs', 'Verifying proof... ⌛'); +const isValid = await backend.verifyProof(proof); +show("logs", `Proof is ${isValid ? "valid" : "invalid"}... ✅`); +``` + +You have successfully generated a client-side Noir web app! + +![coded app without math knowledge](@site/static/img/memes/flextape.jpeg) + +## Next steps + +At this point, you have a working ZK app that works on the browser. Actually, it works on a mobile phone too! + +If you want to continue learning by doing, here are some challenges for you: + +- Install [nargo](https://noir-lang.org/docs/getting_started/noir_installation) and write [Noir tests](../tooling/testing) +- Change the circuit to accept a [public input](../noir/concepts/data_types/#private--public-types) as the cutoff age. It could be different depending on the purpose, for example! +- Enjoy Noir's Rust-like syntax and write a struct `Country` that implements a trait `MinAge` with a method `get_min_age`. Then, make a struct `Person` have an `u8` as its age and a country of type `Country`. You can pass a `person` in JS just like a JSON object `person: { age, country: { min_age: 18 }}` + +The world is your stage, just have fun with ZK! You can see how noirjs is used in a full stack Next.js hardhat application in the [noir-starter repo here](https://github.com/noir-lang/noir-starter/tree/main/vite-hardhat). The example shows how to calculate a proof in the browser and verify it with a deployed Solidity verifier contract from noirjs. + +Check out other starters, tools, or just cool projects in the [awesome noir repository](https://github.com/noir-lang/awesome-noir). diff --git a/noir/noir-repo/docs/versioned_sidebars/version-v1.0.0-beta.1-sidebars.json b/noir/noir-repo/docs/versioned_sidebars/version-v1.0.0-beta.1-sidebars.json new file mode 100644 index 00000000000..b9ad026f69f --- /dev/null +++ b/noir/noir-repo/docs/versioned_sidebars/version-v1.0.0-beta.1-sidebars.json @@ -0,0 +1,93 @@ +{ + "sidebar": [ + { + "type": "doc", + "id": "index" + }, + { + "type": "category", + "label": "Getting Started", + "items": [ + { + "type": "autogenerated", + "dirName": "getting_started" + } + ] + }, + { + "type": "category", + "label": "The Noir Language", + "items": [ + { + "type": "autogenerated", + "dirName": "noir" + } + ] + }, + { + "type": "html", + "value": "
", + "defaultStyle": true + }, + { + "type": "category", + "label": "How To Guides", + "items": [ + { + "type": "autogenerated", + "dirName": "how_to" + } + ] + }, + { + "type": "category", + "label": "Explainers", + "items": [ + { + "type": "autogenerated", + "dirName": "explainers" + } + ] + }, + { + "type": "category", + "label": "Tutorials", + "items": [ + { + "type": "autogenerated", + "dirName": "tutorials" + } + ] + }, + { + "type": "category", + "label": "Reference", + "items": [ + { + "type": "autogenerated", + "dirName": "reference" + } + ] + }, + { + "type": "category", + "label": "Tooling", + "items": [ + { + "type": "autogenerated", + "dirName": "tooling" + } + ] + }, + { + "type": "html", + "value": "
", + "defaultStyle": true + }, + { + "type": "doc", + "id": "migration_notes", + "label": "Migration notes" + } + ] +} diff --git a/noir/noir-repo/noir_stdlib/src/bigint.nr b/noir/noir-repo/noir_stdlib/src/bigint.nr index c94a7a75f25..6ce3ea7d72a 100644 --- a/noir/noir-repo/noir_stdlib/src/bigint.nr +++ b/noir/noir-repo/noir_stdlib/src/bigint.nr @@ -33,17 +33,17 @@ pub struct BigInt { // docs:end:big_int_definition impl BigInt { - #[builtin(bigint_add)] + #[foreign(bigint_add)] fn bigint_add(self, other: BigInt) -> BigInt {} - #[builtin(bigint_sub)] + #[foreign(bigint_sub)] fn bigint_sub(self, other: BigInt) -> BigInt {} - #[builtin(bigint_mul)] + #[foreign(bigint_mul)] fn bigint_mul(self, other: BigInt) -> BigInt {} - #[builtin(bigint_div)] + #[foreign(bigint_div)] fn bigint_div(self, other: BigInt) -> BigInt {} - #[builtin(bigint_from_le_bytes)] + #[foreign(bigint_from_le_bytes)] fn from_le_bytes(bytes: [u8], modulus: [u8]) -> BigInt {} - #[builtin(bigint_to_le_bytes)] + #[foreign(bigint_to_le_bytes)] fn to_le_bytes(self) -> [u8; 32] {} fn check_32_bytes(self: Self, other: BigInt) -> bool { diff --git a/noir/noir-repo/test_programs/gates_report.sh b/noir/noir-repo/test_programs/gates_report.sh index b7698f1ca78..c92346f40e8 100755 --- a/noir/noir-repo/test_programs/gates_report.sh +++ b/noir/noir-repo/test_programs/gates_report.sh @@ -24,7 +24,7 @@ for pathname in $test_dirs; do fi GATES_INFO=$($BACKEND gates -b "$artifacts_path/$ARTIFACT_NAME/target/program.json") - MAIN_FUNCTION_INFO=$(echo $GATES_INFO | jq -r ".functions[0] | {package_name: "\"$ARTIFACT_NAME\"", functions: [{name: \"main\", acir_opcodes, opcodes: .acir_opcodes, circuit_size}]}") + MAIN_FUNCTION_INFO=$(echo $GATES_INFO | jq -r ".functions[0] | {package_name: "\"$ARTIFACT_NAME\"", functions: [{name: \"main\", acir_opcodes, opcodes: .acir_opcodes, circuit_size}], unconstrained_functions: []}") echo -n $MAIN_FUNCTION_INFO >> gates_report.json if (($ITER == $NUM_ARTIFACTS)); then diff --git a/noir/noir-repo/test_programs/memory_report.sh b/noir/noir-repo/test_programs/memory_report.sh index 4d03726d374..e501464c198 100755 --- a/noir/noir-repo/test_programs/memory_report.sh +++ b/noir/noir-repo/test_programs/memory_report.sh @@ -12,7 +12,7 @@ current_dir=$(pwd) base_path="$current_dir/execution_success" # If there is an argument that means we want to generate a report for only the current directory -if [ "$#" -ne 0 ]; then +if [ "$1" == "1" ]; then base_path="$current_dir" tests_to_profile=(".") fi @@ -31,11 +31,16 @@ for test_name in ${tests_to_profile[@]}; do echo " ," >> $current_dir"/memory_report.json" fi - if [ "$#" -ne 0 ]; then + if [ "$1" == "1" ]; then test_name=$(basename $current_dir) fi - heaptrack --output $current_dir/$test_name"_heap" $NARGO compile --force + COMMAND="compile --force --silence-warnings" + if [ "$2" == "1" ]; then + COMMAND="execute --silence-warnings" + fi + + heaptrack --output $current_dir/$test_name"_heap" $NARGO $COMMAND if test -f $current_dir/$test_name"_heap.gz"; then heaptrack --analyze $current_dir/$test_name"_heap.gz" > $current_dir/$test_name"_heap_analysis.txt" diff --git a/noir/noir-repo/tooling/acvm_cli/src/cli/execute_cmd.rs b/noir/noir-repo/tooling/acvm_cli/src/cli/execute_cmd.rs index d4473eb3eef..c3c83a8f000 100644 --- a/noir/noir-repo/tooling/acvm_cli/src/cli/execute_cmd.rs +++ b/noir/noir-repo/tooling/acvm_cli/src/cli/execute_cmd.rs @@ -9,7 +9,7 @@ use nargo::PrintOutput; use crate::cli::fs::inputs::{read_bytecode_from_file, read_inputs_from_file}; use crate::errors::CliError; -use nargo::{foreign_calls::DefaultForeignCallExecutor, ops::execute_program}; +use nargo::{foreign_calls::DefaultForeignCallBuilder, ops::execute_program}; use super::fs::witness::{create_output_witness_string, save_witness_to_dir}; @@ -74,7 +74,8 @@ pub(crate) fn execute_program_from_witness( &program, inputs_map, &Bn254BlackBoxSolver, - &mut DefaultForeignCallExecutor::new(PrintOutput::Stdout, None, None, None), + &mut DefaultForeignCallBuilder { output: PrintOutput::Stdout, ..Default::default() } + .build(), ) .map_err(CliError::CircuitExecutionError) } diff --git a/noir/noir-repo/tooling/debugger/src/foreign_calls.rs b/noir/noir-repo/tooling/debugger/src/foreign_calls.rs index 899ba892d8f..b92e22844ea 100644 --- a/noir/noir-repo/tooling/debugger/src/foreign_calls.rs +++ b/noir/noir-repo/tooling/debugger/src/foreign_calls.rs @@ -4,12 +4,13 @@ use acvm::{ AcirField, FieldElement, }; use nargo::{ - foreign_calls::{DefaultForeignCallExecutor, ForeignCallExecutor}, + foreign_calls::{ + layers::Layer, DefaultForeignCallBuilder, ForeignCallError, ForeignCallExecutor, + }, PrintOutput, }; use noirc_artifacts::debug::{DebugArtifact, DebugVars, StackFrame}; use noirc_errors::debug_info::{DebugFnId, DebugVarId}; -use noirc_printable_type::ForeignCallError; pub(crate) enum DebugForeignCall { VarAssign, @@ -44,23 +45,31 @@ pub trait DebugForeignCallExecutor: ForeignCallExecutor { fn current_stack_frame(&self) -> Option>; } -pub struct DefaultDebugForeignCallExecutor<'a> { - executor: DefaultForeignCallExecutor<'a, FieldElement>, +#[derive(Default)] +pub struct DefaultDebugForeignCallExecutor { pub debug_vars: DebugVars, } -impl<'a> DefaultDebugForeignCallExecutor<'a> { - pub fn new(output: PrintOutput<'a>) -> Self { - Self { - executor: DefaultForeignCallExecutor::new(output, None, None, None), - debug_vars: DebugVars::default(), - } +impl DefaultDebugForeignCallExecutor { + fn make( + output: PrintOutput<'_>, + ex: DefaultDebugForeignCallExecutor, + ) -> impl DebugForeignCallExecutor + '_ { + DefaultForeignCallBuilder::default().with_output(output).build().add_layer(ex) + } + + #[allow(clippy::new_ret_no_self, dead_code)] + pub fn new(output: PrintOutput<'_>) -> impl DebugForeignCallExecutor + '_ { + Self::make(output, Self::default()) } - pub fn from_artifact(output: PrintOutput<'a>, artifact: &DebugArtifact) -> Self { - let mut ex = Self::new(output); + pub fn from_artifact<'a>( + output: PrintOutput<'a>, + artifact: &DebugArtifact, + ) -> impl DebugForeignCallExecutor + 'a { + let mut ex = Self::default(); ex.load_artifact(artifact); - ex + Self::make(output, ex) } pub fn load_artifact(&mut self, artifact: &DebugArtifact) { @@ -73,7 +82,7 @@ impl<'a> DefaultDebugForeignCallExecutor<'a> { } } -impl DebugForeignCallExecutor for DefaultDebugForeignCallExecutor<'_> { +impl DebugForeignCallExecutor for DefaultDebugForeignCallExecutor { fn get_variables(&self) -> Vec> { self.debug_vars.get_variables() } @@ -91,7 +100,7 @@ fn debug_fn_id(value: &FieldElement) -> DebugFnId { DebugFnId(value.to_u128() as u32) } -impl ForeignCallExecutor for DefaultDebugForeignCallExecutor<'_> { +impl ForeignCallExecutor for DefaultDebugForeignCallExecutor { fn execute( &mut self, foreign_call: &ForeignCallWaitInfo, @@ -166,7 +175,21 @@ impl ForeignCallExecutor for DefaultDebugForeignCallExecutor<'_> { self.debug_vars.pop_fn(); Ok(ForeignCallResult::default()) } - None => self.executor.execute(foreign_call), + None => Err(ForeignCallError::NoHandler(foreign_call_name.to_string())), } } } + +impl DebugForeignCallExecutor for Layer +where + H: DebugForeignCallExecutor, + I: ForeignCallExecutor, +{ + fn get_variables(&self) -> Vec> { + self.handler().get_variables() + } + + fn current_stack_frame(&self) -> Option> { + self.handler().current_stack_frame() + } +} diff --git a/noir/noir-repo/tooling/lsp/src/requests/completion.rs b/noir/noir-repo/tooling/lsp/src/requests/completion.rs index 3762ba9cf8d..fd6ef60af82 100644 --- a/noir/noir-repo/tooling/lsp/src/requests/completion.rs +++ b/noir/noir-repo/tooling/lsp/src/requests/completion.rs @@ -31,7 +31,7 @@ use noirc_frontend::{ }, }, hir_def::traits::Trait, - node_interner::{NodeInterner, ReferenceId, StructId}, + node_interner::{FuncId, NodeInterner, ReferenceId, StructId}, parser::{Item, ItemKind, ParsedSubModule}, token::{MetaAttribute, Token, Tokens}, Kind, ParsedModule, StructType, Type, TypeBinding, @@ -120,6 +120,8 @@ struct NodeFinder<'a> { use_segment_positions: UseSegmentPositions, self_type: Option, in_comptime: bool, + /// The function we are in, if any + func_id: Option, } impl<'a> NodeFinder<'a> { @@ -165,6 +167,7 @@ impl<'a> NodeFinder<'a> { use_segment_positions: UseSegmentPositions::default(), self_type: None, in_comptime: false, + func_id: None, } } @@ -639,6 +642,13 @@ impl<'a> NodeFinder<'a> { function_completion_kind: FunctionCompletionKind, self_prefix: bool, ) { + self.complete_trait_constraints_methods( + typ, + prefix, + function_kind, + function_completion_kind, + ); + let Some(methods_by_name) = self.interner.get_type_methods(typ) else { return; }; @@ -697,6 +707,31 @@ impl<'a> NodeFinder<'a> { } } + fn complete_trait_constraints_methods( + &mut self, + typ: &Type, + prefix: &str, + function_kind: FunctionKind, + function_completion_kind: FunctionCompletionKind, + ) { + let Some(func_id) = self.func_id else { + return; + }; + + let func_meta = self.interner.function_meta(&func_id); + for constraint in &func_meta.trait_constraints { + if *typ == constraint.typ { + let trait_ = self.interner.get_trait(constraint.trait_bound.trait_id); + self.complete_trait_methods( + trait_, + prefix, + function_kind, + function_completion_kind, + ); + } + } + } + fn complete_trait_methods( &mut self, trait_: &Trait, @@ -1125,8 +1160,17 @@ impl<'a> Visitor for NodeFinder<'a> { let old_in_comptime = self.in_comptime; self.in_comptime = noir_function.def.is_comptime; + if let Some(ReferenceId::Function(func_id)) = self + .interner + .reference_at_location(Location::new(noir_function.name_ident().span(), self.file)) + { + self.func_id = Some(func_id); + } + noir_function.def.body.accept(Some(span), self); + self.func_id = None; + self.in_comptime = old_in_comptime; self.type_parameters = old_type_parameters; self.self_type = None; @@ -1207,7 +1251,7 @@ impl<'a> Visitor for NodeFinder<'a> { fn visit_trait_item_function( &mut self, - _name: &Ident, + name: &Ident, generics: &UnresolvedGenerics, parameters: &[(Ident, UnresolvedType)], return_type: &noirc_frontend::ast::FunctionReturnType, @@ -1232,7 +1276,16 @@ impl<'a> Visitor for NodeFinder<'a> { for (name, _) in parameters { self.local_variables.insert(name.to_string(), name.span()); } + + if let Some(ReferenceId::Function(func_id)) = + self.interner.reference_at_location(Location::new(name.span(), self.file)) + { + self.func_id = Some(func_id); + } + body.accept(None, self); + + self.func_id = None; }; self.type_parameters = old_type_parameters; diff --git a/noir/noir-repo/tooling/lsp/src/requests/completion/tests.rs b/noir/noir-repo/tooling/lsp/src/requests/completion/tests.rs index 97c7ad86d5a..65157090767 100644 --- a/noir/noir-repo/tooling/lsp/src/requests/completion/tests.rs +++ b/noir/noir-repo/tooling/lsp/src/requests/completion/tests.rs @@ -2861,4 +2861,22 @@ fn main() { assert_eq!(items.len(), 1); assert!(items[0].label == "bar_baz()"); } + + #[test] + async fn test_suggests_trait_method_from_where_clause_in_function() { + let src = r#" + trait Foo { + fn foo(self) -> i32; + } + + fn something(x: T) -> i32 + where + T: Foo, + { + x.fo>|< + } + "#; + let items = get_completions(src).await; + assert_eq!(items.len(), 1); + } } diff --git a/noir/noir-repo/tooling/lsp/src/requests/mod.rs b/noir/noir-repo/tooling/lsp/src/requests/mod.rs index 22bdda8d7d7..f7b58d7d42f 100644 --- a/noir/noir-repo/tooling/lsp/src/requests/mod.rs +++ b/noir/noir-repo/tooling/lsp/src/requests/mod.rs @@ -18,6 +18,7 @@ use nargo_fmt::Config; use noirc_frontend::graph::CrateId; use noirc_frontend::hir::def_map::CrateDefMap; +use noirc_frontend::parser::ParserError; use noirc_frontend::usage_tracker::UsageTracker; use noirc_frontend::{graph::Dependency, node_interner::NodeInterner}; use serde::{Deserialize, Serialize}; @@ -285,7 +286,8 @@ fn on_formatting_inner( if let Some(source) = state.input_files.get(&path) { let (module, errors) = noirc_frontend::parse_program(source); - if !errors.is_empty() { + let is_all_warnings = errors.iter().all(ParserError::is_warning); + if !is_all_warnings { return Ok(None); } diff --git a/noir/noir-repo/tooling/lsp/src/requests/test_run.rs b/noir/noir-repo/tooling/lsp/src/requests/test_run.rs index 72ae6695b82..1071866dfad 100644 --- a/noir/noir-repo/tooling/lsp/src/requests/test_run.rs +++ b/noir/noir-repo/tooling/lsp/src/requests/test_run.rs @@ -3,6 +3,7 @@ use std::future::{self, Future}; use crate::insert_all_files_for_workspace_into_file_manager; use async_lsp::{ErrorCode, ResponseError}; use nargo::{ + foreign_calls::DefaultForeignCallBuilder, ops::{run_test, TestStatus}, PrintOutput, }; @@ -88,10 +89,16 @@ fn on_test_run_request_inner( &mut context, &test_function, PrintOutput::Stdout, - None, - Some(workspace.root_dir.clone()), - Some(package.name.to_string()), &CompileOptions::default(), + |output, base| { + DefaultForeignCallBuilder { + output, + resolver_url: None, // NB without this the root and package don't do anything. + root_path: Some(workspace.root_dir.clone()), + package_name: Some(package.name.to_string()), + } + .build_with_base(base) + }, ); let result = match test_result { TestStatus::Pass => NargoTestRunResult { diff --git a/noir/noir-repo/tooling/nargo/Cargo.toml b/noir/noir-repo/tooling/nargo/Cargo.toml index 1dbb9978b0b..9fb46b78bc9 100644 --- a/noir/noir-repo/tooling/nargo/Cargo.toml +++ b/noir/noir-repo/tooling/nargo/Cargo.toml @@ -21,20 +21,27 @@ noirc_errors.workspace = true noirc_frontend.workspace = true noirc_printable_type.workspace = true iter-extended.workspace = true +jsonrpsee.workspace = true +rayon.workspace = true thiserror.workspace = true tracing.workspace = true -rayon.workspace = true -jsonrpc.workspace = true -rand.workspace = true serde.workspace = true +serde_json.workspace = true walkdir = "2.5.0" +# Some dependencies are optional so we can compile to Wasm. +tokio = { workspace = true, optional = true } +rand = { workspace = true, optional = true } + [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -noir_fuzzer.workspace = true -proptest.workspace = true +noir_fuzzer = { workspace = true } +proptest = { workspace = true } [dev-dependencies] -jsonrpc-http-server = "18.0" -jsonrpc-core-client = "18.0" -jsonrpc-derive = "18.0" -jsonrpc-core = "18.0" +jsonrpsee = { workspace = true, features = ["server"] } + +[features] +default = [] + +# Execution currently uses HTTP based Oracle resolvers; does not compile to Wasm. +rpc = ["jsonrpsee/http-client", "jsonrpsee/macros", "tokio/rt", "rand"] diff --git a/noir/noir-repo/tooling/nargo/src/errors.rs b/noir/noir-repo/tooling/nargo/src/errors.rs index 5256f28e36c..00c411bf7e4 100644 --- a/noir/noir-repo/tooling/nargo/src/errors.rs +++ b/noir/noir-repo/tooling/nargo/src/errors.rs @@ -16,9 +16,10 @@ use noirc_errors::{ pub use noirc_errors::Location; use noirc_driver::CrateName; -use noirc_printable_type::ForeignCallError; use thiserror::Error; +use crate::foreign_calls::ForeignCallError; + /// Errors covering situations where a package cannot be compiled. #[derive(Debug, Error)] pub enum CompileError { diff --git a/noir/noir-repo/tooling/nargo/src/foreign_calls/default.rs b/noir/noir-repo/tooling/nargo/src/foreign_calls/default.rs new file mode 100644 index 00000000000..ce4af3aa744 --- /dev/null +++ b/noir/noir-repo/tooling/nargo/src/foreign_calls/default.rs @@ -0,0 +1,115 @@ +use acvm::AcirField; +use serde::{Deserialize, Serialize}; + +use crate::PrintOutput; + +use super::{ + layers::{self, Layer, Layering}, + mocker::MockForeignCallExecutor, + print::PrintForeignCallExecutor, + ForeignCallExecutor, +}; + +#[cfg(feature = "rpc")] +use super::rpc::RPCForeignCallExecutor; + +/// A builder for [DefaultForeignCallLayers] where we can enable fields based on feature flags, +/// which is easier than providing different overrides for a `new` method. +#[derive(Default)] +pub struct DefaultForeignCallBuilder<'a> { + pub output: PrintOutput<'a>, + #[cfg(feature = "rpc")] + pub resolver_url: Option, + #[cfg(feature = "rpc")] + pub root_path: Option, + #[cfg(feature = "rpc")] + pub package_name: Option, +} + +impl<'a> DefaultForeignCallBuilder<'a> { + /// Override the output. + pub fn with_output(mut self, output: PrintOutput<'a>) -> Self { + self.output = output; + self + } + + /// Compose the executor layers with [layers::Empty] as the default handler. + pub fn build(self) -> DefaultForeignCallLayers<'a, layers::Empty, F> + where + F: AcirField + Serialize + for<'de> Deserialize<'de> + 'a, + { + self.build_with_base(layers::Empty) + } + + /// Compose the executor layers with `base` as the default handler. + pub fn build_with_base(self, base: B) -> DefaultForeignCallLayers<'a, B, F> + where + F: AcirField + Serialize + for<'de> Deserialize<'de> + 'a, + B: ForeignCallExecutor + 'a, + { + let executor = { + #[cfg(feature = "rpc")] + { + use rand::Rng; + + base.add_layer(self.resolver_url.map(|resolver_url| { + let id = rand::thread_rng().gen(); + RPCForeignCallExecutor::new( + &resolver_url, + id, + self.root_path, + self.package_name, + ) + })) + } + #[cfg(not(feature = "rpc"))] + { + base + } + }; + + executor + .add_layer(MockForeignCallExecutor::default()) + .add_layer(PrintForeignCallExecutor::new(self.output)) + } +} + +/// Facilitate static typing of layers on a base layer, so inner layers can be accessed. +#[cfg(feature = "rpc")] +pub type DefaultForeignCallLayers<'a, B, F> = Layer< + PrintForeignCallExecutor<'a>, + Layer, Layer, B>>, +>; +#[cfg(not(feature = "rpc"))] +pub type DefaultForeignCallLayers<'a, B, F> = + Layer, Layer, B>>; + +/// Convenience constructor for code that used to create the executor this way. +#[cfg(feature = "rpc")] +pub struct DefaultForeignCallExecutor; + +/// Convenience constructors for the RPC case. Non-RPC versions are not provided +/// because once a crate opts into this within the workspace, everyone gets it +/// even if they don't want to. For the non-RPC case we can nudge people to +/// use `DefaultForeignCallBuilder` which is easier to keep flexible. +#[cfg(feature = "rpc")] +impl DefaultForeignCallExecutor { + #[allow(clippy::new_ret_no_self)] + pub fn new<'a, F>( + output: PrintOutput<'a>, + resolver_url: Option<&str>, + root_path: Option, + package_name: Option, + ) -> impl ForeignCallExecutor + 'a + where + F: AcirField + Serialize + for<'de> Deserialize<'de> + 'a, + { + DefaultForeignCallBuilder { + output, + resolver_url: resolver_url.map(|s| s.to_string()), + root_path, + package_name, + } + .build() + } +} diff --git a/noir/noir-repo/tooling/nargo/src/foreign_calls/layers.rs b/noir/noir-repo/tooling/nargo/src/foreign_calls/layers.rs new file mode 100644 index 00000000000..19f14c6f4a8 --- /dev/null +++ b/noir/noir-repo/tooling/nargo/src/foreign_calls/layers.rs @@ -0,0 +1,140 @@ +use acvm::{acir::brillig::ForeignCallResult, pwg::ForeignCallWaitInfo, AcirField}; + +use super::{ForeignCallError, ForeignCallExecutor}; + +/// Returns an empty result when called. +/// +/// If all executors have no handler for the given foreign call then we cannot +/// return a correct response to the ACVM. The best we can do is to return an empty response, +/// this allows us to ignore any foreign calls which exist solely to pass information from inside +/// the circuit to the environment (e.g. custom logging) as the execution will still be able to progress. +/// +/// We optimistically return an empty response for all oracle calls as the ACVM will error +/// should a response have been required. +pub struct Empty; + +impl ForeignCallExecutor for Empty { + fn execute( + &mut self, + _foreign_call: &ForeignCallWaitInfo, + ) -> Result, ForeignCallError> { + Ok(ForeignCallResult::default()) + } +} + +/// Returns `NoHandler` for every call. +pub struct Unhandled; + +impl ForeignCallExecutor for Unhandled { + fn execute( + &mut self, + foreign_call: &ForeignCallWaitInfo, + ) -> Result, ForeignCallError> { + Err(ForeignCallError::NoHandler(foreign_call.function.clone())) + } +} + +/// Forwards to the inner executor if its own handler doesn't handle the call. +pub struct Layer { + pub handler: H, + pub inner: I, +} + +impl ForeignCallExecutor for Layer +where + H: ForeignCallExecutor, + I: ForeignCallExecutor, +{ + fn execute( + &mut self, + foreign_call: &ForeignCallWaitInfo, + ) -> Result, ForeignCallError> { + match self.handler.execute(foreign_call) { + Err(ForeignCallError::NoHandler(_)) => self.inner.execute(foreign_call), + handled => handled, + } + } +} + +impl Layer { + /// Create a layer from two handlers + pub fn new(handler: H, inner: I) -> Self { + Self { handler, inner } + } +} + +impl Layer { + /// Create a layer from a handler. + /// If the handler doesn't handle a call, a default empty response is returned. + pub fn or_empty(handler: H) -> Self { + Self { handler, inner: Empty } + } +} + +impl Layer { + /// Create a layer from a handler. + /// If the handler doesn't handle a call, `NoHandler` error is returned. + pub fn or_unhandled(handler: H) -> Self { + Self { handler, inner: Unhandled } + } +} + +impl Layer { + /// A base layer that doesn't handle anything. + pub fn unhandled() -> Self { + Self { handler: Unhandled, inner: Unhandled } + } +} + +impl Layer { + /// Add another layer on top of this one. + pub fn add_layer(self, handler: J) -> Layer { + Layer::new(handler, self) + } + + pub fn handler(&self) -> &H { + &self.handler + } + + pub fn inner(&self) -> &I { + &self.inner + } +} + +/// Compose handlers. +pub trait Layering { + /// Layer an executor on top of this one. + /// The `other` executor will be called first. + fn add_layer(self, other: L) -> Layer + where + Self: Sized + ForeignCallExecutor, + L: ForeignCallExecutor; +} + +impl Layering for T { + fn add_layer(self, other: L) -> Layer + where + T: Sized + ForeignCallExecutor, + L: ForeignCallExecutor, + { + Layer::new(other, self) + } +} + +/// Support disabling a layer by making it optional. +/// This way we can still have a known static type for a composition, +/// because layers are always added, potentially wrapped in an `Option`. +impl ForeignCallExecutor for Option +where + H: ForeignCallExecutor, +{ + fn execute( + &mut self, + foreign_call: &ForeignCallWaitInfo, + ) -> Result, ForeignCallError> { + match self { + Some(handler) => handler.execute(foreign_call), + None => Err(ForeignCallError::NoHandler(foreign_call.function.clone())), + } + } +} diff --git a/noir/noir-repo/tooling/nargo/src/foreign_calls/mocker.rs b/noir/noir-repo/tooling/nargo/src/foreign_calls/mocker.rs index c93d16bbaf6..b289e907cd7 100644 --- a/noir/noir-repo/tooling/nargo/src/foreign_calls/mocker.rs +++ b/noir/noir-repo/tooling/nargo/src/foreign_calls/mocker.rs @@ -1,12 +1,13 @@ +use std::marker::PhantomData; + use acvm::{ acir::brillig::{ForeignCallParam, ForeignCallResult}, pwg::ForeignCallWaitInfo, AcirField, }; -use noirc_printable_type::{decode_string_value, ForeignCallError}; -use serde::{Deserialize, Serialize}; +use noirc_abi::decode_string_value; -use super::{ForeignCall, ForeignCallExecutor}; +use super::{ForeignCall, ForeignCallError, ForeignCallExecutor}; /// This struct represents an oracle mock. It can be used for testing programs that use oracles. #[derive(Debug, PartialEq, Eq, Clone)] @@ -45,7 +46,7 @@ impl MockedCall { } #[derive(Debug, Default)] -pub(crate) struct MockForeignCallExecutor { +pub struct MockForeignCallExecutor { /// Mocks have unique ids used to identify them in Noir, allowing to update or remove them. last_mock_id: usize, /// The registered mocks @@ -78,8 +79,9 @@ impl MockForeignCallExecutor { } } -impl Deserialize<'a>> ForeignCallExecutor - for MockForeignCallExecutor +impl ForeignCallExecutor for MockForeignCallExecutor +where + F: AcirField, { fn execute( &mut self, @@ -174,3 +176,30 @@ impl Deserialize<'a>> ForeignCallExecutor } } } + +/// Handler that panics if any of the mock functions are called. +#[allow(dead_code)] // TODO: Make the mocker optional +pub(crate) struct DisabledMockForeignCallExecutor { + _field: PhantomData, +} + +impl ForeignCallExecutor for DisabledMockForeignCallExecutor { + fn execute( + &mut self, + foreign_call: &ForeignCallWaitInfo, + ) -> Result, ForeignCallError> { + let foreign_call_name = foreign_call.function.as_str(); + if let Some( + ForeignCall::CreateMock + | ForeignCall::SetMockParams + | ForeignCall::GetMockLastParams + | ForeignCall::SetMockReturns + | ForeignCall::SetMockTimes + | ForeignCall::ClearMock, + ) = ForeignCall::lookup(foreign_call_name) + { + panic!("unexpected mock call: {}", foreign_call.function) + } + Err(ForeignCallError::NoHandler(foreign_call.function.clone())) + } +} diff --git a/noir/noir-repo/tooling/nargo/src/foreign_calls/mod.rs b/noir/noir-repo/tooling/nargo/src/foreign_calls/mod.rs index 65ff051bcbf..06fe42bfec9 100644 --- a/noir/noir-repo/tooling/nargo/src/foreign_calls/mod.rs +++ b/noir/noir-repo/tooling/nargo/src/foreign_calls/mod.rs @@ -1,16 +1,16 @@ -use std::path::PathBuf; +use acvm::{acir::brillig::ForeignCallResult, pwg::ForeignCallWaitInfo}; +use thiserror::Error; -use acvm::{acir::brillig::ForeignCallResult, pwg::ForeignCallWaitInfo, AcirField}; -use mocker::MockForeignCallExecutor; -use noirc_printable_type::ForeignCallError; -use print::{PrintForeignCallExecutor, PrintOutput}; -use rand::Rng; -use rpc::RPCForeignCallExecutor; -use serde::{Deserialize, Serialize}; +pub mod layers; +pub mod mocker; +pub mod print; -pub(crate) mod mocker; -pub(crate) mod print; -pub(crate) mod rpc; +pub mod default; +#[cfg(feature = "rpc")] +pub mod rpc; +pub use default::DefaultForeignCallBuilder; +#[cfg(feature = "rpc")] +pub use default::DefaultForeignCallExecutor; pub trait ForeignCallExecutor { fn execute( @@ -64,77 +64,20 @@ impl ForeignCall { } } -#[derive(Debug, Default)] -pub struct DefaultForeignCallExecutor<'a, F> { - /// The executor for any [`ForeignCall::Print`] calls. - printer: PrintForeignCallExecutor<'a>, - mocker: MockForeignCallExecutor, - external: Option, -} - -impl<'a, F: Default> DefaultForeignCallExecutor<'a, F> { - pub fn new( - output: PrintOutput<'a>, - resolver_url: Option<&str>, - root_path: Option, - package_name: Option, - ) -> Self { - let id = rand::thread_rng().gen(); - let printer = PrintForeignCallExecutor { output }; - let external_resolver = resolver_url.map(|resolver_url| { - RPCForeignCallExecutor::new(resolver_url, id, root_path, package_name) - }); - DefaultForeignCallExecutor { - printer, - mocker: MockForeignCallExecutor::default(), - external: external_resolver, - } - } -} +#[derive(Debug, Error)] +pub enum ForeignCallError { + #[error("No handler could be found for foreign call `{0}`")] + NoHandler(String), -impl<'a, F: AcirField + Serialize + for<'b> Deserialize<'b>> ForeignCallExecutor - for DefaultForeignCallExecutor<'a, F> -{ - fn execute( - &mut self, - foreign_call: &ForeignCallWaitInfo, - ) -> Result, ForeignCallError> { - let foreign_call_name = foreign_call.function.as_str(); - match ForeignCall::lookup(foreign_call_name) { - Some(ForeignCall::Print) => self.printer.execute(foreign_call), - Some( - ForeignCall::CreateMock - | ForeignCall::SetMockParams - | ForeignCall::GetMockLastParams - | ForeignCall::SetMockReturns - | ForeignCall::SetMockTimes - | ForeignCall::ClearMock, - ) => self.mocker.execute(foreign_call), + #[error("Foreign call inputs needed for execution are missing")] + MissingForeignCallInputs, - None => { - // First check if there's any defined mock responses for this foreign call. - match self.mocker.execute(foreign_call) { - Err(ForeignCallError::NoHandler(_)) => (), - response_or_error => return response_or_error, - }; + #[error("Could not parse PrintableType argument. {0}")] + ParsingError(#[from] serde_json::Error), - if let Some(external_resolver) = &mut self.external { - // If the user has registered an external resolver then we forward any remaining oracle calls there. - match external_resolver.execute(foreign_call) { - Err(ForeignCallError::NoHandler(_)) => (), - response_or_error => return response_or_error, - }; - } + #[error("Failed calling external resolver. {0}")] + ExternalResolverError(#[from] jsonrpsee::core::client::Error), - // If all executors have no handler for the given foreign call then we cannot - // return a correct response to the ACVM. The best we can do is to return an empty response, - // this allows us to ignore any foreign calls which exist solely to pass information from inside - // the circuit to the environment (e.g. custom logging) as the execution will still be able to progress. - // - // We optimistically return an empty response for all oracle calls as the ACVM will error - // should a response have been required. - Ok(ForeignCallResult::default()) - } - } - } + #[error("Assert message resolved after an unsatisfied constrain. {0}")] + ResolvedAssertMessage(String), } diff --git a/noir/noir-repo/tooling/nargo/src/foreign_calls/print.rs b/noir/noir-repo/tooling/nargo/src/foreign_calls/print.rs index 8b2b5efd8b6..fb5621da942 100644 --- a/noir/noir-repo/tooling/nargo/src/foreign_calls/print.rs +++ b/noir/noir-repo/tooling/nargo/src/foreign_calls/print.rs @@ -1,7 +1,12 @@ -use acvm::{acir::brillig::ForeignCallResult, pwg::ForeignCallWaitInfo, AcirField}; -use noirc_printable_type::{ForeignCallError, PrintableValueDisplay}; +use acvm::{ + acir::brillig::{ForeignCallParam, ForeignCallResult}, + pwg::ForeignCallWaitInfo, + AcirField, +}; +use noirc_abi::{decode_printable_value, decode_string_value}; +use noirc_printable_type::{PrintableType, PrintableValueDisplay}; -use super::{ForeignCall, ForeignCallExecutor}; +use super::{ForeignCall, ForeignCallError, ForeignCallExecutor}; #[derive(Debug, Default)] pub enum PrintOutput<'a> { @@ -12,8 +17,14 @@ pub enum PrintOutput<'a> { } #[derive(Debug, Default)] -pub(crate) struct PrintForeignCallExecutor<'a> { - pub(crate) output: PrintOutput<'a>, +pub struct PrintForeignCallExecutor<'a> { + output: PrintOutput<'a>, +} + +impl<'a> PrintForeignCallExecutor<'a> { + pub fn new(output: PrintOutput<'a>) -> Self { + Self { output } + } } impl ForeignCallExecutor for PrintForeignCallExecutor<'_> { @@ -32,7 +43,8 @@ impl ForeignCallExecutor for PrintForeignCallExecutor<'_> { .ok_or(ForeignCallError::MissingForeignCallInputs)? .1; - let display_values: PrintableValueDisplay = foreign_call_inputs.try_into()?; + let display_values: PrintableValueDisplay = + try_from_params(foreign_call_inputs)?; let display_string = format!("{display_values}{}", if skip_newline { "" } else { "\n" }); @@ -50,3 +62,72 @@ impl ForeignCallExecutor for PrintForeignCallExecutor<'_> { } } } + +fn try_from_params( + foreign_call_inputs: &[ForeignCallParam], +) -> Result, ForeignCallError> { + let (is_fmt_str, foreign_call_inputs) = + foreign_call_inputs.split_last().ok_or(ForeignCallError::MissingForeignCallInputs)?; + + if is_fmt_str.unwrap_field().is_one() { + convert_fmt_string_inputs(foreign_call_inputs) + } else { + convert_string_inputs(foreign_call_inputs) + } +} + +fn convert_string_inputs( + foreign_call_inputs: &[ForeignCallParam], +) -> Result, ForeignCallError> { + // Fetch the PrintableType from the foreign call input + // The remaining input values should hold what is to be printed + let (printable_type_as_values, input_values) = + foreign_call_inputs.split_last().ok_or(ForeignCallError::MissingForeignCallInputs)?; + let printable_type = fetch_printable_type(printable_type_as_values)?; + + // We must use a flat map here as each value in a struct will be in a separate input value + let mut input_values_as_fields = input_values.iter().flat_map(|param| param.fields()); + + let value = decode_printable_value(&mut input_values_as_fields, &printable_type); + + Ok(PrintableValueDisplay::Plain(value, printable_type)) +} + +fn convert_fmt_string_inputs( + foreign_call_inputs: &[ForeignCallParam], +) -> Result, ForeignCallError> { + let (message, input_and_printable_types) = + foreign_call_inputs.split_first().ok_or(ForeignCallError::MissingForeignCallInputs)?; + + let message_as_fields = message.fields(); + let message_as_string = decode_string_value(&message_as_fields); + + let (num_values, input_and_printable_types) = input_and_printable_types + .split_first() + .ok_or(ForeignCallError::MissingForeignCallInputs)?; + + let mut output = Vec::new(); + let num_values = num_values.unwrap_field().to_u128() as usize; + + let types_start_at = input_and_printable_types.len() - num_values; + let mut input_iter = + input_and_printable_types[0..types_start_at].iter().flat_map(|param| param.fields()); + for printable_type in input_and_printable_types.iter().skip(types_start_at) { + let printable_type = fetch_printable_type(printable_type)?; + let value = decode_printable_value(&mut input_iter, &printable_type); + + output.push((value, printable_type)); + } + + Ok(PrintableValueDisplay::FmtString(message_as_string, output)) +} + +fn fetch_printable_type( + printable_type: &ForeignCallParam, +) -> Result { + let printable_type_as_fields = printable_type.fields(); + let printable_type_as_string = decode_string_value(&printable_type_as_fields); + let printable_type: PrintableType = serde_json::from_str(&printable_type_as_string)?; + + Ok(printable_type) +} diff --git a/noir/noir-repo/tooling/nargo/src/foreign_calls/rpc.rs b/noir/noir-repo/tooling/nargo/src/foreign_calls/rpc.rs index 0653eb1c7e3..89a748b6c45 100644 --- a/noir/noir-repo/tooling/nargo/src/foreign_calls/rpc.rs +++ b/noir/noir-repo/tooling/nargo/src/foreign_calls/rpc.rs @@ -1,25 +1,31 @@ use std::path::PathBuf; use acvm::{acir::brillig::ForeignCallResult, pwg::ForeignCallWaitInfo, AcirField}; -use jsonrpc::{arg as build_json_rpc_arg, minreq_http::Builder, Client}; -use noirc_printable_type::ForeignCallError; +use jsonrpsee::{ + core::client::ClientT, + http_client::{HttpClient, HttpClientBuilder}, + rpc_params, +}; use serde::{Deserialize, Serialize}; -use super::ForeignCallExecutor; +use super::{ForeignCallError, ForeignCallExecutor}; #[derive(Debug)] -pub(crate) struct RPCForeignCallExecutor { +pub struct RPCForeignCallExecutor { /// A randomly generated id for this `DefaultForeignCallExecutor`. /// /// This is used so that a single `external_resolver` can distinguish between requests from multiple /// instantiations of `DefaultForeignCallExecutor`. id: u64, /// JSON RPC client to resolve foreign calls - external_resolver: Client, + external_resolver: HttpClient, /// Root path to the program or workspace in execution. root_path: Option, /// Name of the package in execution package_name: Option, + /// Runtime to execute asynchronous tasks on. + /// See [bridging](https://tokio.rs/tokio/topics/bridging). + runtime: tokio::runtime::Runtime, } #[derive(Debug, Serialize, Deserialize)] @@ -31,59 +37,76 @@ struct ResolveForeignCallRequest { /// performed in parallel. session_id: u64, - #[serde(flatten)] /// The foreign call which the external RPC server is to provide a response for. + #[serde(flatten)] function_call: ForeignCallWaitInfo, - #[serde(skip_serializing_if = "Option::is_none")] /// Root path to the program or workspace in execution. - root_path: Option, #[serde(skip_serializing_if = "Option::is_none")] + root_path: Option, + /// Name of the package in execution + #[serde(skip_serializing_if = "Option::is_none")] package_name: Option, } +type ResolveForeignCallResult = Result, ForeignCallError>; + impl RPCForeignCallExecutor { - pub(crate) fn new( + pub fn new( resolver_url: &str, id: u64, root_path: Option, package_name: Option, ) -> Self { - let mut transport_builder = - Builder::new().url(resolver_url).expect("Invalid oracle resolver URL"); + let mut client_builder = HttpClientBuilder::new(); if let Some(Ok(timeout)) = std::env::var("NARGO_FOREIGN_CALL_TIMEOUT").ok().map(|timeout| timeout.parse()) { let timeout_duration = std::time::Duration::from_millis(timeout); - transport_builder = transport_builder.timeout(timeout_duration); + client_builder = client_builder.request_timeout(timeout_duration); }; - let oracle_resolver = Client::with_transport(transport_builder.build()); - RPCForeignCallExecutor { external_resolver: oracle_resolver, id, root_path, package_name } + let oracle_resolver = + client_builder.build(resolver_url).expect("Invalid oracle resolver URL"); + + // Opcodes are executed in the `ProgramExecutor::execute_circuit` one by one in a loop, + // we don't need a concurrent thread pool. + let runtime = tokio::runtime::Builder::new_current_thread() + .enable_time() + .enable_io() + .build() + .expect("failed to build tokio runtime"); + + RPCForeignCallExecutor { + external_resolver: oracle_resolver, + id, + root_path, + package_name, + runtime, + } } } -impl Deserialize<'a>> ForeignCallExecutor - for RPCForeignCallExecutor +impl ForeignCallExecutor for RPCForeignCallExecutor +where + F: AcirField + Serialize + for<'a> Deserialize<'a>, { - fn execute( - &mut self, - foreign_call: &ForeignCallWaitInfo, - ) -> Result, ForeignCallError> { - let encoded_params = vec![build_json_rpc_arg(ResolveForeignCallRequest { + /// Execute an async call blocking the current thread. + /// This method cannot be called from inside a `tokio` runtime, for that to work + /// we need to offload the execution into a different thread; see the tests. + fn execute(&mut self, foreign_call: &ForeignCallWaitInfo) -> ResolveForeignCallResult { + let encoded_params = rpc_params!(ResolveForeignCallRequest { session_id: self.id, function_call: foreign_call.clone(), root_path: self.root_path.clone().map(|path| path.to_str().unwrap().to_string()), package_name: self.package_name.clone(), - })]; - - let req = self.external_resolver.build_request("resolve_foreign_call", &encoded_params); - - let response = self.external_resolver.send_request(req)?; + }); - let parsed_response: ForeignCallResult = response.result()?; + let parsed_response = self.runtime.block_on(async { + self.external_resolver.request("resolve_foreign_call", encoded_params).await + })?; Ok(parsed_response) } @@ -95,20 +118,23 @@ mod tests { acir::brillig::ForeignCallParam, brillig_vm::brillig::ForeignCallResult, pwg::ForeignCallWaitInfo, FieldElement, }; - use jsonrpc_core::Result as RpcResult; - use jsonrpc_derive::rpc; - use jsonrpc_http_server::{Server, ServerBuilder}; - - use super::{ForeignCallExecutor, RPCForeignCallExecutor, ResolveForeignCallRequest}; + use jsonrpsee::proc_macros::rpc; + use jsonrpsee::server::Server; + use jsonrpsee::types::ErrorObjectOwned; + use tokio::sync::{mpsc, oneshot}; + + use super::{ + ForeignCallExecutor, RPCForeignCallExecutor, ResolveForeignCallRequest, + ResolveForeignCallResult, + }; - #[allow(unreachable_pub)] - #[rpc] - pub trait OracleResolver { - #[rpc(name = "resolve_foreign_call")] + #[rpc(server)] + trait OracleResolver { + #[method(name = "resolve_foreign_call")] fn resolve_foreign_call( &self, req: ResolveForeignCallRequest, - ) -> RpcResult>; + ) -> Result, ErrorObjectOwned>; } struct OracleResolverImpl; @@ -129,99 +155,129 @@ mod tests { } } - impl OracleResolver for OracleResolverImpl { + impl OracleResolverServer for OracleResolverImpl { fn resolve_foreign_call( &self, req: ResolveForeignCallRequest, - ) -> RpcResult> { + ) -> Result, ErrorObjectOwned> { let response = match req.function_call.function.as_str() { "sum" => self.sum(req.function_call.inputs[0].clone()), "echo" => self.echo(req.function_call.inputs[0].clone()), "id" => FieldElement::from(req.session_id as u128).into(), - _ => panic!("unexpected foreign call"), }; Ok(response) } } - fn build_oracle_server() -> (Server, String) { - let mut io = jsonrpc_core::IoHandler::new(); - io.extend_with(OracleResolverImpl.to_delegate()); + /// The test client send its request and a response channel. + type RPCForeignCallClientRequest = ( + ForeignCallWaitInfo, + oneshot::Sender>, + ); - // Choosing port 0 results in a random port being assigned. - let server = ServerBuilder::new(io) - .start_http(&"127.0.0.1:0".parse().expect("Invalid address")) - .expect("Could not start server"); + /// Async client used in the tests. + #[derive(Clone)] + struct RPCForeignCallClient { + tx: mpsc::UnboundedSender, + } + + impl RPCForeignCallExecutor { + /// Spawn and run the executor in the background until all clients are closed. + fn run(mut self) -> RPCForeignCallClient { + let (tx, mut rx) = mpsc::unbounded_channel::(); + let handle = tokio::task::spawn_blocking(move || { + while let Some((req, tx)) = rx.blocking_recv() { + let res = self.execute(&req); + let _ = tx.send(res); + } + }); + // The task will finish when the client goes out of scope. + drop(handle); + RPCForeignCallClient { tx } + } + } + + impl RPCForeignCallClient { + /// Asynchronously execute a foreign call. + async fn execute( + &self, + req: &ForeignCallWaitInfo, + ) -> ResolveForeignCallResult { + let (tx, rx) = oneshot::channel(); + self.tx.send((req.clone(), tx)).expect("failed to send to executor"); + rx.await.expect("failed to receive from executor") + } + } - let url = format!("http://{}", server.address()); - (server, url) + /// Start running the Oracle server or a random port, returning the listen URL. + async fn build_oracle_server() -> std::io::Result { + // Choosing port 0 results in a random port being assigned. + let server = Server::builder().build("127.0.0.1:0").await?; + let addr = server.local_addr()?; + let handle = server.start(OracleResolverImpl.into_rpc()); + let url = format!("http://{}", addr); + // In this test we don't care about doing shutdown so let's it run forever. + tokio::spawn(handle.stopped()); + Ok(url) } - #[test] - fn test_oracle_resolver_echo() { - let (server, url) = build_oracle_server(); + #[tokio::test] + async fn test_oracle_resolver_echo() { + let url = build_oracle_server().await.unwrap(); - let mut executor = RPCForeignCallExecutor::new(&url, 1, None, None); + let executor = RPCForeignCallExecutor::new(&url, 1, None, None).run(); let foreign_call: ForeignCallWaitInfo = ForeignCallWaitInfo { function: "echo".to_string(), inputs: vec![ForeignCallParam::Single(1_u128.into())], }; - let result = executor.execute(&foreign_call); + let result = executor.execute(&foreign_call).await; assert_eq!(result.unwrap(), ForeignCallResult { values: foreign_call.inputs }); - - server.close(); } - #[test] - fn test_oracle_resolver_sum() { - let (server, url) = build_oracle_server(); + #[tokio::test] + async fn test_oracle_resolver_sum() { + let url = build_oracle_server().await.unwrap(); - let mut executor = RPCForeignCallExecutor::new(&url, 2, None, None); + let executor = RPCForeignCallExecutor::new(&url, 2, None, None).run(); let foreign_call: ForeignCallWaitInfo = ForeignCallWaitInfo { function: "sum".to_string(), inputs: vec![ForeignCallParam::Array(vec![1_usize.into(), 2_usize.into()])], }; - let result = executor.execute(&foreign_call); + let result = executor.execute(&foreign_call).await; assert_eq!(result.unwrap(), FieldElement::from(3_usize).into()); - - server.close(); } - #[test] - fn foreign_call_executor_id_is_persistent() { - let (server, url) = build_oracle_server(); + #[tokio::test] + async fn foreign_call_executor_id_is_persistent() { + let url = build_oracle_server().await.unwrap(); - let mut executor = RPCForeignCallExecutor::new(&url, 3, None, None); + let executor = RPCForeignCallExecutor::new(&url, 3, None, None).run(); let foreign_call: ForeignCallWaitInfo = ForeignCallWaitInfo { function: "id".to_string(), inputs: Vec::new() }; - let result_1 = executor.execute(&foreign_call).unwrap(); - let result_2 = executor.execute(&foreign_call).unwrap(); + let result_1 = executor.execute(&foreign_call).await.unwrap(); + let result_2 = executor.execute(&foreign_call).await.unwrap(); assert_eq!(result_1, result_2); - - server.close(); } - #[test] - fn oracle_resolver_rpc_can_distinguish_executors() { - let (server, url) = build_oracle_server(); + #[tokio::test] + async fn oracle_resolver_rpc_can_distinguish_executors() { + let url = build_oracle_server().await.unwrap(); - let mut executor_1 = RPCForeignCallExecutor::new(&url, 4, None, None); - let mut executor_2 = RPCForeignCallExecutor::new(&url, 5, None, None); + let executor_1 = RPCForeignCallExecutor::new(&url, 4, None, None).run(); + let executor_2 = RPCForeignCallExecutor::new(&url, 5, None, None).run(); let foreign_call: ForeignCallWaitInfo = ForeignCallWaitInfo { function: "id".to_string(), inputs: Vec::new() }; - let result_1 = executor_1.execute(&foreign_call).unwrap(); - let result_2 = executor_2.execute(&foreign_call).unwrap(); + let result_1 = executor_1.execute(&foreign_call).await.unwrap(); + let result_2 = executor_2.execute(&foreign_call).await.unwrap(); assert_ne!(result_1, result_2); - - server.close(); } } diff --git a/noir/noir-repo/tooling/nargo/src/lib.rs b/noir/noir-repo/tooling/nargo/src/lib.rs index ee7b2e4809a..de032ca55ae 100644 --- a/noir/noir-repo/tooling/nargo/src/lib.rs +++ b/noir/noir-repo/tooling/nargo/src/lib.rs @@ -14,6 +14,9 @@ pub mod ops; pub mod package; pub mod workspace; +pub use self::errors::NargoError; +pub use self::foreign_calls::print::PrintOutput; + use std::{ collections::{BTreeMap, HashMap, HashSet}, path::PathBuf, @@ -29,9 +32,6 @@ use package::{Dependency, Package}; use rayon::prelude::*; use walkdir::WalkDir; -pub use self::errors::NargoError; -pub use self::foreign_calls::print::PrintOutput; - pub fn prepare_dependencies( context: &mut Context, parent_crate: CrateId, @@ -97,7 +97,7 @@ fn insert_all_files_for_package_into_file_manager( .parent() .unwrap_or_else(|| panic!("The entry path is expected to be a single file within a directory and so should have a parent {:?}", package.entry_path)); - for entry in WalkDir::new(entry_path_parent) { + for entry in WalkDir::new(entry_path_parent).sort_by_file_name() { let Ok(entry) = entry else { continue; }; diff --git a/noir/noir-repo/tooling/nargo/src/ops/mod.rs b/noir/noir-repo/tooling/nargo/src/ops/mod.rs index 04efeb5a9ec..7a52a829be3 100644 --- a/noir/noir-repo/tooling/nargo/src/ops/mod.rs +++ b/noir/noir-repo/tooling/nargo/src/ops/mod.rs @@ -3,10 +3,10 @@ pub use self::compile::{ collect_errors, compile_contract, compile_program, compile_program_with_debug_instrumenter, compile_workspace, report_errors, }; -pub use self::execute::{execute_program, execute_program_with_profiling}; pub use self::optimize::{optimize_contract, optimize_program}; pub use self::transform::{transform_contract, transform_program}; +pub use self::execute::{execute_program, execute_program_with_profiling}; pub use self::test::{run_test, TestStatus}; mod check; diff --git a/noir/noir-repo/tooling/nargo/src/ops/test.rs b/noir/noir-repo/tooling/nargo/src/ops/test.rs index 1306150518d..bfd5cd3713f 100644 --- a/noir/noir-repo/tooling/nargo/src/ops/test.rs +++ b/noir/noir-repo/tooling/nargo/src/ops/test.rs @@ -1,5 +1,3 @@ -use std::path::PathBuf; - use acvm::{ acir::{ brillig::ForeignCallResult, @@ -12,18 +10,10 @@ use noirc_abi::Abi; use noirc_driver::{compile_no_check, CompileError, CompileOptions, DEFAULT_EXPRESSION_WIDTH}; use noirc_errors::{debug_info::DebugInfo, FileDiagnostic}; use noirc_frontend::hir::{def_map::TestFunction, Context}; -use noirc_printable_type::ForeignCallError; -use rand::Rng; -use serde::{Deserialize, Serialize}; use crate::{ errors::try_to_diagnose_runtime_error, - foreign_calls::{ - mocker::MockForeignCallExecutor, - print::{PrintForeignCallExecutor, PrintOutput}, - rpc::RPCForeignCallExecutor, - ForeignCall, ForeignCallExecutor, - }, + foreign_calls::{layers, print::PrintOutput, ForeignCallError, ForeignCallExecutor}, NargoError, }; @@ -43,17 +33,19 @@ impl TestStatus { } } -#[allow(clippy::too_many_arguments)] -pub fn run_test>( +pub fn run_test<'a, B, F, E>( blackbox_solver: &B, context: &mut Context, test_function: &TestFunction, - output: PrintOutput<'_>, - foreign_call_resolver_url: Option<&str>, - root_path: Option, - package_name: Option, + output: PrintOutput<'a>, config: &CompileOptions, -) -> TestStatus { + build_foreign_call_executor: F, +) -> TestStatus +where + B: BlackBoxFunctionSolver, + F: Fn(PrintOutput<'a>, layers::Unhandled) -> E + 'a, + E: ForeignCallExecutor, +{ let test_function_has_no_arguments = context .def_interner .function_meta(&test_function.get_id()) @@ -70,12 +62,9 @@ pub fn run_test>( if test_function_has_no_arguments { // Run the backend to ensure the PWG evaluates functions like std::hash::pedersen, // otherwise constraints involving these expressions will not error. - let mut foreign_call_executor = TestForeignCallExecutor::new( - output, - foreign_call_resolver_url, - root_path, - package_name, - ); + // Use a base layer that doesn't handle anything, which we handle in the `execute` below. + let inner_executor = build_foreign_call_executor(output, layers::Unhandled); + let mut foreign_call_executor = TestForeignCallExecutor::new(inner_executor); let circuit_execution = execute_program( &compiled_program.program, @@ -133,16 +122,17 @@ pub fn run_test>( |program: &Program, initial_witness: WitnessMap| -> Result, String> { + // Use a base layer that doesn't handle anything, which we handle in the `execute` below. + let inner_executor = + build_foreign_call_executor(PrintOutput::None, layers::Unhandled); + let mut foreign_call_executor = + TestForeignCallExecutor::new(inner_executor); + let circuit_execution = execute_program( program, initial_witness, blackbox_solver, - &mut TestForeignCallExecutor::::new( - PrintOutput::None, - foreign_call_resolver_url, - root_path.clone(), - package_name.clone(), - ), + &mut foreign_call_executor, ); let status = test_status_program_compile_pass( @@ -278,38 +268,21 @@ fn check_expected_failure_message( } /// A specialized foreign call executor which tracks whether it has encountered any unknown foreign calls -struct TestForeignCallExecutor<'a, F> { - /// The executor for any [`ForeignCall::Print`] calls. - printer: PrintForeignCallExecutor<'a>, - mocker: MockForeignCallExecutor, - external: Option, - +struct TestForeignCallExecutor { + executor: E, encountered_unknown_foreign_call: bool, } -impl<'a, F: Default> TestForeignCallExecutor<'a, F> { - fn new( - output: PrintOutput<'a>, - resolver_url: Option<&str>, - root_path: Option, - package_name: Option, - ) -> Self { - let id = rand::thread_rng().gen(); - let printer = PrintForeignCallExecutor { output }; - let external_resolver = resolver_url.map(|resolver_url| { - RPCForeignCallExecutor::new(resolver_url, id, root_path, package_name) - }); - TestForeignCallExecutor { - printer, - mocker: MockForeignCallExecutor::default(), - external: external_resolver, - encountered_unknown_foreign_call: false, - } +impl TestForeignCallExecutor { + fn new(executor: E) -> Self { + Self { executor, encountered_unknown_foreign_call: false } } } -impl<'a, F: AcirField + Serialize + for<'b> Deserialize<'b>> ForeignCallExecutor - for TestForeignCallExecutor<'a, F> +impl ForeignCallExecutor for TestForeignCallExecutor +where + F: AcirField, + E: ForeignCallExecutor, { fn execute( &mut self, @@ -317,46 +290,14 @@ impl<'a, F: AcirField + Serialize + for<'b> Deserialize<'b>> ForeignCallExecutor ) -> Result, ForeignCallError> { // If the circuit has reached a new foreign call opcode then it can't have failed from any previous unknown foreign calls. self.encountered_unknown_foreign_call = false; - - let foreign_call_name = foreign_call.function.as_str(); - match ForeignCall::lookup(foreign_call_name) { - Some(ForeignCall::Print) => self.printer.execute(foreign_call), - - Some( - ForeignCall::CreateMock - | ForeignCall::SetMockParams - | ForeignCall::GetMockLastParams - | ForeignCall::SetMockReturns - | ForeignCall::SetMockTimes - | ForeignCall::ClearMock, - ) => self.mocker.execute(foreign_call), - - None => { - // First check if there's any defined mock responses for this foreign call. - match self.mocker.execute(foreign_call) { - Err(ForeignCallError::NoHandler(_)) => (), - response_or_error => return response_or_error, - }; - - if let Some(external_resolver) = &mut self.external { - // If the user has registered an external resolver then we forward any remaining oracle calls there. - match external_resolver.execute(foreign_call) { - Err(ForeignCallError::NoHandler(_)) => (), - response_or_error => return response_or_error, - }; - } - + match self.executor.execute(foreign_call) { + Err(ForeignCallError::NoHandler(_)) => { self.encountered_unknown_foreign_call = true; - - // If all executors have no handler for the given foreign call then we cannot - // return a correct response to the ACVM. The best we can do is to return an empty response, - // this allows us to ignore any foreign calls which exist solely to pass information from inside - // the circuit to the environment (e.g. custom logging) as the execution will still be able to progress. - // - // We optimistically return an empty response for all oracle calls as the ACVM will error - // should a response have been required. - Ok(ForeignCallResult::default()) + // If the inner executor cannot handle this foreign call, then it's very likely that this is a custom + // foreign call. We then return an empty response in case the foreign call doesn't need return values. + layers::Empty.execute(foreign_call) } + other => other, } } } diff --git a/noir/noir-repo/tooling/nargo_cli/Cargo.toml b/noir/noir-repo/tooling/nargo_cli/Cargo.toml index 5603b7f4fca..f7a98b4c278 100644 --- a/noir/noir-repo/tooling/nargo_cli/Cargo.toml +++ b/noir/noir-repo/tooling/nargo_cli/Cargo.toml @@ -27,7 +27,13 @@ clap.workspace = true fm.workspace = true fxhash.workspace = true iter-extended.workspace = true -nargo.workspace = true +# This is the only crate that really needs the RPC feature, +# but enabling it here implicitly enables it for the whole +# workspace. A crate could opt out using `path` dependency, +# but it's only `noir_wasm` which couldn't compile with it, +# and that is a different target, and for that the feature +# aren't unified with this one. +nargo = { workspace = true, features = ["rpc"] } nargo_fmt.workspace = true nargo_toml.workspace = true noir_lsp.workspace = true @@ -88,12 +94,10 @@ proptest.workspace = true sha2.workspace = true sha3.workspace = true iai = "0.1.1" -test-binary = "3.0.2" test-case.workspace = true lazy_static.workspace = true light-poseidon = "0.2.0" - [[bench]] name = "criterion" harness = false diff --git a/noir/noir-repo/tooling/nargo_cli/benches/criterion.rs b/noir/noir-repo/tooling/nargo_cli/benches/criterion.rs index 9bc50f87d8e..3d81ade65bc 100644 --- a/noir/noir-repo/tooling/nargo_cli/benches/criterion.rs +++ b/noir/noir-repo/tooling/nargo_cli/benches/criterion.rs @@ -3,7 +3,6 @@ use acvm::{acir::native_types::WitnessMap, FieldElement}; use assert_cmd::prelude::{CommandCargoExt, OutputAssertExt}; use criterion::{criterion_group, criterion_main, Criterion}; -use nargo::PrintOutput; use noirc_abi::{ input_parser::{Format, InputValue}, Abi, InputMap, @@ -116,7 +115,7 @@ fn criterion_test_execution(c: &mut Criterion, test_program_dir: &Path, force_br let artifacts = RefCell::new(None); let mut foreign_call_executor = - nargo::foreign_calls::DefaultForeignCallExecutor::new(PrintOutput::None, None, None, None); + nargo::foreign_calls::DefaultForeignCallBuilder::default().build(); c.bench_function(&benchmark_name, |b| { b.iter_batched( diff --git a/noir/noir-repo/tooling/nargo_cli/src/cli/info_cmd.rs b/noir/noir-repo/tooling/nargo_cli/src/cli/info_cmd.rs index ee8ff32922e..6320cbbf350 100644 --- a/noir/noir-repo/tooling/nargo_cli/src/cli/info_cmd.rs +++ b/noir/noir-repo/tooling/nargo_cli/src/cli/info_cmd.rs @@ -3,8 +3,7 @@ use bn254_blackbox_solver::Bn254BlackBoxSolver; use clap::Args; use iter_extended::vecmap; use nargo::{ - constants::PROVER_INPUT_FILE, foreign_calls::DefaultForeignCallExecutor, package::Package, - PrintOutput, + constants::PROVER_INPUT_FILE, foreign_calls::DefaultForeignCallBuilder, package::Package, }; use nargo_toml::{get_package_manifest, resolve_workspace_from_toml}; use noirc_abi::input_parser::Format; @@ -255,7 +254,7 @@ fn profile_brillig_execution( &program_artifact.bytecode, initial_witness, &Bn254BlackBoxSolver, - &mut DefaultForeignCallExecutor::new(PrintOutput::None, None, None, None), + &mut DefaultForeignCallBuilder::default().build(), )?; let expression_width = get_target_width(package.expression_width, expression_width); diff --git a/noir/noir-repo/tooling/nargo_cli/src/cli/test_cmd.rs b/noir/noir-repo/tooling/nargo_cli/src/cli/test_cmd.rs index 1fd4ed2d873..0aa31f36686 100644 --- a/noir/noir-repo/tooling/nargo_cli/src/cli/test_cmd.rs +++ b/noir/noir-repo/tooling/nargo_cli/src/cli/test_cmd.rs @@ -14,8 +14,9 @@ use clap::Args; use fm::FileManager; use formatters::{Formatter, JsonFormatter, PrettyFormatter, TerseFormatter}; use nargo::{ - insert_all_files_for_workspace_into_file_manager, ops::TestStatus, package::Package, parse_all, - prepare_package, workspace::Workspace, PrintOutput, + foreign_calls::DefaultForeignCallBuilder, insert_all_files_for_workspace_into_file_manager, + ops::TestStatus, package::Package, parse_all, prepare_package, workspace::Workspace, + PrintOutput, }; use nargo_toml::{get_package_manifest, resolve_workspace_from_toml}; use noirc_driver::{check_crate, CompileOptions, NOIR_ARTIFACT_VERSION_STRING}; @@ -42,6 +43,10 @@ pub(crate) struct TestCommand { #[clap(long)] exact: bool, + /// Print all matching test names. + #[clap(long)] + list_tests: bool, + #[clap(flatten)] pub(super) package_options: PackageOptions, @@ -170,6 +175,15 @@ impl<'a> TestRunner<'a> { // First compile all packages and collect their tests let packages_tests = self.collect_packages_tests()?; + if self.args.list_tests { + for (package_name, package_tests) in packages_tests { + for test in package_tests { + println!("{} {}", package_name, test.name); + } + } + return Ok(()); + } + // Now gather all tests and how many are per packages let mut tests = Vec::new(); let mut test_count_per_package = BTreeMap::new(); @@ -494,10 +508,16 @@ impl<'a> TestRunner<'a> { &mut context, test_function, PrintOutput::String(&mut output_string), - foreign_call_resolver_url, - root_path, - Some(package_name), &self.args.compile_options, + |output, base| { + DefaultForeignCallBuilder { + output, + resolver_url: foreign_call_resolver_url.map(|s| s.to_string()), + root_path: root_path.clone(), + package_name: Some(package_name.clone()), + } + .build_with_base(base) + }, ); (test_status, output_string) } diff --git a/noir/noir-repo/tooling/nargo_cli/tests/execute.rs b/noir/noir-repo/tooling/nargo_cli/tests/execute.rs index 561520c57a9..77d77cfd902 100644 --- a/noir/noir-repo/tooling/nargo_cli/tests/execute.rs +++ b/noir/noir-repo/tooling/nargo_cli/tests/execute.rs @@ -12,8 +12,6 @@ mod tests { use super::*; - test_binary::build_test_binary_once!(mock_backend, "../backend_interface/test-binaries"); - // Utilities to keep the test matrix labels more intuitive. #[derive(Debug, Clone, Copy)] struct ForceBrillig(pub bool); diff --git a/noir/noir-repo/tooling/nargo_cli/tests/stdlib-props.rs b/noir/noir-repo/tooling/nargo_cli/tests/stdlib-props.rs index 9750eb823a6..8f08703ab04 100644 --- a/noir/noir-repo/tooling/nargo_cli/tests/stdlib-props.rs +++ b/noir/noir-repo/tooling/nargo_cli/tests/stdlib-props.rs @@ -2,9 +2,7 @@ use std::{cell::RefCell, collections::BTreeMap, path::Path}; use acvm::{acir::native_types::WitnessStack, AcirField, FieldElement}; use iter_extended::vecmap; -use nargo::{ - foreign_calls::DefaultForeignCallExecutor, ops::execute_program, parse_all, PrintOutput, -}; +use nargo::{foreign_calls::DefaultForeignCallBuilder, ops::execute_program, parse_all}; use noirc_abi::input_parser::InputValue; use noirc_driver::{ compile_main, file_manager_with_stdlib, prepare_crate, CompilationResult, CompileOptions, @@ -81,8 +79,7 @@ fn run_snippet_proptest( }; let blackbox_solver = bn254_blackbox_solver::Bn254BlackBoxSolver; - let foreign_call_executor = - RefCell::new(DefaultForeignCallExecutor::new(PrintOutput::None, None, None, None)); + let foreign_call_executor = RefCell::new(DefaultForeignCallBuilder::default().build()); // Generate multiple input/output proptest!(ProptestConfig::with_cases(100), |(io in strategy)| { diff --git a/noir/noir-repo/tooling/nargo_cli/tests/stdlib-tests.rs b/noir/noir-repo/tooling/nargo_cli/tests/stdlib-tests.rs index 29b871814b8..6aae94f6645 100644 --- a/noir/noir-repo/tooling/nargo_cli/tests/stdlib-tests.rs +++ b/noir/noir-repo/tooling/nargo_cli/tests/stdlib-tests.rs @@ -2,6 +2,7 @@ #![allow(clippy::items_after_test_module)] use clap::Parser; use fm::FileManager; +use nargo::foreign_calls::DefaultForeignCallBuilder; use nargo::PrintOutput; use noirc_driver::{check_crate, file_manager_with_stdlib, CompileOptions}; use noirc_frontend::hir::FunctionNameMatch; @@ -88,10 +89,10 @@ fn run_stdlib_tests(force_brillig: bool, inliner_aggressiveness: i64) { &mut context, &test_function, PrintOutput::Stdout, - None, - Some(dummy_package.root_dir.clone()), - Some(dummy_package.name.to_string()), &CompileOptions { force_brillig, inliner_aggressiveness, ..Default::default() }, + |output, base| { + DefaultForeignCallBuilder { output, ..Default::default() }.build_with_base(base) + }, ); (test_name, status) }) diff --git a/noir/noir-repo/tooling/nargo_fmt/src/formatter/function.rs b/noir/noir-repo/tooling/nargo_fmt/src/formatter/function.rs index 8207db5e486..ca905f3dcf8 100644 --- a/noir/noir-repo/tooling/nargo_fmt/src/formatter/function.rs +++ b/noir/noir-repo/tooling/nargo_fmt/src/formatter/function.rs @@ -19,10 +19,11 @@ pub(super) struct FunctionToFormat { pub(super) return_visibility: Visibility, pub(super) where_clause: Vec, pub(super) body: Option, + pub(super) skip_visibility: bool, } impl<'a> Formatter<'a> { - pub(super) fn format_function(&mut self, func: NoirFunction) { + pub(super) fn format_function(&mut self, func: NoirFunction, skip_visibility: bool) { self.format_function_impl(FunctionToFormat { attributes: func.def.attributes, visibility: func.def.visibility, @@ -33,6 +34,7 @@ impl<'a> Formatter<'a> { return_visibility: func.def.return_visibility, where_clause: func.def.where_clause, body: Some(func.def.body), + skip_visibility, }); } @@ -41,7 +43,7 @@ impl<'a> Formatter<'a> { self.format_attributes(func.attributes); self.write_indentation(); - self.format_function_modifiers(func.visibility); + self.format_function_modifiers(func.visibility, func.skip_visibility); self.write_keyword(Keyword::Fn); self.write_space(); self.write_identifier(func.name); @@ -94,7 +96,11 @@ impl<'a> Formatter<'a> { } } - pub(super) fn format_function_modifiers(&mut self, visibility: ItemVisibility) { + pub(super) fn format_function_modifiers( + &mut self, + visibility: ItemVisibility, + skip_visibility: bool, + ) { // For backwards compatibility, unconstrained might come before visibility. // We'll remember this but put it after the visibility. let unconstrained = if self.is_at_keyword(Keyword::Unconstrained) { @@ -105,7 +111,14 @@ impl<'a> Formatter<'a> { false }; - self.format_item_visibility(visibility); + if skip_visibility { + // The intention here is to format the visibility into a temporary buffer that is discarded + self.chunk_formatter().chunk(|formatter| { + formatter.format_item_visibility(visibility); + }); + } else { + self.format_item_visibility(visibility); + } if unconstrained { self.write("unconstrained "); diff --git a/noir/noir-repo/tooling/nargo_fmt/src/formatter/impls.rs b/noir/noir-repo/tooling/nargo_fmt/src/formatter/impls.rs index 1c2c25c9200..71548dd5efa 100644 --- a/noir/noir-repo/tooling/nargo_fmt/src/formatter/impls.rs +++ b/noir/noir-repo/tooling/nargo_fmt/src/formatter/impls.rs @@ -38,7 +38,9 @@ impl<'a> Formatter<'a> { if !doc_comments.is_empty() { self.format_outer_doc_comments(); } - self.format_function(method); + self.format_function( + method, false, // skip visibility + ); } self.skip_comments_and_whitespace(); diff --git a/noir/noir-repo/tooling/nargo_fmt/src/formatter/item.rs b/noir/noir-repo/tooling/nargo_fmt/src/formatter/item.rs index 521e476fe71..3365e52ec29 100644 --- a/noir/noir-repo/tooling/nargo_fmt/src/formatter/item.rs +++ b/noir/noir-repo/tooling/nargo_fmt/src/formatter/item.rs @@ -58,7 +58,10 @@ impl<'a> Formatter<'a> { ItemKind::Import(use_tree, item_visibility) => { self.format_import(use_tree, item_visibility); } - ItemKind::Function(noir_function) => self.format_function(noir_function), + ItemKind::Function(noir_function) => self.format_function( + noir_function, + false, // skip visibility + ), ItemKind::Struct(noir_struct) => self.format_struct(noir_struct), ItemKind::Trait(noir_trait) => self.format_trait(noir_trait), ItemKind::TraitImpl(noir_trait_impl) => self.format_trait_impl(noir_trait_impl), diff --git a/noir/noir-repo/tooling/nargo_fmt/src/formatter/trait_impl.rs b/noir/noir-repo/tooling/nargo_fmt/src/formatter/trait_impl.rs index b31da8a4101..5bb9a0d0025 100644 --- a/noir/noir-repo/tooling/nargo_fmt/src/formatter/trait_impl.rs +++ b/noir/noir-repo/tooling/nargo_fmt/src/formatter/trait_impl.rs @@ -1,8 +1,5 @@ use noirc_frontend::{ - ast::{ - FunctionDefinition, ItemVisibility, NoirFunction, NoirTraitImpl, Pattern, TraitImplItem, - TraitImplItemKind, - }, + ast::{NoirTraitImpl, Pattern, TraitImplItem, TraitImplItemKind}, token::{Keyword, Token}, }; @@ -69,12 +66,10 @@ impl<'a> Formatter<'a> { fn format_trait_impl_item(&mut self, item: TraitImplItem) { match item.kind { TraitImplItemKind::Function(noir_function) => { - // Trait impl functions are public, but there's no `pub` keyword in the source code, - // so to format it we pass a private one. - let def = - FunctionDefinition { visibility: ItemVisibility::Private, ..noir_function.def }; - let noir_function = NoirFunction { def, ..noir_function }; - self.format_function(noir_function); + self.format_function( + noir_function, + true, // skip visibility + ); } TraitImplItemKind::Constant(name, typ, value) => { let pattern = Pattern::Identifier(name); @@ -179,6 +174,22 @@ fn foo ( ) { } assert_format(src, expected); } + #[test] + fn format_trait_impl_function_with_visibility() { + let src = " mod moo { impl Foo for Bar { + /// Some doc comment +pub fn foo ( ) { } + } }"; + let expected = "mod moo { + impl Foo for Bar { + /// Some doc comment + fn foo() {} + } +} +"; + assert_format(src, expected); + } + #[test] fn format_trait_impl_constant_without_type() { let src = " mod moo { impl Foo for Bar { diff --git a/noir/noir-repo/tooling/nargo_fmt/src/formatter/traits.rs b/noir/noir-repo/tooling/nargo_fmt/src/formatter/traits.rs index 1f192be471e..175dcad6170 100644 --- a/noir/noir-repo/tooling/nargo_fmt/src/formatter/traits.rs +++ b/noir/noir-repo/tooling/nargo_fmt/src/formatter/traits.rs @@ -113,6 +113,7 @@ impl<'a> Formatter<'a> { return_visibility: Visibility::Private, where_clause, body, + skip_visibility: true, }; self.format_function_impl(func); } @@ -236,12 +237,12 @@ mod tests { fn format_trait_with_function_without_body() { let src = " mod moo { trait Foo { /// hello - pub fn foo ( ); + fn foo ( ); } }"; let expected = "mod moo { trait Foo { /// hello - pub fn foo(); + fn foo(); } } "; @@ -252,12 +253,12 @@ mod tests { fn format_trait_with_function_with_body() { let src = " mod moo { trait Foo { /// hello - pub fn foo ( ) { 1 } + fn foo ( ) { 1 } } }"; let expected = "mod moo { trait Foo { /// hello - pub fn foo() { + fn foo() { 1 } } @@ -270,12 +271,12 @@ mod tests { fn format_trait_with_function_with_params() { let src = " mod moo { trait Foo { /// hello - pub fn foo ( x : i32 , y : Field ); + fn foo ( x : i32 , y : Field ); } }"; let expected = "mod moo { trait Foo { /// hello - pub fn foo(x: i32, y: Field); + fn foo(x: i32, y: Field); } } "; @@ -298,6 +299,24 @@ mod tests { assert_format(src, expected); } + #[test] + fn format_trait_with_function_with_visibility() { + let src = " mod moo { trait Foo { + /// hello + pub fn foo ( ) { 1 } + } }"; + let expected = "mod moo { + trait Foo { + /// hello + fn foo() { + 1 + } + } +} +"; + assert_format(src, expected); + } + #[test] fn format_multiple_traits() { let src = " trait Foo {} diff --git a/noir/noir-repo/tooling/nargo_fmt/src/lib.rs b/noir/noir-repo/tooling/nargo_fmt/src/lib.rs index eda77e78c7c..2b55b86e975 100644 --- a/noir/noir-repo/tooling/nargo_fmt/src/lib.rs +++ b/noir/noir-repo/tooling/nargo_fmt/src/lib.rs @@ -66,6 +66,7 @@ pub(crate) fn assert_format_with_config(src: &str, expected: &str, config: Confi use noirc_frontend::parser; let (parsed_module, errors) = parser::parse_program(src); + let errors: Vec<_> = errors.into_iter().filter(|error| !error.is_warning()).collect(); if !errors.is_empty() { panic!("Expected no errors, got: {:?}", errors); } diff --git a/noir/noir-repo/tooling/noir_codegen/package.json b/noir/noir-repo/tooling/noir_codegen/package.json index c96ecd22230..351a29ae595 100644 --- a/noir/noir-repo/tooling/noir_codegen/package.json +++ b/noir/noir-repo/tooling/noir_codegen/package.json @@ -3,7 +3,7 @@ "contributors": [ "The Noir Team " ], - "version": "1.0.0-beta.0", + "version": "1.0.0-beta.1", "packageManager": "yarn@3.5.1", "license": "(MIT OR Apache-2.0)", "type": "module", diff --git a/noir/noir-repo/tooling/noir_js/package.json b/noir/noir-repo/tooling/noir_js/package.json index 0f0e111c30b..2a6dc614cb0 100644 --- a/noir/noir-repo/tooling/noir_js/package.json +++ b/noir/noir-repo/tooling/noir_js/package.json @@ -3,7 +3,7 @@ "contributors": [ "The Noir Team " ], - "version": "1.0.0-beta.0", + "version": "1.0.0-beta.1", "packageManager": "yarn@3.5.1", "license": "(MIT OR Apache-2.0)", "type": "module", diff --git a/noir/noir-repo/tooling/noir_js_types/package.json b/noir/noir-repo/tooling/noir_js_types/package.json index 17e9efc7678..057ff29ef25 100644 --- a/noir/noir-repo/tooling/noir_js_types/package.json +++ b/noir/noir-repo/tooling/noir_js_types/package.json @@ -4,7 +4,7 @@ "The Noir Team " ], "packageManager": "yarn@3.5.1", - "version": "1.0.0-beta.0", + "version": "1.0.0-beta.1", "license": "(MIT OR Apache-2.0)", "homepage": "https://noir-lang.org/", "repository": { diff --git a/noir/noir-repo/tooling/noirc_abi/src/lib.rs b/noir/noir-repo/tooling/noirc_abi/src/lib.rs index bd5674d64f1..5f5f3748bc4 100644 --- a/noir/noir-repo/tooling/noirc_abi/src/lib.rs +++ b/noir/noir-repo/tooling/noirc_abi/src/lib.rs @@ -13,10 +13,7 @@ use acvm::{ use errors::AbiError; use input_parser::InputValue; use iter_extended::{try_btree_map, try_vecmap, vecmap}; -use noirc_printable_type::{ - decode_value as printable_type_decode_value, PrintableType, PrintableValue, - PrintableValueDisplay, -}; +use noirc_printable_type::{PrintableType, PrintableValue, PrintableValueDisplay}; use serde::{Deserialize, Serialize}; use std::borrow::Borrow; use std::{collections::BTreeMap, str}; @@ -30,8 +27,11 @@ mod arbitrary; pub mod errors; pub mod input_parser; +mod printable_type; mod serialization; +pub use printable_type::decode_value as decode_printable_value; + /// A map from the fields in an TOML/JSON file which correspond to some ABI to their values pub type InputMap = BTreeMap; @@ -417,7 +417,7 @@ pub fn decode_value( Ok(value) } -fn decode_string_value(field_elements: &[FieldElement]) -> String { +pub fn decode_string_value(field_elements: &[F]) -> String { let string_as_slice = vecmap(field_elements, |e| { let mut field_as_bytes = e.to_be_bytes(); let char_byte = field_as_bytes.pop().unwrap(); // A character in a string is represented by a u8, thus we just want the last byte of the element @@ -476,21 +476,21 @@ pub fn display_abi_error( AbiErrorType::FmtString { length, item_types } => { let mut fields_iter = fields.iter().copied(); let PrintableValue::String(string) = - printable_type_decode_value(&mut fields_iter, &PrintableType::String { length }) + decode_printable_value(&mut fields_iter, &PrintableType::String { length }) else { unreachable!("Got non-string from string decoding"); }; let _length_of_items = fields_iter.next(); let items = item_types.into_iter().map(|abi_type| { let printable_typ = (&abi_type).into(); - let decoded = printable_type_decode_value(&mut fields_iter, &printable_typ); + let decoded = decode_printable_value(&mut fields_iter, &printable_typ); (decoded, printable_typ) }); PrintableValueDisplay::FmtString(string, items.collect()) } AbiErrorType::Custom(abi_typ) => { let printable_type = (&abi_typ).into(); - let decoded = printable_type_decode_value(&mut fields.iter().copied(), &printable_type); + let decoded = decode_printable_value(&mut fields.iter().copied(), &printable_type); PrintableValueDisplay::Plain(decoded, printable_type) } AbiErrorType::String { string } => { diff --git a/noir/noir-repo/tooling/noirc_abi/src/printable_type.rs b/noir/noir-repo/tooling/noirc_abi/src/printable_type.rs new file mode 100644 index 00000000000..a81eb0ce8f6 --- /dev/null +++ b/noir/noir-repo/tooling/noirc_abi/src/printable_type.rs @@ -0,0 +1,78 @@ +use std::collections::BTreeMap; + +use acvm::acir::AcirField; +use iter_extended::vecmap; + +use noirc_printable_type::{PrintableType, PrintableValue}; + +use crate::decode_string_value; + +/// Assumes that `field_iterator` contains enough field elements in order to decode the [PrintableType] +pub fn decode_value( + field_iterator: &mut impl Iterator, + typ: &PrintableType, +) -> PrintableValue { + match typ { + PrintableType::Field + | PrintableType::SignedInteger { .. } + | PrintableType::UnsignedInteger { .. } + | PrintableType::Boolean => { + let field_element = field_iterator.next().unwrap(); + + PrintableValue::Field(field_element) + } + PrintableType::Array { length, typ } => { + let length = *length as usize; + let mut array_elements = Vec::with_capacity(length); + for _ in 0..length { + array_elements.push(decode_value(field_iterator, typ)); + } + + PrintableValue::Vec { array_elements, is_slice: false } + } + PrintableType::Slice { typ } => { + let length = field_iterator + .next() + .expect("not enough data to decode variable array length") + .to_u128() as usize; + let mut array_elements = Vec::with_capacity(length); + for _ in 0..length { + array_elements.push(decode_value(field_iterator, typ)); + } + + PrintableValue::Vec { array_elements, is_slice: true } + } + PrintableType::Tuple { types } => PrintableValue::Vec { + array_elements: vecmap(types, |typ| decode_value(field_iterator, typ)), + is_slice: false, + }, + PrintableType::String { length } => { + let field_elements: Vec = field_iterator.take(*length as usize).collect(); + + PrintableValue::String(decode_string_value(&field_elements)) + } + PrintableType::Struct { fields, .. } => { + let mut struct_map = BTreeMap::new(); + + for (field_key, param_type) in fields { + let field_value = decode_value(field_iterator, param_type); + + struct_map.insert(field_key.to_owned(), field_value); + } + + PrintableValue::Struct(struct_map) + } + PrintableType::Function { env, .. } => { + let field_element = field_iterator.next().unwrap(); + let func_ref = PrintableValue::Field(field_element); + // we want to consume the fields from the environment, but for now they are not actually printed + decode_value(field_iterator, env); + func_ref + } + PrintableType::MutableReference { typ } => { + // we decode the reference, but it's not really used for printing + decode_value(field_iterator, typ) + } + PrintableType::Unit => PrintableValue::Field(F::zero()), + } +} diff --git a/noir/noir-repo/tooling/noirc_abi_wasm/package.json b/noir/noir-repo/tooling/noirc_abi_wasm/package.json index 9194714454d..0148a9343db 100644 --- a/noir/noir-repo/tooling/noirc_abi_wasm/package.json +++ b/noir/noir-repo/tooling/noirc_abi_wasm/package.json @@ -3,7 +3,7 @@ "contributors": [ "The Noir Team " ], - "version": "1.0.0-beta.0", + "version": "1.0.0-beta.1", "license": "(MIT OR Apache-2.0)", "homepage": "https://noir-lang.org/", "repository": { diff --git a/noir/noir-repo/tooling/noirc_artifacts/src/debug_vars.rs b/noir/noir-repo/tooling/noirc_artifacts/src/debug_vars.rs index aa9328432b8..8efeeebb3aa 100644 --- a/noir/noir-repo/tooling/noirc_artifacts/src/debug_vars.rs +++ b/noir/noir-repo/tooling/noirc_artifacts/src/debug_vars.rs @@ -1,8 +1,9 @@ use acvm::AcirField; +use noirc_abi::decode_printable_value; use noirc_errors::debug_info::{ DebugFnId, DebugFunction, DebugInfo, DebugTypeId, DebugVarId, DebugVariable, }; -use noirc_printable_type::{decode_value, PrintableType, PrintableValue}; +use noirc_printable_type::{PrintableType, PrintableValue}; use std::collections::HashMap; #[derive(Debug, Default, Clone)] @@ -45,7 +46,7 @@ impl DebugVars { &'a self, fn_id: &DebugFnId, frame: &'a HashMap>, - ) -> StackFrame { + ) -> StackFrame<'a, F> { let debug_fn = &self.functions.get(fn_id).expect("failed to find function metadata"); let params: Vec<&str> = @@ -72,7 +73,7 @@ impl DebugVars { .last_mut() .expect("unexpected empty stack frames") .1 - .insert(var_id, decode_value(&mut values.iter().copied(), ptype)); + .insert(var_id, decode_printable_value(&mut values.iter().copied(), ptype)); } pub fn assign_field(&mut self, var_id: DebugVarId, indexes: Vec, values: &[F]) { @@ -143,7 +144,7 @@ impl DebugVars { } }; } - *cursor = decode_value(&mut values.iter().copied(), cursor_type); + *cursor = decode_printable_value(&mut values.iter().copied(), cursor_type); } pub fn assign_deref(&mut self, _var_id: DebugVarId, _values: &[F]) { diff --git a/noir/noir-repo/tooling/profiler/src/cli/execution_flamegraph_cmd.rs b/noir/noir-repo/tooling/profiler/src/cli/execution_flamegraph_cmd.rs index 76b23ebf739..bab15529744 100644 --- a/noir/noir-repo/tooling/profiler/src/cli/execution_flamegraph_cmd.rs +++ b/noir/noir-repo/tooling/profiler/src/cli/execution_flamegraph_cmd.rs @@ -3,13 +3,13 @@ use std::path::{Path, PathBuf}; use acir::circuit::OpcodeLocation; use clap::Args; use color_eyre::eyre::{self, Context}; +use nargo::foreign_calls::DefaultForeignCallBuilder; use nargo::PrintOutput; use crate::flamegraph::{BrilligExecutionSample, FlamegraphGenerator, InfernoFlamegraphGenerator}; use crate::fs::{read_inputs_from_file, read_program_from_file}; use crate::opcode_formatter::format_brillig_opcode; use bn254_blackbox_solver::Bn254BlackBoxSolver; -use nargo::foreign_calls::DefaultForeignCallExecutor; use noirc_abi::input_parser::Format; use noirc_artifacts::debug::DebugArtifact; @@ -55,7 +55,7 @@ fn run_with_generator( &program.bytecode, initial_witness, &Bn254BlackBoxSolver, - &mut DefaultForeignCallExecutor::new(PrintOutput::Stdout, None, None, None), + &mut DefaultForeignCallBuilder::default().with_output(PrintOutput::Stdout).build(), )?; println!("Executed"); diff --git a/noir/scripts/run_test.sh b/noir/scripts/run_test.sh new file mode 100755 index 00000000000..3693ea1a53f --- /dev/null +++ b/noir/scripts/run_test.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -eu + +cd $(dirname $0)/../noir-repo + +export RAYON_NUM_THREADS=1 + +./target/release/deps/$1 --exact $2 \ No newline at end of file diff --git a/spartan/aztec-network/files/config/config-prover-env.sh b/spartan/aztec-network/files/config/config-prover-env.sh index 073547821d4..2d56ed1c897 100644 --- a/spartan/aztec-network/files/config/config-prover-env.sh +++ b/spartan/aztec-network/files/config/config-prover-env.sh @@ -19,6 +19,7 @@ coin_issuer_address=$(echo "$output" | grep -oP 'CoinIssuer Address: \K0x[a-fA-F reward_distributor_address=$(echo "$output" | grep -oP 'RewardDistributor Address: \K0x[a-fA-F0-9]{40}') governance_proposer_address=$(echo "$output" | grep -oP 'GovernanceProposer Address: \K0x[a-fA-F0-9]{40}') governance_address=$(echo "$output" | grep -oP 'Governance Address: \K0x[a-fA-F0-9]{40}') +slash_factory_address=$(echo "$output" | grep -oP 'SlashFactory Address: \K0x[a-fA-F0-9]{40}') # Write the addresses to a file in the shared volume cat </shared/contracts/contracts.env @@ -34,6 +35,7 @@ export COIN_ISSUER_CONTRACT_ADDRESS=$coin_issuer_address export REWARD_DISTRIBUTOR_CONTRACT_ADDRESS=$reward_distributor_address export GOVERNANCE_PROPOSER_CONTRACT_ADDRESS=$governance_proposer_address export GOVERNANCE_CONTRACT_ADDRESS=$governance_address +export SLASH_FACTORY_CONTRACT_ADDRESS=$slash_factory_address EOF cat /shared/contracts/contracts.env diff --git a/spartan/aztec-network/files/config/config-validator-env.sh b/spartan/aztec-network/files/config/config-validator-env.sh index 78b6b319f36..7576d424ee0 100644 --- a/spartan/aztec-network/files/config/config-validator-env.sh +++ b/spartan/aztec-network/files/config/config-validator-env.sh @@ -19,6 +19,7 @@ coin_issuer_address=$(echo "$output" | grep -oP 'CoinIssuer Address: \K0x[a-fA-F reward_distributor_address=$(echo "$output" | grep -oP 'RewardDistributor Address: \K0x[a-fA-F0-9]{40}') governance_proposer_address=$(echo "$output" | grep -oP 'GovernanceProposer Address: \K0x[a-fA-F0-9]{40}') governance_address=$(echo "$output" | grep -oP 'Governance Address: \K0x[a-fA-F0-9]{40}') +slash_factory_address=$(echo "$output" | grep -oP 'SlashFactory Address: \K0x[a-fA-F0-9]{40}') # We assume that there is an env var set for validator keys from the config map # We get the index in the config map from the pod name, which will have the validator index within it @@ -39,6 +40,7 @@ export COIN_ISSUER_CONTRACT_ADDRESS=$coin_issuer_address export REWARD_DISTRIBUTOR_CONTRACT_ADDRESS=$reward_distributor_address export GOVERNANCE_PROPOSER_CONTRACT_ADDRESS=$governance_proposer_address export GOVERNANCE_CONTRACT_ADDRESS=$governance_address +export SLASH_FACTORY_CONTRACT_ADDRESS=$slash_factory_address export VALIDATOR_PRIVATE_KEY=$private_key export L1_PRIVATE_KEY=$private_key export SEQ_PUBLISHER_PRIVATE_KEY=$private_key diff --git a/spartan/aztec-network/files/config/deploy-l1-contracts.sh b/spartan/aztec-network/files/config/deploy-l1-contracts.sh index 855372ca77c..d9352ed0b39 100755 --- a/spartan/aztec-network/files/config/deploy-l1-contracts.sh +++ b/spartan/aztec-network/files/config/deploy-l1-contracts.sh @@ -48,6 +48,7 @@ coin_issuer_address=$(echo "$output" | grep -oP 'CoinIssuer Address: \K0x[a-fA-F reward_distributor_address=$(echo "$output" | grep -oP 'RewardDistributor Address: \K0x[a-fA-F0-9]{40}') governance_proposer_address=$(echo "$output" | grep -oP 'GovernanceProposer Address: \K0x[a-fA-F0-9]{40}') governance_address=$(echo "$output" | grep -oP 'Governance Address: \K0x[a-fA-F0-9]{40}') +slash_factory_address=$(echo "$output" | grep -oP 'SlashFactory Address: \K0x[a-fA-F0-9]{40}') # Write the addresses to a file in the shared volume cat </shared/contracts/contracts.env @@ -62,6 +63,7 @@ export COIN_ISSUER_CONTRACT_ADDRESS=$coin_issuer_address export REWARD_DISTRIBUTOR_CONTRACT_ADDRESS=$reward_distributor_address export GOVERNANCE_PROPOSER_CONTRACT_ADDRESS=$governance_proposer_address export GOVERNANCE_CONTRACT_ADDRESS=$governance_address +export SLASH_FACTORY_CONTRACT_ADDRESS=$slash_factory_address EOF cat /shared/contracts/contracts.env diff --git a/spartan/aztec-network/values/rc-1.yaml b/spartan/aztec-network/values/rc-1.yaml index f38470a775b..249fd2a6569 100644 --- a/spartan/aztec-network/values/rc-1.yaml +++ b/spartan/aztec-network/values/rc-1.yaml @@ -126,7 +126,7 @@ bootNode: storageSize: "100Gi" proverAgent: - replicas: 12 + replicas: 60 bb: hardwareConcurrency: 31 gke: @@ -139,7 +139,7 @@ proverAgent: bot: followChain: "PENDING" enabled: true - txIntervalSeconds: 300 + txIntervalSeconds: 10 jobs: deployL1Verifier: diff --git a/spartan/aztec-network/values/release-devnet.yaml b/spartan/aztec-network/values/release-devnet.yaml index a6bf3ce8c53..16a9ca389ca 100644 --- a/spartan/aztec-network/values/release-devnet.yaml +++ b/spartan/aztec-network/values/release-devnet.yaml @@ -18,11 +18,15 @@ bootNode: disabled: true proverAgent: - replicas: 1 + replicas: 10 + bb: + hardwareConcurrency: 31 + gke: + spotEnabled: true resources: requests: - memory: "4Gi" - cpu: "1" + memory: "116Gi" + cpu: "31" bot: followChain: "PENDING" diff --git a/spartan/aztec-network/values/sepolia-48-validators-with-metrics.yaml b/spartan/aztec-network/values/sepolia-48-validators-with-metrics.yaml new file mode 100644 index 00000000000..9e944e701fb --- /dev/null +++ b/spartan/aztec-network/values/sepolia-48-validators-with-metrics.yaml @@ -0,0 +1,76 @@ +telemetry: + enabled: true + otelCollectorEndpoint: http://metrics-opentelemetry-collector.metrics:4318 + +network: + setupL2Contracts: false + public: false + +ethereum: + externalHost: + chainId: "11155111" + deployL1ContractsPrivateKey: + +validator: + replicas: 48 + validatorKeys: + validatorAddresses: + - 0xcD92B30FeFbD2752fF80dD1d152347B1C0b80555 + - 0x3eb04876AEaC0ecB2095D5be5FCE965BE114f6Ea + - 0x69746Fc304C08331C5B3F0E4A8Be82Bbe9079de7 + - 0x11eCa503d1A4C89EA801B5428690844378FF8EDb + - 0x690944149F6090F8B8131d21B7C9243f44953dA3 + - 0x9991124C826d4b469544A326B8e93C7ea6291Df6 + - 0x790a1ACe055c42Ef0aDd7C94b0605e68F4F7ac32 + - 0x3bb53E1A35768B250185d9a1E3A220dfcFD21959 + - 0x1a42bfAF536DD0931AbDb6C7b5d6a2e795849111 + - 0x0b69F2c3b1DCe6974c860655C1B1A0bE209F0EEe + - 0x15dC3B5b63B2846Caf36631b4cc89EC2133484A3 + - 0xEb81BB1891ad6bDB88Bd870703e8E8ca809bF76e + - 0xe484C194039a2D1334F9f701e6AeEAdb2b1009F8 + - 0xC1f9e958888FcfB74C0f72FF4fcA8525a2FD7577 + - 0x27A99682eF70cE26CBe981B2E0BEA2f608bfD44D + - 0xb010Fb11B64Ad756721884d84E66dF0Aa96F1f5f + - 0xC5E960E795284a7AF2F1b5ED3acb17cE51143342 + - 0x44C08d1b44C5D099ecCB626297541E9214aED279 + - 0x78117dD80E4e54EFFd9546Dce1719fB5df30a0A1 + - 0x941d42B68BE5B50f32b24e39c7C48A07Cda37f34 + - 0xAbE28C0BA704111b03903BCBC92c486CE457eC3C + - 0xb0F15e42B0b234070C222B02e173b1e1263E9Bad + - 0xbEaB732a958301EF542DD465DFfcaaa7DA0D64cA + - 0x56C4277eACF43a4a19dEafa2617776f88566C9A8 + - 0xfCaEA5838C6C5a90DA0DE920a122998D7F72e049 + - 0xB204ed1f6cD2E7609421477DA004Aad34eD44aa2 + - 0x5e6a2e947b506f0E06E94b5C421097564c1bf7B1 + - 0x4f321D1922ECDAc05F137E6E9cD2b2873D02b13C + - 0x7964e6211fC121Fb4577d25729724aD97AfD6349 + - 0x3Bf8F13D4D2d218B25C91F3C5d983c3cd25c686D + - 0xb310E13232e3a85b19123adA4E0762B3dC50B4E6 + - 0x8C0B299a706beB7FCE32F820A40f558451534880 + - 0xF88c298c08A46d235d688Eb9CFEA7A1B704842bC + - 0xe2a2ff6cA23AeCD58Aa5c2E5bEA89c2142Ce20cc + - 0x47D8383296B3Db67726fFb4dbDE21a15A17f5084 + - 0xdE5e20DCB0781072341294f8bEfd3811E043f5Ca + - 0x686aC93A652194D6F7f3CF996C61B72cab1A3B4e + - 0x719b0E230E9c9F42C6485cc4DF0347318ced8daa + - 0x829CC1ad52d6c09e9F2249B69C42B99180FC8c17 + - 0xEf051f942CAE84d86c8DED6f45632547E4f6b945 + - 0x54D1aDec93f2EbA4fb90Bb140b56bd822c867e7D + - 0x879B29Bcef645E778136A2Ab727dc1691c089DE7 + - 0x88f7C34641378E6e82F3e949c067589A0B38eacd + - 0x96C668DE46451ECD4F8C8FB16D342EC679f6E87f + - 0x981f78212b18671aA5A449d482001EDC1e00303D + - 0x6BE5a2c8250A2c8342E96a365957933DEbe22ca0 + validator: + disabled: false + +bootNode: + seqPublisherPrivateKey: + validator: + disabled: true + +proverNode: + proverPublisherPrivateKey: + +bot: + txIntervalSeconds: 20 \ No newline at end of file diff --git a/spartan/metrics/.gitignore b/spartan/metrics/.gitignore new file mode 100644 index 00000000000..7d101009614 --- /dev/null +++ b/spartan/metrics/.gitignore @@ -0,0 +1 @@ +values.yaml \ No newline at end of file diff --git a/spartan/metrics/install-kind.sh b/spartan/metrics/install-kind.sh index 3a9ecfb4ccf..5b1c9ce7900 100755 --- a/spartan/metrics/install-kind.sh +++ b/spartan/metrics/install-kind.sh @@ -10,6 +10,10 @@ if helm ls --namespace metrics | grep -q metrics; then exit 0 fi +# Inject the Aztec Networks dashboard into values.yaml +DASHBOARD_JSON=$(jq -c '.' grafana_dashboards/aztec-dashboard-all-in-one.json) +DASHBOARD_JSON=$DASHBOARD_JSON yq e '.grafana.dashboards.default."aztec-networks".json = strenv(DASHBOARD_JSON)' values.tmp.yaml > values.yaml + helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts helm repo add grafana https://grafana.github.io/helm-charts helm repo add prometheus-community https://prometheus-community.github.io/helm-charts diff --git a/spartan/metrics/install-prod.sh b/spartan/metrics/install-prod.sh index a61cc2b8ef4..edb5af00aa7 100755 --- a/spartan/metrics/install-prod.sh +++ b/spartan/metrics/install-prod.sh @@ -3,4 +3,7 @@ set -eu cd "$(dirname "${BASH_SOURCE[0]}")" +DASHBOARD_JSON=$(jq -c '.' grafana_dashboards/aztec-dashboard-all-in-one.json) +DASHBOARD_JSON=$DASHBOARD_JSON yq e '.grafana.dashboards.default."aztec-networks".json = strenv(DASHBOARD_JSON)' values.tmp.yaml > values.yaml + helm upgrade metrics . -n metrics --values "./values/prod.yaml" --install --create-namespace $@ diff --git a/spartan/metrics/values.tmp.yaml b/spartan/metrics/values.tmp.yaml new file mode 100644 index 00000000000..f6eb0e506c1 --- /dev/null +++ b/spartan/metrics/values.tmp.yaml @@ -0,0 +1,166 @@ +opentelemetry-collector: + mode: deployment + + service: + enabled: true + + image: + repository: "otel/opentelemetry-collector-contrib" + + ports: + otlp-http: + enabled: true + containerPort: 4318 + servicePort: 4318 + hostPort: 4318 + protocol: TCP + otel-metrics: + enabled: true + containerPort: 8888 + servicePort: 8888 + hostPort: 8888 + protocol: TCP + aztec-metrics: + enabled: true + containerPort: 8889 + servicePort: 8889 + hostPort: 8889 + protocol: TCP + + presets: + kubernetesAttributes: + enabled: true + config: + extensions: + health_check: + endpoint: ${env:MY_POD_IP}:13133 + processors: + resource: + attributes: + - action: preserve + key: k8s.namespace.name + batch: {} + receivers: + otlp: + protocols: + http: + endpoint: ${env:MY_POD_IP}:4318 + grpc: + endpoint: ${env:MY_POD_IP}:4317 + service: + extensions: [health_check] + telemetry: + metrics: + address: ${env:MY_POD_IP}:8888 + pipelines: + logs: + receivers: + - otlp + processors: + - batch + exporters: + - otlphttp/logs + traces: + receivers: + - otlp + processors: + - batch + exporters: + - otlp/tempo + metrics: + receivers: + - otlp + processors: + - batch + exporters: + - prometheus + # - debug + +# Enable and configure the Loki subchart +# https://artifacthub.io/packages/helm/grafana/loki +# loki: +# Nothing set here, because we need to use values from the values directory; +# otherwise, things don't get overridden correctly. + +# Enable and configure the Tempo subchart +# https://artifacthub.io/packages/helm/grafana/tempo +tempo: + minio: + enabled: true + mode: standalone + rootUser: grafana-tempo + rootPassword: supersecret + buckets: + # Default Tempo storage bucket + - name: tempo-traces + policy: none + purge: false + traces: + otlp: + grpc: + enabled: true + http: + enabled: true + zipkin: + enabled: false + jaeger: + thriftHttp: + enabled: false + opencensus: + enabled: false + +prometheus: + server: + global: + evaluation_interval: 15s + scrape_interval: 15s + serverFiles: + prometheus.yml: + scrape_configs: + - job_name: otel-collector + static_configs: + - targets: ["metrics-opentelemetry-collector.metrics:8888"] + - job_name: aztec + static_configs: + - targets: ["metrics-opentelemetry-collector.metrics:8889"] + - job_name: "kube-state-metrics" + static_configs: + - targets: + ["metrics-kube-state-metrics.metrics.svc.cluster.local:8080"] + +# Enable and configure Grafana +# https://artifacthub.io/packages/helm/grafana/grafana +grafana: + datasources: + datasources.yaml: + apiVersion: 1 + datasources: + - name: Loki + type: loki + url: http://metrics-loki.metrics:3100 + - name: Tempo + type: tempo + url: http://metrics-tempo.metrics:3100 + - name: Prometheus + type: prometheus + uid: spartan-metrics-prometheus + isDefault: true + url: http://metrics-prometheus-server.metrics:80 + dashboardProviders: + dashboardproviders.yaml: + apiVersion: 1 + providers: + - name: "default" + orgId: 1 + folder: "" + type: file + disableDeletion: false + editable: true + options: + path: /var/lib/grafana/dashboards/default + dashboards: + default: + # unfortunately, we can't use the `file` helper here, so we have to inline the dashboard + # json. This is a limitation of Helm. + # See the install scripts: we inject the dashboard json into a copy of this file, which is the + # version that actually gets helm installed. diff --git a/spartan/metrics/values.yaml b/spartan/metrics/values.yaml deleted file mode 100644 index df2ca87aa21..00000000000 --- a/spartan/metrics/values.yaml +++ /dev/null @@ -1,332 +0,0 @@ -opentelemetry-collector: - mode: deployment - - service: - enabled: true - - image: - repository: "otel/opentelemetry-collector-contrib" - - ports: - otlp-http: - enabled: true - containerPort: 4318 - servicePort: 4318 - hostPort: 4318 - protocol: TCP - otel-metrics: - enabled: true - containerPort: 8888 - servicePort: 8888 - hostPort: 8888 - protocol: TCP - aztec-metrics: - enabled: true - containerPort: 8889 - servicePort: 8889 - hostPort: 8889 - protocol: TCP - - presets: - kubernetesAttributes: - enabled: true - config: - extensions: - health_check: - endpoint: ${env:MY_POD_IP}:13133 - processors: - resource: - attributes: - - action: preserve - key: k8s.namespace.name - batch: {} - receivers: - otlp: - protocols: - http: - endpoint: ${env:MY_POD_IP}:4318 - grpc: - endpoint: ${env:MY_POD_IP}:4317 - service: - extensions: [health_check] - telemetry: - metrics: - address: ${env:MY_POD_IP}:8888 - pipelines: - logs: - receivers: - - otlp - processors: - - batch - exporters: - - otlphttp/logs - traces: - receivers: - - otlp - processors: - - batch - exporters: - - otlp/tempo - metrics: - receivers: - - otlp - processors: - - batch - exporters: - - prometheus - # - debug - -# Enable and configure the Loki subchart -# https://artifacthub.io/packages/helm/grafana/loki -# loki: -# Nothing set here, because we need to use values from the values directory; -# otherwise, things don't get overridden correctly. - -# Enable and configure the Tempo subchart -# https://artifacthub.io/packages/helm/grafana/tempo -tempo: - minio: - enabled: true - mode: standalone - rootUser: grafana-tempo - rootPassword: supersecret - buckets: - # Default Tempo storage bucket - - name: tempo-traces - policy: none - purge: false - traces: - otlp: - grpc: - enabled: true - http: - enabled: true - zipkin: - enabled: false - jaeger: - thriftHttp: - enabled: false - opencensus: - enabled: false - -prometheus: - server: - global: - evaluation_interval: 15s - scrape_interval: 15s - serverFiles: - prometheus.yml: - scrape_configs: - - job_name: otel-collector - static_configs: - - targets: ["metrics-opentelemetry-collector.metrics:8888"] - - job_name: aztec - static_configs: - - targets: ["metrics-opentelemetry-collector.metrics:8889"] - - job_name: "kube-state-metrics" - static_configs: - - targets: - ["metrics-kube-state-metrics.metrics.svc.cluster.local:8080"] - -# Enable and configure Grafana -# https://artifacthub.io/packages/helm/grafana/grafana -grafana: - datasources: - datasources.yaml: - apiVersion: 1 - datasources: - - name: Loki - type: loki - url: http://metrics-loki.metrics:3100 - - name: Tempo - type: tempo - url: http://metrics-tempo.metrics:3100 - - name: Prometheus - type: prometheus - uid: spartan-metrics-prometheus - isDefault: true - url: http://metrics-prometheus-server.metrics:80 - dashboardProviders: - dashboardproviders.yaml: - apiVersion: 1 - providers: - - name: "default" - orgId: 1 - folder: "" - type: file - disableDeletion: false - editable: true - options: - path: /var/lib/grafana/dashboards/default - dashboards: - default: - # unfortunately, we can't use the `file` helper here, so we have to inline the dashboard - # json. This is a limitation of Helm. - # See https://github.com/helm/helm/issues/1892 - spartan-dashboard: - json: | - { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 1, - "links": [], - "panels": [ - { - "datasource": { - "default": false, - "type": "prometheus", - "uid": "spartan-metrics-prometheus" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "series", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "spartan-metrics-prometheus" - }, - "editorMode": "code", - "expr": "aztec_archiver_block_height", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "L2 Block Height", - "type": "timeseries" - } - ], - "schemaVersion": 39, - "tags": [], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "smoke", - "value": "smoke" - }, - "datasource": { - "type": "prometheus", - "uid": "spartan-metrics-prometheus" - }, - "definition": "label_values(k8s_namespace_name)", - "hide": 0, - "includeAll": false, - "multi": false, - "name": "Deployment", - "options": [], - "query": { - "qryType": 1, - "query": "label_values(k8s_namespace_name)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 1, - "type": "query" - } - ] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": {}, - "timezone": "browser", - "title": "Spartan Deployments", - "uid": "ae01y5sn1bls0a", - "version": 1, - "weekStart": "" - } diff --git a/spartan/releases/create-spartan.sh b/spartan/releases/create-spartan.sh index 7fd1dd89d3b..6c688eec227 100755 --- a/spartan/releases/create-spartan.sh +++ b/spartan/releases/create-spartan.sh @@ -1,7 +1,7 @@ #!/bin/bash # URL of the aztec-spartan.sh script -DEFAULT_URL="https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/spartan/releases/rough-rhino/aztec-spartan.sh" +DEFAULT_URL="https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/spartan/releases/testnet/aztec-spartan.sh" # Colors for output GREEN='\033[0;32m' diff --git a/spartan/releases/rough-rhino/Earthfile b/spartan/releases/testnet/Earthfile similarity index 99% rename from spartan/releases/rough-rhino/Earthfile rename to spartan/releases/testnet/Earthfile index 3e0da23adfc..45a3c82c32f 100644 --- a/spartan/releases/rough-rhino/Earthfile +++ b/spartan/releases/testnet/Earthfile @@ -160,4 +160,4 @@ test-all: BUILD +test-update BUILD +test-data-dir BUILD +test-p2p-key - BUILD +test-ethereum-host + BUILD +test-ethereum-host \ No newline at end of file diff --git a/spartan/releases/rough-rhino/aztec-spartan.sh b/spartan/releases/testnet/aztec-spartan.sh similarity index 97% rename from spartan/releases/rough-rhino/aztec-spartan.sh rename to spartan/releases/testnet/aztec-spartan.sh index 283aeaed7cd..2b90bf5fc0e 100755 --- a/spartan/releases/rough-rhino/aztec-spartan.sh +++ b/spartan/releases/testnet/aztec-spartan.sh @@ -78,10 +78,10 @@ parse_args() { show_banner() { echo -e "${BLUE}" echo " _ ____ _____ _____ _____ _____ _____ ____ _____ _ _ _____ _____ " - echo " / \ |_ /|_ _| ____| __/ |_ _| ____/ ___|_ _| \ | | ____|_ _|" - echo " / _ \ / / | | | _| | | | | | _| \___ \ | | | \| | _| | | " - echo " / ___ \/ /_ | | | |___ | |__ | | | |___ ___) || | | |\ | |___ | | " - echo "/_/ \_\___| |_| |______|____\ |_| |_____|____/ |_| |_| \_|_____| |_| " + echo " / \ |_ /|_ _| _____| __/|_ _| ____/ ___|_ _| \ | | ____|_ _|" + echo " / _ \ / / | | | _| | | | | | _| \___ \ | | | \| | _| | | " + echo " / ___ \/ /_ | | | |___ | |__ | | | |___ ___) || | | |\ | |___ | | " + echo "/_/ \_\___| |_| |______|____\ |_| |_____|____/ |_| |_| \_|_____| |_| " echo -e "${NC}" } diff --git a/yarn-project/.yarn/patches/jest-runner-npm-29.7.0-3bc9f82b58.patch b/yarn-project/.yarn/patches/jest-runner-npm-29.7.0-3bc9f82b58.patch new file mode 100644 index 00000000000..36a2a45009b --- /dev/null +++ b/yarn-project/.yarn/patches/jest-runner-npm-29.7.0-3bc9f82b58.patch @@ -0,0 +1,13 @@ +diff --git a/build/index.js b/build/index.js +index 65c0ed180a1f44a5095f80d572aacb68be1db3da..3bb4938110a50a2eca1b2f01466b7be16c9c8145 100644 +--- a/build/index.js ++++ b/build/index.js +@@ -124,7 +124,7 @@ class TestRunner extends _types.EmittingTestRunner { + enableWorkerThreads: this._globalConfig.workerThreads, + exposedMethods: ['worker'], + forkOptions: { +- serialization: 'json', ++ serialization: 'advanced', + stdio: 'pipe' + }, + // The workerIdleMemoryLimit should've been converted to a number during diff --git a/yarn-project/accounts/package.json b/yarn-project/accounts/package.json index 83ff41b5309..1468b59bad1 100644 --- a/yarn-project/accounts/package.json +++ b/yarn-project/accounts/package.json @@ -65,12 +65,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/archiver/package.json b/yarn-project/archiver/package.json index 7e9a218284f..478aedf90a1 100644 --- a/yarn-project/archiver/package.json +++ b/yarn-project/archiver/package.json @@ -56,12 +56,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/aztec-faucet/package.json b/yarn-project/aztec-faucet/package.json index b0be9805a99..be649f7b998 100644 --- a/yarn-project/aztec-faucet/package.json +++ b/yarn-project/aztec-faucet/package.json @@ -53,12 +53,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/aztec-node/package.json b/yarn-project/aztec-node/package.json index 6f7ec39ff16..9edee48067e 100644 --- a/yarn-project/aztec-node/package.json +++ b/yarn-project/aztec-node/package.json @@ -54,12 +54,7 @@ "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index a801fbabf28..545a6d13d7f 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -73,7 +73,7 @@ import { createP2PClient, } from '@aztec/p2p'; import { ProtocolContractAddress } from '@aztec/protocol-contracts'; -import { GlobalVariableBuilder, type L1Publisher, SequencerClient } from '@aztec/sequencer-client'; +import { GlobalVariableBuilder, type L1Publisher, SequencerClient, createSlasherClient } from '@aztec/sequencer-client'; import { PublicProcessorFactory } from '@aztec/simulator'; import { Attributes, type TelemetryClient, type Traceable, type Tracer, trackSpan } from '@aztec/telemetry-client'; import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; @@ -180,8 +180,10 @@ export class AztecNodeService implements AztecNode, Traceable { telemetry, ); + const slasherClient = await createSlasherClient(config, archiver, telemetry); + // start both and wait for them to sync from the block source - await Promise.all([p2pClient.start(), worldStateSynchronizer.start()]); + await Promise.all([p2pClient.start(), worldStateSynchronizer.start(), slasherClient.start()]); const validatorClient = createValidatorClient(config, { p2pClient, telemetry, dateProvider, epochCache }); @@ -192,6 +194,7 @@ export class AztecNodeService implements AztecNode, Traceable { validatorClient, p2pClient, worldStateSynchronizer, + slasherClient, contractDataSource: archiver, l2BlockSource: archiver, l1ToL2MessageSource: archiver, diff --git a/yarn-project/aztec.js/package.json b/yarn-project/aztec.js/package.json index a18a0400266..1c00eadb280 100644 --- a/yarn-project/aztec.js/package.json +++ b/yarn-project/aztec.js/package.json @@ -70,12 +70,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/aztec.js/src/contract/contract.test.ts b/yarn-project/aztec.js/src/contract/contract.test.ts index 66a54e8cfb5..f45eb0203d1 100644 --- a/yarn-project/aztec.js/src/contract/contract.test.ts +++ b/yarn-project/aztec.js/src/contract/contract.test.ts @@ -47,6 +47,7 @@ describe('Contract Class', () => { coinIssuerAddress: EthAddress.random(), rewardDistributorAddress: EthAddress.random(), governanceProposerAddress: EthAddress.random(), + slashFactoryAddress: EthAddress.random(), }; const mockNodeInfo: NodeInfo = { nodeVersion: 'vx.x.x', diff --git a/yarn-project/aztec/CHANGELOG.md b/yarn-project/aztec/CHANGELOG.md index 540ac77ec33..bf36a15cd5d 100644 --- a/yarn-project/aztec/CHANGELOG.md +++ b/yarn-project/aztec/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [0.69.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-package-v0.68.2...aztec-package-v0.69.0) (2025-01-03) + + +### Miscellaneous + +* Add version number when starting sandbox ([#10935](https://github.com/AztecProtocol/aztec-packages/issues/10935)) ([c8dcd8f](https://github.com/AztecProtocol/aztec-packages/commit/c8dcd8f3e50e6447e1e7a09d768b3aff5f17044b)) +* Cl/ci3.2 ([#10919](https://github.com/AztecProtocol/aztec-packages/issues/10919)) ([49dacc3](https://github.com/AztecProtocol/aztec-packages/commit/49dacc3378a339f8cc36971b630c52952249f60c)) + ## [0.68.2](https://github.com/AztecProtocol/aztec-packages/compare/aztec-package-v0.68.1...aztec-package-v0.68.2) (2024-12-24) diff --git a/yarn-project/aztec/package.json b/yarn-project/aztec/package.json index d8fca706ba1..714b0362802 100644 --- a/yarn-project/aztec/package.json +++ b/yarn-project/aztec/package.json @@ -1,6 +1,6 @@ { "name": "@aztec/aztec", - "version": "0.68.2", + "version": "0.69.0", "type": "module", "exports": { ".": "./dest/index.js" @@ -104,12 +104,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/aztec/src/cli/aztec_start_action.ts b/yarn-project/aztec/src/cli/aztec_start_action.ts index 983afecf019..0e45a891463 100644 --- a/yarn-project/aztec/src/cli/aztec_start_action.ts +++ b/yarn-project/aztec/src/cli/aztec_start_action.ts @@ -6,11 +6,18 @@ import { startHttpRpcServer, } from '@aztec/foundation/json-rpc/server'; import { type LogFn, type Logger } from '@aztec/foundation/log'; +import { fileURLToPath } from '@aztec/foundation/url'; + +import { readFileSync } from 'fs'; +import { dirname, resolve } from 'path'; import { createSandbox } from '../sandbox.js'; import { github, splash } from '../splash.js'; import { createAccountLogs, extractNamespacedOptions, installSignalHandlers } from './util.js'; +const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json'); +const cliVersion: string = JSON.parse(readFileSync(packageJsonPath).toString()).version; + export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logger) { // list of 'stop' functions to call when process ends const signalHandlers: Array<() => Promise> = []; @@ -19,7 +26,8 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg if (options.sandbox) { const sandboxOptions = extractNamespacedOptions(options, 'sandbox'); userLog(`${splash}\n${github}\n\n`); - userLog(`Setting up Aztec Sandbox, please stand by...`); + userLog(`Setting up Aztec Sandbox ${cliVersion}, please stand by...`); + const { aztecNodeConfig, node, pxe, stop } = await createSandbox({ enableGas: sandboxOptions.enableGas, l1Mnemonic: options.l1Mnemonic, diff --git a/yarn-project/bb-prover/package.json b/yarn-project/bb-prover/package.json index d8ead63d687..6606d7e14d4 100644 --- a/yarn-project/bb-prover/package.json +++ b/yarn-project/bb-prover/package.json @@ -58,12 +58,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/bootstrap.sh b/yarn-project/bootstrap.sh index 3398fadc727..5fa2254cf34 100755 --- a/yarn-project/bootstrap.sh +++ b/yarn-project/bootstrap.sh @@ -4,7 +4,8 @@ source $(git rev-parse --show-toplevel)/ci3/source_bootstrap TEST_FLAKES=${TEST_FLAKES:-0} cmd=${1:-} -hash=$(cache_content_hash ../noir/.rebuild_patterns \ +hash=$(cache_content_hash \ + ../noir/.rebuild_patterns \ ../{avm-transpiler,noir-projects,l1-contracts,yarn-project}/.rebuild_patterns \ ../barretenberg/*/.rebuild_patterns) @@ -56,165 +57,13 @@ function build { } function test { - if test_should_run yarn-project-unit-tests-$hash; then - github_group "yarn-project test" - denoise yarn formatting - denoise yarn test - cache_upload_flag yarn-project-unit-tests-$hash - github_endgroup - fi - - test_e2e -} - -function test_e2e { - test_should_run yarn-project-e2e-tests-$hash || return - - github_group "yarn-project e2e tests" - cd end-to-end - - # This is pre-pulled in our build instance ami, so should be a time noop in CI. - denoise docker pull aztecprotocol/build:2.0 - - # List every test individually. Do not put folders. Ensures fair balancing of load and simplifies resource management. - # All tests are run within a docker container to keep them isolated. - # The first element describes how the test should be run, the second is a path to a unique test file. - # Any further elements are environment variables passed to the launching script. - # "simple" tests are single jest tests launched by ./scripts/test_simple.sh in docker. - # "compose" tests are the same, but are launched via docker compose and ./scripts/docker-compose.yml. - # If a test flakes out, mark it as flake in your PR so it no longer runs, and post a message in slack about it. - # To mark it a flake it becomes e.g. "simple-flake" or "compose-flake". - # If you can, try to find whoever is responsible for the test, and have them acknowledge they'll resolve it later. - # DO NOT just re-run your PR and leave flakey tests running to impact on other engineers. - # If you've been tasked with resolving a flakey test, grind on it using e.g.: - # while ./scripts/test.sh simple e2e_2_pxes; do true; done - TESTS=( - "simple e2e_2_pxes" - "simple e2e_account_contracts" - "simple e2e_authwit" - "simple e2e_avm_simulator" - "simple e2e_blacklist_token_contract/access_control" - "simple e2e_blacklist_token_contract/burn" - "simple e2e_blacklist_token_contract/minting" - "simple e2e_blacklist_token_contract/shielding" - "simple e2e_blacklist_token_contract/transfer_private" - "simple e2e_blacklist_token_contract/transfer_public" - "simple e2e_blacklist_token_contract/unshielding" - "simple-flake e2e_block_building" - "simple e2e_bot" - "simple e2e_card_game" - "simple e2e_cheat_codes" - "simple e2e_cross_chain_messaging/l1_to_l2" - "simple e2e_cross_chain_messaging/l2_to_l1" - "simple e2e_cross_chain_messaging/token_bridge_failure_cases" - "simple e2e_cross_chain_messaging/token_bridge_private" - "simple e2e_cross_chain_messaging/token_bridge_public" - "simple e2e_crowdfunding_and_claim" - "simple e2e_deploy_contract/contract_class_registration" - "simple e2e_deploy_contract/deploy_method" - "simple e2e_deploy_contract/legacy" - "simple e2e_deploy_contract/private_initialization" - "simple e2e_escrow_contract" - "simple e2e_event_logs" - "simple e2e_fees/account_init" - "simple e2e_fees/failures" - "simple e2e_fees/fee_juice_payments" - "simple e2e_fees/gas_estimation" - "simple e2e_fees/private_payments" - "simple e2e_keys" - "simple e2e_l1_with_wall_time" - "simple e2e_lending_contract" - "simple e2e_max_block_number" - "simple e2e_multiple_accounts_1_enc_key" - "simple e2e_nested_contract/importer" - "simple e2e_nested_contract/manual_private_call" - "simple e2e_nested_contract/manual_private_enqueue" - "simple e2e_nested_contract/manual_public" - "simple e2e_nft" - "simple e2e_non_contract_account" - "simple e2e_note_getter" - "simple e2e_ordering" - "simple e2e_outbox" - "simple e2e_p2p/gossip_network" - "simple e2e_p2p/rediscovery" - "simple-flake e2e_p2p/reqresp" - "simple-flake e2e_p2p/upgrade_governance_proposer" - "simple e2e_private_voting_contract" - "simple-flake e2e_prover/full FAKE_PROOFS=1" - "simple e2e_prover_coordination" - "simple e2e_public_testnet_transfer" - "simple e2e_state_vars" - "simple e2e_static_calls" - "simple e2e_synching" - "simple e2e_token_contract/access_control" - "simple e2e_token_contract/burn" - "simple e2e_token_contract/minting" - "simple e2e_token_contract/private_transfer_recursion" - "simple e2e_token_contract/reading_constants" - "simple e2e_token_contract/transfer_in_private" - "simple e2e_token_contract/transfer_in_public" - "simple e2e_token_contract/transfer_to_private" - "simple e2e_token_contract/transfer_to_public" - "simple e2e_token_contract/transfer.test" - "simple-flake flakey_e2e_inclusion_proofs_contract" - - "compose composed/docs_examples" - "compose composed/e2e_aztec_js_browser" - "compose composed/e2e_pxe" - "compose composed/e2e_sandbox_example" - "compose composed/integration_l1_publisher" - "compose sample-dapp/index" - "compose sample-dapp/ci/index" - "compose guides/dapp_testing" - "compose guides/up_quick_start" - "compose guides/writing_an_account_contract" - ) - - commands=() - tests=() - env_vars=() - for entry in "${TESTS[@]}"; do - cmd=$(echo "$entry" | awk '{print $1}') - test=$(echo "$entry" | awk '{print $2}') - env=$(echo "$entry" | cut -d' ' -f3-) - if [[ ("$TEST_FLAKES" -eq 1 && "$cmd" =~ .*"-flake") || - ("$TEST_FLAKES" -eq 0 && ! "$cmd" =~ .*"-flake") ]]; then - commands+=("$cmd") - tests+=("$test") - env_vars+=("$env") - fi - done - - # We will halt immediately on failure, unless testing flakes, in which case let it run to the end. - [ "$TEST_FLAKES" -eq 0 ] && local args="--halt now,fail=1" - - rm -rf results - set +e - parallel --timeout 15m --verbose --joblog joblog.txt --results results/{2}-{#}/ ${args:-} \ - '{3} ./scripts/test.sh {1} {2} 2>&1' ::: ${commands[@]} :::+ ${tests[@]} :::+ "${env_vars[@]}" - code=$? - set -e - - # Note this is highly dependent on the command structure above. - # Skip first line (header). - # 7th field (1-indexed) is exit value. - # (NF-1) is the second to last field, so skips the last field "2>&1" to give the test name. - # We can't index from the front because {3} above is a variable length set of env vars. - # We concat the test name with its job number in $1, to allow running the same test with different env vars. - awk 'NR > 1 && $7 != 0 {print $(NF-1) "-" $1}' joblog.txt | while read -r job; do - stdout_file="results/${job}/stdout" - if [ -f "$stdout_file" ]; then - echo "=== Failed Job Output ===" - cat "$stdout_file" - fi - done - - echo "=== Job Log ===" - cat joblog.txt + test_should_run yarn-project-unit-tests-$hash || return 0 + github_group "yarn-project test" + denoise yarn formatting + denoise yarn test + cache_upload_flag yarn-project-unit-tests-$hash github_endgroup - cache_upload_flag yarn-project-e2e-tests-$hash - return $code } case "$cmd" in @@ -233,11 +82,11 @@ case "$cmd" in "test") test ;; - "test-e2e") - TEST=1 test_e2e - ;; - "test-e2e-flakes") - TEST=1 TEST_FLAKES=1 test_e2e + "test-cmds") + for test in !(end-to-end|kv-store|bb-prover|prover-client)/dest/**/*.test.js; do + echo yarn-project/scripts/run_test.sh $test + done + ./end-to-end/bootstrap.sh test-cmds ;; "ci") build full diff --git a/yarn-project/bot/package.json b/yarn-project/bot/package.json index 2bffdb95764..304bac4be34 100644 --- a/yarn-project/bot/package.json +++ b/yarn-project/bot/package.json @@ -44,12 +44,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/builder/package.json b/yarn-project/builder/package.json index 4d646502b29..2232aa01dac 100644 --- a/yarn-project/builder/package.json +++ b/yarn-project/builder/package.json @@ -59,12 +59,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/circuit-types/package.json b/yarn-project/circuit-types/package.json index 7f6445ad14f..42e5e6a1855 100644 --- a/yarn-project/circuit-types/package.json +++ b/yarn-project/circuit-types/package.json @@ -58,12 +58,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/circuits.js/package.json b/yarn-project/circuits.js/package.json index 535b9124aaf..b5941142e50 100644 --- a/yarn-project/circuits.js/package.json +++ b/yarn-project/circuits.js/package.json @@ -94,12 +94,7 @@ "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/cli-wallet/package.json b/yarn-project/cli-wallet/package.json index ce535734133..41cd3291767 100644 --- a/yarn-project/cli-wallet/package.json +++ b/yarn-project/cli-wallet/package.json @@ -57,12 +57,7 @@ ] }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/cli/package.json b/yarn-project/cli/package.json index cc2407f5ee5..21236b4a1c5 100644 --- a/yarn-project/cli/package.json +++ b/yarn-project/cli/package.json @@ -59,12 +59,7 @@ ] }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/cli/src/cmds/infrastructure/sequencers.ts b/yarn-project/cli/src/cmds/infrastructure/sequencers.ts index a3e6c77d39d..cf5dbe7bdc1 100644 --- a/yarn-project/cli/src/cmds/infrastructure/sequencers.ts +++ b/yarn-project/cli/src/cmds/infrastructure/sequencers.ts @@ -1,5 +1,5 @@ import { createCompatibleClient } from '@aztec/aztec.js'; -import { MINIMUM_STAKE, createEthereumChain } from '@aztec/ethereum'; +import { createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum'; import { type LogFn, type Logger } from '@aztec/foundation/log'; import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts'; @@ -71,14 +71,16 @@ export async function sequencers(opts: { client: walletClient, }); + const config = getL1ContractsConfigEnvVars(); + await Promise.all( [ - await stakingAsset.write.mint([walletClient.account.address, MINIMUM_STAKE], {} as any), - await stakingAsset.write.approve([rollup.address, MINIMUM_STAKE], {} as any), + await stakingAsset.write.mint([walletClient.account.address, config.minimumStake], {} as any), + await stakingAsset.write.approve([rollup.address, config.minimumStake], {} as any), ].map(txHash => publicClient.waitForTransactionReceipt({ hash: txHash })), ); - const hash = await writeableRollup.write.deposit([who, who, who, MINIMUM_STAKE]); + const hash = await writeableRollup.write.deposit([who, who, who, config.minimumStake]); await publicClient.waitForTransactionReceipt({ hash }); log(`Added in tx ${hash}`); } else if (command === 'remove') { diff --git a/yarn-project/cli/src/cmds/l1/deploy_l1_contracts.ts b/yarn-project/cli/src/cmds/l1/deploy_l1_contracts.ts index 21ac9d71ec6..39b4bfd4635 100644 --- a/yarn-project/cli/src/cmds/l1/deploy_l1_contracts.ts +++ b/yarn-project/cli/src/cmds/l1/deploy_l1_contracts.ts @@ -48,5 +48,6 @@ export async function deployL1Contracts( log(`RewardDistributor Address: ${l1ContractAddresses.rewardDistributorAddress.toString()}`); log(`GovernanceProposer Address: ${l1ContractAddresses.governanceProposerAddress.toString()}`); log(`Governance Address: ${l1ContractAddresses.governanceAddress.toString()}`); + log(`SlashFactory Address: ${l1ContractAddresses.slashFactoryAddress.toString()}`); } } diff --git a/yarn-project/cli/src/cmds/l1/update_l1_validators.ts b/yarn-project/cli/src/cmds/l1/update_l1_validators.ts index 7d5edca07ba..40d06e2fd6d 100644 --- a/yarn-project/cli/src/cmds/l1/update_l1_validators.ts +++ b/yarn-project/cli/src/cmds/l1/update_l1_validators.ts @@ -1,6 +1,6 @@ import { EthCheatCodes } from '@aztec/aztec.js'; import { type EthAddress } from '@aztec/circuits.js'; -import { MINIMUM_STAKE, createEthereumChain, getL1ContractsConfigEnvVars, isAnvilTestChain } from '@aztec/ethereum'; +import { createEthereumChain, getL1ContractsConfigEnvVars, isAnvilTestChain } from '@aztec/ethereum'; import { type LogFn, type Logger } from '@aztec/foundation/log'; import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts'; @@ -40,6 +40,7 @@ export async function addL1Validator({ log, debugLogger, }: RollupCommandArgs & LoggerArgs & { validatorAddress: EthAddress }) { + const config = getL1ContractsConfigEnvVars(); const dualLog = makeDualLog(log, debugLogger); const publicClient = getPublicClient(rpcUrl, chainId); const walletClient = getWalletClient(rpcUrl, chainId, privateKey, mnemonic); @@ -57,8 +58,8 @@ export async function addL1Validator({ await Promise.all( [ - await stakingAsset.write.mint([walletClient.account.address, MINIMUM_STAKE], {} as any), - await stakingAsset.write.approve([rollupAddress.toString(), MINIMUM_STAKE], {} as any), + await stakingAsset.write.mint([walletClient.account.address, config.minimumStake], {} as any), + await stakingAsset.write.approve([rollupAddress.toString(), config.minimumStake], {} as any), ].map(txHash => publicClient.waitForTransactionReceipt({ hash: txHash })), ); @@ -67,7 +68,7 @@ export async function addL1Validator({ validatorAddress.toString(), validatorAddress.toString(), validatorAddress.toString(), - MINIMUM_STAKE, + config.minimumStake, ]); dualLog(`Transaction hash: ${txHash}`); await publicClient.waitForTransactionReceipt({ hash: txHash }); diff --git a/yarn-project/cli/src/cmds/pxe/get_node_info.ts b/yarn-project/cli/src/cmds/pxe/get_node_info.ts index 329b2428297..fdd44f8d1db 100644 --- a/yarn-project/cli/src/cmds/pxe/get_node_info.ts +++ b/yarn-project/cli/src/cmds/pxe/get_node_info.ts @@ -34,6 +34,7 @@ export async function getNodeInfo( rewardDistributor: info.l1ContractAddresses.rewardDistributorAddress.toString(), governanceProposer: info.l1ContractAddresses.governanceProposerAddress.toString(), governance: info.l1ContractAddresses.governanceAddress.toString(), + slashFactory: info.l1ContractAddresses.slashFactoryAddress.toString(), }, protocolContractAddresses: { classRegisterer: info.protocolContractAddresses.classRegisterer.toString(), @@ -59,6 +60,7 @@ export async function getNodeInfo( log(` RewardDistributor Address: ${info.l1ContractAddresses.rewardDistributorAddress.toString()}`); log(` GovernanceProposer Address: ${info.l1ContractAddresses.governanceProposerAddress.toString()}`); log(` Governance Address: ${info.l1ContractAddresses.governanceAddress.toString()}`); + log(` SlashFactory Address: ${info.l1ContractAddresses.slashFactoryAddress.toString()}`); log(`L2 Contract Addresses:`); log(` Class Registerer: ${info.protocolContractAddresses.classRegisterer.toString()}`); diff --git a/yarn-project/end-to-end/bootstrap.sh b/yarn-project/end-to-end/bootstrap.sh new file mode 100755 index 00000000000..51b3cd813cf --- /dev/null +++ b/yarn-project/end-to-end/bootstrap.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +source $(git rev-parse --show-toplevel)/ci3/source_bootstrap + +cmd=${1:-} + +# hash=$(cache_content_hash ../noir/.rebuild_patterns \ +# ../{avm-transpiler,noir-projects,l1-contracts,yarn-project}/.rebuild_patterns \ +# ../barretenberg/*/.rebuild_patterns) + +function test_cmds { + local run_test="yarn-project/end-to-end/scripts/test.sh" + echo "$run_test simple e2e_2_pxes" + echo "$run_test simple e2e_account_contracts" + echo "$run_test simple e2e_authwit" + echo "$run_test simple e2e_avm_simulator" + echo "$run_test simple e2e_blacklist_token_contract/access_control" + echo "$run_test simple e2e_blacklist_token_contract/burn" + echo "$run_test simple e2e_blacklist_token_contract/minting" + echo "$run_test simple e2e_blacklist_token_contract/shielding" + echo "$run_test simple e2e_blacklist_token_contract/transfer_private" + echo "$run_test simple e2e_blacklist_token_contract/transfer_public" + echo "$run_test simple e2e_blacklist_token_contract/unshielding" + # echo "$run_test simple-flake e2e_block_building" + echo "$run_test simple e2e_bot" + echo "$run_test simple e2e_card_game" + echo "$run_test simple e2e_cheat_codes" + echo "$run_test simple e2e_cross_chain_messaging/l1_to_l2" + echo "$run_test simple e2e_cross_chain_messaging/l2_to_l1" + echo "$run_test simple e2e_cross_chain_messaging/token_bridge_failure_cases" + echo "$run_test simple e2e_cross_chain_messaging/token_bridge_private" + echo "$run_test simple e2e_cross_chain_messaging/token_bridge_public" + echo "$run_test simple e2e_crowdfunding_and_claim" + echo "$run_test simple e2e_deploy_contract/contract_class_registration" + echo "$run_test simple e2e_deploy_contract/deploy_method" + echo "$run_test simple e2e_deploy_contract/legacy" + echo "$run_test simple e2e_deploy_contract/private_initialization" + echo "$run_test simple e2e_escrow_contract" + echo "$run_test simple e2e_event_logs" + echo "$run_test simple e2e_fees/account_init" + echo "$run_test simple e2e_fees/failures" + echo "$run_test simple e2e_fees/fee_juice_payments" + echo "$run_test simple e2e_fees/gas_estimation" + # echo "$run_test simple e2e_fees/private_payments" + echo "$run_test simple e2e_keys" + echo "$run_test simple e2e_l1_with_wall_time" + echo "$run_test simple e2e_lending_contract" + echo "$run_test simple e2e_max_block_number" + echo "$run_test simple e2e_multiple_accounts_1_enc_key" + echo "$run_test simple e2e_nested_contract/importer" + echo "$run_test simple e2e_nested_contract/manual_private_call" + echo "$run_test simple e2e_nested_contract/manual_private_enqueue" + echo "$run_test simple e2e_nested_contract/manual_public" + echo "$run_test simple e2e_nft" + echo "$run_test simple e2e_non_contract_account" + echo "$run_test simple e2e_note_getter" + echo "$run_test simple e2e_ordering" + echo "$run_test simple e2e_outbox" + echo "$run_test simple e2e_p2p/gossip_network" + # echo "$run_test simple e2e_p2p/rediscovery" + # echo "$run_test simple-flake e2e_p2p/reqresp" + # echo "$run_test simple-flake e2e_p2p/upgrade_governance_proposer" + echo "$run_test simple e2e_private_voting_contract" + # echo "FAKE_PROOFS=1 $run_test simple-flake e2e_prover/full" + echo "$run_test simple e2e_prover_coordination" + echo "$run_test simple e2e_public_testnet_transfer" + echo "$run_test simple e2e_state_vars" + echo "$run_test simple e2e_static_calls" + echo "$run_test simple e2e_synching" + echo "$run_test simple e2e_token_contract/access_control" + echo "$run_test simple e2e_token_contract/burn" + echo "$run_test simple e2e_token_contract/minting" + echo "$run_test simple e2e_token_contract/private_transfer_recursion" + echo "$run_test simple e2e_token_contract/reading_constants" + echo "$run_test simple e2e_token_contract/transfer_in_private" + echo "$run_test simple e2e_token_contract/transfer_in_public" + echo "$run_test simple e2e_token_contract/transfer_to_private" + echo "$run_test simple e2e_token_contract/transfer_to_public" + echo "$run_test simple e2e_token_contract/transfer.test" + # echo "$run_test simple-flake flakey_e2e_inclusion_proofs_contract" + + echo "$run_test compose composed/docs_examples" + echo "$run_test compose composed/e2e_aztec_js_browser" + echo "$run_test compose composed/e2e_pxe" + echo "$run_test compose composed/e2e_sandbox_example" + echo "$run_test compose composed/integration_l1_publisher" + echo "$run_test compose sample-dapp/index" + echo "$run_test compose sample-dapp/ci/index" + echo "$run_test compose guides/dapp_testing" + echo "$run_test compose guides/up_quick_start" + echo "$run_test compose guides/writing_an_account_contract" +} + +case "$cmd" in + "clean") + git clean -fdx + ;; + "test-cmds") + test_cmds + ;; + *) + echo "Unknown command: $cmd" + exit 1 + ;; +esac diff --git a/yarn-project/end-to-end/scripts/e2e_test_config.yml b/yarn-project/end-to-end/scripts/e2e_test_config.yml index 80c0d27b2e2..36ebb2e9ed3 100644 --- a/yarn-project/end-to-end/scripts/e2e_test_config.yml +++ b/yarn-project/end-to-end/scripts/e2e_test_config.yml @@ -90,6 +90,8 @@ tests: e2e_p2p_gossip: test_path: 'e2e_p2p/gossip_network.test.ts' with_alerts: true + e2e_p2p_slashing: + test_path: 'e2e_p2p/slashing.test.ts' e2e_p2p_upgrade_governance_proposer: test_path: 'e2e_p2p/upgrade_governance_proposer.test.ts' e2e_p2p_rediscovery: diff --git a/yarn-project/end-to-end/scripts/native-network/deploy-l1-contracts.sh b/yarn-project/end-to-end/scripts/native-network/deploy-l1-contracts.sh index 2f1d670620c..9c87ef3332c 100755 --- a/yarn-project/end-to-end/scripts/native-network/deploy-l1-contracts.sh +++ b/yarn-project/end-to-end/scripts/native-network/deploy-l1-contracts.sh @@ -63,6 +63,7 @@ COIN_ISSUER_CONTRACT_ADDRESS=$(echo "$output" | grep -oP 'CoinIssuer Address: \K REWARD_DISTRIBUTOR_CONTRACT_ADDRESS=$(echo "$output" | grep -oP 'RewardDistributor Address: \K0x[a-fA-F0-9]{40}') GOVERNANCE_PROPOSER_CONTRACT_ADDRESS=$(echo "$output" | grep -oP 'GovernanceProposer Address: \K0x[a-fA-F0-9]{40}') GOVERNANCE_CONTRACT_ADDRESS=$(echo "$output" | grep -oP 'Governance Address: \K0x[a-fA-F0-9]{40}') +SLASH_FACTORY_CONTRACT_ADDRESS=$(echo "$output" | grep -oP 'SlashFactory Address: \K0x[a-fA-F0-9]{40}') # Save contract addresses to state/l1-contracts.env cat <$(git rev-parse --show-toplevel)/yarn-project/end-to-end/scripts/native-network/state/l1-contracts.env @@ -77,6 +78,7 @@ export COIN_ISSUER_CONTRACT_ADDRESS=$COIN_ISSUER_CONTRACT_ADDRESS export REWARD_DISTRIBUTOR_CONTRACT_ADDRESS=$REWARD_DISTRIBUTOR_CONTRACT_ADDRESS export GOVERNANCE_PROPOSER_CONTRACT_ADDRESS=$GOVERNANCE_PROPOSER_CONTRACT_ADDRESS export GOVERNANCE_CONTRACT_ADDRESS=$GOVERNANCE_CONTRACT_ADDRESS +export SLASH_FACTORY_CONTRACT_ADDRESS=$SLASH_FACTORY_CONTRACT_ADDRESS EOCONFIG echo "Contract addresses saved to state/l1-contracts.env" diff --git a/yarn-project/end-to-end/scripts/test.sh b/yarn-project/end-to-end/scripts/test.sh index c9f31e52fa9..9b37a74ffde 100755 --- a/yarn-project/end-to-end/scripts/test.sh +++ b/yarn-project/end-to-end/scripts/test.sh @@ -12,13 +12,16 @@ set -eu TYPE=$1 export TEST=$2 +cd $(dirname $0) + case "$TYPE" in "simple"|"simple-flake") - name=${TEST//\//_} + # Strip leading non alpha numerics and replace / with _ for the container name. + name=$(echo "${TEST}" | sed 's/^[^a-zA-Z0-9]*//' | tr '/' '_') trap 'docker kill $name &> /dev/null' SIGINT SIGTERM docker run --rm \ --name $name \ - -v$PWD/../..:/root/aztec-packages \ + -v$(git rev-parse --show-toplevel):/root/aztec-packages \ -v$HOME/.bb-crs:/root/.bb-crs \ --mount type=tmpfs,target=/tmp,tmpfs-size=1g \ --mount type=tmpfs,target=/tmp-jest,tmpfs-size=512m \ @@ -27,7 +30,7 @@ case "$TYPE" in aztecprotocol/build:2.0 ./scripts/test_simple.sh $TEST ;; "compose"|"compose-flake") - docker compose -p "${TEST//[\/\.]/_}" -f ./scripts/docker-compose.yml up --exit-code-from=end-to-end --force-recreate + docker compose -p "${TEST//[\/\.]/_}" up --exit-code-from=end-to-end --force-recreate ;; "skip") echo "Skipping test: $TEST" diff --git a/yarn-project/end-to-end/src/e2e_block_building.test.ts b/yarn-project/end-to-end/src/e2e_block_building.test.ts index 4385c888c12..6a2ed021376 100644 --- a/yarn-project/end-to-end/src/e2e_block_building.test.ts +++ b/yarn-project/end-to-end/src/e2e_block_building.test.ts @@ -193,7 +193,7 @@ describe('e2e_block_building', () => { logger.info(`Updating aztec node config`); await aztecNode.setConfig({ minTxsPerBlock: 1, maxTxsPerBlock: TX_COUNT, enforceTimeTable: true }); - // We tweak the sequencer so it uses a fake simulator that adds a 200ms delay to every public tx. + // We tweak the sequencer so it uses a fake simulator that adds a delay to every public tx. const archiver = (aztecNode as AztecNodeService).getContractDataSource(); sequencer.sequencer.publicProcessorFactory = new TestPublicProcessorFactory( archiver, @@ -202,11 +202,13 @@ describe('e2e_block_building', () => { ); // We also cheat the sequencer's timetable so it allocates little time to processing. - // This will leave the sequencer with just 2s to build the block, so it shouldn't be - // able to squeeze in more than 10 txs in each. This is sensitive to the time it takes - // to pick up and validate the txs, so we may need to bump it to work on CI. - sequencer.sequencer.timeTable[SequencerState.WAITING_FOR_TXS] = 2; - sequencer.sequencer.timeTable[SequencerState.CREATING_BLOCK] = 2; + // This will leave the sequencer with just a few seconds to build the block, so it shouldn't + // be able to squeeze in more than ~12 txs in each. This is sensitive to the time it takes + // to pick up and validate the txs, so we may need to bump it to work on CI. Note that we need + // at least 3s here so the archiver has time to loop once and sync, and the sequencer has at + // least 1s to loop. + sequencer.sequencer.timeTable[SequencerState.WAITING_FOR_TXS] = 4; + sequencer.sequencer.timeTable[SequencerState.CREATING_BLOCK] = 4; sequencer.sequencer.processTxTime = 1; // Flood the mempool with TX_COUNT simultaneous txs @@ -615,9 +617,11 @@ type TestSequencer = Omit & { }; type TestSequencerClient = Omit & { sequencer: TestSequencer }; +const TEST_PUBLIC_TX_SIMULATION_DELAY_MS = 300; + class TestPublicTxSimulator extends PublicTxSimulator { public override async simulate(tx: Tx): Promise { - await sleep(200); + await sleep(TEST_PUBLIC_TX_SIMULATION_DELAY_MS); return super.simulate(tx); } } 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 c1fa2d4fbec..39420fd44b8 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,8 +325,7 @@ describe('e2e_fees private_payment', () => { }); // TODO(#7694): Remove this test once the lacking feature in TXE is implemented. - // 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 () => { + it('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 4bfe4c45e99..e7a8f8fd56b 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 @@ -1,7 +1,7 @@ import { getSchnorrAccount } from '@aztec/accounts/schnorr'; import { type AztecNodeConfig, type AztecNodeService } from '@aztec/aztec-node'; import { type AccountWalletWithSecretKey } from '@aztec/aztec.js'; -import { MINIMUM_STAKE, getL1ContractsConfigEnvVars } from '@aztec/ethereum'; +import { L1TxUtils, getL1ContractsConfigEnvVars } from '@aztec/ethereum'; import { EthCheatCodesWithState } from '@aztec/ethereum/test'; import { type Logger, createLogger } from '@aztec/foundation/log'; import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts'; @@ -53,6 +53,8 @@ export class P2PNetworkTest { private cleanupInterval: NodeJS.Timeout | undefined = undefined; + private gasUtils: L1TxUtils | undefined = undefined; + constructor( testName: string, public bootstrapNode: BootstrapNode, @@ -61,6 +63,7 @@ export class P2PNetworkTest { initialValidatorConfig: AztecNodeConfig, // If set enable metrics collection metricsPort?: number, + assumeProvenThrough?: number, ) { this.logger = createLogger(`e2e:e2e_p2p:${testName}`); @@ -72,12 +75,24 @@ export class P2PNetworkTest { this.bootstrapNodeEnr = bootstrapNode.getENR().encodeTxt(); - this.snapshotManager = createSnapshotManager(`e2e_p2p_network/${testName}`, process.env.E2E_DATA_PATH, { - ...initialValidatorConfig, - ethereumSlotDuration: l1ContractsConfig.ethereumSlotDuration, - salt: 420, - metricsPort: metricsPort, - }); + this.snapshotManager = createSnapshotManager( + `e2e_p2p_network/${testName}`, + process.env.E2E_DATA_PATH, + { + ...initialValidatorConfig, + ethereumSlotDuration: l1ContractsConfig.ethereumSlotDuration, + salt: 420, + metricsPort: metricsPort, + }, + { + aztecEpochDuration: initialValidatorConfig.aztecEpochDuration ?? l1ContractsConfig.aztecEpochDuration, + aztecEpochProofClaimWindowInL2Slots: + initialValidatorConfig.aztecEpochProofClaimWindowInL2Slots ?? + l1ContractsConfig.aztecEpochProofClaimWindowInL2Slots, + assumeProvenThrough: assumeProvenThrough ?? Number.MAX_SAFE_INTEGER, + initialValidators: [], + }, + ); } static async create({ @@ -85,11 +100,15 @@ export class P2PNetworkTest { numberOfNodes, basePort, metricsPort, + initialConfig, + assumeProvenThrough, }: { testName: string; numberOfNodes: number; basePort?: number; metricsPort?: number; + initialConfig?: Partial; + assumeProvenThrough?: number; }) { const port = basePort || (await getPort()); @@ -97,9 +116,20 @@ export class P2PNetworkTest { const bootstrapNode = await createBootstrapNodeFromPrivateKey(BOOTSTRAP_NODE_PRIVATE_KEY, port, telemetry); const bootstrapNodeEnr = bootstrapNode.getENR().encodeTxt(); - const initialValidatorConfig = await createValidatorConfig({} as AztecNodeConfig, bootstrapNodeEnr); + const initialValidatorConfig = await createValidatorConfig( + (initialConfig ?? {}) as AztecNodeConfig, + bootstrapNodeEnr, + ); - return new P2PNetworkTest(testName, bootstrapNode, port, numberOfNodes, initialValidatorConfig); + return new P2PNetworkTest( + testName, + bootstrapNode, + port, + numberOfNodes, + initialValidatorConfig, + metricsPort, + assumeProvenThrough, + ); } /** @@ -118,15 +148,13 @@ export class P2PNetworkTest { this.logger.info('Syncing mock system time'); const { dateProvider, deployL1ContractsValues } = this.ctx!; // Send a tx and only update the time after the tx is mined, as eth time is not continuous - const tx = await deployL1ContractsValues.walletClient.sendTransaction({ + const receipt = await this.gasUtils!.sendAndMonitorTransaction({ to: this.baseAccount.address, + data: '0x', value: 1n, - account: this.baseAccount, - }); - const receipt = await deployL1ContractsValues.publicClient.waitForTransactionReceipt({ - hash: tx, }); const timestamp = await deployL1ContractsValues.publicClient.getBlock({ blockNumber: receipt.blockNumber }); + this.logger.info(`Timestamp: ${timestamp.timestamp}`); dateProvider.setTime(Number(timestamp.timestamp) * 1000); } @@ -148,7 +176,7 @@ export class P2PNetworkTest { client: deployL1ContractsValues.walletClient, }); - const stakeNeeded = MINIMUM_STAKE * BigInt(this.numberOfNodes); + const stakeNeeded = l1ContractsConfig.minimumStake * BigInt(this.numberOfNodes); await Promise.all( [ await stakingAsset.write.mint( @@ -171,7 +199,7 @@ export class P2PNetworkTest { attester: attester.address, proposer: proposer.address, withdrawer: attester.address, - amount: MINIMUM_STAKE, + amount: l1ContractsConfig.minimumStake, } as const); this.logger.verbose( @@ -266,6 +294,20 @@ export class P2PNetworkTest { async setup() { this.ctx = await this.snapshotManager.setup(); this.startSyncMockSystemTimeInterval(); + + this.gasUtils = new L1TxUtils( + this.ctx.deployL1ContractsValues.publicClient, + this.ctx.deployL1ContractsValues.walletClient, + this.logger, + { + gasLimitBufferPercentage: 20n, + maxGwei: 500n, + minGwei: 1n, + maxAttempts: 3, + checkIntervalMs: 100, + stallTimeMs: 1000, + }, + ); } async stopNodes(nodes: AztecNodeService[]) { diff --git a/yarn-project/end-to-end/src/e2e_p2p/slashing.test.ts b/yarn-project/end-to-end/src/e2e_p2p/slashing.test.ts new file mode 100644 index 00000000000..fcb6cca9c3f --- /dev/null +++ b/yarn-project/end-to-end/src/e2e_p2p/slashing.test.ts @@ -0,0 +1,264 @@ +import { type AztecNodeService } from '@aztec/aztec-node'; +import { sleep } from '@aztec/aztec.js'; +import { RollupAbi, SlashFactoryAbi, SlasherAbi, SlashingProposerAbi } from '@aztec/l1-artifacts'; + +import fs from 'fs'; +import { getAddress, getContract, parseEventLogs } from 'viem'; + +import { shouldCollectMetrics } from '../fixtures/fixtures.js'; +import { createNodes } from '../fixtures/setup_p2p_test.js'; +import { P2PNetworkTest } from './p2p_network.js'; +import { createPXEServiceAndSubmitTransactions } from './shared.js'; + +// Don't set this to a higher value than 9 because each node will use a different L1 publisher account and anvil seeds +const NUM_NODES = 4; +const BOOT_NODE_UDP_PORT = 40600; + +const DATA_DIR = './data/slashing'; + +// This test is showcasing that slashing can happen, abusing that our nodes are honest but stupid +// making them slash themselves. +describe('e2e_p2p_slashing', () => { + let t: P2PNetworkTest; + let nodes: AztecNodeService[]; + + const slashingQuorum = 6; + const slashingRoundSize = 10; + + beforeEach(async () => { + t = await P2PNetworkTest.create({ + testName: 'e2e_p2p_slashing', + numberOfNodes: NUM_NODES, + basePort: BOOT_NODE_UDP_PORT, + metricsPort: shouldCollectMetrics(), + initialConfig: { + aztecEpochDuration: 1, + aztecEpochProofClaimWindowInL2Slots: 1, + slashingQuorum, + slashingRoundSize, + }, + assumeProvenThrough: 1, + }); + + await t.applyBaseSnapshots(); + await t.setup(); + await t.removeInitialNode(); + }); + + afterEach(async () => { + await t.stopNodes(nodes); + await t.teardown(); + for (let i = 0; i < NUM_NODES; i++) { + fs.rmSync(`${DATA_DIR}-${i}`, { recursive: true, force: true }); + } + }); + + it('should slash the attesters', async () => { + // create the bootstrap node for the network + if (!t.bootstrapNodeEnr) { + throw new Error('Bootstrap node ENR is not available'); + } + + const rollup = getContract({ + address: t.ctx.deployL1ContractsValues!.l1ContractAddresses.rollupAddress.toString(), + abi: RollupAbi, + client: t.ctx.deployL1ContractsValues!.walletClient, + }); + + const slasherContract = getContract({ + address: getAddress(await rollup.read.SLASHER()), + abi: SlasherAbi, + client: t.ctx.deployL1ContractsValues.publicClient, + }); + + const slashingProposer = getContract({ + address: getAddress(await slasherContract.read.PROPOSER()), + abi: SlashingProposerAbi, + client: t.ctx.deployL1ContractsValues.publicClient, + }); + + const slashFactory = getContract({ + address: getAddress(t.ctx.deployL1ContractsValues.l1ContractAddresses.slashFactoryAddress.toString()), + abi: SlashFactoryAbi, + client: t.ctx.deployL1ContractsValues.publicClient, + }); + + const slashingInfo = async () => { + const bn = await t.ctx.cheatCodes.eth.blockNumber(); + const slotNumber = await rollup.read.getCurrentSlot(); + const roundNumber = await slashingProposer.read.computeRound([slotNumber]); + const instanceAddress = t.ctx.deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(); + const info = await slashingProposer.read.rounds([instanceAddress, roundNumber]); + const leaderVotes = await slashingProposer.read.yeaCount([instanceAddress, roundNumber, info[1]]); + return { bn, slotNumber, roundNumber, info, leaderVotes }; + }; + + const jumpToNextRound = async () => { + t.logger.info(`Jumping to next round`); + const roundSize = await slashingProposer.read.M(); + const nextRoundTimestamp = await rollup.read.getTimestampForSlot([ + ((await rollup.read.getCurrentSlot()) / roundSize) * roundSize + roundSize, + ]); + await t.ctx.cheatCodes.eth.warp(Number(nextRoundTimestamp)); + + await t.syncMockSystemTime(); + }; + + t.ctx.aztecNodeConfig.validatorReexecute = false; + + // create our network of nodes and submit txs into each of them + // the number of txs per node and the number of txs per rollup + // should be set so that the only way for rollups to be built + // is if the txs are successfully gossiped around the nodes. + t.logger.info('Creating nodes'); + nodes = await createNodes( + t.ctx.aztecNodeConfig, + t.ctx.dateProvider, + t.bootstrapNodeEnr, + NUM_NODES, + BOOT_NODE_UDP_PORT, + DATA_DIR, + // To collect metrics - run in aztec-packages `docker compose --profile metrics up` and set COLLECT_METRICS=true + shouldCollectMetrics(), + ); + + // We are overriding the slashing amount to 1, such that the slashing will "really" happen. + for (const node of nodes) { + const seqClient = node.getSequencer(); + if (!seqClient) { + throw new Error('Sequencer not found'); + } + const sequencer = (seqClient as any).sequencer; + const slasher = (sequencer as any).slasherClient; + slasher.slashingAmount = 1n; + } + + // wait a bit for peers to discover each other + await sleep(4000); + + let sInfo = await slashingInfo(); + + const votesNeeded = await slashingProposer.read.N(); + + // We should push us to land exactly at the next round + await jumpToNextRound(); + + // Produce blocks until we hit an issue with pruning. + // Then we should jump in time to the next round so we are sure that we have the votes + // Then we just sit on our hands and wait. + + const seqClient = nodes[0].getSequencer(); + if (!seqClient) { + throw new Error('Sequencer not found'); + } + const sequencer = (seqClient as any).sequencer; + const slasher = (sequencer as any).slasherClient; + + t.logger.info(`Producing blocks until we hit a pruning event`); + + // Run for up to the slashing round size, or as long as needed to get a slash event + // Variable because sometimes hit race-condition issues with attestations. + for (let i = 0; i < slashingRoundSize; i++) { + t.logger.info('Submitting transactions'); + const bn = await nodes[0].getBlockNumber(); + await createPXEServiceAndSubmitTransactions(t.logger, nodes[0], 1); + + t.logger.info(`Waiting for block number to change`); + while (bn === (await nodes[0].getBlockNumber())) { + await sleep(1000); + } + + if (slasher.slashEvents.length > 0) { + t.logger.info(`We have a slash event ${i}`); + break; + } + } + + expect(slasher.slashEvents.length).toBeGreaterThan(0); + + // We should push us to land exactly at the next round + await jumpToNextRound(); + + // For the next round we will try to cast votes. + // Stop early if we have enough votes. + t.logger.info(`Waiting for votes to be cast`); + for (let i = 0; i < slashingRoundSize; i++) { + t.logger.info('Waiting for slot number to change and votes to be cast'); + const slotNumber = await rollup.read.getCurrentSlot(); + t.logger.info(`Waiting for block number to change`); + while (slotNumber === (await rollup.read.getCurrentSlot())) { + await sleep(1000); + } + sInfo = await slashingInfo(); + t.logger.info(`We have ${sInfo.leaderVotes} votes in round ${sInfo.roundNumber} on ${sInfo.info[1]}`); + if (sInfo.leaderVotes > votesNeeded) { + t.logger.info(`We have sufficient votes`); + break; + } + } + + t.logger.info('Deploy the actual payload for slashing!'); + const slashEvent = slasher.slashEvents[0]; + await t.ctx.deployL1ContractsValues.publicClient.waitForTransactionReceipt({ + hash: await slashFactory.write.createSlashPayload([slashEvent.epoch, slashEvent.amount], { + account: t.ctx.deployL1ContractsValues.walletClient.account, + }), + }); + + t.logger.info(`We jump in time to the next round to execute`); + await jumpToNextRound(); + const attestersPre = await rollup.read.getAttesters(); + + for (const attester of attestersPre) { + const attesterInfo = await rollup.read.getInfo([attester]); + // Check that status isValidating + expect(attesterInfo.status).toEqual(1); + } + + t.logger.info(`Push the proposal, SLASHING!`); + const tx = await slashingProposer.write.executeProposal([sInfo.roundNumber], { + account: t.ctx.deployL1ContractsValues.walletClient.account, + }); + await t.ctx.deployL1ContractsValues.publicClient.waitForTransactionReceipt({ + hash: tx, + }); + + const receipt = await t.ctx.deployL1ContractsValues.publicClient.getTransactionReceipt({ + hash: tx, + }); + + const slashingEvents = parseEventLogs({ + abi: RollupAbi, + logs: receipt.logs, + }).filter(log => log.eventName === 'Slashed'); + + const attestersSlashed = slashingEvents.map(event => { + // Because TS is a little nagging bitch + return (event.args as any).attester; + }); + + // Convert attestersPre elements to lowercase for consistent comparison + const normalizedAttestersPre = attestersPre.map(addr => addr.toLowerCase()); + const normalizedAttestersSlashed = attestersSlashed.map(addr => addr.toLowerCase()); + expect(new Set(normalizedAttestersPre)).toEqual(new Set(normalizedAttestersSlashed)); + + const instanceAddress = t.ctx.deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(); + const infoPost = await slashingProposer.read.rounds([instanceAddress, sInfo.roundNumber]); + + expect(sInfo.info[0]).toEqual(infoPost[0]); + expect(sInfo.info[1]).toEqual(infoPost[1]); + expect(sInfo.info[2]).toEqual(false); + expect(infoPost[2]).toEqual(true); + + const attestersPost = await rollup.read.getAttesters(); + + for (const attester of attestersPre) { + const attesterInfo = await rollup.read.getInfo([attester]); + // Check that status is Living + expect(attesterInfo.status).toEqual(2); + } + const committee = await rollup.read.getEpochCommittee([slashEvent.epoch]); + expect(attestersPre.length).toBe(committee.length); + expect(attestersPost.length).toBe(0); + }, 1_000_000); +}); diff --git a/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts b/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts index 9499bce2eef..bad8f5a7c7b 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/upgrade_governance_proposer.test.ts @@ -162,7 +162,10 @@ describe('e2e_p2p_governance_proposer', () => { await waitL1Block(); - const txHash = await governanceProposer.write.pushProposal([govData.round], { account: emperor, gas: 1_000_000n }); + const txHash = await governanceProposer.write.executeProposal([govData.round], { + account: emperor, + gas: 1_000_000n, + }); await t.ctx.deployL1ContractsValues.publicClient.waitForTransactionReceipt({ hash: txHash }); const token = getContract({ 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 010717e3283..4f2d68d3e98 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 @@ -256,6 +256,7 @@ describe('full_prover', () => { 'rollup-base-public', 'rollup-merge', 'rollup-block-root', + 'rollup-block-merge', 'rollup-root', ].forEach(circuitName => { const data = getTestData(circuitName); 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 d031d18c5bd..929768285c7 100644 --- a/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts +++ b/yarn-project/end-to-end/src/fixtures/snapshot_manager.ts @@ -317,9 +317,9 @@ async function setupFromFresh( } const deployL1ContractsValues = await setupL1Contracts(aztecNodeConfig.l1RpcUrl, hdAccount, logger, { + ...getL1ContractsConfigEnvVars(), salt: opts.salt, ...deployL1ContractsArgs, - ...getL1ContractsConfigEnvVars(), initialValidators: opts.initialValidators, }); aztecNodeConfig.l1Contracts = deployL1ContractsValues.l1ContractAddresses; diff --git a/yarn-project/entrypoints/package.json b/yarn-project/entrypoints/package.json index 0614aa497f9..ed5e880828e 100644 --- a/yarn-project/entrypoints/package.json +++ b/yarn-project/entrypoints/package.json @@ -53,12 +53,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/epoch-cache/package.json b/yarn-project/epoch-cache/package.json index 346af28de71..b7dbabcba86 100644 --- a/yarn-project/epoch-cache/package.json +++ b/yarn-project/epoch-cache/package.json @@ -80,12 +80,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/ethereum/package.json b/yarn-project/ethereum/package.json index 6a4cc9df32a..87ecc3d321e 100644 --- a/yarn-project/ethereum/package.json +++ b/yarn-project/ethereum/package.json @@ -80,12 +80,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/ethereum/src/config.ts b/yarn-project/ethereum/src/config.ts index 9d1fee99530..2a2bff7e4fa 100644 --- a/yarn-project/ethereum/src/config.ts +++ b/yarn-project/ethereum/src/config.ts @@ -1,4 +1,9 @@ -import { type ConfigMappingsType, getConfigFromMappings, numberConfigHelper } from '@aztec/foundation/config'; +import { + type ConfigMappingsType, + bigintConfigHelper, + getConfigFromMappings, + numberConfigHelper, +} from '@aztec/foundation/config'; export type L1ContractsConfig = { /** How many seconds an L1 slot lasts. */ @@ -11,6 +16,16 @@ export type L1ContractsConfig = { aztecTargetCommitteeSize: number; /** The number of L2 slots that we can wait for a proof of an epoch to be produced. */ aztecEpochProofClaimWindowInL2Slots: number; + /** The minimum stake for a validator. */ + minimumStake: bigint; + /** The slashing quorum */ + slashingQuorum: number; + /** The slashing round size */ + slashingRoundSize: number; + /** Governance proposing quorum */ + governanceProposerQuorum: number; + /** Governance proposing round size */ + governanceProposerRoundSize: number; }; export const DefaultL1ContractsConfig = { @@ -19,6 +34,11 @@ export const DefaultL1ContractsConfig = { aztecEpochDuration: 16, aztecTargetCommitteeSize: 48, aztecEpochProofClaimWindowInL2Slots: 13, + minimumStake: BigInt(100e18), + slashingQuorum: 6, + slashingRoundSize: 10, + governanceProposerQuorum: 6, + governanceProposerRoundSize: 10, } satisfies L1ContractsConfig; export const l1ContractsConfigMappings: ConfigMappingsType = { @@ -47,6 +67,31 @@ export const l1ContractsConfigMappings: ConfigMappingsType = description: 'The number of L2 slots that we can wait for a proof of an epoch to be produced.', ...numberConfigHelper(DefaultL1ContractsConfig.aztecEpochProofClaimWindowInL2Slots), }, + minimumStake: { + env: 'AZTEC_MINIMUM_STAKE', + description: 'The minimum stake for a validator.', + ...bigintConfigHelper(DefaultL1ContractsConfig.minimumStake), + }, + slashingQuorum: { + env: 'AZTEC_SLASHING_QUORUM', + description: 'The slashing quorum', + ...numberConfigHelper(DefaultL1ContractsConfig.slashingQuorum), + }, + slashingRoundSize: { + env: 'AZTEC_SLASHING_ROUND_SIZE', + description: 'The slashing round size', + ...numberConfigHelper(DefaultL1ContractsConfig.slashingRoundSize), + }, + governanceProposerQuorum: { + env: 'AZTEC_GOVERNANCE_PROPOSER_QUORUM', + description: 'The governance proposing quorum', + ...numberConfigHelper(DefaultL1ContractsConfig.governanceProposerQuorum), + }, + governanceProposerRoundSize: { + env: 'AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE', + description: 'The governance proposing round size', + ...numberConfigHelper(DefaultL1ContractsConfig.governanceProposerRoundSize), + }, }; export function getL1ContractsConfigEnvVars(): L1ContractsConfig { diff --git a/yarn-project/ethereum/src/constants.ts b/yarn-project/ethereum/src/constants.ts index 2fea0175aca..c1f4b34d732 100644 --- a/yarn-project/ethereum/src/constants.ts +++ b/yarn-project/ethereum/src/constants.ts @@ -2,4 +2,3 @@ import { type Hex } from 'viem'; export const NULL_KEY: Hex = `0x${'0000000000000000000000000000000000000000000000000000000000000000'}`; export const AZTEC_TEST_CHAIN_ID = 677692; -export const MINIMUM_STAKE = BigInt(100e18); diff --git a/yarn-project/ethereum/src/deploy_l1_contracts.ts b/yarn-project/ethereum/src/deploy_l1_contracts.ts index 31b2c1eeb50..657c9ff7145 100644 --- a/yarn-project/ethereum/src/deploy_l1_contracts.ts +++ b/yarn-project/ethereum/src/deploy_l1_contracts.ts @@ -26,6 +26,8 @@ import { RollupAbi, RollupBytecode, RollupLinkReferences, + SlashFactoryAbi, + SlashFactoryBytecode, TestERC20Abi, TestERC20Bytecode, } from '@aztec/l1-artifacts'; @@ -53,7 +55,6 @@ import { type HDAccount, type PrivateKeyAccount, mnemonicToAccount, privateKeyTo import { foundry } from 'viem/chains'; import { type L1ContractsConfig } from './config.js'; -import { MINIMUM_STAKE } from './constants.js'; import { isAnvilTestChain } from './ethereum_chain.js'; import { type L1ContractAddresses } from './l1_contract_addresses.js'; import { L1TxUtils } from './l1_tx_utils.js'; @@ -156,6 +157,10 @@ export interface L1ContractArtifactsForDeployment { * Governance contract artifacts. */ governance: ContractArtifacts; + /** + * SlashFactory contract artifacts. + */ + slashFactory: ContractArtifacts; } export const l1Artifacts: L1ContractArtifactsForDeployment = { @@ -216,6 +221,10 @@ export const l1Artifacts: L1ContractArtifactsForDeployment = { contractAbi: GovernanceAbi, contractBytecode: GovernanceBytecode, }, + slashFactory: { + contractAbi: SlashFactoryAbi, + contractBytecode: SlashFactoryBytecode, + }, }; export interface DeployL1ContractsArgs extends L1ContractsConfig { @@ -331,14 +340,10 @@ export const deployL1Contracts = async ( ]); logger.verbose(`Deployed Staking Asset at ${stakingAssetAddress}`); - // @todo #8084 - // @note These numbers are just chosen to make testing simple. - const quorumSize = 6n; - const roundSize = 10n; const governanceProposerAddress = await govDeployer.deploy(l1Artifacts.governanceProposer, [ registryAddress.toString(), - quorumSize, - roundSize, + args.governanceProposerQuorum, + args.governanceProposerRoundSize, ]); logger.verbose(`Deployed GovernanceProposer at ${governanceProposerAddress}`); @@ -382,7 +387,9 @@ export const deployL1Contracts = async ( aztecEpochDuration: args.aztecEpochDuration, targetCommitteeSize: args.aztecTargetCommitteeSize, aztecEpochProofClaimWindowInL2Slots: args.aztecEpochProofClaimWindowInL2Slots, - minimumStake: MINIMUM_STAKE, + minimumStake: args.minimumStake, + slashingQuorum: args.slashingQuorum, + slashingRoundSize: args.slashingRoundSize, }; const rollupArgs = [ feeJuicePortalAddress.toString(), @@ -396,6 +403,9 @@ export const deployL1Contracts = async ( const rollupAddress = await deployer.deploy(l1Artifacts.rollup, rollupArgs); logger.verbose(`Deployed Rollup at ${rollupAddress}`, rollupConfigArgs); + const slashFactoryAddress = await deployer.deploy(l1Artifacts.slashFactory, [rollupAddress.toString()]); + logger.info(`Deployed SlashFactory at ${slashFactoryAddress}`); + await deployer.waitForDeployments(); logger.verbose(`All core contracts have been deployed`); @@ -434,7 +444,7 @@ export const deployL1Contracts = async ( if (args.initialValidators && args.initialValidators.length > 0) { // Mint tokens, approve them, use cheat code to initialise validator set without setting up the epoch. - const stakeNeeded = MINIMUM_STAKE * BigInt(args.initialValidators.length); + const stakeNeeded = args.minimumStake * BigInt(args.initialValidators.length); await Promise.all( [ await stakingAsset.write.mint([walletClient.account.address, stakeNeeded], {} as any), @@ -447,7 +457,7 @@ export const deployL1Contracts = async ( attester: v.toString(), proposer: v.toString(), withdrawer: v.toString(), - amount: MINIMUM_STAKE, + amount: args.minimumStake, })), ]); txHashes.push(initiateValidatorSetTxHash); @@ -560,6 +570,7 @@ export const deployL1Contracts = async ( rewardDistributorAddress, governanceProposerAddress, governanceAddress, + slashFactoryAddress, }; logger.info(`Aztec L1 contracts initialized`, l1Contracts); diff --git a/yarn-project/ethereum/src/l1_contract_addresses.ts b/yarn-project/ethereum/src/l1_contract_addresses.ts index eca35f4edea..aca32ba2dd2 100644 --- a/yarn-project/ethereum/src/l1_contract_addresses.ts +++ b/yarn-project/ethereum/src/l1_contract_addresses.ts @@ -21,6 +21,7 @@ export const L1ContractsNames = [ 'governanceProposerAddress', 'governanceAddress', 'stakingAssetAddress', + 'slashFactoryAddress', ] as const; /** Provides the directory of current L1 contract addresses */ @@ -40,6 +41,7 @@ export const L1ContractAddressesSchema = z.object({ rewardDistributorAddress: schemas.EthAddress, governanceProposerAddress: schemas.EthAddress, governanceAddress: schemas.EthAddress, + slashFactoryAddress: schemas.EthAddress, }) satisfies ZodFor; const parseEnv = (val: string) => EthAddress.fromString(val); @@ -100,4 +102,9 @@ export const l1ContractAddressesMapping: ConfigMappingsType description: 'The deployed L1 governance contract address', parseEnv, }, + slashFactoryAddress: { + env: 'SLASH_FACTORY_CONTRACT_ADDRESS', + description: 'The deployed L1 slashFactory contract address', + parseEnv, + }, }; diff --git a/yarn-project/foundation/package.json b/yarn-project/foundation/package.json index 7376d0c2c5c..3a2d12142e1 100644 --- a/yarn-project/foundation/package.json +++ b/yarn-project/foundation/package.json @@ -91,12 +91,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFilesAfterEnv": [ diff --git a/yarn-project/foundation/src/config/env_var.ts b/yarn-project/foundation/src/config/env_var.ts index cf8d34bfd05..4ce23b9946e 100644 --- a/yarn-project/foundation/src/config/env_var.ts +++ b/yarn-project/foundation/src/config/env_var.ts @@ -145,6 +145,7 @@ export type EnvVar = | 'SEQ_TX_POLLING_INTERVAL_MS' | 'SEQ_ENFORCE_TIME_TABLE' | 'SEQ_MAX_L1_TX_INCLUSION_TIME_INTO_SLOT' + | 'SLASH_FACTORY_CONTRACT_ADDRESS' | 'STAKING_ASSET_CONTRACT_ADDRESS' | 'REWARD_DISTRIBUTOR_CONTRACT_ADDRESS' | 'TELEMETRY' @@ -172,6 +173,11 @@ export type EnvVar = | 'AZTEC_EPOCH_DURATION' | 'AZTEC_TARGET_COMMITTEE_SIZE' | 'AZTEC_EPOCH_PROOF_CLAIM_WINDOW_IN_L2_SLOTS' + | 'AZTEC_MINIMUM_STAKE' + | 'AZTEC_SLASHING_QUORUM' + | 'AZTEC_SLASHING_ROUND_SIZE' + | 'AZTEC_GOVERNANCE_PROPOSER_QUORUM' + | 'AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE' | 'L1_GAS_LIMIT_BUFFER_PERCENTAGE' | 'L1_GAS_LIMIT_BUFFER_FIXED' | 'L1_GAS_PRICE_MIN' diff --git a/yarn-project/foundation/src/testing/files/index.ts b/yarn-project/foundation/src/testing/files/index.ts index 04ff3dbff30..d068bf35434 100644 --- a/yarn-project/foundation/src/testing/files/index.ts +++ b/yarn-project/foundation/src/testing/files/index.ts @@ -42,8 +42,8 @@ export function updateInlineTestData(targetFileFromRepoRoot: string, itemName: s /** * Updates the sample Prover.toml files in noir-projects/noir-protocol-circuits/crates/. - * @remarks Requires AZTEC_GENERATE_TEST_DATA=1 & generateProtocolCircuitTestData=true to be set - * To re-gen, run 'AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn workspace @aztec/end-to-end test full.test' + * @remarks Requires AZTEC_GENERATE_TEST_DATA=1 to be set + * To re-gen, run 'AZTEC_GENERATE_TEST_DATA=1 FAKE_PROOFS=1 yarn test:e2e-no-docker full.test ' */ export function updateProtocolCircuitSampleInputs(circuitName: string, value: string) { const logger = createConsoleLogger('aztec:testing:test_data'); diff --git a/yarn-project/foundation/src/wasm/wasm_module.test.ts b/yarn-project/foundation/src/wasm/wasm_module.test.ts deleted file mode 100644 index 32e293e1e9b..00000000000 --- a/yarn-project/foundation/src/wasm/wasm_module.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { readFile } from 'fs/promises'; -import { dirname } from 'path'; - -import { fileURLToPath } from '../url/index.js'; -import { WasmModule } from './wasm_module.js'; - -/** - * Fetch a simple WASM. - */ -async function fetchCode() { - const __dirname = dirname(fileURLToPath(import.meta.url)); - return await readFile(`${__dirname}/fixtures/gcd.wasm`); -} - -describe('simple wasm', () => { - let wasm!: WasmModule; - - beforeAll(async () => { - wasm = new WasmModule(await fetchCode(), () => ({ - /*no imports*/ - })); - await wasm.init(1, 1, /* No init method */ null); - }); - - it('should call gcd with correct result', () => { - expect(wasm.call('gcd', 12312, 12123)).toBe(27); - }); -}); diff --git a/yarn-project/ivc-integration/package.json b/yarn-project/ivc-integration/package.json index 5bc6f9b9709..ed615b1ac09 100644 --- a/yarn-project/ivc-integration/package.json +++ b/yarn-project/ivc-integration/package.json @@ -52,12 +52,7 @@ ] }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/ivc-integration/src/browser_client_ivc_integration.test.ts b/yarn-project/ivc-integration/src/browser_client_ivc_integration.test.ts index 7e6956cd10b..f8e9cab226d 100644 --- a/yarn-project/ivc-integration/src/browser_client_ivc_integration.test.ts +++ b/yarn-project/ivc-integration/src/browser_client_ivc_integration.test.ts @@ -16,7 +16,6 @@ import { /* eslint-disable camelcase */ -createDebug.enable('*'); const logger = createDebug('aztec:browser-ivc-test'); jest.setTimeout(120_000); diff --git a/yarn-project/ivc-integration/src/index.ts b/yarn-project/ivc-integration/src/index.ts index d3fc886bf43..67000066875 100644 --- a/yarn-project/ivc-integration/src/index.ts +++ b/yarn-project/ivc-integration/src/index.ts @@ -49,7 +49,6 @@ export { MockPrivateKernelTailVk, }; -createDebug.enable('*'); const logger = createDebug('aztec:ivc-test'); /* eslint-disable camelcase */ @@ -251,9 +250,11 @@ export async function proveThenVerifyAztecClient( bytecodes.map(base64ToUint8Array).map((arr: Uint8Array) => ungzip(arr)), { threads }, ); - - const [proof, vk] = await backend.prove(witnessStack.map((arr: Uint8Array) => ungzip(arr))); - const verified = await backend.verify(proof, vk); - await backend.destroy(); - return verified; + try { + const [proof, vk] = await backend.prove(witnessStack.map((arr: Uint8Array) => ungzip(arr))); + const verified = await backend.verify(proof, vk); + return verified; + } finally { + await backend.destroy(); + } } diff --git a/yarn-project/ivc-integration/src/serve.ts b/yarn-project/ivc-integration/src/serve.ts index be23f105556..3f12245e171 100644 --- a/yarn-project/ivc-integration/src/serve.ts +++ b/yarn-project/ivc-integration/src/serve.ts @@ -2,7 +2,6 @@ import createDebug from 'debug'; import { generate3FunctionTestingIVCStack, proveThenVerifyAztecClient } from './index.js'; -createDebug.enable('*'); const logger = createDebug('aztec:ivc-test'); /* eslint-disable no-console */ diff --git a/yarn-project/key-store/package.json b/yarn-project/key-store/package.json index faa128e9ae1..53c5d9f3cd6 100644 --- a/yarn-project/key-store/package.json +++ b/yarn-project/key-store/package.json @@ -47,12 +47,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/kv-store/package.json b/yarn-project/kv-store/package.json index 2b238f7885d..6cdf31d3f0a 100644 --- a/yarn-project/kv-store/package.json +++ b/yarn-project/kv-store/package.json @@ -15,7 +15,7 @@ "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", - "test:node": "NODE_NO_WARNINGS=1 mocha --config ./.mocharc.json", + "test:node": "NODE_NO_WARNINGS=1 mocha --config ./.mocharc.json --reporter dot", "test:browser": "wtr --config ./web-test-runner.config.mjs", "test": "yarn test:node && yarn test:browser" }, @@ -82,12 +82,7 @@ "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", diff --git a/yarn-project/kv-store/src/lmdb/array.ts b/yarn-project/kv-store/src/lmdb/array.ts index 19537dd7598..08aa0decda5 100644 --- a/yarn-project/kv-store/src/lmdb/array.ts +++ b/yarn-project/kv-store/src/lmdb/array.ts @@ -90,14 +90,20 @@ export class LmdbAztecArray implements AztecArray, AztecAsyncArray { } *entries(): IterableIterator<[number, T]> { - const values = this.#db.getRange({ - start: this.#slot(0), - limit: this.length, - }); - - for (const { key, value } of values) { - const index = key[3]; - yield [index, value]; + const transaction = this.#db.useReadTransaction(); + try { + const values = this.#db.getRange({ + start: this.#slot(0), + limit: this.length, + transaction, + }); + + for (const { key, value } of values) { + const index = key[3]; + yield [index, value]; + } + } finally { + transaction.done(); } } diff --git a/yarn-project/kv-store/src/lmdb/map.ts b/yarn-project/kv-store/src/lmdb/map.ts index 4458c3c3539..dd0d9aef064 100644 --- a/yarn-project/kv-store/src/lmdb/map.ts +++ b/yarn-project/kv-store/src/lmdb/map.ts @@ -40,9 +40,16 @@ export class LmdbAztecMap implements AztecMultiMap, Azte } *getValues(key: K): IterableIterator { - const values = this.db.getValues(this.slot(key)); - for (const value of values) { - yield value?.[1]; + const transaction = this.db.useReadTransaction(); + try { + const values = this.db.getValues(this.slot(key), { + transaction, + }); + for (const value of values) { + yield value?.[1]; + } + } finally { + transaction.done(); } } @@ -88,38 +95,45 @@ export class LmdbAztecMap implements AztecMultiMap, Azte } *entries(range: Range = {}): IterableIterator<[K, V]> { - const { reverse = false, limit } = range; - // LMDB has a quirk where it expects start > end when reverse=true - // in that case, we need to swap the start and end sentinels - const start = reverse - ? range.end - ? this.slot(range.end) - : this.endSentinel - : range.start - ? this.slot(range.start) - : this.startSentinel; - - const end = reverse - ? range.start + const transaction = this.db.useReadTransaction(); + + try { + const { reverse = false, limit } = range; + // LMDB has a quirk where it expects start > end when reverse=true + // in that case, we need to swap the start and end sentinels + const start = reverse + ? range.end + ? this.slot(range.end) + : this.endSentinel + : range.start ? this.slot(range.start) - : this.startSentinel - : range.end - ? this.slot(range.end) - : this.endSentinel; + : this.startSentinel; - const lmdbRange: RangeOptions = { - start, - end, - reverse, - limit, - }; - - const iterator = this.db.getRange(lmdbRange); - - for (const { - value: [key, value], - } of iterator) { - yield [key, value]; + const end = reverse + ? range.start + ? this.slot(range.start) + : this.startSentinel + : range.end + ? this.slot(range.end) + : this.endSentinel; + + const lmdbRange: RangeOptions = { + start, + end, + reverse, + limit, + transaction, + }; + + const iterator = this.db.getRange(lmdbRange); + + for (const { + value: [key, value], + } of iterator) { + yield [key, value]; + } + } finally { + transaction.done(); } } diff --git a/yarn-project/kv-store/web-test-runner.config.mjs b/yarn-project/kv-store/web-test-runner.config.mjs index 0458e1fe9a9..933c2c91a4d 100644 --- a/yarn-project/kv-store/web-test-runner.config.mjs +++ b/yarn-project/kv-store/web-test-runner.config.mjs @@ -1,11 +1,8 @@ import { esbuildPlugin } from '@web/dev-server-esbuild'; -import { defaultReporter } from '@web/test-runner'; -import { summaryReporter } from '@web/test-runner'; +import { dotReporter } from '@web/test-runner'; import { playwrightLauncher } from '@web/test-runner-playwright'; import { fileURLToPath } from 'url'; -const reporter = process.env.CI ? summaryReporter() : defaultReporter(); - export default { browsers: [ playwrightLauncher({ product: 'chromium' }), @@ -20,5 +17,5 @@ export default { files: ['./src/**/indexeddb/*.test.ts'], rootDir: fileURLToPath(new URL('../', import.meta.url)), nodeResolve: true, - reporters: [reporter], + reporters: [dotReporter()], }; diff --git a/yarn-project/l1-artifacts/scripts/generate-artifacts.sh b/yarn-project/l1-artifacts/scripts/generate-artifacts.sh index 04bb74e264d..fd3825893f6 100755 --- a/yarn-project/l1-artifacts/scripts/generate-artifacts.sh +++ b/yarn-project/l1-artifacts/scripts/generate-artifacts.sh @@ -30,6 +30,10 @@ CONTRACTS=( "l1-contracts:NewGovernanceProposerPayload" "l1-contracts:LeonidasLib" "l1-contracts:ExtRollupLib" + "l1-contracts:SlashingProposer" + "l1-contracts:Slasher" + "l1-contracts:EmpireBase" + "l1-contracts:SlashFactory" ) # Read the error ABI's once and store it in COMBINED_ERRORS variable diff --git a/yarn-project/merkle-tree/package.json b/yarn-project/merkle-tree/package.json index 042840916c4..0179429df93 100644 --- a/yarn-project/merkle-tree/package.json +++ b/yarn-project/merkle-tree/package.json @@ -48,12 +48,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/noir-contracts.js/package.json b/yarn-project/noir-contracts.js/package.json index f37735e091b..b1cea9b52bf 100644 --- a/yarn-project/noir-contracts.js/package.json +++ b/yarn-project/noir-contracts.js/package.json @@ -47,12 +47,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/noir-protocol-circuits-types/package.json b/yarn-project/noir-protocol-circuits-types/package.json index 46b3671294b..720ff230865 100644 --- a/yarn-project/noir-protocol-circuits-types/package.json +++ b/yarn-project/noir-protocol-circuits-types/package.json @@ -54,12 +54,7 @@ ] }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/p2p-bootstrap/package.json b/yarn-project/p2p-bootstrap/package.json index 51671674183..897dbc4b88f 100644 --- a/yarn-project/p2p-bootstrap/package.json +++ b/yarn-project/p2p-bootstrap/package.json @@ -75,12 +75,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/p2p/package.json b/yarn-project/p2p/package.json index 1034444d6d3..10ad63bc58c 100644 --- a/yarn-project/p2p/package.json +++ b/yarn-project/p2p/package.json @@ -55,12 +55,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/package.common.json b/yarn-project/package.common.json index fec3a9a873c..0d372617e69 100644 --- a/yarn-project/package.common.json +++ b/yarn-project/package.common.json @@ -39,7 +39,7 @@ "moduleNameMapper": { "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" }, - "reporters": [["jest-silent-reporter", { "useDots": true }]], + "reporters": ["default"], "testTimeout": 30000, "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", diff --git a/yarn-project/package.json b/yarn-project/package.json index d05d9baeb5f..0a2e6fbc9eb 100644 --- a/yarn-project/package.json +++ b/yarn-project/package.json @@ -10,7 +10,7 @@ "formatting:fix": "FORCE_COLOR=true yarn workspaces foreach -A -p -v run formatting:fix", "lint": "yarn eslint --cache --ignore-pattern l1-artifacts .", "format": "yarn prettier --cache -w .", - "test": "RAYON_NUM_THREADS=4 FORCE_COLOR=true yarn workspaces foreach -A --exclude @aztec/aztec3-packages --exclude @aztec/bb-prover --exclude @aztec/prover-client -p -v run test", + "test": "RAYON_NUM_THREADS=4 FORCE_COLOR=true yarn workspaces foreach -A --exclude @aztec/aztec3-packages --exclude @aztec/bb-prover --exclude @aztec/prover-client -p -v run test --reporters=summary", "build": "FORCE_COLOR=true yarn workspaces foreach -A --parallel --topological-dev --verbose --exclude @aztec/aztec3-packages --exclude @aztec/docs run build", "build:fast": "cd foundation && yarn build && cd ../l1-artifacts && yarn build && cd ../circuits.js && yarn build && cd .. && yarn generate && tsc -b", "build:dev": "./watch.sh", @@ -71,7 +71,6 @@ "eslint": "^8.21.0", "eslint-import-resolver-typescript": "^3.5.5", "eslint-plugin-import": "^2.27.5", - "jest-silent-reporter": "^0.6.0", "madge": "^6.1.0", "prettier": "^2.8.8", "typedoc": "^0.24.8", @@ -83,6 +82,7 @@ "@noir-lang/types": "portal:../noir/packages/types", "@noir-lang/noirc_abi": "portal:../noir/packages/noirc_abi", "@noir-lang/noir_codegen": "portal:../noir/packages/noir_codegen", - "@noir-lang/noir_js": "file:../noir/packages/noir_js" + "@noir-lang/noir_js": "file:../noir/packages/noir_js", + "jest-runner@npm:^29.7.0": "patch:jest-runner@npm%3A29.7.0#~/.yarn/patches/jest-runner-npm-29.7.0-3bc9f82b58.patch" } } diff --git a/yarn-project/proof-verifier/package.json b/yarn-project/proof-verifier/package.json index 97cae4df78d..99ded95a154 100644 --- a/yarn-project/proof-verifier/package.json +++ b/yarn-project/proof-verifier/package.json @@ -67,12 +67,7 @@ "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", diff --git a/yarn-project/protocol-contracts/package.json b/yarn-project/protocol-contracts/package.json index f555a517fa0..7bece1c9c02 100644 --- a/yarn-project/protocol-contracts/package.json +++ b/yarn-project/protocol-contracts/package.json @@ -61,12 +61,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/prover-client/package.json b/yarn-project/prover-client/package.json index 43fcfd10c56..e4363feffd5 100644 --- a/yarn-project/prover-client/package.json +++ b/yarn-project/prover-client/package.json @@ -58,12 +58,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts b/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts index fcd971b41e5..f7e5fb2194f 100644 --- a/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts +++ b/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts @@ -85,6 +85,7 @@ describe('prover/bb_prover/full-rollup', () => { ); } }, + 900000, ); // TODO(@PhilWindle): Remove public functions and re-enable once we can handle empty tx slots diff --git a/yarn-project/prover-node/package.json b/yarn-project/prover-node/package.json index 938fec1bf7b..13a872b8864 100644 --- a/yarn-project/prover-node/package.json +++ b/yarn-project/prover-node/package.json @@ -44,12 +44,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ 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 06e5d26fa82..3db7c5ca4d2 100644 --- a/yarn-project/prover-node/src/job/epoch-proving-job.ts +++ b/yarn-project/prover-node/src/job/epoch-proving-job.ts @@ -7,9 +7,7 @@ import { type L2Block, type L2BlockSource, type ProcessedTx, - type ProverCoordination, type Tx, - type TxHash, } from '@aztec/circuit-types'; import { asyncPool } from '@aztec/foundation/async-pool'; import { createLogger } from '@aztec/foundation/log'; @@ -41,12 +39,12 @@ export class EpochProvingJob implements Traceable { private dbProvider: ForkMerkleTreeOperations, private epochNumber: bigint, private blocks: L2Block[], + private txs: Tx[], private prover: EpochProver, private publicProcessorFactory: PublicProcessorFactory, private publisher: L1Publisher, private l2BlockSource: L2BlockSource, private l1ToL2MessageSource: L1ToL2MessageSource, - private coordination: ProverCoordination, private metrics: ProverNodeMetrics, private config: { parallelBlockLimit: number } = { parallelBlockLimit: 32 }, private cleanUp: (job: EpochProvingJob) => Promise = () => Promise.resolve(), @@ -92,10 +90,9 @@ export class EpochProvingJob implements Traceable { await asyncPool(this.config.parallelBlockLimit, this.blocks, async block => { const globalVariables = block.header.globalVariables; - const txHashes = block.body.txEffects.map(tx => tx.txHash); const txCount = block.body.numberOfTxsIncludingPadded; + const txs = this.getTxs(block); const l1ToL2Messages = await this.getL1ToL2Messages(block); - const txs = await this.getTxs(txHashes, block.number); const previousHeader = await this.getBlockHeader(block.number - 1); this.log.verbose(`Starting processing block ${block.number}`, { @@ -162,17 +159,9 @@ export class EpochProvingJob implements Traceable { return this.l2BlockSource.getBlockHeader(blockNumber); } - private async getTxs(txHashes: TxHash[], blockNumber: number): Promise { - const txs = await Promise.all( - txHashes.map(txHash => this.coordination.getTxByHash(txHash).then(tx => [txHash, tx] as const)), - ); - const notFound = txs.filter(([_, tx]) => !tx); - if (notFound.length) { - throw new Error( - `Txs not found for block ${blockNumber}: ${notFound.map(([txHash]) => txHash.toString()).join(', ')}`, - ); - } - return txs.map(([_, tx]) => tx!); + private getTxs(block: L2Block): Tx[] { + const txHashes = block.body.txEffects.map(tx => tx.txHash.toBigInt()); + return this.txs.filter(tx => txHashes.includes(tx.getTxHash().toBigInt())); } private getL1ToL2Messages(block: L2Block) { diff --git a/yarn-project/prover-node/src/prover-node.test.ts b/yarn-project/prover-node/src/prover-node.test.ts index bb73e84bfe1..56581e5e23d 100644 --- a/yarn-project/prover-node/src/prover-node.test.ts +++ b/yarn-project/prover-node/src/prover-node.test.ts @@ -1,4 +1,5 @@ import { + type Body, type EpochProofClaim, EpochProofQuote, EpochProofQuotePayload, @@ -9,6 +10,9 @@ import { type MerkleTreeWriteOperations, P2PClientType, type ProverCoordination, + type Tx, + type TxEffect, + TxHash, WorldStateRunningState, type WorldStateSynchronizer, } from '@aztec/circuit-types'; @@ -44,7 +48,8 @@ describe('prover-node', () => { let l1ToL2MessageSource: MockProxy; let contractDataSource: MockProxy; let worldState: MockProxy; - let coordination: MockProxy | ProverCoordination; + let coordination: ProverCoordination; + let mockCoordination: MockProxy; let quoteProvider: MockProxy; let quoteSigner: MockProxy; let bondManager: MockProxy; @@ -108,7 +113,8 @@ describe('prover-node', () => { l1ToL2MessageSource = mock(); contractDataSource = mock(); worldState = mock(); - coordination = mock(); + mockCoordination = mock(); + coordination = mockCoordination; quoteProvider = mock(); quoteSigner = mock(); bondManager = mock(); @@ -134,10 +140,23 @@ describe('prover-node', () => { // Signer returns an empty signature quoteSigner.sign.mockImplementation(payload => Promise.resolve(new EpochProofQuote(payload, Signature.empty()))); + // We create 3 fake blocks with 1 tx effect each + blocks = times(3, i => + mock({ + number: i + 20, + hash: () => new Fr(i), + body: mock({ txEffects: [mock({ txHash: TxHash.random() } as TxEffect)] }), + }), + ); + // Archiver returns a bunch of fake blocks - blocks = times(3, i => mock({ number: i + 20, hash: () => new Fr(i) })); l2BlockSource.getBlocksForEpoch.mockResolvedValue(blocks); + // Coordination plays along and returns a tx whenever requested + mockCoordination.getTxByHash.mockImplementation(hash => + Promise.resolve(mock({ getTxHash: () => hash, tryGetTxHash: () => hash })), + ); + // A sample claim claim = { epochToProve: 10n, bondProvider: address } as EpochProofClaim; @@ -175,6 +194,12 @@ describe('prover-node', () => { expect(coordination.addEpochProofQuote).not.toHaveBeenCalled(); }); + it('does not send a quote if there is a tx missing from coordinator', async () => { + mockCoordination.getTxByHash.mockResolvedValue(undefined); + await proverNode.handleEpochCompleted(10n); + expect(coordination.addEpochProofQuote).not.toHaveBeenCalled(); + }); + it('does not send a quote on a finished epoch if the provider does not return one', async () => { quoteProvider.getQuote.mockResolvedValue(undefined); await proverNode.handleEpochCompleted(10n); @@ -309,7 +334,7 @@ describe('prover-node', () => { // Things to test // - Another aztec node receives the proof quote via p2p // - The prover node can get the it is missing via p2p, or it has them in it's mempool - describe('Using a p2p coordination', () => { + describe('using a p2p coordination', () => { let bootnode: BootstrapNode; let epochCache: MockProxy; let p2pClient: P2PClient; @@ -346,6 +371,11 @@ describe('prover-node', () => { // Set the p2p client to be the coordination method coordination = p2pClient; + // But still mock getTxByHash + const mockGetTxByHash = (hash: TxHash) => Promise.resolve(mock({ getTxHash: () => hash })); + jest.spyOn(p2pClient, 'getTxByHash').mockImplementation(mockGetTxByHash); + jest.spyOn(otherP2PClient, 'getTxByHash').mockImplementation(mockGetTxByHash); + await Promise.all([p2pClient.start(), otherP2PClient.start()]); // Sleep to enable peer discovery @@ -373,7 +403,7 @@ describe('prover-node', () => { await proverNode.stop(); }); - it('Should send a proof quote via p2p to another node', async () => { + it('should send a proof quote via p2p to another node', async () => { const epochNumber = 10n; epochCache.getEpochAndSlotNow.mockReturnValue({ epoch: epochNumber, @@ -412,6 +442,7 @@ describe('prover-node', () => { protected override doCreateEpochProvingJob( epochNumber: bigint, _blocks: L2Block[], + _txs: Tx[], _publicProcessorFactory: PublicProcessorFactory, cleanUp: (job: EpochProvingJob) => Promise, ): EpochProvingJob { diff --git a/yarn-project/prover-node/src/prover-node.ts b/yarn-project/prover-node/src/prover-node.ts index 5bb23e97378..10a65b3594f 100644 --- a/yarn-project/prover-node/src/prover-node.ts +++ b/yarn-project/prover-node/src/prover-node.ts @@ -10,6 +10,7 @@ import { type ProverCoordination, type ProverNodeApi, type Service, + type Tx, type WorldStateSynchronizer, tryStop, } from '@aztec/circuit-types'; @@ -49,6 +50,7 @@ export class ProverNode implements ClaimsMonitorHandler, EpochMonitorHandler, Pr private latestEpochWeAreProving: bigint | undefined; private jobs: Map = new Map(); + private cachedEpochData: { epochNumber: bigint; blocks: L2Block[]; txs: Tx[] } | undefined = undefined; private options: ProverNodeOptions; private metrics: ProverNodeMetrics; @@ -139,13 +141,12 @@ export class ProverNode implements ClaimsMonitorHandler, EpochMonitorHandler, Pr */ async handleEpochCompleted(epochNumber: bigint): Promise { try { - // Construct a quote for the epoch - const blocks = await this.l2BlockSource.getBlocksForEpoch(epochNumber); - if (blocks.length === 0) { - this.log.info(`No blocks found for epoch ${epochNumber}`); - return; - } + // Gather data for the epoch + const epochData = await this.gatherEpochData(epochNumber); + const { blocks } = epochData; + this.cachedEpochData = { epochNumber, ...epochData }; + // Construct a quote for the epoch const partialQuote = await this.quoteProvider.getQuote(Number(epochNumber), blocks); if (!partialQuote) { this.log.info(`No quote produced for epoch ${epochNumber}`); @@ -256,10 +257,9 @@ export class ProverNode implements ClaimsMonitorHandler, EpochMonitorHandler, Pr } // Gather blocks for this epoch - const blocks = await this.l2BlockSource.getBlocksForEpoch(epochNumber); - if (blocks.length === 0) { - throw new Error(`No blocks found for epoch ${epochNumber}`); - } + const cachedEpochData = this.cachedEpochData?.epochNumber === epochNumber ? this.cachedEpochData : undefined; + const { blocks, txs } = cachedEpochData ?? (await this.gatherEpochData(epochNumber)); + const fromBlock = blocks[0].number; const toBlock = blocks.at(-1)!.number; @@ -279,15 +279,51 @@ export class ProverNode implements ClaimsMonitorHandler, EpochMonitorHandler, Pr return Promise.resolve(); }; - const job = this.doCreateEpochProvingJob(epochNumber, blocks, publicProcessorFactory, cleanUp); + const job = this.doCreateEpochProvingJob(epochNumber, blocks, txs, publicProcessorFactory, cleanUp); this.jobs.set(job.getId(), job); return job; } + @trackSpan('ProverNode.gatherEpochData', epochNumber => ({ [Attributes.EPOCH_NUMBER]: Number(epochNumber) })) + private async gatherEpochData(epochNumber: bigint) { + // Gather blocks for this epoch and their txs + const blocks = await this.gatherBlocks(epochNumber); + const txs = await this.gatherTxs(epochNumber, blocks); + + return { blocks, txs }; + } + + private async gatherBlocks(epochNumber: bigint) { + const blocks = await this.l2BlockSource.getBlocksForEpoch(epochNumber); + if (blocks.length === 0) { + throw new Error(`No blocks found for epoch ${epochNumber}`); + } + return blocks; + } + + private async gatherTxs(epochNumber: bigint, blocks: L2Block[]) { + const txs = await Promise.all( + blocks.flatMap(block => + block.body.txEffects + .map(tx => tx.txHash) + .map(txHash => this.coordination.getTxByHash(txHash).then(tx => [block.number, txHash, tx] as const)), + ), + ); + + const notFound = txs.filter(([_blockNum, _txHash, tx]) => !tx); + if (notFound.length) { + const notFoundList = notFound.map(([blockNum, txHash]) => `${txHash.toString()} (block ${blockNum})`).join(', '); + throw new Error(`Txs not found for epoch ${epochNumber}: ${notFoundList}`); + } + + return txs.map(([_blockNumber, _txHash, tx]) => tx!); + } + /** Extracted for testing purposes. */ protected doCreateEpochProvingJob( epochNumber: bigint, blocks: L2Block[], + txs: Tx[], publicProcessorFactory: PublicProcessorFactory, cleanUp: () => Promise, ) { @@ -295,12 +331,12 @@ export class ProverNode implements ClaimsMonitorHandler, EpochMonitorHandler, Pr this.worldState, epochNumber, blocks, + txs, this.prover.createEpochProver(), publicProcessorFactory, this.publisher, this.l2BlockSource, this.l1ToL2MessageSource, - this.coordination, this.metrics, { parallelBlockLimit: this.options.maxParallelBlocksPerEpoch }, cleanUp, diff --git a/yarn-project/pxe/package.json b/yarn-project/pxe/package.json index 716483f57e1..59069d0f5dc 100644 --- a/yarn-project/pxe/package.json +++ b/yarn-project/pxe/package.json @@ -58,12 +58,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ 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 5f333ecb0c4..f000655f45f 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 @@ -44,6 +44,7 @@ async function createPXEService(): Promise { coinIssuerAddress: EthAddress.random(), rewardDistributorAddress: EthAddress.random(), governanceProposerAddress: EthAddress.random(), + slashFactoryAddress: EthAddress.random(), }; node.getL1ContractAddresses.mockResolvedValue(mockedContracts); diff --git a/yarn-project/scripts/package.json b/yarn-project/scripts/package.json index 3fc80b2aec7..be14fa8b141 100644 --- a/yarn-project/scripts/package.json +++ b/yarn-project/scripts/package.json @@ -77,12 +77,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/scripts/run_test.sh b/yarn-project/scripts/run_test.sh new file mode 100755 index 00000000000..3c7ca41af63 --- /dev/null +++ b/yarn-project/scripts/run_test.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# This runs an individual test from the dest folder. +# It's the script used by ./bootstrap.sh test-cmds. +# It means we can return a concise, easy to read, easy to run command for reproducing a test run. +set -eu + +dir=${1%%/*} +test=${1#*dest/} + +export NODE_OPTIONS="--no-warnings --experimental-vm-modules" + +cd $(dirname $0)/../$dir + +# TODO: --forceExit *should not be needed*. Find out what's not being cleaned up. +node ../node_modules/.bin/jest --forceExit --runInBand --testRegex '\.test\.js$' --rootDir dest $test \ No newline at end of file diff --git a/yarn-project/sequencer-client/package.json b/yarn-project/sequencer-client/package.json index 1ad914e4f81..6721e3080b5 100644 --- a/yarn-project/sequencer-client/package.json +++ b/yarn-project/sequencer-client/package.json @@ -53,6 +53,7 @@ "viem": "^2.7.15" }, "devDependencies": { + "@aztec/archiver": "workspace:^", "@aztec/kv-store": "workspace:^", "@jest/globals": "^29.5.0", "@types/jest": "^29.5.0", @@ -106,12 +107,7 @@ "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/sequencer-client/src/client/sequencer-client.ts b/yarn-project/sequencer-client/src/client/sequencer-client.ts index 81bf69ad10f..6947f4101ac 100644 --- a/yarn-project/sequencer-client/src/client/sequencer-client.ts +++ b/yarn-project/sequencer-client/src/client/sequencer-client.ts @@ -13,6 +13,7 @@ import { type SequencerClientConfig } from '../config.js'; import { GlobalVariableBuilder } from '../global_variable_builder/index.js'; import { L1Publisher } from '../publisher/index.js'; import { Sequencer, type SequencerConfig } from '../sequencer/index.js'; +import { type SlasherClient } from '../slasher/index.js'; import { TxValidatorFactory } from '../tx_validator/tx_validator_factory.js'; /** @@ -40,6 +41,7 @@ export class SequencerClient { validatorClient: ValidatorClient | undefined; // allowed to be undefined while we migrate p2pClient: P2P; worldStateSynchronizer: WorldStateSynchronizer; + slasherClient: SlasherClient; contractDataSource: ContractDataSource; l2BlockSource: L2BlockSource; l1ToL2MessageSource: L1ToL2MessageSource; @@ -52,6 +54,7 @@ export class SequencerClient { validatorClient, p2pClient, worldStateSynchronizer, + slasherClient, contractDataSource, l2BlockSource, l1ToL2MessageSource, @@ -91,6 +94,7 @@ export class SequencerClient { globalsBuilder, p2pClient, worldStateSynchronizer, + slasherClient, new LightweightBlockBuilderFactory(telemetryClient), l2BlockSource, l1ToL2MessageSource, diff --git a/yarn-project/sequencer-client/src/index.ts b/yarn-project/sequencer-client/src/index.ts index dcac430ac13..35129eed538 100644 --- a/yarn-project/sequencer-client/src/index.ts +++ b/yarn-project/sequencer-client/src/index.ts @@ -2,6 +2,7 @@ export * from './client/index.js'; export * from './config.js'; export * from './publisher/index.js'; export { Sequencer, SequencerState } from './sequencer/index.js'; +export * from './slasher/index.js'; // Used by the node to simulate public parts of transactions. Should these be moved to a shared library? // ISSUE(#9832) diff --git a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts index 3642f039874..c27d4710031 100644 --- a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts +++ b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts @@ -16,24 +16,18 @@ import { type Proof, } from '@aztec/circuits.js'; import { type FeeRecipient, type RootRollupPublicInputs } from '@aztec/circuits.js/rollup'; -import { - type EthereumChain, - type L1ContractsConfig, - L1TxUtils, - type L1TxUtilsConfig, - createEthereumChain, -} from '@aztec/ethereum'; +import { type EthereumChain, type L1ContractsConfig, L1TxUtils, createEthereumChain } from '@aztec/ethereum'; import { makeTuple } from '@aztec/foundation/array'; import { toHex } from '@aztec/foundation/bigint-buffer'; import { Blob } from '@aztec/foundation/blob'; import { areArraysEqual, compactArray, times } from '@aztec/foundation/collection'; import { type Signature } from '@aztec/foundation/eth-signature'; import { Fr } from '@aztec/foundation/fields'; -import { createLogger } from '@aztec/foundation/log'; +import { type Logger, createLogger } from '@aztec/foundation/log'; import { type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; import { InterruptibleSleep } from '@aztec/foundation/sleep'; import { Timer } from '@aztec/foundation/timer'; -import { ExtRollupLibAbi, GovernanceProposerAbi, LeonidasLibAbi, RollupAbi } from '@aztec/l1-artifacts'; +import { EmpireBaseAbi, ExtRollupLibAbi, LeonidasLibAbi, RollupAbi, SlasherAbi } from '@aztec/l1-artifacts'; import { type TelemetryClient } from '@aztec/telemetry-client'; import pick from 'lodash.pick'; @@ -135,6 +129,13 @@ export type L1SubmitEpochProofArgs = { proof: Proof; }; +export enum VoteType { + GOVERNANCE, + SLASHING, +} + +type GetSlashPayloadCallBack = (slotNumber: bigint) => Promise; + /** * Publishes L2 blocks to L1. This implementation does *not* retry a transaction in * the event of network congestion, but should work for local development. @@ -149,20 +150,25 @@ export class L1Publisher { private interrupted = false; private metrics: L1PublisherMetrics; - private payload: EthAddress = EthAddress.ZERO; - private myLastVote: bigint = 0n; + protected governanceLog = createLogger('sequencer:publisher:governance'); + protected governanceProposerAddress?: EthAddress; + private governancePayload: EthAddress = EthAddress.ZERO; + + protected slashingLog = createLogger('sequencer:publisher:slashing'); + protected slashingProposerAddress?: EthAddress; + private getSlashPayload?: GetSlashPayloadCallBack = undefined; + + private myLastVotes: Record = { + [VoteType.GOVERNANCE]: 0n, + [VoteType.SLASHING]: 0n, + }; protected log = createLogger('sequencer:publisher'); - protected governanceLog = createLogger('sequencer:publisher:governance'); protected rollupContract: GetContractReturnType< typeof RollupAbi, WalletClient >; - protected governanceProposerContract?: GetContractReturnType< - typeof GovernanceProposerAbi, - WalletClient - > = undefined; protected publicClient: PublicClient; protected walletClient: WalletClient; @@ -178,7 +184,7 @@ export class L1Publisher { private readonly l1TxUtils: L1TxUtils; constructor( - config: TxSenderConfig & PublisherConfig & Pick & L1TxUtilsConfig, + config: TxSenderConfig & PublisherConfig & Pick, client: TelemetryClient, ) { this.sleepTimeMs = config?.l1PublishRetryIntervalMS ?? 60_000; @@ -205,16 +211,31 @@ export class L1Publisher { }); if (l1Contracts.governanceProposerAddress) { - this.governanceProposerContract = getContract({ - address: getAddress(l1Contracts.governanceProposerAddress.toString()), - abi: GovernanceProposerAbi, - client: this.walletClient, - }); + this.governanceProposerAddress = EthAddress.fromString(l1Contracts.governanceProposerAddress.toString()); } this.l1TxUtils = new L1TxUtils(this.publicClient, this.walletClient, this.log, config); } + public registerSlashPayloadGetter(callback: GetSlashPayloadCallBack) { + this.getSlashPayload = callback; + } + + private async getSlashingProposerAddress() { + if (this.slashingProposerAddress) { + return this.slashingProposerAddress; + } + + const slasherAddress = await this.rollupContract.read.SLASHER(); + const slasher = getContract({ + address: getAddress(slasherAddress.toString()), + abi: SlasherAbi, + client: this.walletClient, + }); + this.slashingProposerAddress = EthAddress.fromString(await slasher.read.PROPOSER()); + return this.slashingProposerAddress; + } + get publisherAddress() { return this.account.address; } @@ -230,12 +251,12 @@ export class L1Publisher { }); } - public getPayLoad() { - return this.payload; + public getGovernancePayload() { + return this.governancePayload; } - public setPayload(payload: EthAddress) { - this.payload = payload; + public setGovernancePayload(payload: EthAddress) { + this.governancePayload = payload; } public getSenderAddress(): EthAddress { @@ -450,68 +471,106 @@ export class L1Publisher { calldataGas: getCalldataGasUsage(calldata), }; } - - public async castVote(slotNumber: bigint, timestamp: bigint): Promise { - if (this.payload.equals(EthAddress.ZERO)) { + public async castVote(slotNumber: bigint, timestamp: bigint, voteType: VoteType) { + // @todo This function can be optimized by doing some of the computations locally instead of calling the L1 contracts + if (this.myLastVotes[voteType] >= slotNumber) { return false; } - if (!this.governanceProposerContract) { - return false; - } + const voteConfig = async (): Promise< + { payload: EthAddress; voteContractAddress: EthAddress; logger: Logger } | undefined + > => { + if (voteType === VoteType.GOVERNANCE) { + if (this.governancePayload.equals(EthAddress.ZERO)) { + return undefined; + } + if (!this.governanceProposerAddress) { + return undefined; + } + return { + payload: this.governancePayload, + voteContractAddress: this.governanceProposerAddress, + logger: this.governanceLog, + }; + } else if (voteType === VoteType.SLASHING) { + if (!this.getSlashPayload) { + return undefined; + } + const slashingProposerAddress = await this.getSlashingProposerAddress(); + if (!slashingProposerAddress) { + return undefined; + } + + const slashPayload = await this.getSlashPayload(slotNumber); + + if (!slashPayload) { + return undefined; + } + + return { + payload: slashPayload, + voteContractAddress: slashingProposerAddress, + logger: this.slashingLog, + }; + } else { + throw new Error('Invalid vote type'); + } + }; - if (this.myLastVote >= slotNumber) { + const vConfig = await voteConfig(); + + if (!vConfig) { return false; } - // @todo This can be optimized A LOT by doing the computation instead of making calls to L1, but it is very convenient - // for when we keep changing the values and don't want to have multiple versions of the same logic implemented. + const { payload, voteContractAddress, logger } = vConfig; + + const voteContract = getContract({ + address: getAddress(voteContractAddress.toString()), + abi: EmpireBaseAbi, + client: this.walletClient, + }); const [proposer, roundNumber] = await Promise.all([ this.rollupContract.read.getProposerAt([timestamp]), - this.governanceProposerContract.read.computeRound([slotNumber]), + voteContract.read.computeRound([slotNumber]), ]); if (proposer.toLowerCase() !== this.account.address.toLowerCase()) { return false; } - const [slotForLastVote] = await this.governanceProposerContract.read.rounds([ - this.rollupContract.address, - roundNumber, - ]); + const [slotForLastVote] = await voteContract.read.rounds([this.rollupContract.address, roundNumber]); if (slotForLastVote >= slotNumber) { return false; } - // Storing these early such that a quick entry again would not send another tx, - // revert the state if there is a failure. - const cachedMyLastVote = this.myLastVote; - this.myLastVote = slotNumber; - - this.governanceLog.verbose(`Casting vote for ${this.payload}`); + const cachedMyLastVote = this.myLastVotes[voteType]; + this.myLastVotes[voteType] = slotNumber; let txHash; try { - txHash = await this.governanceProposerContract.write.vote([this.payload.toString()], { account: this.account }); + txHash = await voteContract.write.vote([payload.toString()], { + account: this.account, + }); } catch (err) { const msg = prettyLogViemErrorMsg(err); - this.governanceLog.error(`Failed to vote`, msg); - this.myLastVote = cachedMyLastVote; + logger.error(`Failed to vote`, msg); + this.myLastVotes[voteType] = cachedMyLastVote; return false; } if (txHash) { const receipt = await this.getTransactionReceipt(txHash); if (!receipt) { - this.governanceLog.warn(`Failed to get receipt for tx ${txHash}`); - this.myLastVote = cachedMyLastVote; + logger.warn(`Failed to get receipt for tx ${txHash}`); + this.myLastVotes[voteType] = cachedMyLastVote; return false; } } - this.governanceLog.info(`Cast vote for ${this.payload}`); + logger.info(`Cast vote for ${payload}`); return true; } diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts index b1a02401450..60aa4208611 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.test.ts @@ -48,6 +48,7 @@ import { type MockProxy, mock, mockFn } from 'jest-mock-extended'; import { type GlobalVariableBuilder } from '../global_variable_builder/global_builder.js'; import { type L1Publisher } from '../publisher/l1-publisher.js'; +import { type SlasherClient } from '../slasher/index.js'; import { TxValidatorFactory } from '../tx_validator/tx_validator_factory.js'; import { Sequencer } from './sequencer.js'; import { SequencerState } from './utils.js'; @@ -195,6 +196,8 @@ describe('sequencer', () => { const l1GenesisTime = BigInt(Math.floor(Date.now() / 1000)); const l1Constants = { l1GenesisTime, slotDuration, ethereumSlotDuration }; + const slasherClient = mock(); + sequencer = new TestSubject( publisher, // TODO(md): add the relevant methods to the validator client that will prevent it stalling when waiting for attestations @@ -202,6 +205,7 @@ describe('sequencer', () => { globalVariableBuilder, p2p, worldState, + slasherClient, blockBuilderFactory, l2BlockSource, l1ToL2MessageSource, @@ -257,7 +261,7 @@ describe('sequencer', () => { await expect(sequencer.doRealWork()).rejects.toThrow( expect.objectContaining({ name: 'SequencerTooSlowError', - message: expect.stringContaining(`Too far into slot to transition to ${delayedState}.`), + message: expect.stringContaining(`Too far into slot to transition to ${delayedState}`), }), ); diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.ts index 9f758c456cc..44acbec00d3 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.ts @@ -36,8 +36,9 @@ import { Attributes, type TelemetryClient, type Tracer, trackSpan } from '@aztec import { type ValidatorClient } from '@aztec/validator-client'; import { type GlobalVariableBuilder } from '../global_variable_builder/global_builder.js'; -import { type L1Publisher } from '../publisher/l1-publisher.js'; +import { type L1Publisher, VoteType } from '../publisher/l1-publisher.js'; import { prettyLogViemErrorMsg } from '../publisher/utils.js'; +import { type SlasherClient } from '../slasher/slasher_client.js'; import { type TxValidatorFactory } from '../tx_validator/tx_validator_factory.js'; import { getDefaultAllowedSetupFunctions } from './allowed.js'; import { type SequencerConfig } from './config.js'; @@ -60,7 +61,7 @@ export class SequencerTooSlowError extends Error { public readonly currentTime: number, ) { super( - `Too far into slot to transition to ${proposedState}. max allowed: ${maxAllowedTime}s, time into slot: ${currentTime}s`, + `Too far into slot to transition to ${proposedState} (max allowed: ${maxAllowedTime}s, time into slot: ${currentTime}s)`, ); this.name = 'SequencerTooSlowError'; } @@ -106,6 +107,7 @@ export class Sequencer { private globalsBuilder: GlobalVariableBuilder, private p2pClient: P2P, private worldState: WorldStateSynchronizer, + private slasherClient: SlasherClient, private blockBuilderFactory: BlockBuilderFactory, private l2BlockSource: L2BlockSource, private l1ToL2MessageSource: L1ToL2MessageSource, @@ -122,6 +124,9 @@ export class Sequencer { // Register the block builder with the validator client for re-execution this.validatorClient?.registerBlockBuilder(this.buildBlock.bind(this)); + + // Register the slasher on the publisher to fetch slashing payloads + this.publisher.registerSlashPayloadGetter(this.slasherClient.getSlashPayload.bind(this.slasherClient)); } get tracer(): Tracer { @@ -157,7 +162,7 @@ export class Sequencer { this.maxBlockSizeInBytes = config.maxBlockSizeInBytes; } if (config.governanceProposerPayload) { - this.publisher.setPayload(config.governanceProposerPayload); + this.publisher.setGovernancePayload(config.governanceProposerPayload); } if (config.maxL1TxInclusionTimeIntoSlot !== undefined) { this.maxL1TxInclusionTimeIntoSlot = config.maxL1TxInclusionTimeIntoSlot; @@ -172,10 +177,10 @@ export class Sequencer { private setTimeTable() { // How late into the slot can we be to start working - const initialTime = 1; + const initialTime = 2; // How long it takes to validate the txs collected and get ready to start building - const blockPrepareTime = 2; + const blockPrepareTime = 1; // How long it takes to for attestations to travel across the p2p layer. const attestationPropagationTime = 2; @@ -245,6 +250,7 @@ export class Sequencer { this.log.debug(`Stopping sequencer`); await this.validatorClient?.stop(); await this.runningPromise?.stop(); + await this.slasherClient?.stop(); this.publisher.interrupt(); this.setState(SequencerState.STOPPED, 0n, true /** force */); this.log.info('Stopped sequencer'); @@ -314,7 +320,8 @@ export class Sequencer { slot, ); - void this.publisher.castVote(slot, newGlobalVariables.timestamp.toBigInt()); + void this.publisher.castVote(slot, newGlobalVariables.timestamp.toBigInt(), VoteType.GOVERNANCE); + void this.publisher.castVote(slot, newGlobalVariables.timestamp.toBigInt(), VoteType.SLASHING); if (!this.shouldProposeBlock(historicalHeader, {})) { return; @@ -430,7 +437,7 @@ export class Sequencer { const bufferSeconds = maxAllowedTime - secondsIntoSlot; if (bufferSeconds < 0) { - this.log.warn(`Too far into slot to transition to ${proposedState}`, { maxAllowedTime, secondsIntoSlot }); + this.log.debug(`Too far into slot to transition to ${proposedState}`, { maxAllowedTime, secondsIntoSlot }); return false; } diff --git a/yarn-project/sequencer-client/src/slasher/factory.ts b/yarn-project/sequencer-client/src/slasher/factory.ts new file mode 100644 index 00000000000..85decb074ea --- /dev/null +++ b/yarn-project/sequencer-client/src/slasher/factory.ts @@ -0,0 +1,22 @@ +import type { L2BlockSource } from '@aztec/circuit-types'; +import { type L1ContractsConfig, type L1ReaderConfig } from '@aztec/ethereum'; +import { createLogger } from '@aztec/foundation/log'; +import { type AztecKVStore } from '@aztec/kv-store'; +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 { SlasherClient } from './slasher_client.js'; +import { type SlasherConfig } from './slasher_client.js'; + +export const createSlasherClient = async ( + _config: SlasherConfig & DataStoreConfig & L1ContractsConfig & L1ReaderConfig, + l2BlockSource: L2BlockSource, + telemetry: TelemetryClient = new NoopTelemetryClient(), + deps: { store?: AztecKVStore } = {}, +) => { + const config = { ..._config }; + const store = deps.store ?? (await createStore('slasher', config, createLogger('slasher:lmdb'))); + return new SlasherClient(config, store, l2BlockSource, telemetry); +}; diff --git a/yarn-project/sequencer-client/src/slasher/index.ts b/yarn-project/sequencer-client/src/slasher/index.ts new file mode 100644 index 00000000000..e33e274a76b --- /dev/null +++ b/yarn-project/sequencer-client/src/slasher/index.ts @@ -0,0 +1,2 @@ +export * from './slasher_client.js'; +export { createSlasherClient } from './factory.js'; diff --git a/yarn-project/sequencer-client/src/slasher/slasher_client.test.ts b/yarn-project/sequencer-client/src/slasher/slasher_client.test.ts new file mode 100644 index 00000000000..bb097b9da72 --- /dev/null +++ b/yarn-project/sequencer-client/src/slasher/slasher_client.test.ts @@ -0,0 +1,120 @@ +import { MockL2BlockSource } from '@aztec/archiver/test'; +import { L2Block } from '@aztec/circuit-types'; +import { + type L1ContractAddresses, + type L1ContractsConfig, + type L1ReaderConfig, + getL1ContractsConfigEnvVars, +} from '@aztec/ethereum'; +import { EthAddress } from '@aztec/foundation/eth-address'; +import { retryUntil } from '@aztec/foundation/retry'; +import { sleep } from '@aztec/foundation/sleep'; +import { type AztecKVStore } from '@aztec/kv-store'; +import { openTmpStore } from '@aztec/kv-store/lmdb'; + +import { expect } from '@jest/globals'; + +import { SlasherClient, type SlasherConfig } from './slasher_client.js'; + +// Most of this test are directly copied from the P2P client test. +describe('In-Memory Slasher Client', () => { + let blockSource: MockL2BlockSource; + let kvStore: AztecKVStore; + let client: SlasherClient; + let config: SlasherConfig & L1ContractsConfig & L1ReaderConfig; + + beforeEach(() => { + blockSource = new MockL2BlockSource(); + blockSource.createBlocks(100); + + const l1Config = getL1ContractsConfigEnvVars(); + + // Need some configuration here. Can be a basic bitch config really. + config = { + ...l1Config, + blockCheckIntervalMS: 100, + blockRequestBatchSize: 20, + l1Contracts: { + slashFactoryAddress: EthAddress.ZERO, + } as unknown as L1ContractAddresses, + l1RpcUrl: 'http://127.0.0.1:8545', + l1ChainId: 1, + viemPollingIntervalMS: 1000, + }; + + kvStore = openTmpStore(); + client = new SlasherClient(config, kvStore, blockSource); + }); + + const advanceToProvenBlock = async (getProvenBlockNumber: number, provenEpochNumber = getProvenBlockNumber) => { + blockSource.setProvenBlockNumber(getProvenBlockNumber); + blockSource.setProvenEpochNumber(provenEpochNumber); + await retryUntil( + () => Promise.resolve(client.getSyncedProvenBlockNum() >= getProvenBlockNumber), + 'synced', + 10, + 0.1, + ); + }; + + afterEach(async () => { + if (client.isReady()) { + await client.stop(); + } + }); + + it('can start & stop', async () => { + expect(client.isReady()).toEqual(false); + + await client.start(); + expect(client.isReady()).toEqual(true); + + await client.stop(); + expect(client.isReady()).toEqual(false); + }); + + it('restores the previous block number it was at', async () => { + await client.start(); + await client.stop(); + + const client2 = new SlasherClient(config, kvStore, blockSource); + expect(client2.getSyncedLatestBlockNum()).toEqual(client.getSyncedLatestBlockNum()); + }); + + describe('Chain prunes', () => { + it('moves the tips on a chain reorg', async () => { + blockSource.setProvenBlockNumber(0); + await client.start(); + + await advanceToProvenBlock(90); + + await expect(client.getL2Tips()).resolves.toEqual({ + latest: { number: 100, hash: expect.any(String) }, + proven: { number: 90, hash: expect.any(String) }, + finalized: { number: 90, hash: expect.any(String) }, + }); + + blockSource.removeBlocks(10); + + // give the client a chance to react to the reorg + await sleep(100); + + await expect(client.getL2Tips()).resolves.toEqual({ + latest: { number: 90, hash: expect.any(String) }, + proven: { number: 90, hash: expect.any(String) }, + finalized: { number: 90, hash: expect.any(String) }, + }); + + blockSource.addBlocks([L2Block.random(91), L2Block.random(92)]); + + // give the client a chance to react to the new blocks + await sleep(100); + + await expect(client.getL2Tips()).resolves.toEqual({ + latest: { number: 92, hash: expect.any(String) }, + proven: { number: 90, hash: expect.any(String) }, + finalized: { number: 90, hash: expect.any(String) }, + }); + }); + }); +}); diff --git a/yarn-project/sequencer-client/src/slasher/slasher_client.ts b/yarn-project/sequencer-client/src/slasher/slasher_client.ts new file mode 100644 index 00000000000..cc5e60e25ea --- /dev/null +++ b/yarn-project/sequencer-client/src/slasher/slasher_client.ts @@ -0,0 +1,402 @@ +import { + type L2Block, + type L2BlockId, + type L2BlockSource, + L2BlockStream, + type L2BlockStreamEvent, + type L2Tips, +} from '@aztec/circuit-types'; +import { INITIAL_L2_BLOCK_NUM } from '@aztec/circuits.js/constants'; +import { type L1ContractsConfig, type L1ReaderConfig, createEthereumChain } from '@aztec/ethereum'; +import { EthAddress } from '@aztec/foundation/eth-address'; +import { createLogger } from '@aztec/foundation/log'; +import { type AztecKVStore, type AztecMap, type AztecSingleton } from '@aztec/kv-store'; +import { SlashFactoryAbi } from '@aztec/l1-artifacts'; +import { type TelemetryClient, WithTracer } from '@aztec/telemetry-client'; +import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; + +import { + type Chain, + type GetContractReturnType, + type HttpTransport, + type PublicClient, + createPublicClient, + getAddress, + getContract, + http, +} from 'viem'; + +/** + * Enum defining the possible states of the Slasher client. + */ +export enum SlasherClientState { + IDLE, + SYNCHING, + RUNNING, + STOPPED, +} + +/** + * The synchronization status of the Slasher client. + */ +export interface SlasherSyncState { + /** + * The current state of the slasher client. + */ + state: SlasherClientState; + /** + * The block number that the slasher client is synced to. + */ + syncedToL2Block: L2BlockId; +} + +export interface SlasherConfig { + blockCheckIntervalMS: number; + blockRequestBatchSize: number; +} + +type SlashEvent = { + epoch: bigint; + amount: bigint; + lifetime: bigint; +}; + +/** + * @notice A Hypomeiones slasher client implementation + * + * Hypomeiones: a class of individuals in ancient Sparta who were considered inferior or lesser citizens compared + * to the full Spartan citizens. + * + * The implementation here is less than ideal. It exists, not to be the end all be all, but to show that + * slashing can be done with this mechanism. + * + * The implementation is VERY brute in the sense that it only looks for pruned blocks and then tries to slash + * the full committee of that. + * If it sees a prune, it will mark the full epoch as "to be slashed". + * + * Also, it is not particularly smart around what it should if there were to be multiple slashing events. + * + * A few improvements: + * - Only vote on the proposal if it is possible to reach, e.g., if 6 votes are needed and only 4 slots are left don't vote. + * - Stop voting on a payload once it is processed. + * - Only vote on the proposal if it have not already been executed + * - Caveat, we need to fully decide if it is acceptable to have the same payload address multiple times. In the current + * slash factory that could mean slashing the same committee for the same error multiple times. + * - Decide how to deal with multiple slashing events in the same round. + * - This could be that multiple epochs are pruned in the same round, but with the current naive implementation we could end up + * slashing only the first, because the "lifetime" of the second would have passed after that vote + */ +export class SlasherClient extends WithTracer { + private currentState = SlasherClientState.IDLE; + private syncPromise = Promise.resolve(); + private syncResolve?: () => void = undefined; + private latestBlockNumberAtStart = -1; + private provenBlockNumberAtStart = -1; + + private synchedBlockHashes: AztecMap; + private synchedLatestBlockNumber: AztecSingleton; + private synchedProvenBlockNumber: AztecSingleton; + + private blockStream; + + private slashEvents: SlashEvent[] = []; + + protected slashFactoryContract?: GetContractReturnType> = + undefined; + + // The amount to slash for a prune. + // Note that we set it to 0, such that no actual slashing will happen, but the event will be fired, + // showing that the slashing mechanism is working. + private slashingAmount: bigint = 0n; + + constructor( + private config: SlasherConfig & L1ContractsConfig & L1ReaderConfig, + private store: AztecKVStore, + private l2BlockSource: L2BlockSource, + telemetry: TelemetryClient = new NoopTelemetryClient(), + private log = createLogger('slasher'), + ) { + super(telemetry, 'slasher'); + + this.blockStream = new L2BlockStream(l2BlockSource, this, this, createLogger('slasher:block_stream'), { + batchSize: config.blockRequestBatchSize, + pollIntervalMS: config.blockCheckIntervalMS, + }); + + this.synchedBlockHashes = store.openMap('slasher_block_hashes'); + this.synchedLatestBlockNumber = store.openSingleton('slasher_last_l2_block'); + this.synchedProvenBlockNumber = store.openSingleton('slasher_last_proven_l2_block'); + + if (config.l1Contracts.slashFactoryAddress && config.l1Contracts.slashFactoryAddress !== EthAddress.ZERO) { + const chain = createEthereumChain(config.l1RpcUrl, config.l1ChainId); + const publicClient = createPublicClient({ + chain: chain.chainInfo, + transport: http(chain.rpcUrl), + pollingInterval: config.viemPollingIntervalMS, + }); + + this.slashFactoryContract = getContract({ + address: getAddress(config.l1Contracts.slashFactoryAddress.toString()), + abi: SlashFactoryAbi, + client: publicClient, + }); + } else { + this.log.warn('No slash factory address found, slashing will not be enabled'); + } + + this.log.info(`Slasher client initialized`); + } + + // This is where we should put a bunch of the improvements mentioned earlier. + public async getSlashPayload(slotNumber: bigint): Promise { + if (!this.slashFactoryContract) { + return undefined; + } + + // As long as the slot is greater than the lifetime, we want to keep deleting the first element + // since it will not make sense to include anymore. + while (this.slashEvents.length > 0 && this.slashEvents[0].lifetime < slotNumber) { + this.slashEvents.shift(); + } + + if (this.slashEvents.length == 0) { + return undefined; + } + + const slashEvent = this.slashEvents[0]; + + const [payloadAddress, isDeployed] = await this.slashFactoryContract.read.getAddressAndIsDeployed([ + slashEvent.epoch, + slashEvent.amount, + ]); + + if (!isDeployed) { + // The proposal cannot be executed until it is deployed + this.log.verbose(`Voting on not yet deployed payload: ${payloadAddress}`); + } + + return EthAddress.fromString(payloadAddress); + } + + public getL2BlockHash(number: number): Promise { + return Promise.resolve(this.synchedBlockHashes.get(number)); + } + + public getL2Tips(): Promise { + const latestBlockNumber = this.getSyncedLatestBlockNum(); + let latestBlockHash: string | undefined; + const provenBlockNumber = this.getSyncedProvenBlockNum(); + let provenBlockHash: string | undefined; + + if (latestBlockNumber > 0) { + latestBlockHash = this.synchedBlockHashes.get(latestBlockNumber); + if (typeof latestBlockHash === 'undefined') { + this.log.warn(`Block hash for latest block ${latestBlockNumber} not found`); + throw new Error(); + } + } + + if (provenBlockNumber > 0) { + provenBlockHash = this.synchedBlockHashes.get(provenBlockNumber); + if (typeof provenBlockHash === 'undefined') { + this.log.warn(`Block hash for proven block ${provenBlockNumber} not found`); + throw new Error(); + } + } + + return Promise.resolve({ + latest: { hash: latestBlockHash!, number: latestBlockNumber }, + proven: { hash: provenBlockHash!, number: provenBlockNumber }, + finalized: { hash: provenBlockHash!, number: provenBlockNumber }, + }); + } + + public async handleBlockStreamEvent(event: L2BlockStreamEvent): Promise { + this.log.debug(`Handling block stream event ${event.type}`); + switch (event.type) { + case 'blocks-added': + await this.handleLatestL2Blocks(event.blocks); + break; + case 'chain-finalized': + // TODO (alexg): I think we can prune the block hashes map here + break; + case 'chain-proven': { + const from = this.getSyncedProvenBlockNum() + 1; + const limit = event.blockNumber - from + 1; + await this.handleProvenL2Blocks(await this.l2BlockSource.getBlocks(from, limit)); + break; + } + case 'chain-pruned': + await this.handlePruneL2Blocks(event.blockNumber); + break; + default: { + const _: never = event; + break; + } + } + } + + public async start() { + if (this.currentState === SlasherClientState.STOPPED) { + throw new Error('Slasher already stopped'); + } + if (this.currentState !== SlasherClientState.IDLE) { + return this.syncPromise; + } + + // get the current latest block numbers + this.latestBlockNumberAtStart = await this.l2BlockSource.getBlockNumber(); + this.provenBlockNumberAtStart = await this.l2BlockSource.getProvenBlockNumber(); + + const syncedLatestBlock = this.getSyncedLatestBlockNum() + 1; + const syncedProvenBlock = this.getSyncedProvenBlockNum() + 1; + + // if there are blocks to be retrieved, go to a synching state + if (syncedLatestBlock <= this.latestBlockNumberAtStart || syncedProvenBlock <= this.provenBlockNumberAtStart) { + this.setCurrentState(SlasherClientState.SYNCHING); + this.syncPromise = new Promise(resolve => { + this.syncResolve = resolve; + }); + this.log.verbose(`Starting sync from ${syncedLatestBlock} (last proven ${syncedProvenBlock})`); + } else { + // if no blocks to be retrieved, go straight to running + this.setCurrentState(SlasherClientState.RUNNING); + this.syncPromise = Promise.resolve(); + this.log.verbose(`Block ${syncedLatestBlock} (proven ${syncedProvenBlock}) already beyond current block`); + } + + this.blockStream.start(); + this.log.verbose(`Started block downloader from block ${syncedLatestBlock}`); + + return this.syncPromise; + } + + /** + * Allows consumers to stop the instance of the slasher client. + * 'ready' will now return 'false' and the running promise that keeps the client synced is interrupted. + */ + public async stop() { + this.log.debug('Stopping Slasher client...'); + await this.blockStream.stop(); + this.log.debug('Stopped block downloader'); + this.setCurrentState(SlasherClientState.STOPPED); + this.log.info('Slasher client stopped.'); + } + + /** + * Public function to check if the slasher client is fully synced and ready to receive txs. + * @returns True if the slasher client is ready to receive txs. + */ + public isReady() { + return this.currentState === SlasherClientState.RUNNING; + } + + /** + * Public function to check the latest block number that the slasher client is synced to. + * @returns Block number of latest L2 Block we've synced with. + */ + public getSyncedLatestBlockNum() { + return this.synchedLatestBlockNumber.get() ?? INITIAL_L2_BLOCK_NUM - 1; + } + + /** + * Public function to check the latest proven block number that the slasher client is synced to. + * @returns Block number of latest proven L2 Block we've synced with. + */ + public getSyncedProvenBlockNum() { + return this.synchedProvenBlockNumber.get() ?? INITIAL_L2_BLOCK_NUM - 1; + } + + /** + * Method to check the status of the slasher client. + * @returns Information about slasher client status: state & syncedToBlockNum. + */ + public async getStatus(): Promise { + const blockNumber = this.getSyncedLatestBlockNum(); + const blockHash = + blockNumber == 0 + ? '' + : await this.l2BlockSource.getBlockHeader(blockNumber).then(header => header?.hash().toString()); + return Promise.resolve({ + state: this.currentState, + syncedToL2Block: { number: blockNumber, hash: blockHash }, + } as SlasherSyncState); + } + + /** + * Handles new blocks + * @param blocks - A list of blocks that the slasher client needs to store block hashes for + * @returns Empty promise. + */ + private async handleLatestL2Blocks(blocks: L2Block[]): Promise { + if (!blocks.length) { + return Promise.resolve(); + } + + const lastBlockNum = blocks[blocks.length - 1].number; + await Promise.all(blocks.map(block => this.synchedBlockHashes.set(block.number, block.hash().toString()))); + await this.synchedLatestBlockNumber.set(lastBlockNum); + this.log.debug(`Synched to latest block ${lastBlockNum}`); + this.startServiceIfSynched(); + } + + /** + * Handles new proven blocks by updating the proven block number + * @param blocks - A list of proven L2 blocks. + * @returns Empty promise. + */ + private async handleProvenL2Blocks(blocks: L2Block[]): Promise { + if (!blocks.length) { + return Promise.resolve(); + } + const lastBlockNum = blocks[blocks.length - 1].number; + await this.synchedProvenBlockNumber.set(lastBlockNum); + this.log.debug(`Synched to proven block ${lastBlockNum}`); + + this.startServiceIfSynched(); + } + + private async handlePruneL2Blocks(latestBlock: number): Promise { + const blockHeader = await this.l2BlockSource.getBlockHeader(latestBlock); + const slotNumber = blockHeader ? blockHeader.globalVariables.slotNumber.toBigInt() : BigInt(0); + const epochNumber = slotNumber / BigInt(this.config.aztecEpochDuration); + this.log.info(`Detected chain prune. Punishing the validators at epoch ${epochNumber}`); + + // Set the lifetime such that we have a full round that we could vote throughout. + const slotsIntoRound = slotNumber % BigInt(this.config.slashingRoundSize); + const toNext = slotsIntoRound == 0n ? 0n : BigInt(this.config.slashingRoundSize) - slotsIntoRound; + + const lifetime = slotNumber + toNext + BigInt(this.config.slashingRoundSize); + + this.slashEvents.push({ + epoch: epochNumber, + amount: this.slashingAmount, + lifetime, + }); + + await this.synchedLatestBlockNumber.set(latestBlock); + } + + private startServiceIfSynched() { + if ( + this.currentState === SlasherClientState.SYNCHING && + this.getSyncedLatestBlockNum() >= this.latestBlockNumberAtStart && + this.getSyncedProvenBlockNum() >= this.provenBlockNumberAtStart + ) { + this.log.debug(`Synched to blocks at start`); + this.setCurrentState(SlasherClientState.RUNNING); + if (this.syncResolve !== undefined) { + this.syncResolve(); + } + } + } + + /** + * Method to set the value of the current state. + * @param newState - New state value. + */ + private setCurrentState(newState: SlasherClientState) { + this.currentState = newState; + this.log.debug(`Moved to state ${SlasherClientState[this.currentState]}`); + } +} diff --git a/yarn-project/sequencer-client/tsconfig.json b/yarn-project/sequencer-client/tsconfig.json index 9a8615c0299..4161156625e 100644 --- a/yarn-project/sequencer-client/tsconfig.json +++ b/yarn-project/sequencer-client/tsconfig.json @@ -60,6 +60,9 @@ { "path": "../world-state" }, + { + "path": "../archiver" + }, { "path": "../kv-store" } diff --git a/yarn-project/simulator/package.json b/yarn-project/simulator/package.json index 487bd0ff5ff..a0bde2ce857 100644 --- a/yarn-project/simulator/package.json +++ b/yarn-project/simulator/package.json @@ -53,12 +53,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/telemetry-client/package.json b/yarn-project/telemetry-client/package.json index 6cad929392f..7face42b10c 100644 --- a/yarn-project/telemetry-client/package.json +++ b/yarn-project/telemetry-client/package.json @@ -76,12 +76,7 @@ "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", diff --git a/yarn-project/txe/package.json b/yarn-project/txe/package.json index d17b71b0533..d35ab5aceea 100644 --- a/yarn-project/txe/package.json +++ b/yarn-project/txe/package.json @@ -19,7 +19,7 @@ "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", "test": "HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-16} RAYON_NUM_THREADS=${RAYON_NUM_THREADS:-4} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}", "dev": "LOG_LEVEL=debug node ./dest/bin/index.js", - "start": "node ./dest/bin/index.js" + "start": "node --no-warnings ./dest/bin/index.js" }, "inherits": [ "../package.common.json" @@ -51,12 +51,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/types/package.json b/yarn-project/types/package.json index 3a2206e7957..46de945c274 100644 --- a/yarn-project/types/package.json +++ b/yarn-project/types/package.json @@ -52,12 +52,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/validator-client/package.json b/yarn-project/validator-client/package.json index 8970687e0dc..d0b6efa372c 100644 --- a/yarn-project/validator-client/package.json +++ b/yarn-project/validator-client/package.json @@ -53,12 +53,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/world-state/package.json b/yarn-project/world-state/package.json index b3bdd5346c6..a396423edce 100644 --- a/yarn-project/world-state/package.json +++ b/yarn-project/world-state/package.json @@ -54,12 +54,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index 3d2aa27b05c..c4806a57b34 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -225,7 +225,6 @@ __metadata: eslint: "npm:^8.21.0" eslint-import-resolver-typescript: "npm:^3.5.5" eslint-plugin-import: "npm:^2.27.5" - jest-silent-reporter: "npm:^0.6.0" madge: "npm:^6.1.0" prettier: "npm:^2.8.8" typedoc: "npm:^0.24.8" @@ -1158,6 +1157,7 @@ __metadata: version: 0.0.0-use.local resolution: "@aztec/sequencer-client@workspace:sequencer-client" dependencies: + "@aztec/archiver": "workspace:^" "@aztec/aztec.js": "workspace:^" "@aztec/bb-prover": "workspace:^" "@aztec/circuit-types": "workspace:^" @@ -2837,19 +2837,6 @@ __metadata: languageName: node linkType: hard -"@jest/types@npm:^26.6.2": - version: 26.6.2 - resolution: "@jest/types@npm:26.6.2" - dependencies: - "@types/istanbul-lib-coverage": "npm:^2.0.0" - "@types/istanbul-reports": "npm:^3.0.0" - "@types/node": "npm:*" - "@types/yargs": "npm:^15.0.0" - chalk: "npm:^4.0.0" - checksum: 10/02d42749c8c6dc7e3184d0ff0293dd91c97233c2e6dc3708d61ef33d3162d4f07ad38d2d8a39abd94cf2fced69b92a87565c7099137c4529809242ca327254af - languageName: node - linkType: hard - "@jest/types@npm:^29.6.3": version: 29.6.3 resolution: "@jest/types@npm:29.6.3" @@ -3868,7 +3855,7 @@ __metadata: version: 0.0.0-use.local resolution: "@noir-lang/noir_codegen@portal:../noir/packages/noir_codegen::locator=%40aztec%2Faztec3-packages%40workspace%3A." dependencies: - "@noir-lang/types": "npm:1.0.0-beta.0" + "@noir-lang/types": "npm:1.0.0-beta.1" glob: "npm:^10.3.10" ts-command-line-args: "npm:^2.5.1" bin: @@ -3877,13 +3864,13 @@ __metadata: linkType: soft "@noir-lang/noir_js@file:../noir/packages/noir_js::locator=%40aztec%2Faztec3-packages%40workspace%3A.": - version: 1.0.0-beta.0 - resolution: "@noir-lang/noir_js@file:../noir/packages/noir_js#../noir/packages/noir_js::hash=90b0a4&locator=%40aztec%2Faztec3-packages%40workspace%3A." + version: 1.0.0-beta.1 + resolution: "@noir-lang/noir_js@file:../noir/packages/noir_js#../noir/packages/noir_js::hash=fd2109&locator=%40aztec%2Faztec3-packages%40workspace%3A." dependencies: - "@noir-lang/acvm_js": "npm:1.0.0-beta.0" - "@noir-lang/noirc_abi": "npm:1.0.0-beta.0" - "@noir-lang/types": "npm:1.0.0-beta.0" - checksum: 10/938fa6d909859abbc62eb45508b4a1729c3b3b0ced99dba2de37571697b9fa9f1c90c932e3768c01ceb50315e69d5c249e8a717e470f6fec33cf105a39b73cd4 + "@noir-lang/acvm_js": "npm:1.0.0-beta.1" + "@noir-lang/noirc_abi": "npm:1.0.0-beta.1" + "@noir-lang/types": "npm:1.0.0-beta.1" + checksum: 10/90680504cc73c9ce1587bfafac654dc6bae5347d1ba858c0698f70731254e45b877884cbbe2fd2a6cc50a2f41ecba340375576f4d94b3657768f65fd17c227a9 languageName: node linkType: hard @@ -3891,7 +3878,7 @@ __metadata: version: 0.0.0-use.local resolution: "@noir-lang/noirc_abi@portal:../noir/packages/noirc_abi::locator=%40aztec%2Faztec3-packages%40workspace%3A." dependencies: - "@noir-lang/types": "npm:1.0.0-beta.0" + "@noir-lang/types": "npm:1.0.0-beta.1" languageName: node linkType: soft @@ -5776,15 +5763,6 @@ __metadata: languageName: node linkType: hard -"@types/yargs@npm:^15.0.0": - version: 15.0.19 - resolution: "@types/yargs@npm:15.0.19" - dependencies: - "@types/yargs-parser": "npm:*" - checksum: 10/c3abcd3472c32c02702f365dc1702a0728562deb8a8c61f3ce2161958d756cc033f7d78567565b4eba62f5869e9b5eac93d4c1dcb2c97af17aafda8f9f892b4b - languageName: node - linkType: hard - "@types/yargs@npm:^17.0.8": version: 17.0.32 resolution: "@types/yargs@npm:17.0.32" @@ -8074,13 +8052,6 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^2.0.0": - version: 2.0.0 - resolution: "ci-info@npm:2.0.0" - checksum: 10/3b374666a85ea3ca43fa49aa3a048d21c9b475c96eb13c133505d2324e7ae5efd6a454f41efe46a152269e9b6a00c9edbe63ec7fa1921957165aae16625acd67 - languageName: node - linkType: hard - "ci-info@npm:^3.2.0": version: 3.9.0 resolution: "ci-info@npm:3.9.0" @@ -12308,17 +12279,6 @@ __metadata: languageName: node linkType: hard -"is-ci@npm:^2.0.0": - version: 2.0.0 - resolution: "is-ci@npm:2.0.0" - dependencies: - ci-info: "npm:^2.0.0" - bin: - is-ci: bin.js - checksum: 10/77b869057510f3efa439bbb36e9be429d53b3f51abd4776eeea79ab3b221337fe1753d1e50058a9e2c650d38246108beffb15ccfd443929d77748d8c0cc90144 - languageName: node - linkType: hard - "is-core-module@npm:^2.1.0, is-core-module@npm:^2.11.0, is-core-module@npm:^2.13.0, is-core-module@npm:^2.13.1": version: 2.13.1 resolution: "is-core-module@npm:2.13.1" @@ -13331,7 +13291,7 @@ __metadata: languageName: node linkType: hard -"jest-runner@npm:^29.7.0": +"jest-runner@npm:29.7.0": version: 29.7.0 resolution: "jest-runner@npm:29.7.0" dependencies: @@ -13360,6 +13320,35 @@ __metadata: languageName: node linkType: hard +"jest-runner@patch:jest-runner@npm%3A29.7.0#~/.yarn/patches/jest-runner-npm-29.7.0-3bc9f82b58.patch": + version: 29.7.0 + resolution: "jest-runner@patch:jest-runner@npm%3A29.7.0#~/.yarn/patches/jest-runner-npm-29.7.0-3bc9f82b58.patch::version=29.7.0&hash=a79dea" + dependencies: + "@jest/console": "npm:^29.7.0" + "@jest/environment": "npm:^29.7.0" + "@jest/test-result": "npm:^29.7.0" + "@jest/transform": "npm:^29.7.0" + "@jest/types": "npm:^29.6.3" + "@types/node": "npm:*" + chalk: "npm:^4.0.0" + emittery: "npm:^0.13.1" + graceful-fs: "npm:^4.2.9" + jest-docblock: "npm:^29.7.0" + jest-environment-node: "npm:^29.7.0" + jest-haste-map: "npm:^29.7.0" + jest-leak-detector: "npm:^29.7.0" + jest-message-util: "npm:^29.7.0" + jest-resolve: "npm:^29.7.0" + jest-runtime: "npm:^29.7.0" + jest-util: "npm:^29.7.0" + jest-watcher: "npm:^29.7.0" + jest-worker: "npm:^29.7.0" + p-limit: "npm:^3.1.0" + source-map-support: "npm:0.5.13" + checksum: 10/d520c4f40179a22626d547b9fdf5f802a7e40d27e50f13a3ecca327581e78164dcdc8c650ed2974ef8f82caef935f7e356f7ce2d1f8dac65a9556101da79a27c + languageName: node + linkType: hard + "jest-runtime@npm:^29.7.0": version: 29.7.0 resolution: "jest-runtime@npm:29.7.0" @@ -13390,16 +13379,6 @@ __metadata: languageName: node linkType: hard -"jest-silent-reporter@npm:^0.6.0": - version: 0.6.0 - resolution: "jest-silent-reporter@npm:0.6.0" - dependencies: - chalk: "npm:^4.0.0" - jest-util: "npm:^26.0.0" - checksum: 10/443e0abaf5a6dc8c17da1e8495b7a55f813224adc39b6d1954bf49ff7fe70533b1020571453180dbb8388ace87f8e1dfc79610a4554bb93334f6c4154231c292 - languageName: node - linkType: hard - "jest-snapshot@npm:^29.7.0": version: 29.7.0 resolution: "jest-snapshot@npm:29.7.0" @@ -13428,20 +13407,6 @@ __metadata: languageName: node linkType: hard -"jest-util@npm:^26.0.0": - version: 26.6.2 - resolution: "jest-util@npm:26.6.2" - dependencies: - "@jest/types": "npm:^26.6.2" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - graceful-fs: "npm:^4.2.4" - is-ci: "npm:^2.0.0" - micromatch: "npm:^4.0.2" - checksum: 10/4502bc699f147d2fa43274af18174b55fd5b956becd1347665217e35a5354e929206abaef580f967ed239587be926c835eb3ca9b5c361205df1988bc8d58a462 - languageName: node - linkType: hard - "jest-util@npm:^29.0.0, jest-util@npm:^29.7.0": version: 29.7.0 resolution: "jest-util@npm:29.7.0"