From 1d723d9292b9923010959a487e960533dd8245ab Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:45:31 +0000 Subject: [PATCH] feat(spartan): cl layer in spartan --- .github/ensure-builder/install | 2 +- .github/ensure-builder/run | 2 +- .github/ensure-tester/action.yml | 1 + .github/ensure-tester/run | 6 + .github/workflows/ci-arm.yml | 3 +- .github/workflows/ci-mac.yml | 19 +- .github/workflows/ci.yml | 96 +- .github/workflows/devnet-deploy.yml | 2 +- .noir-sync-commit | 2 +- .release-please-manifest.json | 8 +- .yarn/install-state.gz | Bin 0 -> 719 bytes CHANGELOG.md | 204 + Dockerfile.boxes | 4 +- Dockerfile.end-to-end | 2 +- Earthfile | 1 + avm-transpiler/Cargo.lock | 143 +- avm-transpiler/rust-toolchain.toml | 2 +- aztec-nargo/README.md | 12 + aztec-up/README.md | 2 +- aztec-up/bin/docker-compose.sandbox.yml | 4 +- barretenberg/.gitrepo | 4 +- barretenberg/CHANGELOG.md | 32 + barretenberg/acir_tests/bootstrap.sh | 7 +- barretenberg/acir_tests/sol-test/src/index.js | 22 +- barretenberg/cpp/CMakeLists.txt | 2 +- .../cpp/pil/avm/gadgets/mem_slice.pil | 6 +- barretenberg/cpp/pil/vm2/README.md | 7 + barretenberg/cpp/pil/vm2/addressing.pil | 21 + barretenberg/cpp/pil/vm2/alu.pil | 16 + barretenberg/cpp/pil/vm2/execution.pil | 55 + barretenberg/cpp/pil/vm2/precomputed.pil | 17 + barretenberg/cpp/src/CMakeLists.txt | 2 + barretenberg/cpp/src/barretenberg/bb/main.cpp | 125 +- .../mega_memory_bench/mega_memory.bench.cpp | 5 +- .../mega_memory_bench/memory_estimator.hpp | 77 + .../commitment_key.test.hpp | 32 +- .../commitment_schemes/gemini/gemini_impl.hpp | 9 + .../commitment_schemes/ipa/ipa.hpp | 2 +- .../shplonk/shplemini.test.cpp | 306 +- .../small_subgroup_ipa/small_subgroup_ipa.hpp | 40 +- .../small_subgroup_ipa.test.cpp | 248 + .../utils/instance_witness_generator.hpp | 70 + .../utils/test_settings.hpp | 29 + .../cpp/src/barretenberg/common/thread.cpp | 16 + .../cpp/src/barretenberg/common/thread.hpp | 18 + .../content_addressed_append_only_tree.hpp | 8 +- .../content_addressed_indexed_tree.hpp | 4 +- .../merkle_tree/lmdb_store/lmdb_database.hpp | 1 + .../lmdb_store/lmdb_environment.test.cpp | 203 + .../lmdb_store/lmdb_tree_read_transaction.hpp | 2 + .../lmdb_store/lmdb_tree_store.test.cpp | 42 + .../lmdb_tree_write_transaction.hpp | 1 + .../cached_content_addressed_tree_store.hpp | 186 +- .../dsl/acir_proofs/honk_contract.hpp | 277 +- .../ecc/groups/affine_element.hpp | 3 + .../src/barretenberg/eccvm/eccvm_flavor.hpp | 7 - .../cpp/src/barretenberg/flavor/flavor.hpp | 26 +- .../src/barretenberg/goblin/mock_circuits.hpp | 1 - .../composer/permutation_lib.hpp | 60 +- .../library/grand_product_library.hpp | 124 +- .../barretenberg/polynomials/polynomial.hpp | 4 - .../protogalaxy/protogalaxy.test.cpp | 22 +- .../protogalaxy_prover_internal.hpp | 14 +- .../protogalaxy_recursive_verifier.test.cpp | 1 + .../mega_circuit_builder.hpp | 38 - .../stdlib_circuit_builders/mega_flavor.hpp | 135 +- .../stdlib_circuit_builders/ultra_flavor.hpp | 88 +- .../trace_to_polynomials.cpp | 3 +- .../translator_vm/translator_flavor.hpp | 8 - .../ultra_honk/mega_honk.test.cpp | 13 +- .../barretenberg/ultra_honk/oink_prover.cpp | 20 +- .../ultra_honk/relation_correctness.test.cpp | 29 +- .../barretenberg/ultra_honk/sumcheck.test.cpp | 16 +- .../ultra_honk/witness_computation.cpp | 144 + .../ultra_honk/witness_computation.hpp | 32 + .../barretenberg/vm/avm/generated/columns.hpp | 8 +- .../barretenberg/vm/avm/generated/flavor.cpp | 12 +- .../barretenberg/vm/avm/generated/flavor.hpp | 7 +- .../vm/avm/generated/full_row.hpp | 2 +- .../barretenberg/vm/avm/generated/prover.hpp | 3 +- .../vm/avm/generated/relations/mem_slice.hpp | 42 +- .../vm/avm/generated/verifier.hpp | 2 +- .../barretenberg/vm/avm/trace/execution.cpp | 147 +- .../barretenberg/vm/avm/trace/execution.hpp | 2 + .../vm/avm/trace/execution_hints.hpp | 18 + .../vm/avm/trace/gadgets/slice_trace.cpp | 21 +- .../vm/avm/trace/gadgets/slice_trace.hpp | 7 +- .../src/barretenberg/vm/avm/trace/trace.cpp | 40 +- .../src/barretenberg/vm/avm/trace/trace.hpp | 16 +- .../src/barretenberg/vm/aztec_constants.hpp | 2 +- .../cpp/src/barretenberg/vm2/CMakeLists.txt | 3 + .../cpp/src/barretenberg/vm2/avm_api.cpp | 58 + .../cpp/src/barretenberg/vm2/avm_api.hpp | 24 + .../barretenberg/vm2/common/ankerl_map.hpp | 2126 ++ .../barretenberg/vm2/common/avm_inputs.cpp | 23 + .../barretenberg/vm2/common/avm_inputs.hpp | 95 + .../vm2/common/avm_inputs.test.cpp | 122 + .../vm2/common/avm_inputs.testdata.bin | Bin 0 -> 2219 bytes .../barretenberg/vm2/common/aztec_types.hpp | 37 + .../src/barretenberg/vm2/common/constants.hpp | 9 + .../cpp/src/barretenberg/vm2/common/field.hpp | 11 + .../vm2/common/instruction_spec.cpp | 41 + .../vm2/common/instruction_spec.hpp | 31 + .../cpp/src/barretenberg/vm2/common/map.hpp | 19 + .../barretenberg/vm2/common/memory_types.hpp | 23 + .../src/barretenberg/vm2/common/opcodes.cpp | 250 + .../src/barretenberg/vm2/common/opcodes.hpp | 118 + .../barretenberg/vm2/constraining/README.md | 8 + .../vm2/constraining/check_circuit.cpp | 78 + .../vm2/constraining/check_circuit.hpp | 13 + .../vm2/constraining/relations/alu.test.cpp | 56 + .../constraining/relations/execution.test.cpp | 108 + .../constraining/testing/check_relation.hpp | 43 + .../barretenberg/vm2/generated/columns.hpp | 36 + .../src/barretenberg/vm2/generated/flavor.cpp | 275 + .../src/barretenberg/vm2/generated/flavor.hpp | 362 + .../vm2/generated/flavor_settings.hpp | 29 + .../barretenberg/vm2/generated/full_row.cpp | 139 + .../barretenberg/vm2/generated/full_row.hpp | 45 + .../src/barretenberg/vm2/generated/prover.cpp | 156 + .../src/barretenberg/vm2/generated/prover.hpp | 66 + .../vm2/generated/relations/alu.hpp | 57 + .../vm2/generated/relations/execution.hpp | 80 + .../relations/lookup_dummy_dynamic.hpp | 83 + .../relations/lookup_dummy_precomputed.hpp | 84 + .../relations/perm_dummy_dynamic.hpp | 67 + .../barretenberg/vm2/generated/verifier.cpp | 128 + .../barretenberg/vm2/generated/verifier.hpp | 39 + .../src/barretenberg/vm2/proving_helper.cpp | 184 + .../src/barretenberg/vm2/proving_helper.hpp | 22 + .../vm2/simulation/addressing.cpp | 90 + .../vm2/simulation/addressing.hpp | 39 + .../src/barretenberg/vm2/simulation/alu.cpp | 29 + .../src/barretenberg/vm2/simulation/alu.hpp | 33 + .../barretenberg/vm2/simulation/alu.test.cpp | 44 + .../vm2/simulation/bytecode_manager.cpp | 63 + .../vm2/simulation/bytecode_manager.hpp | 93 + .../barretenberg/vm2/simulation/context.hpp | 124 + .../vm2/simulation/context_stack.hpp | 37 + .../simulation/events/addressing_event.hpp | 44 + .../vm2/simulation/events/alu_event.hpp | 25 + .../vm2/simulation/events/bytecode_events.hpp | 36 + .../vm2/simulation/events/event_emitter.hpp | 67 + .../simulation/events/events_container.hpp | 23 + .../vm2/simulation/events/execution_event.hpp | 23 + .../vm2/simulation/events/memory_event.hpp | 23 + .../barretenberg/vm2/simulation/execution.cpp | 180 + .../barretenberg/vm2/simulation/execution.hpp | 89 + .../vm2/simulation/execution.test.cpp | 114 + .../barretenberg/vm2/simulation/lib/README.md | 1 + .../vm2/simulation/lib/contract_crypto.cpp | 44 + .../vm2/simulation/lib/contract_crypto.hpp | 13 + .../vm2/simulation/lib/instruction_info.hpp | 41 + .../vm2/simulation/lib/raw_data_db.cpp | 53 + .../vm2/simulation/lib/raw_data_db.hpp | 31 + .../vm2/simulation/lib/serialization.cpp | 466 + .../vm2/simulation/lib/serialization.hpp | 76 + .../barretenberg/vm2/simulation/memory.cpp | 56 + .../barretenberg/vm2/simulation/memory.hpp | 57 + .../simulation/testing/mock_addressing.hpp | 26 + .../testing/mock_addressing.test.cpp | 9 + .../vm2/simulation/testing/mock_alu.hpp | 23 + .../vm2/simulation/testing/mock_alu.test.cpp | 9 + .../testing/mock_bytecode_manager.hpp | 23 + .../testing/mock_bytecode_manager.test.cpp | 9 + .../vm2/simulation/testing/mock_context.hpp | 43 + .../simulation/testing/mock_context.test.cpp | 8 + .../simulation/testing/mock_context_stack.hpp | 25 + .../vm2/simulation/testing/mock_memory.hpp | 23 + .../simulation/testing/mock_memory.test.cpp | 9 + .../simulation/testing/mock_raw_data_db.hpp | 17 + .../testing/mock_raw_data_db.test.cpp | 9 + .../vm2/simulation/tx_execution.cpp | 21 + .../vm2/simulation/tx_execution.hpp | 25 + .../barretenberg/vm2/simulation_helper.cpp | 86 + .../barretenberg/vm2/simulation_helper.hpp | 28 + .../src/barretenberg/vm2/testing/macros.hpp | 11 + .../barretenberg/vm2/tracegen/alu_trace.cpp | 53 + .../barretenberg/vm2/tracegen/alu_trace.hpp | 18 + .../vm2/tracegen/alu_trace.test.cpp | 46 + .../vm2/tracegen/execution_trace.cpp | 92 + .../vm2/tracegen/execution_trace.hpp | 20 + .../barretenberg/vm2/tracegen/lib/README.md | 19 + .../vm2/tracegen/lib/lookup_builder.hpp | 105 + .../vm2/tracegen/lib/lookup_into_bitwise.hpp | 20 + .../vm2/tracegen/lib/permutation_builder.hpp | 38 + .../vm2/tracegen/precomputed_trace.cpp | 67 + .../vm2/tracegen/precomputed_trace.hpp | 15 + .../vm2/tracegen/test_trace_container.cpp | 49 + .../vm2/tracegen/test_trace_container.hpp | 29 + .../vm2/tracegen/trace_container.cpp | 106 + .../vm2/tracegen/trace_container.hpp | 73 + .../src/barretenberg/vm2/tracegen_helper.cpp | 119 + .../src/barretenberg/vm2/tracegen_helper.hpp | 16 + .../barretenberg/world_state/world_state.cpp | 4 +- .../barretenberg/world_state/world_state.hpp | 2 + barretenberg/sol/README.md | 2 +- .../sol/src/honk/BaseHonkVerifier.sol | 9 +- barretenberg/sol/src/honk/HonkTypes.sol | 11 + barretenberg/sol/src/honk/Relations.sol | 66 +- barretenberg/sol/src/honk/Transcript.sol | 157 +- barretenberg/sol/src/honk/utils.sol | 17 + barretenberg/ts/CHANGELOG.md | 7 + barretenberg/ts/package.json | 2 +- .../bb-pil-backend/templates/flavor.hpp.hbs | 6 +- .../bb-pil-backend/templates/full_row.hpp.hbs | 2 +- .../bb-pil-backend/templates/prover.hpp.hbs | 3 +- .../bb-pil-backend/templates/verifier.hpp.hbs | 2 +- bootstrap.sh | 6 +- boxes/boxes/vite/package.json | 4 +- boxes/boxes/vite/src/App.tsx | 24 +- boxes/boxes/vite/src/config.ts | 44 +- boxes/boxes/vite/vite.config.ts | 22 +- boxes/yarn.lock | 82 +- build-images/Earthfile | 21 +- build-images/adhoc-installs.sh | 8 + ci3/aws/ami_update.sh | 6 +- ci3/bootstrap_ec2 | 2 +- ci3/bootstrap_local | 2 +- ci3/bootstrap_local_noninteractive | 2 +- ci3/cache_content_hash | 48 +- ci3/cache_download | 6 +- ci3/cache_download_flag | 4 + ci3/cache_upload | 6 +- ci3/cache_upload_flag | 6 +- ci3/source | 9 +- ci3/source_bootstrap | 2 +- cspell.json | 3 +- docs/.rebuild_patterns | 4 +- docs/bootstrap.sh | 4 +- .../public-vm/gen/_instruction-set.mdx | 1603 - docs/docs/aztec/concepts/transactions.md | 67 +- .../smart_contracts/functions/attributes.md | 4 +- .../running_nodes/running_provers.md | 6 +- .../running_nodes/running_validators.md | 7 + .../how_to_compile_contract.md | 2 +- .../smart_contracts/how_to_deploy_contract.md | 4 +- .../smart_contracts/index.mdx | 39 + .../smart_contracts/profiling_transactions.md | 4 +- .../{testing_contracts => }/testing.md | 13 +- .../testing_contracts/_category_.json | 6 - .../{call_functions.md => call_contracts.md} | 38 +- .../writing_contracts/how_to_emit_event.md | 2 +- .../writing_contracts/index.mdx | 40 + .../writing_contracts/initializers.md | 2 +- .../writing_contracts/notes/index.md | 4 +- .../writing_contracts/storage/index.md | 1 + docs/docs/guides/index.md | 21 - docs/docs/migration_notes.md | 5 + .../addresses-and-keys/address.md | 0 .../diversified-and-stealth.md | 0 .../diversified-and-stealth-keys.md | 0 .../example-usage/encrypt-and-tag.md | 0 .../example-usage/nullifier.md | 0 .../example-usage/tag-sequence-derivation.md | 0 .../addresses-and-keys/index.md | 0 .../addresses-and-keys/keys-requirements.md | 0 .../addresses-and-keys/keys.md | 0 .../addresses-and-keys/precompiles.md | 0 .../bytecode/index.md | 0 .../calls/batched-calls.md | 0 .../calls/enqueued-calls.md | 0 .../calls/index.md | 0 .../calls/public-private-messaging.md | 0 .../calls/static-calls.md | 0 .../calls/sync-calls.md | 0 .../calls/unconstrained-calls.md | 0 .../circuits/high-level-topology.md | 0 .../circuits/private-function.md | 0 .../circuits/private-kernel-initial.mdx | 0 .../circuits/private-kernel-inner.mdx | 0 .../circuits/private-kernel-reset.md | 0 .../circuits/private-kernel-tail.md | 0 .../circuits/public-kernel-initial.md | 0 .../circuits/public-kernel-inner.md | 0 .../circuits/public-kernel-tail.md | 0 .../constants.md | 0 .../contract-deployment/classes.md | 0 .../contract-deployment/index.md | 0 .../contract-deployment/instances.md | 0 .../cryptography/hashing/hashing.md | 0 .../cryptography/hashing/pedersen.md | 0 .../cryptography/hashing/poseidon2.md | 0 .../cryptography/index.md | 0 .../cryptography/merkle-trees.md | 0 .../cryptography/proving-system/data-bus.md | 0 .../cryptography/proving-system/overview.md | 0 .../proving-system/performance-targets.md | 0 .../index.md | 0 .../overview.md | 0 .../published-data.md | 0 .../decentralization/actors.md | 0 .../decentralization/block-production.md | 0 .../decentralization/governance.md | 0 .../decentralization/p2p-network.md | 0 .../gas-and-fees/fee-juice.md | 0 .../gas-and-fees/fee-schedule.md | 0 .../gas-and-fees/index.md | 0 .../gas-and-fees/kernel-tracking.md | 0 .../published-gas-and-fee-data.md | 0 .../gas-and-fees/specifying-gas-fee-info.md | 0 .../gas-and-fees/tx-setup-and-teardown.md | 0 .../intro.md | 0 .../l1-smart-contracts/frontier.md | 0 .../l1-smart-contracts/index.md | 0 .../logs/index.md | 0 .../pre-compiled-contracts/index.md | 0 .../pre-compiled-contracts/registry.md | 0 .../private-message-delivery/index.md | 0 .../private-msg-delivery.md | 0 .../send-note-guidelines.md | 0 .../public-vm/_nested-context.md | 0 .../public-vm/alu.md | 0 .../public-vm/avm-circuit.md | 0 .../public-vm/bytecode-validation-circuit.md | 0 .../public-vm/circuit-index.md | 0 .../public-vm/context.mdx | 0 .../public-vm/control-flow.md | 0 .../public-vm/execution.md | 0 .../public-vm/index.md | 0 .../public-vm/instruction-set.mdx | 0 .../public-vm/intro.md | 0 .../public-vm/memory-model.md | 0 .../public-vm/nested-calls.mdx | 0 .../public-vm/security.md | 0 .../public-vm/state.md | 0 .../public-vm/type-structs.md | 0 .../rollup-circuits/base-rollup.md | 0 .../rollup-circuits/index.md | 0 .../rollup-circuits/merge-rollup.md | 0 .../rollup-circuits/root-rollup.md | 0 .../rollup-circuits/tree-parity.md | 0 .../state/archive.md | 0 .../state/index.md | 0 .../state/note-hash-tree.md | 0 .../state/nullifier-tree.md | 0 .../state/public-data-tree.md | 0 .../state/tree-implementations.md | 0 .../state/wonky-tree.md | 0 .../todo.md | 0 .../transactions/index.md | 0 .../transactions/local-execution.md | 5 +- .../transactions/public-execution.md | 0 .../transactions/tx-object.md | 0 .../transactions/validity.md | 0 .../developer_references/debugging.md | 5 + docs/docusaurus.config.js | 12 +- docs/package.json | 4 +- docs/sidebars.js | 222 + l1-contracts/foundry.toml | 2 + .../src/core/libraries/ConstantsGen.sol | 31 +- l1-contracts/src/core/libraries/Errors.sol | 1 - .../src/core/libraries/crypto/MerkleLib.sol | 13 +- .../src/core/messagebridge/Outbox.sol | 1 - l1-contracts/test/Outbox.t.sol | 8 - l1-contracts/test/Rollup.t.sol | 31 +- l1-contracts/test/fixtures/empty_block_1.json | 47 +- l1-contracts/test/fixtures/empty_block_2.json | 53 +- l1-contracts/test/fixtures/mixed_block_1.json | 28 +- l1-contracts/test/fixtures/mixed_block_2.json | 30 +- .../test/fixtures/single_tx_block_1.json | 92 + .../test/fixtures/single_tx_block_2.json | 92 + .../test/merkle/UnbalancedMerkle.t.sol | 8 + noir-projects/Earthfile | 8 +- noir-projects/aztec-nr/.gitrepo | 4 +- noir-projects/aztec-nr/authwit/src/auth.nr | 2 +- .../aztec-nr/authwit/src/cheatcodes.nr | 4 +- .../aztec-nr/authwit/src/entrypoint/app.nr | 4 +- .../aztec-nr/authwit/src/entrypoint/fee.nr | 4 +- .../aztec/src/context/call_interfaces.nr | 58 +- .../aztec-nr/aztec/src/context/mod.nr | 4 +- .../aztec/src/context/packed_returns.nr | 36 - .../aztec/src/context/private_context.nr | 128 +- .../aztec/src/context/public_context.nr | 44 +- .../aztec/src/context/returns_hash.nr | 33 + .../encrypted_event_emission.nr | 4 +- .../encrypted_logs/encrypted_note_emission.nr | 22 +- .../aztec/src/encrypted_logs/header.nr | 2 +- .../aztec/src/encrypted_logs/payload.nr | 28 +- .../aztec/src/history/note_inclusion.nr | 1 + .../aztec/src/history/nullifier_inclusion.nr | 1 + .../src/history/nullifier_non_inclusion.nr | 1 + .../aztec/src/history/public_storage.nr | 1 + .../aztec-nr/aztec/src/keys/getters/mod.nr | 2 +- .../aztec-nr/aztec/src/macros/dispatch/mod.nr | 3 +- .../aztec-nr/aztec/src/macros/events/mod.nr | 2 +- .../aztec-nr/aztec/src/macros/mod.nr | 6 +- .../aztec-nr/aztec/src/macros/notes/mod.nr | 10 +- .../aztec-nr/aztec/src/macros/storage/mod.nr | 3 +- .../aztec-nr/aztec/src/macros/utils.nr | 14 +- noir-projects/aztec-nr/aztec/src/messaging.nr | 1 + .../aztec-nr/aztec/src/note/lifecycle.nr | 5 +- .../aztec/src/note/note_getter/mod.nr | 6 +- .../aztec-nr/aztec/src/oracle/arguments.nr | 30 - .../aztec-nr/aztec/src/oracle/block_header.nr | 2 + .../oracle/enqueue_public_function_call.nr | 2 + .../aztec/src/oracle/execution_cache.nr | 34 + .../aztec/src/oracle/get_contract_instance.nr | 14 +- .../aztec/src/oracle/get_sibling_path.nr | 15 - .../aztec-nr/aztec/src/oracle/mod.nr | 4 +- .../aztec-nr/aztec/src/oracle/notes.nr | 25 +- .../aztec-nr/aztec/src/oracle/returns.nr | 23 - noir-projects/aztec-nr/aztec/src/prelude.nr | 2 +- .../aztec/src/state_vars/private_mutable.nr | 21 +- .../aztec/src/state_vars/shared_mutable.nr | 1 + .../aztec-nr/aztec/src/test/helpers/utils.nr | 6 +- .../aztec/src/test/mocks/mock_note.nr | 4 +- .../aztec/src/utils/array/collapse.nr | 4 +- .../aztec-nr/uint-note/src/uint_note.nr | 8 +- .../aztec-nr/value-note/src/value_note.nr | 9 +- .../src/dapp_payload.nr | 4 +- .../src/subscription_note.nr | 8 +- .../contracts/avm_test_contract/src/main.nr | 5 + .../src/main.nr | 14 +- .../Nargo.toml | 1 + .../src/main.nr | 14 +- .../easy_private_voting_contract/src/main.nr | 2 + .../src/test/utils.nr | 15 +- .../ecdsa_public_key_note/src/lib.nr | 9 +- .../contracts/nft_contract/src/main.nr | 5 + .../nft_contract/src/types/nft_note.nr | 8 +- .../contracts/parent_contract/src/main.nr | 8 +- .../schnorr_account_contract/src/main.nr | 3 + .../src/main.nr | 3 + .../src/main.nr | 2 + .../spam_contract/src/types/token_note.nr | 8 +- .../static_parent_contract/src/main.nr | 8 +- .../token_blacklist_contract/src/main.nr | 34 +- .../src/types/token_note.nr | 8 +- .../contracts/token_contract/src/main.nr | 29 +- .../noir-protocol-circuits/.gitignore | 2 +- .../Nargo.template.toml | 6 +- .../crates/blob/src/blob.nr | 24 +- .../crates/blob/src/mock_blob_oracle.nr | 2 + .../crates/blob/src/unconstrained_config.nr | 2 +- .../crates/empty-nested-simulated/Nargo.toml | 9 - .../crates/empty-nested-simulated/src/main.nr | 6 - .../crates/empty-nested/src/main.nr | 6 - .../private-kernel-empty-simulated/Nargo.toml | 9 - .../src/main.nr | 8 - .../crates/private-kernel-empty/src/main.nr | 6 - .../private-kernel-init-simulated/src/main.nr | 2 + .../crates/private-kernel-init/Prover.toml | 225 +- .../crates/private-kernel-init/src/main.nr | 2 + .../crates/private-kernel-inner/Prover.toml | 539 +- .../components/previous_kernel_validator.nr | 18 + ...private_kernel_circuit_output_validator.nr | 31 +- ...e_kernel_circuit_public_inputs_composer.nr | 16 +- .../src/components/reset_output_composer.nr | 8 +- .../src/components/reset_output_validator.nr | 7 +- .../crates/private-kernel-lib/src/lib.nr | 2 - .../src/private_kernel_empty.nr | 88 - .../src/private_kernel_init.nr | 6 + .../src/private_kernel_inner.nr | 4 +- .../src/private_kernel_reset.nr | 114 +- .../src/private_kernel_tail.nr | 19 +- .../src/private_kernel_tail_to_public.nr | 29 +- .../previous_kernel_validator_builder/mod.nr | 2 +- .../mod.nr | 21 +- .../validate_initial_values.nr | 14 +- .../validate_propagated_from_private_call.nr | 12 +- .../mod.nr | 7 + .../new_from_tx_request.nr | 48 +- .../propagate_from_private_call.nr | 12 +- .../reset_output_validator_builder/mod.nr | 4 +- .../tests/tail_output_composer_builder/mod.nr | 2 +- .../tail_output_validator_builder/mod.nr | 4 +- .../mod.nr | 2 +- ...tail_to_public_output_validator_builder.nr | 4 +- .../crates/private-kernel-reset/Prover.toml | 227 +- .../private-kernel-tail-to-public/Prover.toml | 253 +- .../crates/private-kernel-tail/Prover.toml | 361 +- .../crates/rollup-base-private/Prover.toml | 1105 +- .../crates/rollup-base-public/Prover.toml | 709 +- .../crates/rollup-block-merge/Prover.toml | 560 +- .../rollup-block-root-empty/src/main.nr | 2 +- .../Nargo.toml | 4 +- .../src/main.nr | 7 + .../Nargo.toml | 4 +- .../rollup-block-root-single-tx/src/main.nr | 5 + .../crates/rollup-block-root/Prover.toml | 25740 ++++++++-------- .../base_or_merge_rollup_public_inputs.nr | 4 +- .../src/abis/block_root_rollup_data.nr | 34 + .../crates/rollup-lib/src/abis/mod.nr | 1 + .../crates/rollup-lib/src/abis/tx_effect.nr | 2 + .../src/base/private_base_rollup.nr | 66 +- .../rollup-lib/src/base/public_base_rollup.nr | 45 +- .../block_merge/block_merge_rollup_inputs.nr | 16 +- .../block_root/block_root_rollup_inputs.nr | 386 +- .../block_root_rollup_inputs_validator.nr | 79 + .../block_root_rollup_output_composer.nr | 202 + .../src/block_root/components/mod.nr | 2 + .../empty_block_root_rollup_inputs.nr | 242 +- .../crates/rollup-lib/src/block_root/mod.nr | 77 +- .../single_tx_block_root_rollup_inputs.nr | 60 + .../crates/rollup-lib/src/components.nr | 281 +- .../src/merge/merge_rollup_inputs.nr | 36 +- .../crates/rollup-lib/src/merge/mod.nr | 1 + .../src/merge/utils/merge_rollups.nr | 31 + .../crates/rollup-lib/src/merge/utils/mod.nr | 2 + .../utils/validate_consecutive_rollups.nr | 74 + .../rollup-lib/src/root/root_rollup_inputs.nr | 12 +- .../src/tests/block_root_rollup_inputs.nr | 65 - .../src/tests/merge_rollup_inputs.nr | 2 +- .../crates/rollup-lib/src/tests/mod.nr | 1 - .../src/tests/previous_rollup_data.nr | 11 +- .../crates/rollup-merge/Prover.toml | 530 +- .../crates/rollup-root/Prover.toml | 550 +- .../private_kernel_circuit_public_inputs.nr | 7 + ...te_kernel_circuit_public_inputs_builder.nr | 3 + ..._to_public_kernel_circuit_public_inputs.nr | 13 +- ..._to_rollup_kernel_circuit_public_inputs.nr | 13 +- .../types/src/abis/private_kernel_data.nr | 2 + .../crates/types/src/constants.nr | 59 +- .../crates/types/src/debug_log.nr | 3 +- .../crates/types/src/hash.nr | 4 +- .../src/merkle_tree/variable_merkle_tree.nr | 119 +- .../crates/types/src/meta/mod.nr | 6 +- .../crates/types/src/proof/vk_data.nr | 2 + .../crates/types/src/tests/fixture_builder.nr | 14 +- .../types/src/tests/fixtures/vk_tree.nr | 18 +- .../crates/types/src/utils/arrays.nr | 22 +- .../src/utils/arrays/assert_combined_array.nr | 9 +- .../assert_combined_transformed_array.nr | 24 +- .../get_order_hints.nr | 16 +- .../get_split_order_hints.nr | 32 +- .../assert_split_transformed_value_arrays.nr | 1 + .../src/utils/arrays/get_sorted_result.nr | 18 +- .../src/utils/arrays/get_sorted_tuple.nr | 4 +- .../crates/types/src/utils/arrays/sort_by.nr | 4 +- .../types/src/utils/arrays/sort_by_counter.nr | 32 +- .../scripts/flamegraph.sh | 2 +- noir/bootstrap.sh | 3 +- .../critical_libraries_status/.gitignore | 3 + .../aztec-nr.failures.jsonl.does_not_compile | 0 ...-contracts.failures.jsonl.does_not_compile | 0 .../.failures.jsonl.does_not_compile | 0 .../.failures.jsonl.does_not_compile | 0 .../noir_check_shuffle/.failures.jsonl | 0 .../.failures.jsonl.does_not_compile | 0 .../.failures.jsonl.does_not_compile | 0 .../.failures.jsonl.does_not_compile | 0 .../.github/scripts/check_test_results.sh | 3 +- noir/noir-repo/.github/workflows/docs-pr.yml | 2 +- .../.github/workflows/formatting.yml | 32 +- .../.github/workflows/publish-acvm.yml | 4 +- .../.github/workflows/publish-es-packages.yml | 6 +- .../.github/workflows/publish-nargo.yml | 4 +- noir/noir-repo/.github/workflows/reports.yml | 219 +- .../.github/workflows/test-js-packages.yml | 25 +- .../workflows/test-rust-workspace-msrv.yml | 4 +- .../.github/workflows/test-rust-workspace.yml | 4 +- noir/noir-repo/CRITICAL_NOIR_LIBRARIES | 1 + noir/noir-repo/Cargo.lock | 441 +- noir/noir-repo/Cargo.toml | 26 +- noir/noir-repo/README.md | 4 +- noir/noir-repo/acvm-repo/acvm/Cargo.toml | 10 +- .../acvm-repo/acvm/src/compiler/mod.rs | 41 +- .../acvm/src/compiler/transformers/mod.rs | 23 +- .../acvm-repo/acvm/src/pwg/blackbox/bigint.rs | 9 +- .../acvm-repo/acvm/src/pwg/blackbox/logic.rs | 12 +- .../acvm-repo/acvm/src/pwg/blackbox/mod.rs | 12 +- .../acvm-repo/acvm/src/pwg/blackbox/range.rs | 5 +- .../acvm-repo/acvm/src/pwg/memory_op.rs | 53 +- noir/noir-repo/acvm-repo/acvm/src/pwg/mod.rs | 70 +- noir/noir-repo/acvm-repo/acvm/tests/solver.rs | 424 +- .../acvm-repo/acvm_js/src/execute.rs | 73 +- .../acvm-repo/blackbox_solver/Cargo.toml | 1 + .../acvm-repo/blackbox_solver/src/bigint.rs | 100 +- .../src/curve_specific_solver.rs | 15 +- .../bn254_blackbox_solver/Cargo.toml | 2 +- .../src/embedded_curve_ops.rs | 143 +- .../src/generator/generators.rs | 15 +- .../src/generator/hash_to_curve.rs | 12 +- .../bn254_blackbox_solver/src/lib.rs | 10 +- .../noir-repo/acvm-repo/brillig_vm/src/lib.rs | 70 +- .../compiler/noirc_driver/src/lib.rs | 53 +- .../compiler/noirc_evaluator/Cargo.toml | 1 + .../noirc_evaluator/src/acir/acir_variable.rs | 5 +- .../src/acir/generated_acir.rs | 34 +- .../compiler/noirc_evaluator/src/acir/mod.rs | 107 +- .../brillig/brillig_gen/brillig_black_box.rs | 10 +- .../src/brillig/brillig_gen/brillig_block.rs | 146 +- .../brillig/brillig_gen/variable_liveness.rs | 19 +- .../noirc_evaluator/src/brillig/brillig_ir.rs | 4 + .../compiler/noirc_evaluator/src/errors.rs | 6 +- .../compiler/noirc_evaluator/src/ssa.rs | 38 +- .../check_for_underconstrained_values.rs | 44 +- .../src/ssa/function_builder/mod.rs | 80 +- .../noirc_evaluator/src/ssa/ir/dfg.rs | 101 +- .../noirc_evaluator/src/ssa/ir/function.rs | 36 +- .../noirc_evaluator/src/ssa/ir/instruction.rs | 53 +- .../src/ssa/ir/instruction/binary.rs | 221 +- .../src/ssa/ir/instruction/call.rs | 146 +- .../src/ssa/ir/instruction/call/blackbox.rs | 6 +- .../src/ssa/ir/instruction/constrain.rs | 2 +- .../noirc_evaluator/src/ssa/ir/map.rs | 93 - .../noirc_evaluator/src/ssa/ir/printer.rs | 165 +- .../noirc_evaluator/src/ssa/ir/value.rs | 12 +- .../noirc_evaluator/src/ssa/opt/array_set.rs | 2 - .../src/ssa/opt/assert_constant.rs | 6 +- .../src/ssa/opt/constant_folding.rs | 48 +- .../noirc_evaluator/src/ssa/opt/die.rs | 23 +- .../src/ssa/opt/flatten_cfg.rs | 94 +- .../ssa/opt/flatten_cfg/branch_analysis.rs | 8 +- .../ssa/opt/flatten_cfg/capacity_tracker.rs | 171 - .../src/ssa/opt/flatten_cfg/value_merger.rs | 11 +- .../noirc_evaluator/src/ssa/opt/hint.rs | 1 - .../noirc_evaluator/src/ssa/opt/inlining.rs | 49 +- .../src/ssa/opt/loop_invariant.rs | 28 +- .../noirc_evaluator/src/ssa/opt/mem2reg.rs | 12 +- .../src/ssa/opt/mem2reg/alias_set.rs | 32 +- .../src/ssa/opt/mem2reg/block.rs | 6 + .../noirc_evaluator/src/ssa/opt/mod.rs | 3 +- .../src/ssa/opt/normalize_value_ids.rs | 31 +- .../noirc_evaluator/src/ssa/opt/rc.rs | 2 + .../src/ssa/opt/remove_bit_shifts.rs | 56 +- .../src/ssa/opt/remove_enable_side_effects.rs | 15 +- .../src/ssa/opt/remove_if_else.rs | 4 - .../src/ssa/opt/remove_unreachable.rs | 80 + .../src/ssa/opt/resolve_is_unconstrained.rs | 55 - .../src/ssa/opt/runtime_separation.rs | 351 - .../noirc_evaluator/src/ssa/opt/unrolling.rs | 14 +- .../src/ssa/parser/into_ssa.rs | 11 +- .../noirc_evaluator/src/ssa/parser/lexer.rs | 4 - .../noirc_evaluator/src/ssa/parser/mod.rs | 31 +- .../noirc_evaluator/src/ssa/parser/tests.rs | 36 +- .../noirc_evaluator/src/ssa/parser/token.rs | 9 + .../src/ssa/ssa_gen/context.rs | 132 +- .../noirc_evaluator/src/ssa/ssa_gen/mod.rs | 94 +- .../src/ssa/ssa_gen/program.rs | 47 +- .../noirc_evaluator/src/ssa/ssa_gen/value.rs | 12 - .../compiler/noirc_frontend/Cargo.toml | 1 + .../noirc_frontend/src/ast/expression.rs | 8 +- .../noirc_frontend/src/ast/function.rs | 9 +- .../compiler/noirc_frontend/src/ast/mod.rs | 3 +- .../compiler/noirc_frontend/src/debug/mod.rs | 11 +- .../noirc_frontend/src/elaborator/comptime.rs | 6 +- .../src/elaborator/expressions.rs | 11 +- .../noirc_frontend/src/elaborator/mod.rs | 252 +- .../src/elaborator/path_resolution.rs | 158 +- .../noirc_frontend/src/elaborator/patterns.rs | 14 +- .../noirc_frontend/src/elaborator/traits.rs | 58 +- .../noirc_frontend/src/elaborator/types.rs | 312 +- .../compiler/noirc_frontend/src/graph/mod.rs | 35 + .../src/hir/comptime/interpreter.rs | 26 +- .../src/hir/comptime/interpreter/builtin.rs | 150 +- .../interpreter/builtin/builtin_helpers.rs | 14 +- .../src/hir/comptime/interpreter/foreign.rs | 26 +- .../noirc_frontend/src/hir/comptime/tests.rs | 12 +- .../noirc_frontend/src/hir/comptime/value.rs | 55 +- .../src/hir/def_collector/dc_crate.rs | 18 +- .../src/hir/def_collector/dc_mod.rs | 17 +- .../src/hir/def_collector/errors.rs | 2 +- .../noirc_frontend/src/hir/def_map/mod.rs | 37 +- .../src/hir/def_map/namespace.rs | 2 +- .../compiler/noirc_frontend/src/hir/mod.rs | 59 +- .../src/hir/resolution/errors.rs | 2 +- .../src/hir/resolution/import.rs | 29 + .../src/hir/resolution/visibility.rs | 88 +- .../src/hir/type_check/errors.rs | 4 +- .../noirc_frontend/src/hir_def/expr.rs | 9 +- .../noirc_frontend/src/hir_def/function.rs | 5 +- .../noirc_frontend/src/hir_def/traits.rs | 7 +- .../noirc_frontend/src/hir_def/types.rs | 2 +- .../noirc_frontend/src/lexer/lexer.rs | 22 +- .../noirc_frontend/src/lexer/token.rs | 6 + .../src/monomorphization/ast.rs | 19 +- .../src/monomorphization/mod.rs | 206 +- .../src/monomorphization/printer.rs | 1 + .../noirc_frontend/src/node_interner.rs | 309 +- .../noirc_frontend/src/parser/errors.rs | 25 +- .../noirc_frontend/src/parser/parser.rs | 44 +- .../src/parser/parser/expression.rs | 91 +- .../src/parser/parser/function.rs | 31 +- .../src/parser/parser/module.rs | 2 - .../src/parser/parser/statement.rs | 65 +- .../compiler/noirc_frontend/src/tests.rs | 84 +- .../src/tests/metaprogramming.rs | 31 + .../noirc_frontend/src/tests/references.rs | 1 + .../noirc_frontend/src/tests/traits.rs | 662 +- .../noirc_frontend/src/tests/visibility.rs | 23 + .../docs/explainers/explainer-writing-noir.md | 45 +- .../docs/docs/getting_started/quick_start.md | 2 +- .../docs/docs/noir/concepts/traits.md | 31 +- .../docs/docs/noir/concepts/unconstrained.md | 8 +- .../noir/standard_library/meta/struct_def.md | 13 +- .../docs/docs/tutorials/noirjs_app.md | 6 +- .../explainers/explainer-oracle.md | 57 - .../explainers/explainer-recursion.md | 176 - .../getting_started/_category_.json | 5 - .../getting_started/backend/_category_.json | 6 - .../getting_started/backend/index.md | 31 - .../hello_noir/_category_.json | 5 - .../getting_started/hello_noir/index.md | 152 - .../hello_noir/project_breakdown.md | 159 - .../installation/_category_.json | 6 - .../getting_started/installation/index.md | 46 - .../installation/other_install_methods.md | 102 - .../getting_started/tooling/noir_codegen.md | 114 - .../version-v0.32.0/how_to/_category_.json | 5 - .../how_to/debugger/_category_.json | 6 - .../debugger/debugging_with_the_repl.md | 164 - .../how_to/debugger/debugging_with_vs_code.md | 68 - .../version-v0.32.0/how_to/how-to-oracles.md | 269 - .../how_to/how-to-recursion.md | 180 - .../how_to/how-to-solidity-verifier.md | 259 - .../version-v0.32.0/how_to/merkle-proof.mdx | 48 - .../how_to/using-devcontainers.mdx | 110 - .../versioned_docs/version-v0.32.0/index.mdx | 67 - .../version-v0.32.0/migration_notes.md | 105 - .../noir/concepts/_category_.json | 6 - .../version-v0.32.0/noir/concepts/assert.md | 78 - .../version-v0.32.0/noir/concepts/comments.md | 33 - .../noir/concepts/control_flow.md | 77 - .../noir/concepts/data_bus.mdx | 23 - .../noir/concepts/data_types/_category_.json | 5 - .../noir/concepts/data_types/arrays.md | 253 - .../noir/concepts/data_types/booleans.md | 28 - .../noir/concepts/data_types/fields.md | 192 - .../concepts/data_types/function_types.md | 26 - .../noir/concepts/data_types/index.md | 118 - .../noir/concepts/data_types/integers.md | 156 - .../noir/concepts/data_types/references.md | 23 - .../noir/concepts/data_types/slices.mdx | 358 - .../noir/concepts/data_types/strings.md | 79 - .../noir/concepts/data_types/structs.md | 70 - .../noir/concepts/data_types/tuples.md | 48 - .../noir/concepts/functions.md | 226 - .../version-v0.32.0/noir/concepts/generics.md | 106 - .../version-v0.32.0/noir/concepts/globals.md | 72 - .../version-v0.32.0/noir/concepts/lambdas.md | 81 - .../noir/concepts/mutability.md | 121 - .../version-v0.32.0/noir/concepts/ops.md | 98 - .../version-v0.32.0/noir/concepts/oracles.mdx | 29 - .../noir/concepts/shadowing.md | 44 - .../version-v0.32.0/noir/concepts/traits.md | 405 - .../noir/concepts/unconstrained.md | 99 - .../modules_packages_crates/_category_.json | 6 - .../crates_and_packages.md | 43 - .../modules_packages_crates/dependencies.md | 124 - .../noir/modules_packages_crates/modules.md | 185 - .../modules_packages_crates/workspaces.md | 42 - .../noir/standard_library/_category_.json | 6 - .../noir/standard_library/bigint.md | 122 - .../noir/standard_library/black_box_fns.md | 32 - .../noir/standard_library/bn254.md | 46 - .../standard_library/containers/boundedvec.md | 419 - .../standard_library/containers/hashmap.md | 570 - .../noir/standard_library/containers/index.md | 5 - .../noir/standard_library/containers/vec.mdx | 170 - .../cryptographic_primitives/_category_.json | 5 - .../cryptographic_primitives/ciphers.mdx | 32 - .../cryptographic_primitives/ec_primitives.md | 102 - .../ecdsa_sig_verification.mdx | 98 - .../cryptographic_primitives/eddsa.mdx | 37 - .../embedded_curve_ops.mdx | 98 - .../cryptographic_primitives/hashes.mdx | 253 - .../cryptographic_primitives/index.md | 14 - .../cryptographic_primitives/schnorr.mdx | 64 - .../noir/standard_library/is_unconstrained.md | 69 - .../noir/standard_library/logging.md | 78 - .../noir/standard_library/merkle_trees.md | 58 - .../noir/standard_library/options.md | 101 - .../noir/standard_library/recursion.mdx | 85 - .../noir/standard_library/traits.md | 501 - .../noir/standard_library/zeroed.md | 26 - .../NoirJS/backend_barretenberg/.nojekyll | 1 - .../classes/BarretenbergBackend.md | 141 - .../classes/BarretenbergVerifier.md | 58 - .../NoirJS/backend_barretenberg/index.md | 40 - .../type-aliases/BackendOptions.md | 21 - .../backend_barretenberg/typedoc-sidebar.cjs | 4 - .../reference/NoirJS/noir_js/.nojekyll | 1 - .../reference/NoirJS/noir_js/classes/Noir.md | 52 - .../reference/NoirJS/noir_js/functions/and.md | 22 - .../NoirJS/noir_js/functions/blake2s256.md | 21 - .../functions/ecdsa_secp256k1_verify.md | 28 - .../functions/ecdsa_secp256r1_verify.md | 28 - .../NoirJS/noir_js/functions/keccak256.md | 21 - .../NoirJS/noir_js/functions/sha256.md | 21 - .../reference/NoirJS/noir_js/functions/xor.md | 22 - .../reference/NoirJS/noir_js/index.md | 49 - .../noir_js/type-aliases/ErrorWithPayload.md | 15 - .../type-aliases/ForeignCallHandler.md | 24 - .../noir_js/type-aliases/ForeignCallInput.md | 9 - .../noir_js/type-aliases/ForeignCallOutput.md | 9 - .../NoirJS/noir_js/type-aliases/WitnessMap.md | 9 - .../NoirJS/noir_js/typedoc-sidebar.cjs | 4 - .../reference/NoirJS/noir_wasm/.nojekyll | 1 - .../NoirJS/noir_wasm/functions/compile.md | 51 - .../noir_wasm/functions/compile_contract.md | 51 - .../noir_wasm/functions/createFileManager.md | 21 - .../functions/inflateDebugSymbols.md | 21 - .../reference/NoirJS/noir_wasm/index.md | 49 - .../NoirJS/noir_wasm/typedoc-sidebar.cjs | 4 - .../version-v0.32.0/reference/_category_.json | 5 - .../reference/debugger/_category_.json | 6 - .../debugger/debugger_known_limitations.md | 59 - .../reference/debugger/debugger_repl.md | 360 - .../reference/debugger/debugger_vscode.md | 82 - .../reference/nargo_commands.md | 271 - .../version-v0.32.0/tooling/debugger.md | 26 - .../tooling/language_server.md | 43 - .../version-v0.32.0/tooling/testing.md | 79 - .../version-v0.32.0/tutorials/noirjs_app.md | 348 - .../version-v0.33.0/explainers/cspell.json | 5 - .../explainers/explainer-oracle.md | 57 - .../explainers/explainer-recursion.md | 176 - .../explainers/explainer-writing-noir.md | 173 - .../getting_started/_category_.json | 5 - .../getting_started/backend/_category_.json | 6 - .../getting_started/backend/index.md | 31 - .../hello_noir/_category_.json | 5 - .../getting_started/hello_noir/index.md | 152 - .../hello_noir/project_breakdown.md | 159 - .../installation/_category_.json | 6 - .../getting_started/installation/index.md | 46 - .../installation/other_install_methods.md | 102 - .../version-v0.33.0/how_to/_category_.json | 5 - .../how_to/debugger/_category_.json | 6 - .../debugger/debugging_with_the_repl.md | 164 - .../how_to/debugger/debugging_with_vs_code.md | 68 - .../version-v0.33.0/how_to/how-to-oracles.md | 275 - .../how_to/how-to-recursion.md | 180 - .../how_to/how-to-solidity-verifier.md | 253 - .../version-v0.33.0/how_to/merkle-proof.mdx | 48 - .../how_to/using-devcontainers.mdx | 110 - .../versioned_docs/version-v0.33.0/index.mdx | 67 - .../version-v0.33.0/migration_notes.md | 105 - .../noir/concepts/_category_.json | 6 - .../version-v0.33.0/noir/concepts/assert.md | 78 - .../version-v0.33.0/noir/concepts/comments.md | 33 - .../noir/concepts/control_flow.md | 77 - .../noir/concepts/data_bus.mdx | 23 - .../noir/concepts/data_types/_category_.json | 5 - .../noir/concepts/data_types/arrays.md | 253 - .../noir/concepts/data_types/booleans.md | 28 - .../noir/concepts/data_types/fields.md | 192 - .../concepts/data_types/function_types.md | 26 - .../noir/concepts/data_types/index.md | 118 - .../noir/concepts/data_types/integers.md | 156 - .../noir/concepts/data_types/references.md | 23 - .../noir/concepts/data_types/slices.mdx | 358 - .../noir/concepts/data_types/strings.md | 79 - .../noir/concepts/data_types/structs.md | 70 - .../noir/concepts/data_types/tuples.md | 48 - .../noir/concepts/functions.md | 226 - .../version-v0.33.0/noir/concepts/generics.md | 163 - .../version-v0.33.0/noir/concepts/globals.md | 72 - .../version-v0.33.0/noir/concepts/lambdas.md | 81 - .../noir/concepts/mutability.md | 121 - .../version-v0.33.0/noir/concepts/ops.md | 98 - .../version-v0.33.0/noir/concepts/oracles.mdx | 29 - .../noir/concepts/shadowing.md | 44 - .../version-v0.33.0/noir/concepts/traits.md | 405 - .../noir/concepts/unconstrained.md | 99 - .../modules_packages_crates/_category_.json | 6 - .../crates_and_packages.md | 43 - .../modules_packages_crates/dependencies.md | 124 - .../noir/modules_packages_crates/modules.md | 185 - .../modules_packages_crates/workspaces.md | 42 - .../noir/standard_library/_category_.json | 6 - .../noir/standard_library/bigint.md | 122 - .../noir/standard_library/black_box_fns.md | 32 - .../noir/standard_library/bn254.md | 46 - .../standard_library/containers/boundedvec.md | 419 - .../standard_library/containers/hashmap.md | 570 - .../noir/standard_library/containers/index.md | 5 - .../noir/standard_library/containers/vec.mdx | 170 - .../cryptographic_primitives/_category_.json | 5 - .../cryptographic_primitives/ciphers.mdx | 32 - .../cryptographic_primitives/ec_primitives.md | 102 - .../ecdsa_sig_verification.mdx | 98 - .../cryptographic_primitives/eddsa.mdx | 37 - .../embedded_curve_ops.mdx | 95 - .../cryptographic_primitives/hashes.mdx | 253 - .../cryptographic_primitives/index.md | 14 - .../cryptographic_primitives/schnorr.mdx | 64 - .../noir/standard_library/is_unconstrained.md | 69 - .../noir/standard_library/logging.md | 78 - .../noir/standard_library/merkle_trees.md | 58 - .../noir/standard_library/options.md | 101 - .../noir/standard_library/recursion.mdx | 85 - .../noir/standard_library/traits.md | 501 - .../noir/standard_library/zeroed.md | 26 - .../NoirJS/backend_barretenberg/.nojekyll | 1 - .../classes/BarretenbergBackend.md | 141 - .../classes/BarretenbergVerifier.md | 58 - .../classes/UltraHonkBackend.md | 116 - .../classes/UltraHonkVerifier.md | 58 - .../NoirJS/backend_barretenberg/index.md | 42 - .../type-aliases/BackendOptions.md | 21 - .../backend_barretenberg/typedoc-sidebar.cjs | 4 - .../reference/NoirJS/noir_js/.nojekyll | 1 - .../reference/NoirJS/noir_js/classes/Noir.md | 52 - .../reference/NoirJS/noir_js/functions/and.md | 22 - .../NoirJS/noir_js/functions/blake2s256.md | 21 - .../functions/ecdsa_secp256k1_verify.md | 28 - .../functions/ecdsa_secp256r1_verify.md | 28 - .../NoirJS/noir_js/functions/keccak256.md | 21 - .../NoirJS/noir_js/functions/sha256.md | 21 - .../reference/NoirJS/noir_js/functions/xor.md | 22 - .../reference/NoirJS/noir_js/index.md | 49 - .../noir_js/type-aliases/ErrorWithPayload.md | 15 - .../type-aliases/ForeignCallHandler.md | 24 - .../noir_js/type-aliases/ForeignCallInput.md | 9 - .../noir_js/type-aliases/ForeignCallOutput.md | 9 - .../NoirJS/noir_js/type-aliases/WitnessMap.md | 9 - .../NoirJS/noir_js/typedoc-sidebar.cjs | 4 - .../reference/NoirJS/noir_wasm/.nojekyll | 1 - .../NoirJS/noir_wasm/functions/compile.md | 51 - .../noir_wasm/functions/compile_contract.md | 51 - .../noir_wasm/functions/createFileManager.md | 21 - .../functions/inflateDebugSymbols.md | 21 - .../reference/NoirJS/noir_wasm/index.md | 49 - .../NoirJS/noir_wasm/typedoc-sidebar.cjs | 4 - .../version-v0.33.0/reference/_category_.json | 5 - .../reference/debugger/_category_.json | 6 - .../debugger/debugger_known_limitations.md | 59 - .../reference/debugger/debugger_repl.md | 360 - .../reference/debugger/debugger_vscode.md | 82 - .../reference/nargo_commands.md | 289 - .../version-v0.33.0/reference/noir_codegen.md | 114 - .../version-v0.33.0/tooling/debugger.md | 26 - .../tooling/language_server.md | 43 - .../version-v0.33.0/tooling/testing.md | 79 - .../version-v0.33.0/tutorials/noirjs_app.md | 362 - .../version-v0.34.0/explainers/cspell.json | 5 - .../explainers/explainer-oracle.md | 57 - .../explainers/explainer-recursion.md | 176 - .../explainers/explainer-writing-noir.md | 177 - .../getting_started/_category_.json | 5 - .../getting_started/backend/_category_.json | 6 - .../getting_started/backend/index.md | 31 - .../hello_noir/_category_.json | 5 - .../getting_started/hello_noir/index.md | 157 - .../hello_noir/project_breakdown.md | 159 - .../installation/_category_.json | 6 - .../getting_started/installation/index.md | 46 - .../installation/other_install_methods.md | 102 - .../version-v0.34.0/how_to/_category_.json | 5 - .../how_to/debugger/_category_.json | 6 - .../debugger/debugging_with_the_repl.md | 164 - .../how_to/debugger/debugging_with_vs_code.md | 68 - .../version-v0.34.0/how_to/how-to-oracles.md | 275 - .../how_to/how-to-recursion.md | 180 - .../how_to/how-to-solidity-verifier.md | 257 - .../version-v0.34.0/how_to/merkle-proof.mdx | 48 - .../how_to/using-devcontainers.mdx | 110 - .../versioned_docs/version-v0.34.0/index.mdx | 67 - .../version-v0.34.0/migration_notes.md | 105 - .../noir/concepts/_category_.json | 6 - .../version-v0.34.0/noir/concepts/assert.md | 78 - .../version-v0.34.0/noir/concepts/comments.md | 33 - .../version-v0.34.0/noir/concepts/comptime.md | 424 - .../noir/concepts/control_flow.md | 77 - .../noir/concepts/data_bus.mdx | 23 - .../noir/concepts/data_types/_category_.json | 5 - .../noir/concepts/data_types/arrays.md | 275 - .../noir/concepts/data_types/booleans.md | 28 - .../noir/concepts/data_types/fields.md | 240 - .../concepts/data_types/function_types.md | 26 - .../noir/concepts/data_types/index.md | 118 - .../noir/concepts/data_types/integers.md | 156 - .../noir/concepts/data_types/references.md | 23 - .../noir/concepts/data_types/slices.mdx | 358 - .../noir/concepts/data_types/strings.md | 79 - .../noir/concepts/data_types/structs.md | 70 - .../noir/concepts/data_types/tuples.md | 48 - .../noir/concepts/functions.md | 226 - .../version-v0.34.0/noir/concepts/generics.md | 258 - .../version-v0.34.0/noir/concepts/globals.md | 72 - .../version-v0.34.0/noir/concepts/lambdas.md | 81 - .../noir/concepts/mutability.md | 121 - .../version-v0.34.0/noir/concepts/ops.md | 98 - .../version-v0.34.0/noir/concepts/oracles.mdx | 29 - .../noir/concepts/shadowing.md | 44 - .../version-v0.34.0/noir/concepts/traits.md | 465 - .../noir/concepts/unconstrained.md | 104 - .../modules_packages_crates/_category_.json | 6 - .../crates_and_packages.md | 43 - .../modules_packages_crates/dependencies.md | 124 - .../noir/modules_packages_crates/modules.md | 211 - .../modules_packages_crates/workspaces.md | 42 - .../noir/standard_library/_category_.json | 6 - .../noir/standard_library/bigint.md | 127 - .../noir/standard_library/black_box_fns.md | 32 - .../noir/standard_library/bn254.md | 46 - .../standard_library/containers/boundedvec.md | 419 - .../standard_library/containers/hashmap.md | 594 - .../noir/standard_library/containers/index.md | 5 - .../noir/standard_library/containers/vec.mdx | 170 - .../cryptographic_primitives/_category_.json | 5 - .../cryptographic_primitives/ciphers.mdx | 32 - .../cryptographic_primitives/ec_primitives.md | 102 - .../ecdsa_sig_verification.mdx | 98 - .../cryptographic_primitives/eddsa.mdx | 37 - .../embedded_curve_ops.mdx | 95 - .../cryptographic_primitives/hashes.mdx | 253 - .../cryptographic_primitives/index.md | 14 - .../cryptographic_primitives/schnorr.mdx | 64 - .../noir/standard_library/fmtstr.md | 17 - .../noir/standard_library/is_unconstrained.md | 69 - .../noir/standard_library/logging.md | 78 - .../noir/standard_library/merkle_trees.md | 58 - .../noir/standard_library/meta/expr.md | 323 - .../standard_library/meta/function_def.md | 166 - .../noir/standard_library/meta/index.md | 210 - .../noir/standard_library/meta/module.md | 82 - .../noir/standard_library/meta/op.md | 244 - .../noir/standard_library/meta/quoted.md | 138 - .../noir/standard_library/meta/struct_def.md | 177 - .../standard_library/meta/trait_constraint.md | 17 - .../noir/standard_library/meta/trait_def.md | 26 - .../noir/standard_library/meta/trait_impl.md | 60 - .../noir/standard_library/meta/typ.md | 239 - .../noir/standard_library/meta/typed_expr.md | 27 - .../standard_library/meta/unresolved_type.md | 17 - .../noir/standard_library/options.md | 101 - .../noir/standard_library/recursion.mdx | 85 - .../noir/standard_library/traits.md | 625 - .../noir/standard_library/zeroed.md | 26 - .../NoirJS/backend_barretenberg/.nojekyll | 1 - .../classes/BarretenbergBackend.md | 141 - .../classes/BarretenbergVerifier.md | 58 - .../classes/UltraHonkBackend.md | 116 - .../classes/UltraHonkVerifier.md | 58 - .../NoirJS/backend_barretenberg/index.md | 42 - .../type-aliases/BackendOptions.md | 21 - .../backend_barretenberg/typedoc-sidebar.cjs | 4 - .../reference/NoirJS/noir_js/.nojekyll | 1 - .../reference/NoirJS/noir_js/classes/Noir.md | 52 - .../reference/NoirJS/noir_js/functions/and.md | 22 - .../NoirJS/noir_js/functions/blake2s256.md | 21 - .../functions/ecdsa_secp256k1_verify.md | 28 - .../functions/ecdsa_secp256r1_verify.md | 28 - .../NoirJS/noir_js/functions/keccak256.md | 21 - .../NoirJS/noir_js/functions/sha256.md | 21 - .../reference/NoirJS/noir_js/functions/xor.md | 22 - .../reference/NoirJS/noir_js/index.md | 49 - .../noir_js/type-aliases/ErrorWithPayload.md | 15 - .../type-aliases/ForeignCallHandler.md | 24 - .../noir_js/type-aliases/ForeignCallInput.md | 9 - .../noir_js/type-aliases/ForeignCallOutput.md | 9 - .../NoirJS/noir_js/type-aliases/WitnessMap.md | 9 - .../NoirJS/noir_js/typedoc-sidebar.cjs | 4 - .../reference/NoirJS/noir_wasm/.nojekyll | 1 - .../NoirJS/noir_wasm/functions/compile.md | 51 - .../noir_wasm/functions/compile_contract.md | 51 - .../noir_wasm/functions/createFileManager.md | 21 - .../functions/inflateDebugSymbols.md | 21 - .../reference/NoirJS/noir_wasm/index.md | 49 - .../NoirJS/noir_wasm/typedoc-sidebar.cjs | 4 - .../version-v0.34.0/reference/_category_.json | 5 - .../reference/debugger/_category_.json | 6 - .../debugger/debugger_known_limitations.md | 59 - .../reference/debugger/debugger_repl.md | 360 - .../reference/debugger/debugger_vscode.md | 82 - .../reference/nargo_commands.md | 295 - .../version-v0.34.0/reference/noir_codegen.md | 114 - .../version-v0.34.0/tooling/debugger.md | 26 - .../tooling/language_server.md | 43 - .../version-v0.34.0/tooling/testing.md | 79 - .../version-v0.34.0/tutorials/noirjs_app.md | 362 - .../version-v0.35.0/explainers/cspell.json | 5 - .../explainers/explainer-oracle.md | 57 - .../explainers/explainer-recursion.md | 176 - .../explainers/explainer-writing-noir.md | 177 - .../getting_started/_category_.json | 5 - .../getting_started/backend/_category_.json | 6 - .../getting_started/backend/index.md | 31 - .../hello_noir/_category_.json | 5 - .../getting_started/hello_noir/index.md | 157 - .../hello_noir/project_breakdown.md | 159 - .../installation/_category_.json | 6 - .../getting_started/installation/index.md | 46 - .../installation/other_install_methods.md | 102 - .../version-v0.35.0/how_to/_category_.json | 5 - .../how_to/debugger/_category_.json | 6 - .../debugger/debugging_with_the_repl.md | 164 - .../how_to/debugger/debugging_with_vs_code.md | 68 - .../version-v0.35.0/how_to/how-to-oracles.md | 275 - .../how_to/how-to-recursion.md | 180 - .../how_to/how-to-solidity-verifier.md | 259 - .../version-v0.35.0/how_to/merkle-proof.mdx | 48 - .../how_to/using-devcontainers.mdx | 110 - .../versioned_docs/version-v0.35.0/index.mdx | 67 - .../version-v0.35.0/migration_notes.md | 105 - .../noir/concepts/_category_.json | 6 - .../version-v0.35.0/noir/concepts/assert.md | 78 - .../version-v0.35.0/noir/concepts/comments.md | 33 - .../version-v0.35.0/noir/concepts/comptime.md | 440 - .../noir/concepts/control_flow.md | 77 - .../noir/concepts/data_bus.mdx | 23 - .../noir/concepts/data_types/_category_.json | 5 - .../noir/concepts/data_types/arrays.md | 274 - .../noir/concepts/data_types/booleans.md | 28 - .../noir/concepts/data_types/fields.md | 240 - .../concepts/data_types/function_types.md | 26 - .../noir/concepts/data_types/index.md | 126 - .../noir/concepts/data_types/integers.md | 156 - .../noir/concepts/data_types/references.md | 23 - .../noir/concepts/data_types/slices.mdx | 358 - .../noir/concepts/data_types/strings.md | 79 - .../noir/concepts/data_types/structs.md | 82 - .../noir/concepts/data_types/tuples.md | 48 - .../noir/concepts/functions.md | 226 - .../version-v0.35.0/noir/concepts/generics.md | 251 - .../version-v0.35.0/noir/concepts/globals.md | 82 - .../version-v0.35.0/noir/concepts/lambdas.md | 81 - .../noir/concepts/mutability.md | 121 - .../version-v0.35.0/noir/concepts/ops.md | 98 - .../version-v0.35.0/noir/concepts/oracles.mdx | 29 - .../noir/concepts/shadowing.md | 44 - .../version-v0.35.0/noir/concepts/traits.md | 475 - .../noir/concepts/unconstrained.md | 104 - .../modules_packages_crates/_category_.json | 6 - .../crates_and_packages.md | 43 - .../modules_packages_crates/dependencies.md | 124 - .../noir/modules_packages_crates/modules.md | 221 - .../modules_packages_crates/workspaces.md | 42 - .../noir/standard_library/_category_.json | 6 - .../noir/standard_library/bigint.md | 127 - .../noir/standard_library/black_box_fns.md | 32 - .../noir/standard_library/bn254.md | 46 - .../standard_library/containers/boundedvec.md | 419 - .../standard_library/containers/hashmap.md | 594 - .../noir/standard_library/containers/index.md | 5 - .../noir/standard_library/containers/vec.mdx | 170 - .../cryptographic_primitives/_category_.json | 5 - .../cryptographic_primitives/ciphers.mdx | 32 - .../cryptographic_primitives/ec_primitives.md | 102 - .../ecdsa_sig_verification.mdx | 98 - .../cryptographic_primitives/eddsa.mdx | 37 - .../embedded_curve_ops.mdx | 92 - .../cryptographic_primitives/hashes.mdx | 253 - .../cryptographic_primitives/index.md | 14 - .../cryptographic_primitives/schnorr.mdx | 64 - .../noir/standard_library/fmtstr.md | 17 - .../noir/standard_library/is_unconstrained.md | 69 - .../noir/standard_library/logging.md | 78 - .../noir/standard_library/merkle_trees.md | 58 - .../noir/standard_library/meta/ctstring.md | 100 - .../noir/standard_library/meta/expr.md | 378 - .../standard_library/meta/function_def.md | 166 - .../noir/standard_library/meta/index.md | 210 - .../noir/standard_library/meta/module.md | 82 - .../noir/standard_library/meta/op.md | 244 - .../noir/standard_library/meta/quoted.md | 138 - .../noir/standard_library/meta/struct_def.md | 177 - .../standard_library/meta/trait_constraint.md | 17 - .../noir/standard_library/meta/trait_def.md | 26 - .../noir/standard_library/meta/trait_impl.md | 60 - .../noir/standard_library/meta/typ.md | 239 - .../noir/standard_library/meta/typed_expr.md | 27 - .../standard_library/meta/unresolved_type.md | 17 - .../noir/standard_library/options.md | 101 - .../noir/standard_library/recursion.mdx | 85 - .../noir/standard_library/traits.md | 625 - .../noir/standard_library/zeroed.md | 26 - .../NoirJS/backend_barretenberg/.nojekyll | 1 - .../classes/BarretenbergBackend.md | 138 - .../classes/BarretenbergVerifier.md | 58 - .../classes/UltraHonkBackend.md | 114 - .../classes/UltraHonkVerifier.md | 58 - .../NoirJS/backend_barretenberg/index.md | 42 - .../type-aliases/BackendOptions.md | 18 - .../backend_barretenberg/typedoc-sidebar.cjs | 4 - .../reference/NoirJS/noir_js/.nojekyll | 1 - .../reference/NoirJS/noir_js/classes/Noir.md | 52 - .../reference/NoirJS/noir_js/functions/and.md | 22 - .../NoirJS/noir_js/functions/blake2s256.md | 21 - .../functions/ecdsa_secp256k1_verify.md | 28 - .../functions/ecdsa_secp256r1_verify.md | 28 - .../NoirJS/noir_js/functions/keccak256.md | 21 - .../reference/NoirJS/noir_js/functions/xor.md | 22 - .../reference/NoirJS/noir_js/index.md | 48 - .../noir_js/type-aliases/ErrorWithPayload.md | 15 - .../type-aliases/ForeignCallHandler.md | 24 - .../noir_js/type-aliases/ForeignCallInput.md | 9 - .../noir_js/type-aliases/ForeignCallOutput.md | 9 - .../NoirJS/noir_js/type-aliases/WitnessMap.md | 9 - .../NoirJS/noir_js/typedoc-sidebar.cjs | 4 - .../reference/NoirJS/noir_wasm/.nojekyll | 1 - .../NoirJS/noir_wasm/functions/compile.md | 51 - .../noir_wasm/functions/compile_contract.md | 51 - .../noir_wasm/functions/createFileManager.md | 21 - .../functions/inflateDebugSymbols.md | 21 - .../reference/NoirJS/noir_wasm/index.md | 49 - .../NoirJS/noir_wasm/typedoc-sidebar.cjs | 4 - .../version-v0.35.0/reference/_category_.json | 5 - .../reference/debugger/_category_.json | 6 - .../debugger/debugger_known_limitations.md | 59 - .../reference/debugger/debugger_repl.md | 360 - .../reference/debugger/debugger_vscode.md | 82 - .../reference/nargo_commands.md | 297 - .../version-v0.35.0/reference/noir_codegen.md | 114 - .../version-v0.35.0/tooling/debugger.md | 26 - .../tooling/language_server.md | 43 - .../version-v0.35.0/tooling/testing.md | 79 - .../version-v0.35.0/tutorials/noirjs_app.md | 362 - .../version-v0.37.0/explainers/cspell.json | 5 - .../explainers/explainer-oracle.md | 57 - .../explainers/explainer-recursion.md | 176 - .../explainers/explainer-writing-noir.md | 177 - .../getting_started/noir_installation.md | 102 - .../getting_started/project_breakdown.md | 159 - .../getting_started/quick_start.md | 124 - .../version-v0.37.0/how_to/_category_.json | 5 - .../how_to/debugger/_category_.json | 6 - .../debugger/debugging_with_the_repl.md | 164 - .../how_to/debugger/debugging_with_vs_code.md | 68 - .../version-v0.37.0/how_to/how-to-oracles.md | 275 - .../how_to/how-to-recursion.md | 172 - .../how_to/how-to-solidity-verifier.md | 259 - .../version-v0.37.0/how_to/merkle-proof.mdx | 48 - .../how_to/using-devcontainers.mdx | 110 - .../versioned_docs/version-v0.37.0/index.mdx | 76 - .../version-v0.37.0/migration_notes.md | 105 - .../noir/concepts/_category_.json | 6 - .../version-v0.37.0/noir/concepts/assert.md | 78 - .../version-v0.37.0/noir/concepts/comments.md | 33 - .../version-v0.37.0/noir/concepts/comptime.md | 445 - .../noir/concepts/control_flow.md | 79 - .../noir/concepts/data_bus.mdx | 23 - .../noir/concepts/data_types/_category_.json | 5 - .../noir/concepts/data_types/arrays.md | 276 - .../noir/concepts/data_types/booleans.md | 28 - .../noir/concepts/data_types/fields.md | 246 - .../concepts/data_types/function_types.md | 26 - .../noir/concepts/data_types/index.md | 126 - .../noir/concepts/data_types/integers.md | 156 - .../noir/concepts/data_types/references.md | 23 - .../noir/concepts/data_types/slices.mdx | 358 - .../noir/concepts/data_types/strings.md | 79 - .../noir/concepts/data_types/structs.md | 96 - .../noir/concepts/data_types/tuples.md | 48 - .../noir/concepts/functions.md | 226 - .../version-v0.37.0/noir/concepts/generics.md | 251 - .../version-v0.37.0/noir/concepts/globals.md | 82 - .../version-v0.37.0/noir/concepts/lambdas.md | 81 - .../noir/concepts/mutability.md | 121 - .../version-v0.37.0/noir/concepts/ops.md | 98 - .../version-v0.37.0/noir/concepts/oracles.mdx | 29 - .../noir/concepts/shadowing.md | 44 - .../version-v0.37.0/noir/concepts/traits.md | 501 - .../noir/concepts/unconstrained.md | 104 - .../modules_packages_crates/_category_.json | 6 - .../crates_and_packages.md | 43 - .../modules_packages_crates/dependencies.md | 124 - .../noir/modules_packages_crates/modules.md | 221 - .../modules_packages_crates/workspaces.md | 42 - .../noir/standard_library/_category_.json | 6 - .../noir/standard_library/bigint.md | 127 - .../noir/standard_library/black_box_fns.md | 32 - .../noir/standard_library/bn254.md | 46 - .../standard_library/containers/boundedvec.md | 419 - .../standard_library/containers/hashmap.md | 587 - .../noir/standard_library/containers/index.md | 5 - .../noir/standard_library/containers/vec.mdx | 170 - .../cryptographic_primitives/_category_.json | 5 - .../cryptographic_primitives/ciphers.mdx | 32 - .../cryptographic_primitives/ec_primitives.md | 102 - .../ecdsa_sig_verification.mdx | 98 - .../cryptographic_primitives/eddsa.mdx | 37 - .../embedded_curve_ops.mdx | 95 - .../cryptographic_primitives/hashes.mdx | 227 - .../cryptographic_primitives/index.md | 14 - .../cryptographic_primitives/schnorr.mdx | 64 - .../noir/standard_library/fmtstr.md | 17 - .../noir/standard_library/is_unconstrained.md | 69 - .../noir/standard_library/logging.md | 78 - .../noir/standard_library/mem.md | 52 - .../noir/standard_library/merkle_trees.md | 58 - .../noir/standard_library/meta/ctstring.md | 100 - .../noir/standard_library/meta/expr.md | 380 - .../standard_library/meta/function_def.md | 166 - .../noir/standard_library/meta/index.md | 224 - .../noir/standard_library/meta/module.md | 82 - .../noir/standard_library/meta/op.md | 244 - .../noir/standard_library/meta/quoted.md | 141 - .../noir/standard_library/meta/struct_def.md | 177 - .../standard_library/meta/trait_constraint.md | 17 - .../noir/standard_library/meta/trait_def.md | 26 - .../noir/standard_library/meta/trait_impl.md | 60 - .../noir/standard_library/meta/typ.md | 264 - .../noir/standard_library/meta/typed_expr.md | 27 - .../standard_library/meta/unresolved_type.md | 57 - .../noir/standard_library/options.md | 101 - .../noir/standard_library/recursion.mdx | 85 - .../noir/standard_library/traits.md | 628 - .../reference/NoirJS/noir_js/.nojekyll | 1 - .../reference/NoirJS/noir_js/classes/Noir.md | 52 - .../reference/NoirJS/noir_js/functions/and.md | 22 - .../NoirJS/noir_js/functions/blake2s256.md | 21 - .../functions/ecdsa_secp256k1_verify.md | 28 - .../functions/ecdsa_secp256r1_verify.md | 28 - .../reference/NoirJS/noir_js/functions/xor.md | 22 - .../reference/NoirJS/noir_js/index.md | 47 - .../noir_js/type-aliases/ErrorWithPayload.md | 15 - .../type-aliases/ForeignCallHandler.md | 24 - .../noir_js/type-aliases/ForeignCallInput.md | 9 - .../noir_js/type-aliases/ForeignCallOutput.md | 9 - .../NoirJS/noir_js/type-aliases/WitnessMap.md | 9 - .../NoirJS/noir_js/typedoc-sidebar.cjs | 4 - .../reference/NoirJS/noir_wasm/.nojekyll | 1 - .../NoirJS/noir_wasm/functions/compile.md | 51 - .../noir_wasm/functions/compile_contract.md | 51 - .../noir_wasm/functions/createFileManager.md | 21 - .../functions/inflateDebugSymbols.md | 21 - .../reference/NoirJS/noir_wasm/index.md | 49 - .../NoirJS/noir_wasm/typedoc-sidebar.cjs | 4 - .../version-v0.37.0/reference/_category_.json | 5 - .../reference/debugger/_category_.json | 6 - .../debugger/debugger_known_limitations.md | 59 - .../reference/debugger/debugger_repl.md | 360 - .../reference/debugger/debugger_vscode.md | 82 - .../reference/nargo_commands.md | 301 - .../version-v0.37.0/reference/noir_codegen.md | 116 - .../version-v0.37.0/tooling/debugger.md | 26 - .../tooling/language_server.md | 43 - .../version-v0.37.0/tooling/testing.md | 79 - .../version-v0.37.0/tutorials/noirjs_app.md | 366 - .../version-v0.38.0/explainers/cspell.json | 5 - .../explainers/explainer-oracle.md | 57 - .../explainers/explainer-recursion.md | 176 - .../explainers/explainer-writing-noir.md | 177 - .../getting_started/noir_installation.md | 106 - .../getting_started/project_breakdown.md | 159 - .../getting_started/quick_start.md | 126 - .../setting_up_shell_completions.md | 87 - .../version-v0.38.0/how_to/_category_.json | 5 - .../how_to/debugger/_category_.json | 6 - .../debugger/debugging_with_the_repl.md | 164 - .../how_to/debugger/debugging_with_vs_code.md | 68 - .../version-v0.38.0/how_to/how-to-oracles.md | 275 - .../how_to/how-to-recursion.md | 172 - .../version-v0.38.0/how_to/merkle-proof.mdx | 48 - .../how_to/using-devcontainers.mdx | 110 - .../versioned_docs/version-v0.38.0/index.mdx | 76 - .../version-v0.38.0/migration_notes.md | 105 - .../noir/concepts/_category_.json | 6 - .../version-v0.38.0/noir/concepts/assert.md | 78 - .../version-v0.38.0/noir/concepts/comments.md | 33 - .../version-v0.38.0/noir/concepts/comptime.md | 445 - .../noir/concepts/control_flow.md | 79 - .../noir/concepts/data_bus.mdx | 23 - .../noir/concepts/data_types/_category_.json | 5 - .../noir/concepts/data_types/arrays.md | 276 - .../noir/concepts/data_types/booleans.md | 28 - .../noir/concepts/data_types/fields.md | 246 - .../concepts/data_types/function_types.md | 26 - .../noir/concepts/data_types/index.md | 126 - .../noir/concepts/data_types/integers.md | 156 - .../noir/concepts/data_types/references.md | 23 - .../noir/concepts/data_types/slices.mdx | 358 - .../noir/concepts/data_types/strings.md | 79 - .../noir/concepts/data_types/structs.md | 96 - .../noir/concepts/data_types/tuples.md | 48 - .../noir/concepts/functions.md | 226 - .../version-v0.38.0/noir/concepts/generics.md | 251 - .../version-v0.38.0/noir/concepts/globals.md | 82 - .../version-v0.38.0/noir/concepts/lambdas.md | 81 - .../noir/concepts/mutability.md | 121 - .../version-v0.38.0/noir/concepts/ops.md | 98 - .../version-v0.38.0/noir/concepts/oracles.mdx | 29 - .../noir/concepts/shadowing.md | 44 - .../version-v0.38.0/noir/concepts/traits.md | 501 - .../noir/concepts/unconstrained.md | 104 - .../modules_packages_crates/_category_.json | 6 - .../crates_and_packages.md | 43 - .../modules_packages_crates/dependencies.md | 124 - .../noir/modules_packages_crates/modules.md | 221 - .../modules_packages_crates/workspaces.md | 42 - .../noir/standard_library/_category_.json | 6 - .../noir/standard_library/bigint.md | 127 - .../noir/standard_library/black_box_fns.md | 32 - .../noir/standard_library/bn254.md | 46 - .../standard_library/containers/boundedvec.md | 419 - .../standard_library/containers/hashmap.md | 587 - .../noir/standard_library/containers/index.md | 5 - .../noir/standard_library/containers/vec.mdx | 170 - .../cryptographic_primitives/_category_.json | 5 - .../cryptographic_primitives/ciphers.mdx | 32 - .../cryptographic_primitives/ec_primitives.md | 102 - .../ecdsa_sig_verification.mdx | 98 - .../cryptographic_primitives/eddsa.mdx | 37 - .../embedded_curve_ops.mdx | 95 - .../cryptographic_primitives/hashes.mdx | 227 - .../cryptographic_primitives/index.md | 14 - .../cryptographic_primitives/schnorr.mdx | 64 - .../noir/standard_library/fmtstr.md | 17 - .../noir/standard_library/is_unconstrained.md | 69 - .../noir/standard_library/logging.md | 78 - .../noir/standard_library/mem.md | 52 - .../noir/standard_library/merkle_trees.md | 58 - .../noir/standard_library/meta/ctstring.md | 100 - .../noir/standard_library/meta/expr.md | 380 - .../standard_library/meta/function_def.md | 166 - .../noir/standard_library/meta/index.md | 224 - .../noir/standard_library/meta/module.md | 82 - .../noir/standard_library/meta/op.md | 244 - .../noir/standard_library/meta/quoted.md | 141 - .../noir/standard_library/meta/struct_def.md | 177 - .../standard_library/meta/trait_constraint.md | 17 - .../noir/standard_library/meta/trait_def.md | 26 - .../noir/standard_library/meta/trait_impl.md | 60 - .../noir/standard_library/meta/typ.md | 264 - .../noir/standard_library/meta/typed_expr.md | 27 - .../standard_library/meta/unresolved_type.md | 57 - .../noir/standard_library/options.md | 101 - .../noir/standard_library/recursion.mdx | 85 - .../noir/standard_library/traits.md | 628 - .../reference/NoirJS/noir_js/.nojekyll | 1 - .../reference/NoirJS/noir_js/classes/Noir.md | 52 - .../reference/NoirJS/noir_js/functions/and.md | 22 - .../NoirJS/noir_js/functions/blake2s256.md | 21 - .../functions/ecdsa_secp256k1_verify.md | 28 - .../functions/ecdsa_secp256r1_verify.md | 28 - .../reference/NoirJS/noir_js/functions/xor.md | 22 - .../reference/NoirJS/noir_js/index.md | 47 - .../noir_js/type-aliases/ErrorWithPayload.md | 15 - .../type-aliases/ForeignCallHandler.md | 24 - .../noir_js/type-aliases/ForeignCallInput.md | 9 - .../noir_js/type-aliases/ForeignCallOutput.md | 9 - .../NoirJS/noir_js/type-aliases/WitnessMap.md | 9 - .../NoirJS/noir_js/typedoc-sidebar.cjs | 4 - .../reference/NoirJS/noir_wasm/.nojekyll | 1 - .../NoirJS/noir_wasm/functions/compile.md | 51 - .../noir_wasm/functions/compile_contract.md | 51 - .../noir_wasm/functions/createFileManager.md | 21 - .../functions/inflateDebugSymbols.md | 21 - .../reference/NoirJS/noir_wasm/index.md | 49 - .../NoirJS/noir_wasm/typedoc-sidebar.cjs | 4 - .../version-v0.38.0/reference/_category_.json | 5 - .../reference/debugger/_category_.json | 6 - .../debugger/debugger_known_limitations.md | 59 - .../reference/debugger/debugger_repl.md | 360 - .../reference/debugger/debugger_vscode.md | 82 - .../reference/nargo_commands.md | 474 - .../version-v0.38.0/reference/noir_codegen.md | 116 - .../version-v0.38.0/tooling/debugger.md | 26 - .../tooling/language_server.md | 43 - .../version-v0.38.0/tooling/testing.md | 79 - .../version-v0.38.0/tutorials/noirjs_app.md | 366 - .../version-v0.39.0/explainers/cspell.json | 5 - .../explainers/explainer-oracle.md | 57 - .../explainers/explainer-recursion.md | 176 - .../explainers/explainer-writing-noir.md | 177 - .../getting_started/noir_installation.md | 106 - .../getting_started/project_breakdown.md | 159 - .../getting_started/quick_start.md | 126 - .../setting_up_shell_completions.md | 87 - .../version-v0.39.0/how_to/_category_.json | 5 - .../how_to/debugger/_category_.json | 6 - .../debugger/debugging_with_the_repl.md | 164 - .../how_to/debugger/debugging_with_vs_code.md | 68 - .../version-v0.39.0/how_to/how-to-oracles.md | 275 - .../how_to/how-to-recursion.md | 172 - .../how_to/how-to-solidity-verifier.md | 259 - .../version-v0.39.0/how_to/merkle-proof.mdx | 48 - .../how_to/using-devcontainers.mdx | 110 - .../versioned_docs/version-v0.39.0/index.mdx | 76 - .../version-v0.39.0/migration_notes.md | 105 - .../noir/concepts/_category_.json | 6 - .../version-v0.39.0/noir/concepts/assert.md | 78 - .../version-v0.39.0/noir/concepts/comments.md | 33 - .../version-v0.39.0/noir/concepts/comptime.md | 445 - .../noir/concepts/control_flow.md | 79 - .../noir/concepts/data_bus.mdx | 23 - .../noir/concepts/data_types/_category_.json | 5 - .../noir/concepts/data_types/arrays.md | 276 - .../noir/concepts/data_types/booleans.md | 28 - .../noir/concepts/data_types/fields.md | 246 - .../concepts/data_types/function_types.md | 26 - .../noir/concepts/data_types/index.md | 126 - .../noir/concepts/data_types/integers.md | 156 - .../noir/concepts/data_types/references.md | 23 - .../noir/concepts/data_types/slices.mdx | 358 - .../noir/concepts/data_types/strings.md | 79 - .../noir/concepts/data_types/structs.md | 96 - .../noir/concepts/data_types/tuples.md | 48 - .../noir/concepts/functions.md | 226 - .../version-v0.39.0/noir/concepts/generics.md | 251 - .../version-v0.39.0/noir/concepts/globals.md | 82 - .../version-v0.39.0/noir/concepts/lambdas.md | 81 - .../noir/concepts/mutability.md | 121 - .../version-v0.39.0/noir/concepts/ops.md | 98 - .../version-v0.39.0/noir/concepts/oracles.mdx | 29 - .../noir/concepts/shadowing.md | 44 - .../version-v0.39.0/noir/concepts/traits.md | 501 - .../noir/concepts/unconstrained.md | 104 - .../modules_packages_crates/_category_.json | 6 - .../crates_and_packages.md | 43 - .../modules_packages_crates/dependencies.md | 124 - .../noir/modules_packages_crates/modules.md | 221 - .../modules_packages_crates/workspaces.md | 42 - .../noir/standard_library/_category_.json | 6 - .../noir/standard_library/bigint.md | 127 - .../noir/standard_library/black_box_fns.md | 32 - .../noir/standard_library/bn254.md | 46 - .../standard_library/containers/boundedvec.md | 419 - .../standard_library/containers/hashmap.md | 587 - .../noir/standard_library/containers/index.md | 5 - .../noir/standard_library/containers/vec.mdx | 170 - .../cryptographic_primitives/_category_.json | 5 - .../cryptographic_primitives/ciphers.mdx | 32 - .../cryptographic_primitives/ec_primitives.md | 102 - .../ecdsa_sig_verification.mdx | 98 - .../cryptographic_primitives/eddsa.mdx | 37 - .../embedded_curve_ops.mdx | 95 - .../cryptographic_primitives/hashes.mdx | 227 - .../cryptographic_primitives/index.md | 14 - .../cryptographic_primitives/schnorr.mdx | 64 - .../noir/standard_library/fmtstr.md | 17 - .../noir/standard_library/is_unconstrained.md | 69 - .../noir/standard_library/logging.md | 78 - .../noir/standard_library/mem.md | 52 - .../noir/standard_library/merkle_trees.md | 58 - .../noir/standard_library/meta/ctstring.md | 100 - .../noir/standard_library/meta/expr.md | 380 - .../standard_library/meta/function_def.md | 166 - .../noir/standard_library/meta/index.md | 224 - .../noir/standard_library/meta/module.md | 82 - .../noir/standard_library/meta/op.md | 244 - .../noir/standard_library/meta/quoted.md | 141 - .../noir/standard_library/meta/struct_def.md | 177 - .../standard_library/meta/trait_constraint.md | 17 - .../noir/standard_library/meta/trait_def.md | 26 - .../noir/standard_library/meta/trait_impl.md | 60 - .../noir/standard_library/meta/typ.md | 264 - .../noir/standard_library/meta/typed_expr.md | 27 - .../standard_library/meta/unresolved_type.md | 57 - .../noir/standard_library/options.md | 101 - .../noir/standard_library/recursion.mdx | 67 - .../noir/standard_library/traits.md | 628 - .../reference/NoirJS/noir_js/.nojekyll | 1 - .../reference/NoirJS/noir_js/classes/Noir.md | 52 - .../reference/NoirJS/noir_js/functions/and.md | 22 - .../NoirJS/noir_js/functions/blake2s256.md | 21 - .../functions/ecdsa_secp256k1_verify.md | 28 - .../functions/ecdsa_secp256r1_verify.md | 28 - .../reference/NoirJS/noir_js/functions/xor.md | 22 - .../reference/NoirJS/noir_js/index.md | 47 - .../noir_js/type-aliases/ErrorWithPayload.md | 15 - .../type-aliases/ForeignCallHandler.md | 24 - .../noir_js/type-aliases/ForeignCallInput.md | 9 - .../noir_js/type-aliases/ForeignCallOutput.md | 9 - .../NoirJS/noir_js/type-aliases/WitnessMap.md | 9 - .../NoirJS/noir_js/typedoc-sidebar.cjs | 4 - .../reference/NoirJS/noir_wasm/.nojekyll | 1 - .../NoirJS/noir_wasm/functions/compile.md | 51 - .../noir_wasm/functions/compile_contract.md | 51 - .../noir_wasm/functions/createFileManager.md | 21 - .../functions/inflateDebugSymbols.md | 21 - .../reference/NoirJS/noir_wasm/index.md | 49 - .../NoirJS/noir_wasm/typedoc-sidebar.cjs | 4 - .../version-v0.39.0/reference/_category_.json | 5 - .../reference/debugger/_category_.json | 6 - .../debugger/debugger_known_limitations.md | 59 - .../reference/debugger/debugger_repl.md | 360 - .../reference/debugger/debugger_vscode.md | 82 - .../reference/nargo_commands.md | 474 - .../version-v0.39.0/reference/noir_codegen.md | 116 - .../version-v0.39.0/tooling/debugger.md | 26 - .../tooling/language_server.md | 43 - .../version-v0.39.0/tooling/testing.md | 79 - .../version-v0.39.0/tutorials/noirjs_app.md | 366 - .../how_to/how-to-solidity-verifier.md | 259 - .../how_to/how-to-solidity-verifier.mdx} | 141 +- .../tutorials/noirjs_app.md | 380 +- .../version-v0.32.0-sidebars.json | 93 - .../version-v0.33.0-sidebars.json | 93 - .../version-v0.34.0-sidebars.json | 93 - .../version-v0.35.0-sidebars.json | 93 - .../version-v0.37.0-sidebars.json | 93 - .../version-v0.38.0-sidebars.json | 93 - .../version-v0.39.0-sidebars.json | 93 - .../codegen_verifier/codegen_verifier.sh | 2 +- .../prove_and_verify/prove_and_verify.sh | 4 +- noir/noir-repo/noir_stdlib/src/aes128.nr | 6 +- .../noir_stdlib/src/array/check_shuffle.nr | 2 + noir/noir-repo/noir_stdlib/src/array/mod.nr | 7 +- noir/noir-repo/noir_stdlib/src/cmp.nr | 2 +- .../src/collections/bounded_vec.nr | 1 + .../noir_stdlib/src/collections/umap.nr | 13 +- noir/noir-repo/noir_stdlib/src/field/bn254.nr | 12 +- noir/noir-repo/noir_stdlib/src/field/mod.nr | 1 + noir/noir-repo/noir_stdlib/src/hash/mod.nr | 6 +- noir/noir-repo/noir_stdlib/src/hash/sha256.nr | 39 +- noir/noir-repo/noir_stdlib/src/lib.nr | 9 + .../noir_stdlib/src/meta/ctstring.nr | 2 + noir/noir-repo/noir_stdlib/src/meta/expr.nr | 8 +- noir/noir-repo/noir_stdlib/src/meta/mod.nr | 9 +- noir/noir-repo/noir_stdlib/src/meta/op.nr | 2 + .../noir_stdlib/src/meta/struct_def.nr | 16 +- noir/noir-repo/noir_stdlib/src/uint128.nr | 36 +- noir/noir-repo/rust-toolchain.toml | 2 +- .../test_programs/compilation_report.sh | 47 +- .../brillig_mut_ref_from_acir/src/main.nr | 6 +- .../regression_5008/src/main.nr | 8 +- .../unconstrained_ref/src/main.nr | 6 +- .../acir_inside_brillig_recursion/src/main.nr | 1 + .../associated_types_implicit/Nargo.toml | 6 + .../associated_types_implicit/Prover.toml | 1 + .../associated_types_implicit/src/main.nr | 60 + .../brillig_cast/src/main.nr | 1 + .../src/main.nr | 1 + .../src/main.nr | 1 + .../brillig_modulo/src/main.nr | 1 + .../brillig_slice_input/src/main.nr | 2 + .../src/main.nr | 2 + .../comptime_struct_definition/src/main.nr | 22 +- .../comptime_trait_constraint/src/main.nr | 2 +- .../comptime_type/src/main.nr | 2 +- .../ctstring/src/main.nr | 2 + .../derive_impl/src/main.nr | 2 +- .../is_unconstrained/src/main.nr | 1 + .../macros_in_comptime/src/main.nr | 5 +- .../regression_5428/src/main.nr | 2 + .../regression_7038/Nargo.toml | 7 + .../regression_7038/src/main.nr | 40 + .../regression_7038_2/Nargo.toml | 7 + .../regression_7038_2/src/main.nr | 39 + .../regression_7038_3/Nargo.toml | 7 + .../regression_7038_3/src/main.nr | 40 + .../regression_7038_4/Nargo.toml | 7 + .../regression_7038_4/src/main.nr | 29 + .../trait_default_method_uses_op/Nargo.toml | 7 + .../trait_default_method_uses_op/src/main.nr | 7 + .../trait_function_calls/src/main.nr | 123 +- .../Nargo.toml | 0 .../src/main.nr | 20 +- .../src/main.nr | 1 + .../brillig_assert_fail/src/main.nr | 10 +- .../brillig_assert_msg_runtime/src/main.nr | 8 +- .../src/main.nr | 3 +- .../mocks_in_execution/Nargo.toml | 7 + .../mocks_in_execution/Prover.toml | 0 .../mocks_in_execution/src/main.nr | 5 + .../regression_5202/src/main.nr | 21 +- .../test_programs/execution_report.sh | 44 +- .../aes128_encrypt/src/main.nr | 16 +- .../src/main.nr | 1 + .../execution_success/bigint/src/main.nr | 1 + .../brillig_acir_as_brillig/src/main.nr | 1 + .../brillig_arrays/src/main.nr | 1 + .../brillig_blake2s/src/main.nr | 1 + .../brillig_calls_array/src/main.nr | 1 + .../brillig_calls_conditionals/src/main.nr | 1 + .../brillig_conditional/src/main.nr | 1 + .../brillig_fns_as_values/src/main.nr | 1 + .../brillig_identity_function/src/main.nr | 1 + .../brillig_nested_arrays/src/main.nr | 1 + .../execution_success/brillig_not/src/main.nr | 1 + .../brillig_oracle/Prover.toml | 2 - .../brillig_recursion/src/main.nr | 1 + .../brillig_uninitialized_arrays/src/main.nr | 1 + .../encrypted_log_regression/Nargo.toml | 7 + .../encrypted_log_regression/Prover.toml | 9 + .../encrypted_log_regression/src/main.nr | 94 + .../global_consts/src/main.nr | 5 +- .../global_var_regression_simple/Nargo.toml | 6 + .../global_var_regression_simple/Prover.toml | 2 + .../global_var_regression_simple/src/main.nr | 25 + .../hint_black_box/src/main.nr | 6 +- .../nested_arrays_from_brillig/src/main.nr | 6 +- .../reference_counts/src/main.nr | 2 +- .../reference_only_used_as_alias/src/main.nr | 1 + .../regression_5435/src/main.nr | 6 +- .../regression_6451/src/main.nr | 6 +- .../regression_6674_3/src/main.nr | 5 +- .../regression_bignum/Nargo.toml | 7 + .../regression_bignum/src/main.nr | 51 + .../src/main.nr | 6 +- .../execution_success/sha2_byte/src/main.nr | 4 +- .../execution_success/slice_regex/src/main.nr | 150 +- .../execution_success/u16_support/src/main.nr | 1 + .../execution_success/uhashmap/src/main.nr | 13 +- .../test_programs/gates_report_brillig.sh | 2 +- .../gates_report_brillig_execution.sh | 14 +- noir/noir-repo/test_programs/memory_report.sh | 5 +- .../brillig_oracle/Nargo.toml | 0 .../brillig_oracle/src/main.nr | 7 +- .../comptime_blackbox/src/main.nr | 8 +- .../comptime_expr/src/main.nr | 223 +- .../noir_test_success/global_eval/Nargo.toml | 7 + .../noir_test_success/global_eval/src/main.nr | 20 + .../noir_test_success/mock_oracle/src/main.nr | 10 +- .../out_of_bounds_alignment/src/main.nr | 6 +- noir/noir-repo/test_programs/parse_time.sh | 21 + .../tooling/acvm_cli/src/cli/execute_cmd.rs | 20 +- .../noir-repo/tooling/debugger/src/context.rs | 11 +- .../tooling/fuzzer/src/dictionary/mod.rs | 3 + noir/noir-repo/tooling/fuzzer/src/lib.rs | 18 +- .../tooling/fuzzer/src/strategies/int.rs | 12 +- .../tooling/fuzzer/src/strategies/mod.rs | 30 +- .../tooling/fuzzer/src/strategies/uint.rs | 28 +- noir/noir-repo/tooling/lsp/Cargo.toml | 4 +- noir/noir-repo/tooling/lsp/src/lib.rs | 2 +- .../tooling/lsp/src/requests/code_action.rs | 3 + .../src/requests/code_action/import_trait.rs | 252 + .../lsp/src/requests/code_action/tests.rs | 2 +- .../tooling/lsp/src/requests/completion.rs | 69 +- .../lsp/src/requests/completion/builtins.rs | 4 + .../requests/completion/completion_items.rs | 56 +- .../lsp/src/requests/completion/tests.rs | 143 + .../tooling/lsp/src/requests/hover.rs | 73 +- .../noir-repo/tooling/lsp/src/requests/mod.rs | 2 +- .../tooling/lsp/src/requests/test_run.rs | 1 + noir/noir-repo/tooling/lsp/src/solver.rs | 4 + noir/noir-repo/tooling/lsp/src/test_utils.rs | 2 +- .../test_programs/workspace/two/src/lib.nr | 9 + noir/noir-repo/tooling/nargo/Cargo.toml | 6 +- .../nargo/src/foreign_calls/default.rs | 51 +- .../tooling/nargo/src/foreign_calls/layers.rs | 22 + .../tooling/nargo/src/foreign_calls/mocker.rs | 12 +- .../tooling/nargo/src/foreign_calls/mod.rs | 3 + noir/noir-repo/tooling/nargo/src/lib.rs | 1 + noir/noir-repo/tooling/nargo/src/ops/check.rs | 1 + noir/noir-repo/tooling/nargo/src/ops/test.rs | 98 +- noir/noir-repo/tooling/nargo_cli/Cargo.toml | 8 +- .../tooling/nargo_cli/benches/criterion.rs | 3 +- noir/noir-repo/tooling/nargo_cli/build.rs | 28 +- .../tooling/nargo_cli/src/cli/check_cmd.rs | 2 +- .../tooling/nargo_cli/src/cli/compile_cmd.rs | 3 +- .../tooling/nargo_cli/src/cli/dap_cmd.rs | 12 +- .../tooling/nargo_cli/src/cli/debug_cmd.rs | 24 +- .../tooling/nargo_cli/src/cli/execute_cmd.rs | 27 +- .../tooling/nargo_cli/src/cli/fs/program.rs | 1 + .../tooling/nargo_cli/src/cli/info_cmd.rs | 13 +- .../tooling/nargo_cli/src/cli/lsp_cmd.rs | 3 +- .../tooling/nargo_cli/src/cli/mod.rs | 49 + .../tooling/nargo_cli/src/cli/test_cmd.rs | 1 + noir/noir-repo/tooling/nargo_cli/src/main.rs | 30 +- .../tooling/nargo_cli/tests/stdlib-props.rs | 13 +- .../tooling/nargo_cli/tests/stdlib-tests.rs | 5 +- .../nargo_fmt/src/formatter/expression.rs | 28 +- .../nargo_fmt/src/formatter/statement.rs | 48 +- .../nargo_fmt/src/formatter/use_tree_merge.rs | 13 +- noir/noir-repo/tooling/nargo_fmt/src/lib.rs | 1 + .../nargo_fmt/tests/expected/unsafe.nr | 6 +- .../tooling/nargo_fmt/tests/input/unsafe.nr | 6 +- .../src/cli/execution_flamegraph_cmd.rs | 10 +- package.json | 3 + scripts/logs/Earthfile | 20 - scripts/logs/check_logs_for_benchmark.sh | 25 - .../logs/download_base_benchmark_from_s3.sh | 35 - .../upload_aggregated_benchmarks_to_s3.sh | 37 - spartan/aztec-network/.gitignore | 1 + spartan/aztec-network/eth-devnet/README.md | 62 + .../eth-devnet/config/config.yaml | 144 + .../eth-devnet/config/genesis.json | 1078 + .../eth-devnet/config/jwt-secret.hex | 1 + .../eth-devnet/config/mnemonics.yaml | 3 + spartan/aztec-network/eth-devnet/create.sh | 173 + .../aztec-network/files/config/genesis.json | 179 - .../files/config/setup-service-addresses.sh | 6 +- spartan/aztec-network/templates/_helpers.tpl | 20 +- .../aztec-network/templates/boot-node.yaml | 63 +- .../templates/deploy-l1-verifier.yaml | 8 +- .../aztec-network/templates/eth-beacon.yaml | 120 + .../templates/eth-execution.yaml | 120 + .../templates/eth-validator.yaml | 101 + spartan/aztec-network/templates/faucet.yaml | 24 +- .../aztec-network/templates/prover-agent.yaml | 15 +- .../templates/prover-broker.yaml | 56 +- .../aztec-network/templates/prover-node.yaml | 67 +- spartan/aztec-network/templates/pxe.yaml | 8 + spartan/aztec-network/templates/reth.yaml | 149 - .../templates/setup-l2-contracts.yaml | 8 +- .../templates/transaction-bot.yaml | 8 + .../aztec-network/templates/validator.yaml | 48 +- spartan/aztec-network/values.yaml | 63 +- .../values/1-validators-public.yaml | 20 + spartan/aztec-network/values/ci-smoke.yaml | 19 +- spartan/aztec-network/values/ci.yaml | 21 +- spartan/aztec-network/values/exp-1.yaml | 49 +- spartan/aztec-network/values/exp-2.yaml | 3 +- spartan/aztec-network/values/rc-1.yaml | 1 - spartan/aztec-network/values/rc-2.yaml | 1 - .../aztec-network/values/release-devnet.yaml | 1 - .../sepolia-3-validators-with-metrics.yaml | 3 +- .../sepolia-48-validators-with-metrics.yaml | 5 +- spartan/releases/README.md | 1 - spartan/releases/create-spartan.sh | 16 + spartan/releases/testnet/aztec-spartan.sh | 20 +- spartan/terraform/deploy-release/main.tf | 5 + spartan/terraform/gke-cluster/main.tf | 64 + yarn-project/.gitignore | 3 + .../accounts/src/testing/create_account.ts | 14 +- .../archiver/src/archiver/archiver.ts | 47 +- .../archiver/src/archiver/instrumentation.ts | 8 +- .../archiver/kv_archiver_store/log_store.ts | 4 +- .../kv_archiver_store/nullifier_store.ts | 2 +- .../memory_archiver_store.ts | 6 +- .../archiver/src/test/mock_l2_block_source.ts | 7 +- .../aztec-node/src/aztec-node/server.test.ts | 49 +- .../aztec-node/src/aztec-node/server.ts | 13 +- .../account_manager/deploy_account_method.ts | 8 +- .../src/contract/base_contract_interaction.ts | 8 + .../contract/contract_function_interaction.ts | 6 + .../aztec.js/src/contract/deploy_method.ts | 8 +- .../src/entrypoint/default_entrypoint.ts | 10 +- .../default_multi_call_entrypoint.ts | 10 +- .../aztec.js/src/entrypoint/entrypoint.ts | 6 +- .../aztec.js/src/entrypoint/payload.ts | 14 +- yarn-project/aztec.js/src/index.ts | 4 +- yarn-project/aztec.js/src/utils/authwit.ts | 4 +- .../aztec.js/src/utils/chain_monitor.ts | 75 + yarn-project/aztec.js/src/utils/index.ts | 1 + .../aztec.js/src/wallet/base_wallet.ts | 3 + yarn-project/aztec/CHANGELOG.md | 15 + yarn-project/aztec/package.json | 2 +- .../aztec/src/cli/aztec_start_action.ts | 2 +- .../aztec/src/cli/aztec_start_options.ts | 12 +- .../aztec/src/cli/cmds/start_prover_agent.ts | 9 +- .../aztec/src/cli/cmds/start_prover_broker.ts | 11 +- yarn-project/aztec/src/sandbox.ts | 2 +- yarn-project/bb-prover/package.json | 3 +- .../bb-prover/src/avm_proving.test.ts | 228 +- yarn-project/bb-prover/src/bb/cli.ts | 10 +- yarn-project/bb-prover/src/bb/execute.ts | 145 +- yarn-project/bb-prover/src/honk.ts | 37 +- .../prover/bb_native_private_kernel_prover.ts | 118 + .../src/prover/bb_private_kernel_prover.ts | 343 +- .../bb-prover/src/prover/bb_prover.ts | 106 +- yarn-project/bb-prover/src/prover/index.ts | 2 +- yarn-project/bb-prover/src/stats.ts | 17 +- yarn-project/bb-prover/src/test/test_avm.ts | 2 +- .../bb-prover/src/test/test_circuit_prover.ts | 67 +- .../bb-prover/src/verifier/bb_verifier.ts | 27 +- .../src/wasm/bb_wasm_private_kernel_prover.ts | 42 + yarn-project/bb-prover/src/wasm/bundle.ts | 11 + yarn-project/bb-prover/src/wasm/index.ts | 155 - yarn-project/bb-prover/src/wasm/lazy.ts | 11 + yarn-project/bootstrap.sh | 2 +- yarn-project/bot/src/rpc.ts | 5 +- yarn-project/circuit-types/src/body.ts | 15 - yarn-project/circuit-types/src/config.ts | 2 - .../src/epoch-helpers/index.test.ts | 5 +- .../circuit-types/src/epoch-helpers/index.ts | 42 +- .../circuit-types/src/hashed_values.test.ts | 11 + .../{packed_values.ts => hashed_values.ts} | 14 +- yarn-project/circuit-types/src/index.ts | 2 +- .../src/interfaces/archiver.test.ts | 9 + .../circuit-types/src/interfaces/archiver.ts | 2 + .../src/interfaces/aztec-node.test.ts | 2 +- .../src/interfaces/aztec-node.ts | 2 +- .../src/interfaces/epoch-prover.ts | 10 + .../circuit-types/src/interfaces/index.ts | 2 +- ...ree.ts => nullifier_membership_witness.ts} | 0 .../src/interfaces/private_kernel_prover.ts | 48 +- .../src/interfaces/prover-agent.ts | 56 - .../src/interfaces/prover-broker.ts | 48 +- .../src/interfaces/prover-node.ts | 11 + .../src/interfaces/proving-job.ts | 51 +- .../circuit-types/src/interfaces/pxe.test.ts | 10 + .../circuit-types/src/interfaces/pxe.ts | 12 + .../src/interfaces/server_circuit_prover.ts | 22 +- .../circuit-types/src/l2_block_source.ts | 6 + yarn-project/circuit-types/src/mocks.ts | 14 +- .../circuit-types/src/packed_values.test.ts | 11 - .../src/private_execution_result.test.ts | 57 +- .../src/private_execution_result.ts | 112 +- .../circuit-types/src/stats/benchmarks.ts | 12 - yarn-project/circuit-types/src/stats/index.ts | 17 - .../circuit-types/src/stats/metrics.ts | 322 - yarn-project/circuit-types/src/stats/stats.ts | 3 +- .../circuit-types/src/tx/processed_tx.ts | 54 +- .../circuit-types/src/tx/simulated_tx.ts | 14 +- yarn-project/circuit-types/src/tx/tx.ts | 41 +- yarn-project/circuit-types/src/tx_effect.ts | 21 +- .../circuit-types/src/tx_execution_request.ts | 10 +- yarn-project/circuits.js/package.json | 1 + yarn-project/circuits.js/src/constants.gen.ts | 37 +- .../circuits.js/src/structs/avm/avm.test.ts | 122 +- .../circuits.js/src/structs/avm/avm.ts | 97 +- .../src/structs/client_ivc_proof.ts | 4 + yarn-project/circuits.js/src/structs/index.ts | 3 +- .../private_kernel_circuit_public_inputs.ts | 8 + .../private_kernel_empty_inputs.test.ts | 46 - .../kernel/private_kernel_empty_inputs.ts | 141 - ...vate_kernel_init_circuit_private_inputs.ts | 13 +- ...ivate_kernel_tail_circuit_public_inputs.ts | 6 +- .../kernel/private_to_avm_accumulated_data.ts | 25 +- .../private_to_public_accumulated_data.ts | 19 +- ..._to_public_kernel_circuit_public_inputs.ts | 32 +- .../private_to_rollup_accumulated_data.ts | 13 +- ...to_rollup_kernel_circuit_public_inputs.ts} | 38 +- .../src/structs/kernel/tx_constant_data.ts | 13 +- .../src/structs/l2_to_l1_message.ts | 19 +- yarn-project/circuits.js/src/structs/proof.ts | 5 + .../base_or_merge_rollup_public_inputs.ts | 2 +- ...block_root_or_block_merge_public_inputs.ts | 6 +- .../src/structs/rollup/block_root_rollup.ts | 185 +- .../rollup/empty_block_root_rollup_inputs.ts | 58 +- .../src/structs/rollup/private_tube_data.ts | 2 +- .../src/structs/rollup/root_rollup.ts | 19 + .../src/structs/rollup_validation_requests.ts | 18 +- .../trees/append_only_tree_snapshot.ts | 4 + .../circuits.js/src/structs/tx_request.ts | 3 +- .../circuits.js/src/tests/factories.ts | 67 +- yarn-project/cli/src/cmds/l1/index.ts | 4 +- .../cli/src/cmds/l1/update_l1_validators.ts | 4 +- yarn-project/cli/src/utils/aztec.ts | 2 +- yarn-project/end-to-end/package.json | 6 +- yarn-project/end-to-end/scripts/e2e_test.sh | 4 + .../end-to-end/scripts/e2e_test_config.yml | 18 +- .../scripts/native-network/validator.sh | 2 +- .../end-to-end/scripts/network_test.sh | 46 +- .../src/bench/bench_build_block.test.ts | 42 + .../src/{benchmarks => bench}/utils.ts | 101 +- .../end-to-end/src/benchmarks/README.md | 23 - .../benchmarks/bench_process_history.test.ts | 94 - .../src/benchmarks/bench_prover.test.ts | 259 - .../benchmarks/bench_publish_rollup.test.ts | 61 - .../src/benchmarks/bench_tx_size_fees.test.ts | 128 - .../composed/integration_l1_publisher.test.ts | 156 +- .../blacklist_token_contract_test.ts | 2 +- .../end-to-end/src/e2e_block_building.test.ts | 36 +- .../cross_chain_messaging_test.ts | 2 +- .../src/e2e_crowdfunding_and_claim.test.ts | 8 +- .../e2e_deploy_contract/deploy_method.test.ts | 9 + .../private_initialization.test.ts | 2 +- .../end-to-end/src/e2e_epochs.test.ts | 108 +- .../src/e2e_non_contract_account.test.ts | 4 +- .../end-to-end/src/e2e_outbox.test.ts | 17 +- .../end-to-end/src/e2e_p2p/p2p_network.ts | 12 +- .../end-to-end/src/e2e_p2p/reex.test.ts | 229 +- yarn-project/end-to-end/src/e2e_p2p/shared.ts | 11 +- .../src/e2e_prover/e2e_prover_test.ts | 6 +- .../e2e_token_contract/token_contract_test.ts | 2 +- .../transfer_in_private.test.ts | 4 +- .../src/fixtures/setup_l1_contracts.ts | 2 +- .../end-to-end/src/fixtures/setup_p2p_test.ts | 44 +- .../src/fixtures/snapshot_manager.ts | 32 +- yarn-project/end-to-end/src/fixtures/utils.ts | 42 +- .../end-to-end/src/spartan/4epochs.test.ts | 2 +- .../src/spartan/gating-passive.test.ts | 2 +- .../end-to-end/src/spartan/reorg.test.ts | 2 +- .../end-to-end/src/spartan/smoke.test.ts | 2 +- yarn-project/end-to-end/tsconfig.json | 3 + .../entrypoints/src/account_entrypoint.ts | 8 +- .../entrypoints/src/dapp_entrypoint.ts | 10 +- yarn-project/ethereum/src/contracts/rollup.ts | 16 +- .../ethereum/src/deploy_l1_contracts.ts | 6 +- yarn-project/ethereum/src/l1_tx_utils.test.ts | 155 +- yarn-project/ethereum/src/l1_tx_utils.ts | 252 +- yarn-project/ethereum/src/test/tx_delayer.ts | 6 +- yarn-project/ethereum/src/utils.ts | 109 + .../foundation/src/abi/note_selector.ts | 2 +- .../foundation/src/collection/array.test.ts | 58 +- .../foundation/src/collection/array.ts | 31 + yarn-project/foundation/src/config/env_var.ts | 8 +- .../json-rpc/server/safe_json_rpc_server.ts | 37 +- .../foundation/src/log/log_history.test.ts | 3 +- .../foundation/src/log/pino-logger.ts | 21 +- .../foundation/src/promise/running-promise.ts | 8 + .../foundation/src/queue/serial_queue.ts | 5 + .../foundation/src/testing/files/index.ts | 7 +- yarn-project/foundation/src/trees/index.ts | 3 +- .../src/trees/unbalanced_merkle_root.ts | 52 - .../src/trees/unbalanced_merkle_tree.test.ts | 41 + .../src/trees/unbalanced_merkle_tree.ts | 103 + .../src/trees/unbalanced_tree_store.ts | 102 + .../src/avm_integration.test.ts | 12 +- yarn-project/jest.root.config.js | 21 + yarn-project/kv-store/package.json | 4 +- yarn-project/kv-store/package.local.json | 2 +- .../merkle-tree/src/unbalanced_tree.ts | 2 +- .../noir-protocol-circuits-types/package.json | 15 +- .../src/artifacts/client.ts | 38 - .../src/artifacts/client/bundle.ts | 38 + .../src/artifacts/client/lazy.ts | 14 + .../src/artifacts/index.ts | 14 - .../src/artifacts/server.ts | 27 +- .../src/artifacts/types.ts | 30 + .../src/client.ts | 24 - .../src/conversion/client.ts | 2 + .../src/conversion/server.ts | 88 +- .../src/entrypoint/client/bundle.ts | 5 + .../src/entrypoint/client/common.ts | 21 + .../src/entrypoint/client/lazy.ts | 1 + .../src/entrypoint/server.ts | 6 + .../src/{ => entrypoint}/vks.ts | 48 +- .../src/execution/client.ts | 267 +- .../src/execution/index.ts | 2 - .../src/execution/server.ts | 86 +- .../noir-protocol-circuits-types/src/index.ts | 7 - .../generate_client_artifacts_helper.ts | 91 + .../generate_private_kernel_reset_data.ts | 66 +- .../src/scripts/generate_ts_from_abi.ts | 9 +- .../src/utils/private_kernel_reset.ts | 35 +- .../p2p/src/client/p2p_client.test.ts | 11 - yarn-project/p2p/src/client/p2p_client.ts | 3 - .../src/mem_pools/tx_pool/aztec_kv_tx_pool.ts | 13 +- .../mem_pools/tx_pool/tx_pool_test_suite.ts | 10 +- .../block_header_validator.test.ts | 40 + .../tx_validator/block_header_validator.ts | 25 + .../src/msg_validators/tx_validator/index.ts | 1 + .../p2p/src/services/reqresp/reqresp.test.ts | 2 + yarn-project/package.json | 2 +- .../src/block_builder/light.test.ts | 98 +- .../prover-client/src/block_builder/light.ts | 21 +- yarn-project/prover-client/src/config.ts | 8 +- .../prover-client/src/mocks/fixtures.ts | 2 +- .../prover-client/src/mocks/test_context.ts | 4 +- .../orchestrator/block-building-helpers.ts | 164 +- .../src/orchestrator/block-proving-state.ts | 372 +- .../block_building_helpers.test.ts | 107 + .../src/orchestrator/epoch-proving-state.ts | 247 +- .../src/orchestrator/orchestrator.ts | 778 +- .../orchestrator/orchestrator_errors.test.ts | 2 +- .../orchestrator_failures.test.ts | 2 +- .../orchestrator_mixed_blocks.test.ts | 47 +- ...rchestrator_multi_public_functions.test.ts | 2 +- .../orchestrator_public_functions.test.ts | 2 +- .../orchestrator_workflow.test.ts | 30 +- .../src/orchestrator/tx-proving-state.ts | 48 +- .../agent-queue-rpc-integration.test.ts | 7 +- .../src/prover-agent/memory-proving-queue.ts | 26 +- .../src/prover-agent/prover-agent.ts | 8 +- .../src/prover-client/prover-client.ts | 12 +- .../src/prover-client/server-epoch-prover.ts | 44 + .../broker_prover_facade.test.ts | 69 +- .../proving_broker/broker_prover_facade.ts | 385 +- .../src/proving_broker/config.ts | 93 + .../src/proving_broker/factory.ts | 7 +- .../src/proving_broker/fixtures.ts | 14 + .../prover-client/src/proving_broker/index.ts | 1 + .../src/proving_broker/proving_broker.test.ts | 274 +- .../src/proving_broker/proving_broker.ts | 185 +- .../proving_broker/proving_broker_database.ts | 11 +- .../broker_persisted_database.test.ts | 281 + .../proving_broker_database/memory.ts | 28 +- .../proving_broker_database/persisted.ts | 160 +- .../proving_broker/proving_job_controller.ts | 10 +- .../prover-client/src/proving_broker/rpc.ts | 5 +- .../src/test/bb_prover_base_rollup.test.ts | 73 - .../src/test/bb_prover_full_rollup.test.ts | 2 +- .../src/test/bb_prover_parity.test.ts | 2 +- .../prover-client/src/test/mock_prover.ts | 23 +- yarn-project/prover-node/package.json | 3 +- yarn-project/prover-node/src/config.ts | 12 +- .../src/job/epoch-proving-job.test.ts | 155 + .../prover-node/src/job/epoch-proving-job.ts | 91 +- yarn-project/prover-node/src/metrics.ts | 13 +- .../prover-node/src/prover-node.test.ts | 9 +- yarn-project/prover-node/src/prover-node.ts | 57 +- yarn-project/prover-node/src/test/index.ts | 11 + yarn-project/pxe/package.json | 1 - yarn-project/pxe/src/database/note_dao.ts | 2 +- yarn-project/pxe/src/kernel_oracle/index.ts | 2 +- ...ild_private_kernel_reset_private_inputs.ts | 8 +- yarn-project/pxe/src/kernel_prover/index.ts | 2 - .../src/kernel_prover/kernel_prover.test.ts | 31 +- .../pxe/src/kernel_prover/kernel_prover.ts | 78 +- .../kernel_prover/test/test_circuit_prover.ts | 122 - .../brute_force_note_info.ts | 2 +- .../produce_note_daos.ts | 2 + .../produce_note_daos_for_key.ts | 2 + .../pxe/src/pxe_service/error_enriching.ts | 2 +- .../pxe/src/pxe_service/pxe_service.ts | 76 +- .../src/pxe_service/test/pxe_service.test.ts | 23 +- yarn-project/pxe/src/simulator/index.ts | 6 +- .../pxe/src/simulator_oracle/index.ts | 36 +- .../simulator_oracle/simulator_oracle.test.ts | 9 +- .../pxe/src/utils/create_pxe_service.ts | 21 +- yarn-project/scripts/Earthfile | 59 - yarn-project/scripts/package.json | 3 - .../scripts/src/benchmarks/aggregate.ts | 323 - .../scripts/src/benchmarks/markdown.ts | 302 - yarn-project/scripts/src/benchmarks/paths.ts | 13 - .../scripts/src/bin/bench-aggregate.ts | 7 - yarn-project/scripts/src/bin/bench-comment.ts | 9 - .../scripts/src/bin/bench-markdown.ts | 10 - yarn-project/scripts/src/types.ts | 1 - yarn-project/scripts/src/utils/comment.ts | 6 +- yarn-project/sequencer-client/package.json | 3 +- .../src/client/sequencer-client.ts | 2 +- .../sequencer-client/src/config.test.ts | 1 - .../sequencer-client/src/publisher/index.ts | 1 - .../src/publisher/l1-publisher.test.ts | 40 +- .../src/publisher/l1-publisher.ts | 118 +- .../sequencer-client/src/publisher/utils.ts | 14 - .../sequencer-client/src/sequencer/metrics.ts | 12 +- .../src/sequencer/sequencer.test.ts | 56 +- .../src/sequencer/sequencer.ts | 204 +- .../src/sequencer/timetable.test.ts | 130 + .../src/sequencer/timetable.ts | 123 + .../sequencer-client/src/test/index.ts | 22 + .../{publisher => test}/test-l1-publisher.ts | 2 +- .../src/tx_validator/archive_cache.test.ts | 38 + .../src/tx_validator/archive_cache.ts | 27 + .../src/tx_validator/gas_validator.ts | 2 +- .../src/tx_validator/phases_validator.ts | 2 +- .../src/tx_validator/tx_validator_factory.ts | 9 +- yarn-project/simulator/package.json | 5 +- yarn-project/simulator/src/acvm/acvm.ts | 2 +- yarn-project/simulator/src/acvm/index.ts | 2 +- .../simulator/src/acvm/oracle/oracle.ts | 41 +- .../simulator/src/acvm/oracle/typed_oracle.ts | 36 +- .../simulator/src/avm/avm_simulator.test.ts | 2 +- .../simulator/src/avm/avm_simulator.ts | 6 + .../simulator/src/avm/fixtures/index.ts | 9 +- .../simulator/src/avm/journal/journal.test.ts | 2 +- .../simulator/src/avm/journal/journal.ts | 18 +- .../src/avm/journal/nullifiers.test.ts | 2 +- .../simulator/src/avm/journal/nullifiers.ts | 2 +- .../src/avm/journal/public_storage.test.ts | 2 +- .../src/avm/journal/public_storage.ts | 2 +- .../src/avm/opcodes/accrued_substate.test.ts | 2 +- .../src/client/client_execution_context.ts | 77 +- .../simulator/src/client/db_oracle.ts | 22 +- .../src/client/execution_note_cache.ts | 81 +- yarn-project/simulator/src/client/index.ts | 14 +- .../src/client/private_execution.test.ts | 59 +- .../simulator/src/client/private_execution.ts | 38 +- .../simulator/src/client/simulator.test.ts | 5 +- .../simulator/src/client/simulator.ts | 27 +- .../client/unconstrained_execution.test.ts | 5 +- .../src/client/unconstrained_execution.ts | 30 +- .../simulator/src/client/view_data_oracle.ts | 22 +- yarn-project/simulator/src/common.ts | 1 + .../src/common/hashed_values_cache.ts | 55 + yarn-project/simulator/src/common/index.ts | 2 +- .../src/common/message_load_oracle_inputs.ts | 15 + .../src/common/packed_values_cache.ts | 55 - .../src/common/simulation_provider.ts | 45 + .../simulator/src/providers/acvm_native.ts | 14 +- .../simulator/src/providers/acvm_wasm.ts | 45 +- .../src/providers/acvm_wasm_with_blobs.ts | 45 +- .../simulator/src/providers/factory.ts | 2 +- yarn-project/simulator/src/providers/index.ts | 2 +- .../src/providers/simulation_provider.ts | 10 - .../simulator/src/public/db_interfaces.ts | 2 +- .../simulator/src/public/fixtures/index.ts | 88 +- .../simulator/src/public/public_db_sources.ts | 9 +- .../simulator/src/public/public_processor.ts | 2 +- .../simulator/src/public/public_tx_context.ts | 25 +- .../src/public/public_tx_simulator.ts | 8 +- .../simulator/src/{index.ts => server.ts} | 2 - yarn-project/telemetry-client/package.json | 6 +- .../telemetry-client/src/attributes.ts | 2 + .../src/aztec_resource_detector.ts | 12 +- yarn-project/telemetry-client/src/bench.ts | 153 + yarn-project/telemetry-client/src/config.ts | 12 + .../src/event_loop_monitor.ts | 119 + yarn-project/telemetry-client/src/metrics.ts | 15 +- yarn-project/telemetry-client/src/noop.ts | 2 +- yarn-project/telemetry-client/src/otel.ts | 104 +- .../src/otel_logger_provider.ts | 6 +- .../telemetry-client/src/otel_resource.ts | 10 +- yarn-project/telemetry-client/src/start.ts | 4 +- .../src/vendor/otel-pino-stream.ts | 4 +- yarn-project/txe/src/index.ts | 2 +- yarn-project/txe/src/oracle/txe_oracle.ts | 156 +- .../txe/src/txe_service/txe_service.ts | 46 +- .../txe/src/util/txe_world_state_db.ts | 2 +- yarn-project/validator-client/package.json | 3 +- yarn-project/validator-client/src/config.ts | 14 +- .../src/errors/validator.error.ts | 12 + yarn-project/validator-client/src/factory.ts | 2 +- .../validator-client/src/validator.test.ts | 19 +- .../validator-client/src/validator.ts | 59 +- .../src/native/merkle_trees_facade.ts | 2 +- .../world-state/src/native/message.ts | 36 +- .../src/native/native_world_state.test.ts | 79 + .../src/native/native_world_state.ts | 29 +- .../src/native/native_world_state_instance.ts | 100 +- .../src/native/world_state_ops_queue.ts | 187 + yarn-project/world-state/src/test/utils.ts | 11 +- .../src/world-state-db/merkle_trees.ts | 16 +- yarn-project/yarn.lock | 413 +- yarn.lock | 12 + 2177 files changed, 48437 insertions(+), 120629 deletions(-) create mode 100644 .yarn/install-state.gz create mode 100644 aztec-nargo/README.md create mode 100644 barretenberg/cpp/pil/vm2/README.md create mode 100644 barretenberg/cpp/pil/vm2/addressing.pil create mode 100644 barretenberg/cpp/pil/vm2/alu.pil create mode 100644 barretenberg/cpp/pil/vm2/execution.pil create mode 100644 barretenberg/cpp/pil/vm2/precomputed.pil create mode 100644 barretenberg/cpp/src/barretenberg/benchmark/mega_memory_bench/memory_estimator.hpp create mode 100644 barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/commitment_schemes/utils/instance_witness_generator.hpp create mode 100644 barretenberg/cpp/src/barretenberg/commitment_schemes/utils/test_settings.hpp create mode 100644 barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_environment.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/ultra_honk/witness_computation.cpp create mode 100644 barretenberg/cpp/src/barretenberg/ultra_honk/witness_computation.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/CMakeLists.txt create mode 100644 barretenberg/cpp/src/barretenberg/vm2/avm_api.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/avm_api.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/ankerl_map.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/avm_inputs.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/avm_inputs.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/avm_inputs.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/avm_inputs.testdata.bin create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/aztec_types.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/constants.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/field.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/instruction_spec.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/instruction_spec.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/map.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/memory_types.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/opcodes.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/common/opcodes.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/constraining/README.md create mode 100644 barretenberg/cpp/src/barretenberg/vm2/constraining/check_circuit.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/constraining/check_circuit.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/constraining/relations/alu.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/constraining/relations/execution.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/constraining/testing/check_relation.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/columns.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/flavor.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/flavor.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/flavor_settings.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/full_row.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/full_row.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/prover.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/prover.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/relations/alu.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/relations/execution.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/relations/lookup_dummy_dynamic.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/relations/lookup_dummy_precomputed.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/relations/perm_dummy_dynamic.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/verifier.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/generated/verifier.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/proving_helper.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/proving_helper.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/addressing.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/addressing.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/alu.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/alu.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/alu.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/bytecode_manager.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/bytecode_manager.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/context.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/context_stack.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/events/addressing_event.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/events/alu_event.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/events/bytecode_events.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/events/event_emitter.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/events/events_container.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/events/execution_event.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/events/memory_event.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/execution.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/execution.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/execution.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/lib/README.md create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/lib/contract_crypto.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/lib/contract_crypto.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/lib/instruction_info.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/lib/raw_data_db.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/lib/raw_data_db.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/lib/serialization.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/lib/serialization.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/memory.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/memory.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_addressing.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_addressing.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_alu.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_alu.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_bytecode_manager.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_bytecode_manager.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_context.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_context.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_context_stack.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_memory.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_memory.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_raw_data_db.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/testing/mock_raw_data_db.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/tx_execution.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation/tx_execution.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation_helper.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/simulation_helper.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/testing/macros.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/alu_trace.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/alu_trace.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/alu_trace.test.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/execution_trace.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/execution_trace.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/lib/README.md create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/lib/lookup_builder.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/lib/lookup_into_bitwise.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/lib/permutation_builder.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/precomputed_trace.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/precomputed_trace.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/test_trace_container.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/test_trace_container.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/trace_container.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen/trace_container.hpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen_helper.cpp create mode 100644 barretenberg/cpp/src/barretenberg/vm2/tracegen_helper.hpp create mode 100755 build-images/adhoc-installs.sh delete mode 100644 docs/docs/_protocol-specs/public-vm/gen/_instruction-set.mdx create mode 100644 docs/docs/guides/developer_guides/smart_contracts/index.mdx rename docs/docs/guides/developer_guides/smart_contracts/{testing_contracts => }/testing.md (95%) delete mode 100644 docs/docs/guides/developer_guides/smart_contracts/testing_contracts/_category_.json rename docs/docs/guides/developer_guides/smart_contracts/writing_contracts/{call_functions.md => call_contracts.md} (73%) create mode 100644 docs/docs/guides/developer_guides/smart_contracts/writing_contracts/index.mdx rename docs/docs/{_protocol-specs => protocol-specs}/addresses-and-keys/address.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/addresses-and-keys/diversified-and-stealth.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/addresses-and-keys/example-usage/diversified-and-stealth-keys.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/addresses-and-keys/example-usage/encrypt-and-tag.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/addresses-and-keys/example-usage/nullifier.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/addresses-and-keys/example-usage/tag-sequence-derivation.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/addresses-and-keys/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/addresses-and-keys/keys-requirements.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/addresses-and-keys/keys.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/addresses-and-keys/precompiles.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/bytecode/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/calls/batched-calls.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/calls/enqueued-calls.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/calls/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/calls/public-private-messaging.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/calls/static-calls.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/calls/sync-calls.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/calls/unconstrained-calls.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/circuits/high-level-topology.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/circuits/private-function.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/circuits/private-kernel-initial.mdx (100%) rename docs/docs/{_protocol-specs => protocol-specs}/circuits/private-kernel-inner.mdx (100%) rename docs/docs/{_protocol-specs => protocol-specs}/circuits/private-kernel-reset.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/circuits/private-kernel-tail.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/circuits/public-kernel-initial.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/circuits/public-kernel-inner.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/circuits/public-kernel-tail.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/constants.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/contract-deployment/classes.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/contract-deployment/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/contract-deployment/instances.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/cryptography/hashing/hashing.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/cryptography/hashing/pedersen.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/cryptography/hashing/poseidon2.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/cryptography/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/cryptography/merkle-trees.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/cryptography/proving-system/data-bus.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/cryptography/proving-system/overview.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/cryptography/proving-system/performance-targets.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/data-publication-and-availability/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/data-publication-and-availability/overview.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/data-publication-and-availability/published-data.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/decentralization/actors.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/decentralization/block-production.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/decentralization/governance.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/decentralization/p2p-network.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/gas-and-fees/fee-juice.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/gas-and-fees/fee-schedule.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/gas-and-fees/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/gas-and-fees/kernel-tracking.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/gas-and-fees/published-gas-and-fee-data.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/gas-and-fees/specifying-gas-fee-info.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/gas-and-fees/tx-setup-and-teardown.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/intro.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/l1-smart-contracts/frontier.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/l1-smart-contracts/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/logs/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/pre-compiled-contracts/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/pre-compiled-contracts/registry.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/private-message-delivery/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/private-message-delivery/private-msg-delivery.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/private-message-delivery/send-note-guidelines.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/_nested-context.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/alu.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/avm-circuit.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/bytecode-validation-circuit.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/circuit-index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/context.mdx (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/control-flow.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/execution.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/instruction-set.mdx (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/intro.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/memory-model.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/nested-calls.mdx (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/security.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/state.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/public-vm/type-structs.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/rollup-circuits/base-rollup.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/rollup-circuits/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/rollup-circuits/merge-rollup.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/rollup-circuits/root-rollup.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/rollup-circuits/tree-parity.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/state/archive.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/state/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/state/note-hash-tree.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/state/nullifier-tree.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/state/public-data-tree.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/state/tree-implementations.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/state/wonky-tree.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/todo.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/transactions/index.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/transactions/local-execution.md (94%) rename docs/docs/{_protocol-specs => protocol-specs}/transactions/public-execution.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/transactions/tx-object.md (100%) rename docs/docs/{_protocol-specs => protocol-specs}/transactions/validity.md (100%) create mode 100644 l1-contracts/test/fixtures/single_tx_block_1.json create mode 100644 l1-contracts/test/fixtures/single_tx_block_2.json delete mode 100644 noir-projects/aztec-nr/aztec/src/context/packed_returns.nr create mode 100644 noir-projects/aztec-nr/aztec/src/context/returns_hash.nr delete mode 100644 noir-projects/aztec-nr/aztec/src/oracle/arguments.nr create mode 100644 noir-projects/aztec-nr/aztec/src/oracle/execution_cache.nr delete mode 100644 noir-projects/aztec-nr/aztec/src/oracle/get_sibling_path.nr delete mode 100644 noir-projects/aztec-nr/aztec/src/oracle/returns.nr delete mode 100644 noir-projects/noir-protocol-circuits/crates/empty-nested-simulated/Nargo.toml delete mode 100644 noir-projects/noir-protocol-circuits/crates/empty-nested-simulated/src/main.nr delete mode 100644 noir-projects/noir-protocol-circuits/crates/empty-nested/src/main.nr delete mode 100644 noir-projects/noir-protocol-circuits/crates/private-kernel-empty-simulated/Nargo.toml delete mode 100644 noir-projects/noir-protocol-circuits/crates/private-kernel-empty-simulated/src/main.nr delete mode 100644 noir-projects/noir-protocol-circuits/crates/private-kernel-empty/src/main.nr delete mode 100644 noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_empty.nr rename noir-projects/noir-protocol-circuits/crates/{private-kernel-empty => rollup-block-root-single-tx-simulated}/Nargo.toml (56%) create mode 100644 noir-projects/noir-protocol-circuits/crates/rollup-block-root-single-tx-simulated/src/main.nr rename noir-projects/noir-protocol-circuits/crates/{empty-nested => rollup-block-root-single-tx}/Nargo.toml (59%) create mode 100644 noir-projects/noir-protocol-circuits/crates/rollup-block-root-single-tx/src/main.nr create mode 100644 noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/block_root_rollup_data.nr create mode 100644 noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/components/block_root_rollup_inputs_validator.nr create mode 100644 noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/components/block_root_rollup_output_composer.nr create mode 100644 noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/components/mod.nr create mode 100644 noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/single_tx_block_root_rollup_inputs.nr create mode 100644 noir-projects/noir-protocol-circuits/crates/rollup-lib/src/merge/utils/merge_rollups.nr create mode 100644 noir-projects/noir-protocol-circuits/crates/rollup-lib/src/merge/utils/mod.nr create mode 100644 noir-projects/noir-protocol-circuits/crates/rollup-lib/src/merge/utils/validate_consecutive_rollups.nr delete mode 100644 noir-projects/noir-protocol-circuits/crates/rollup-lib/src/tests/block_root_rollup_inputs.nr create mode 100644 noir/noir-repo/.github/critical_libraries_status/.gitignore create mode 100644 noir/noir-repo/.github/critical_libraries_status/AztecProtocol/aztec-packages/noir-projects/aztec-nr.failures.jsonl.does_not_compile create mode 100644 noir/noir-repo/.github/critical_libraries_status/AztecProtocol/aztec-packages/noir-projects/noir-contracts.failures.jsonl.does_not_compile create mode 100644 noir/noir-repo/.github/critical_libraries_status/noir-lang/noir-edwards/.failures.jsonl.does_not_compile create mode 100644 noir/noir-repo/.github/critical_libraries_status/noir-lang/noir_bigcurve/.failures.jsonl.does_not_compile create mode 100644 noir/noir-repo/.github/critical_libraries_status/noir-lang/noir_check_shuffle/.failures.jsonl create mode 100644 noir/noir-repo/.github/critical_libraries_status/noir-lang/noir_json_parser/.failures.jsonl.does_not_compile create mode 100644 noir/noir-repo/.github/critical_libraries_status/noir-lang/noir_sort/.failures.jsonl.does_not_compile create mode 100644 noir/noir-repo/.github/critical_libraries_status/noir-lang/sparse_array/.failures.jsonl.does_not_compile delete mode 100644 noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/flatten_cfg/capacity_tracker.rs create mode 100644 noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/remove_unreachable.rs delete mode 100644 noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/resolve_is_unconstrained.rs delete mode 100644 noir/noir-repo/compiler/noirc_evaluator/src/ssa/opt/runtime_separation.rs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/explainers/explainer-oracle.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/explainers/explainer-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/getting_started/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/getting_started/backend/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/getting_started/backend/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/getting_started/hello_noir/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/getting_started/hello_noir/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/getting_started/hello_noir/project_breakdown.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/getting_started/installation/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/getting_started/installation/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/getting_started/installation/other_install_methods.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/getting_started/tooling/noir_codegen.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/how_to/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/how_to/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/how_to/debugger/debugging_with_the_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/how_to/debugger/debugging_with_vs_code.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/how_to/how-to-oracles.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/how_to/how-to-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/how_to/how-to-solidity-verifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/how_to/merkle-proof.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/how_to/using-devcontainers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/index.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/migration_notes.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/assert.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/comments.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/control_flow.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_bus.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/arrays.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/booleans.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/fields.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/function_types.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/integers.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/references.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/slices.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/strings.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/structs.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/data_types/tuples.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/functions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/generics.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/globals.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/lambdas.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/mutability.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/ops.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/oracles.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/shadowing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/concepts/unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/modules_packages_crates/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/modules_packages_crates/crates_and_packages.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/modules_packages_crates/dependencies.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/modules_packages_crates/modules.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/modules_packages_crates/workspaces.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/bigint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/black_box_fns.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/bn254.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/containers/boundedvec.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/containers/hashmap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/containers/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/containers/vec.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/cryptographic_primitives/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/cryptographic_primitives/ciphers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/cryptographic_primitives/ec_primitives.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/cryptographic_primitives/ecdsa_sig_verification.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/cryptographic_primitives/eddsa.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/cryptographic_primitives/embedded_curve_ops.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/cryptographic_primitives/hashes.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/cryptographic_primitives/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/cryptographic_primitives/schnorr.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/is_unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/logging.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/merkle_trees.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/options.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/recursion.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/noir/standard_library/zeroed.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/backend_barretenberg/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/backend_barretenberg/classes/BarretenbergBackend.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/backend_barretenberg/classes/BarretenbergVerifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/backend_barretenberg/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/backend_barretenberg/type-aliases/BackendOptions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/backend_barretenberg/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/classes/Noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/functions/and.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/functions/blake2s256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/functions/ecdsa_secp256k1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/functions/ecdsa_secp256r1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/functions/keccak256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/functions/sha256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/functions/xor.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/type-aliases/ErrorWithPayload.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/type-aliases/ForeignCallInput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/type-aliases/ForeignCallOutput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/type-aliases/WitnessMap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_js/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_wasm/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_wasm/functions/compile.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_wasm/functions/compile_contract.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_wasm/functions/createFileManager.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_wasm/functions/inflateDebugSymbols.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_wasm/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/NoirJS/noir_wasm/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/debugger/debugger_known_limitations.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/debugger/debugger_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/debugger/debugger_vscode.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/reference/nargo_commands.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/tooling/debugger.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/tooling/language_server.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/tooling/testing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.32.0/tutorials/noirjs_app.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/explainers/cspell.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/explainers/explainer-oracle.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/explainers/explainer-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/explainers/explainer-writing-noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/getting_started/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/getting_started/backend/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/getting_started/backend/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/getting_started/hello_noir/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/getting_started/hello_noir/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/getting_started/hello_noir/project_breakdown.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/getting_started/installation/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/getting_started/installation/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/getting_started/installation/other_install_methods.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/how_to/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/how_to/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/how_to/debugger/debugging_with_the_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/how_to/debugger/debugging_with_vs_code.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/how_to/how-to-oracles.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/how_to/how-to-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/how_to/how-to-solidity-verifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/how_to/merkle-proof.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/how_to/using-devcontainers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/index.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/migration_notes.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/assert.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/comments.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/control_flow.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_bus.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/arrays.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/booleans.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/fields.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/function_types.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/integers.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/references.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/slices.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/strings.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/structs.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/data_types/tuples.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/functions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/generics.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/globals.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/lambdas.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/mutability.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/ops.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/oracles.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/shadowing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/concepts/unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/modules_packages_crates/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/modules_packages_crates/crates_and_packages.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/modules_packages_crates/dependencies.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/modules_packages_crates/modules.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/modules_packages_crates/workspaces.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/bigint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/black_box_fns.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/bn254.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/containers/boundedvec.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/containers/hashmap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/containers/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/containers/vec.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/cryptographic_primitives/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/cryptographic_primitives/ciphers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/cryptographic_primitives/ec_primitives.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/cryptographic_primitives/ecdsa_sig_verification.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/cryptographic_primitives/eddsa.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/cryptographic_primitives/embedded_curve_ops.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/cryptographic_primitives/hashes.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/cryptographic_primitives/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/cryptographic_primitives/schnorr.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/is_unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/logging.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/merkle_trees.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/options.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/recursion.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/noir/standard_library/zeroed.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/backend_barretenberg/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/backend_barretenberg/classes/BarretenbergBackend.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/backend_barretenberg/classes/BarretenbergVerifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/backend_barretenberg/classes/UltraHonkBackend.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/backend_barretenberg/classes/UltraHonkVerifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/backend_barretenberg/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/backend_barretenberg/type-aliases/BackendOptions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/backend_barretenberg/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/classes/Noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/functions/and.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/functions/blake2s256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/functions/ecdsa_secp256k1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/functions/ecdsa_secp256r1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/functions/keccak256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/functions/sha256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/functions/xor.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/type-aliases/ErrorWithPayload.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/type-aliases/ForeignCallInput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/type-aliases/ForeignCallOutput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/type-aliases/WitnessMap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_js/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_wasm/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_wasm/functions/compile.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_wasm/functions/compile_contract.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_wasm/functions/createFileManager.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_wasm/functions/inflateDebugSymbols.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_wasm/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/NoirJS/noir_wasm/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/debugger/debugger_known_limitations.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/debugger/debugger_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/debugger/debugger_vscode.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/nargo_commands.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/reference/noir_codegen.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/tooling/debugger.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/tooling/language_server.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/tooling/testing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.33.0/tutorials/noirjs_app.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/explainers/cspell.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/explainers/explainer-oracle.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/explainers/explainer-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/explainers/explainer-writing-noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/getting_started/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/getting_started/backend/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/getting_started/backend/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/getting_started/hello_noir/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/getting_started/hello_noir/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/getting_started/hello_noir/project_breakdown.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/getting_started/installation/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/getting_started/installation/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/getting_started/installation/other_install_methods.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/how_to/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/how_to/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/how_to/debugger/debugging_with_the_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/how_to/debugger/debugging_with_vs_code.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/how_to/how-to-oracles.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/how_to/how-to-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/how_to/how-to-solidity-verifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/how_to/merkle-proof.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/how_to/using-devcontainers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/index.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/migration_notes.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/assert.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/comments.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/comptime.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/control_flow.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_bus.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/arrays.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/booleans.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/fields.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/function_types.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/integers.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/references.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/slices.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/strings.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/structs.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/data_types/tuples.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/functions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/generics.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/globals.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/lambdas.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/mutability.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/ops.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/oracles.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/shadowing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/concepts/unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/modules_packages_crates/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/modules_packages_crates/crates_and_packages.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/modules_packages_crates/dependencies.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/modules_packages_crates/modules.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/modules_packages_crates/workspaces.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/bigint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/black_box_fns.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/bn254.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/containers/boundedvec.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/containers/hashmap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/containers/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/containers/vec.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/cryptographic_primitives/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/cryptographic_primitives/ciphers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/cryptographic_primitives/ec_primitives.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/cryptographic_primitives/ecdsa_sig_verification.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/cryptographic_primitives/eddsa.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/cryptographic_primitives/embedded_curve_ops.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/cryptographic_primitives/hashes.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/cryptographic_primitives/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/cryptographic_primitives/schnorr.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/fmtstr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/is_unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/logging.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/merkle_trees.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/expr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/function_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/module.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/op.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/quoted.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/struct_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/trait_constraint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/trait_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/trait_impl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/typ.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/typed_expr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/meta/unresolved_type.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/options.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/recursion.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/noir/standard_library/zeroed.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/backend_barretenberg/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/backend_barretenberg/classes/BarretenbergBackend.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/backend_barretenberg/classes/BarretenbergVerifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/backend_barretenberg/classes/UltraHonkBackend.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/backend_barretenberg/classes/UltraHonkVerifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/backend_barretenberg/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/backend_barretenberg/type-aliases/BackendOptions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/backend_barretenberg/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/classes/Noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/functions/and.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/functions/blake2s256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/functions/ecdsa_secp256k1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/functions/ecdsa_secp256r1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/functions/keccak256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/functions/sha256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/functions/xor.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/type-aliases/ErrorWithPayload.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/type-aliases/ForeignCallInput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/type-aliases/ForeignCallOutput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/type-aliases/WitnessMap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_js/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_wasm/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_wasm/functions/compile.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_wasm/functions/compile_contract.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_wasm/functions/createFileManager.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_wasm/functions/inflateDebugSymbols.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_wasm/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/NoirJS/noir_wasm/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/debugger/debugger_known_limitations.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/debugger/debugger_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/debugger/debugger_vscode.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/nargo_commands.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/reference/noir_codegen.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/tooling/debugger.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/tooling/language_server.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/tooling/testing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.34.0/tutorials/noirjs_app.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/explainers/cspell.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/explainers/explainer-oracle.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/explainers/explainer-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/explainers/explainer-writing-noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/getting_started/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/getting_started/backend/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/getting_started/backend/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/getting_started/hello_noir/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/getting_started/hello_noir/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/getting_started/hello_noir/project_breakdown.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/getting_started/installation/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/getting_started/installation/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/getting_started/installation/other_install_methods.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/how_to/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/how_to/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/how_to/debugger/debugging_with_the_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/how_to/debugger/debugging_with_vs_code.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/how_to/how-to-oracles.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/how_to/how-to-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/how_to/how-to-solidity-verifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/how_to/merkle-proof.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/how_to/using-devcontainers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/index.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/migration_notes.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/assert.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/comments.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/comptime.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/control_flow.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_bus.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/arrays.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/booleans.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/fields.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/function_types.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/integers.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/references.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/slices.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/strings.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/structs.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/data_types/tuples.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/functions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/generics.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/globals.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/lambdas.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/mutability.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/ops.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/oracles.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/shadowing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/concepts/unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/modules_packages_crates/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/modules_packages_crates/crates_and_packages.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/modules_packages_crates/dependencies.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/modules_packages_crates/modules.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/modules_packages_crates/workspaces.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/bigint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/black_box_fns.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/bn254.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/containers/boundedvec.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/containers/hashmap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/containers/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/containers/vec.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/cryptographic_primitives/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/cryptographic_primitives/ciphers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/cryptographic_primitives/ec_primitives.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/cryptographic_primitives/ecdsa_sig_verification.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/cryptographic_primitives/eddsa.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/cryptographic_primitives/embedded_curve_ops.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/cryptographic_primitives/hashes.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/cryptographic_primitives/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/cryptographic_primitives/schnorr.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/fmtstr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/is_unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/logging.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/merkle_trees.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/ctstring.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/expr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/function_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/module.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/op.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/quoted.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/struct_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/trait_constraint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/trait_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/trait_impl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/typ.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/typed_expr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/meta/unresolved_type.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/options.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/recursion.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/noir/standard_library/zeroed.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/backend_barretenberg/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/backend_barretenberg/classes/BarretenbergBackend.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/backend_barretenberg/classes/BarretenbergVerifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/backend_barretenberg/classes/UltraHonkBackend.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/backend_barretenberg/classes/UltraHonkVerifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/backend_barretenberg/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/backend_barretenberg/type-aliases/BackendOptions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/backend_barretenberg/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/classes/Noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/functions/and.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/functions/blake2s256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/functions/ecdsa_secp256k1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/functions/ecdsa_secp256r1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/functions/keccak256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/functions/xor.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/type-aliases/ErrorWithPayload.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/type-aliases/ForeignCallInput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/type-aliases/ForeignCallOutput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/type-aliases/WitnessMap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_js/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_wasm/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_wasm/functions/compile.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_wasm/functions/compile_contract.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_wasm/functions/createFileManager.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_wasm/functions/inflateDebugSymbols.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_wasm/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/NoirJS/noir_wasm/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/debugger/debugger_known_limitations.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/debugger/debugger_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/debugger/debugger_vscode.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/nargo_commands.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/reference/noir_codegen.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/tooling/debugger.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/tooling/language_server.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/tooling/testing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.35.0/tutorials/noirjs_app.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/explainers/cspell.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/explainers/explainer-oracle.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/explainers/explainer-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/explainers/explainer-writing-noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/getting_started/noir_installation.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/getting_started/project_breakdown.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/getting_started/quick_start.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/how_to/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/how_to/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/how_to/debugger/debugging_with_the_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/how_to/debugger/debugging_with_vs_code.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/how_to/how-to-oracles.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/how_to/how-to-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/how_to/how-to-solidity-verifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/how_to/merkle-proof.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/how_to/using-devcontainers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/index.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/migration_notes.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/assert.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/comments.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/comptime.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/control_flow.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_bus.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/arrays.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/booleans.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/fields.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/function_types.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/integers.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/references.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/slices.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/strings.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/structs.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/data_types/tuples.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/functions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/generics.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/globals.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/lambdas.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/mutability.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/ops.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/oracles.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/shadowing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/concepts/unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/modules_packages_crates/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/modules_packages_crates/crates_and_packages.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/modules_packages_crates/dependencies.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/modules_packages_crates/modules.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/modules_packages_crates/workspaces.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/bigint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/black_box_fns.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/bn254.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/containers/boundedvec.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/containers/hashmap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/containers/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/containers/vec.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/cryptographic_primitives/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/cryptographic_primitives/ciphers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/cryptographic_primitives/ec_primitives.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/cryptographic_primitives/ecdsa_sig_verification.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/cryptographic_primitives/eddsa.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/cryptographic_primitives/embedded_curve_ops.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/cryptographic_primitives/hashes.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/cryptographic_primitives/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/cryptographic_primitives/schnorr.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/fmtstr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/is_unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/logging.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/mem.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/merkle_trees.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/ctstring.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/expr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/function_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/module.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/op.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/quoted.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/struct_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/trait_constraint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/trait_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/trait_impl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/typ.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/typed_expr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/meta/unresolved_type.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/options.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/recursion.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/noir/standard_library/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/classes/Noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/functions/and.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/functions/blake2s256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/functions/ecdsa_secp256k1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/functions/ecdsa_secp256r1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/functions/xor.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/type-aliases/ErrorWithPayload.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/type-aliases/ForeignCallInput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/type-aliases/ForeignCallOutput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/type-aliases/WitnessMap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_js/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_wasm/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_wasm/functions/compile.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_wasm/functions/compile_contract.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_wasm/functions/createFileManager.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_wasm/functions/inflateDebugSymbols.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_wasm/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/NoirJS/noir_wasm/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/debugger/debugger_known_limitations.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/debugger/debugger_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/debugger/debugger_vscode.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/nargo_commands.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/reference/noir_codegen.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/tooling/debugger.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/tooling/language_server.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/tooling/testing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.37.0/tutorials/noirjs_app.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/explainers/cspell.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/explainers/explainer-oracle.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/explainers/explainer-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/explainers/explainer-writing-noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/getting_started/noir_installation.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/getting_started/project_breakdown.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/getting_started/quick_start.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/getting_started/setting_up_shell_completions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/how_to/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/how_to/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/how_to/debugger/debugging_with_the_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/how_to/debugger/debugging_with_vs_code.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/how_to/how-to-oracles.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/how_to/how-to-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/how_to/merkle-proof.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/how_to/using-devcontainers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/index.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/migration_notes.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/assert.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/comments.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/comptime.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/control_flow.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_bus.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/arrays.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/booleans.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/fields.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/function_types.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/integers.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/references.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/slices.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/strings.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/structs.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/data_types/tuples.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/functions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/generics.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/globals.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/lambdas.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/mutability.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/ops.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/oracles.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/shadowing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/concepts/unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/modules_packages_crates/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/modules_packages_crates/crates_and_packages.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/modules_packages_crates/dependencies.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/modules_packages_crates/modules.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/modules_packages_crates/workspaces.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/bigint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/black_box_fns.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/bn254.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/containers/boundedvec.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/containers/hashmap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/containers/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/containers/vec.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/cryptographic_primitives/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/cryptographic_primitives/ciphers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/cryptographic_primitives/ec_primitives.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/cryptographic_primitives/ecdsa_sig_verification.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/cryptographic_primitives/eddsa.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/cryptographic_primitives/embedded_curve_ops.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/cryptographic_primitives/hashes.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/cryptographic_primitives/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/cryptographic_primitives/schnorr.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/fmtstr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/is_unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/logging.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/mem.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/merkle_trees.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/ctstring.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/expr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/function_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/module.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/op.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/quoted.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/struct_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/trait_constraint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/trait_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/trait_impl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/typ.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/typed_expr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/meta/unresolved_type.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/options.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/recursion.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/noir/standard_library/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/classes/Noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/functions/and.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/functions/blake2s256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/functions/ecdsa_secp256k1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/functions/ecdsa_secp256r1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/functions/xor.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/type-aliases/ErrorWithPayload.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/type-aliases/ForeignCallInput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/type-aliases/ForeignCallOutput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/type-aliases/WitnessMap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_js/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_wasm/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_wasm/functions/compile.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_wasm/functions/compile_contract.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_wasm/functions/createFileManager.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_wasm/functions/inflateDebugSymbols.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_wasm/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/NoirJS/noir_wasm/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/debugger/debugger_known_limitations.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/debugger/debugger_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/debugger/debugger_vscode.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/nargo_commands.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/reference/noir_codegen.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/tooling/debugger.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/tooling/language_server.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/tooling/testing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.38.0/tutorials/noirjs_app.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/explainers/cspell.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/explainers/explainer-oracle.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/explainers/explainer-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/explainers/explainer-writing-noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/getting_started/noir_installation.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/getting_started/project_breakdown.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/getting_started/quick_start.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/getting_started/setting_up_shell_completions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/how_to/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/how_to/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/how_to/debugger/debugging_with_the_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/how_to/debugger/debugging_with_vs_code.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/how_to/how-to-oracles.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/how_to/how-to-recursion.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/how_to/how-to-solidity-verifier.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/how_to/merkle-proof.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/how_to/using-devcontainers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/index.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/migration_notes.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/assert.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/comments.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/comptime.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/control_flow.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_bus.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/arrays.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/booleans.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/fields.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/function_types.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/integers.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/references.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/slices.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/strings.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/structs.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/data_types/tuples.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/functions.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/generics.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/globals.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/lambdas.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/mutability.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/ops.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/oracles.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/shadowing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/concepts/unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/modules_packages_crates/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/modules_packages_crates/crates_and_packages.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/modules_packages_crates/dependencies.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/modules_packages_crates/modules.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/modules_packages_crates/workspaces.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/bigint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/black_box_fns.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/bn254.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/containers/boundedvec.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/containers/hashmap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/containers/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/containers/vec.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/cryptographic_primitives/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/cryptographic_primitives/ciphers.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/cryptographic_primitives/ec_primitives.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/cryptographic_primitives/ecdsa_sig_verification.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/cryptographic_primitives/eddsa.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/cryptographic_primitives/embedded_curve_ops.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/cryptographic_primitives/hashes.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/cryptographic_primitives/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/cryptographic_primitives/schnorr.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/fmtstr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/is_unconstrained.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/logging.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/mem.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/merkle_trees.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/ctstring.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/expr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/function_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/module.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/op.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/quoted.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/struct_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/trait_constraint.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/trait_def.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/trait_impl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/typ.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/typed_expr.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/meta/unresolved_type.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/options.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/recursion.mdx delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/noir/standard_library/traits.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/classes/Noir.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/functions/and.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/functions/blake2s256.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/functions/ecdsa_secp256k1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/functions/ecdsa_secp256r1_verify.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/functions/xor.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/type-aliases/ErrorWithPayload.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/type-aliases/ForeignCallHandler.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/type-aliases/ForeignCallInput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/type-aliases/ForeignCallOutput.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/type-aliases/WitnessMap.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_js/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_wasm/.nojekyll delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_wasm/functions/compile.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_wasm/functions/compile_contract.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_wasm/functions/createFileManager.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_wasm/functions/inflateDebugSymbols.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_wasm/index.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/NoirJS/noir_wasm/typedoc-sidebar.cjs delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/debugger/_category_.json delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/debugger/debugger_known_limitations.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/debugger/debugger_repl.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/debugger/debugger_vscode.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/nargo_commands.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/reference/noir_codegen.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/tooling/debugger.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/tooling/language_server.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/tooling/testing.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v0.39.0/tutorials/noirjs_app.md delete mode 100644 noir/noir-repo/docs/versioned_docs/version-v1.0.0-beta.0/how_to/how-to-solidity-verifier.md rename noir/noir-repo/docs/versioned_docs/{version-v0.38.0/how_to/how-to-solidity-verifier.md => version-v1.0.0-beta.0/how_to/how-to-solidity-verifier.mdx} (64%) delete mode 100644 noir/noir-repo/docs/versioned_sidebars/version-v0.32.0-sidebars.json delete mode 100644 noir/noir-repo/docs/versioned_sidebars/version-v0.33.0-sidebars.json delete mode 100644 noir/noir-repo/docs/versioned_sidebars/version-v0.34.0-sidebars.json delete mode 100644 noir/noir-repo/docs/versioned_sidebars/version-v0.35.0-sidebars.json delete mode 100644 noir/noir-repo/docs/versioned_sidebars/version-v0.37.0-sidebars.json delete mode 100644 noir/noir-repo/docs/versioned_sidebars/version-v0.38.0-sidebars.json delete mode 100644 noir/noir-repo/docs/versioned_sidebars/version-v0.39.0-sidebars.json create mode 100644 noir/noir-repo/test_programs/compile_success_empty/associated_types_implicit/Nargo.toml create mode 100644 noir/noir-repo/test_programs/compile_success_empty/associated_types_implicit/Prover.toml create mode 100644 noir/noir-repo/test_programs/compile_success_empty/associated_types_implicit/src/main.nr create mode 100644 noir/noir-repo/test_programs/compile_success_empty/regression_7038/Nargo.toml create mode 100644 noir/noir-repo/test_programs/compile_success_empty/regression_7038/src/main.nr create mode 100644 noir/noir-repo/test_programs/compile_success_empty/regression_7038_2/Nargo.toml create mode 100644 noir/noir-repo/test_programs/compile_success_empty/regression_7038_2/src/main.nr create mode 100644 noir/noir-repo/test_programs/compile_success_empty/regression_7038_3/Nargo.toml create mode 100644 noir/noir-repo/test_programs/compile_success_empty/regression_7038_3/src/main.nr create mode 100644 noir/noir-repo/test_programs/compile_success_empty/regression_7038_4/Nargo.toml create mode 100644 noir/noir-repo/test_programs/compile_success_empty/regression_7038_4/src/main.nr create mode 100644 noir/noir-repo/test_programs/compile_success_empty/trait_default_method_uses_op/Nargo.toml create mode 100644 noir/noir-repo/test_programs/compile_success_empty/trait_default_method_uses_op/src/main.nr rename noir/noir-repo/test_programs/compile_success_no_bug/{check_uncostrained_regression => check_unconstrained_regression}/Nargo.toml (100%) rename noir/noir-repo/test_programs/compile_success_no_bug/{check_uncostrained_regression => check_unconstrained_regression}/src/main.nr (55%) create mode 100644 noir/noir-repo/test_programs/execution_failure/mocks_in_execution/Nargo.toml create mode 100644 noir/noir-repo/test_programs/execution_failure/mocks_in_execution/Prover.toml create mode 100644 noir/noir-repo/test_programs/execution_failure/mocks_in_execution/src/main.nr delete mode 100644 noir/noir-repo/test_programs/execution_success/brillig_oracle/Prover.toml create mode 100644 noir/noir-repo/test_programs/execution_success/encrypted_log_regression/Nargo.toml create mode 100644 noir/noir-repo/test_programs/execution_success/encrypted_log_regression/Prover.toml create mode 100644 noir/noir-repo/test_programs/execution_success/encrypted_log_regression/src/main.nr create mode 100644 noir/noir-repo/test_programs/execution_success/global_var_regression_simple/Nargo.toml create mode 100644 noir/noir-repo/test_programs/execution_success/global_var_regression_simple/Prover.toml create mode 100644 noir/noir-repo/test_programs/execution_success/global_var_regression_simple/src/main.nr create mode 100644 noir/noir-repo/test_programs/execution_success/regression_bignum/Nargo.toml create mode 100644 noir/noir-repo/test_programs/execution_success/regression_bignum/src/main.nr rename noir/noir-repo/test_programs/{execution_success => noir_test_success}/brillig_oracle/Nargo.toml (100%) rename noir/noir-repo/test_programs/{execution_success => noir_test_success}/brillig_oracle/src/main.nr (95%) create mode 100644 noir/noir-repo/test_programs/noir_test_success/global_eval/Nargo.toml create mode 100644 noir/noir-repo/test_programs/noir_test_success/global_eval/src/main.nr create mode 100755 noir/noir-repo/test_programs/parse_time.sh create mode 100644 noir/noir-repo/tooling/lsp/src/requests/code_action/import_trait.rs create mode 100644 package.json delete mode 100644 scripts/logs/Earthfile delete mode 100755 scripts/logs/check_logs_for_benchmark.sh delete mode 100755 scripts/logs/download_base_benchmark_from_s3.sh delete mode 100755 scripts/logs/upload_aggregated_benchmarks_to_s3.sh create mode 100644 spartan/aztec-network/.gitignore create mode 100644 spartan/aztec-network/eth-devnet/README.md create mode 100644 spartan/aztec-network/eth-devnet/config/config.yaml create mode 100644 spartan/aztec-network/eth-devnet/config/genesis.json create mode 100644 spartan/aztec-network/eth-devnet/config/jwt-secret.hex create mode 100644 spartan/aztec-network/eth-devnet/config/mnemonics.yaml create mode 100755 spartan/aztec-network/eth-devnet/create.sh delete mode 100644 spartan/aztec-network/files/config/genesis.json create mode 100644 spartan/aztec-network/templates/eth-beacon.yaml create mode 100644 spartan/aztec-network/templates/eth-execution.yaml create mode 100644 spartan/aztec-network/templates/eth-validator.yaml delete mode 100644 spartan/aztec-network/templates/reth.yaml create mode 100644 spartan/aztec-network/values/1-validators-public.yaml create mode 100644 yarn-project/aztec.js/src/utils/chain_monitor.ts create mode 100644 yarn-project/bb-prover/src/prover/bb_native_private_kernel_prover.ts create mode 100644 yarn-project/bb-prover/src/wasm/bb_wasm_private_kernel_prover.ts create mode 100644 yarn-project/bb-prover/src/wasm/bundle.ts delete mode 100644 yarn-project/bb-prover/src/wasm/index.ts create mode 100644 yarn-project/bb-prover/src/wasm/lazy.ts create mode 100644 yarn-project/circuit-types/src/hashed_values.test.ts rename yarn-project/circuit-types/src/{packed_values.ts => hashed_values.ts} (64%) rename yarn-project/circuit-types/src/interfaces/{nullifier_tree.ts => nullifier_membership_witness.ts} (100%) delete mode 100644 yarn-project/circuit-types/src/packed_values.test.ts delete mode 100644 yarn-project/circuit-types/src/stats/benchmarks.ts delete mode 100644 yarn-project/circuit-types/src/stats/metrics.ts delete mode 100644 yarn-project/circuits.js/src/structs/kernel/private_kernel_empty_inputs.test.ts delete mode 100644 yarn-project/circuits.js/src/structs/kernel/private_kernel_empty_inputs.ts rename yarn-project/circuits.js/src/structs/kernel/{kernel_circuit_public_inputs.ts => private_to_rollup_kernel_circuit_public_inputs.ts} (68%) create mode 100644 yarn-project/end-to-end/src/bench/bench_build_block.test.ts rename yarn-project/end-to-end/src/{benchmarks => bench}/utils.ts (51%) delete mode 100644 yarn-project/end-to-end/src/benchmarks/README.md delete mode 100644 yarn-project/end-to-end/src/benchmarks/bench_process_history.test.ts delete mode 100644 yarn-project/end-to-end/src/benchmarks/bench_prover.test.ts delete mode 100644 yarn-project/end-to-end/src/benchmarks/bench_publish_rollup.test.ts delete mode 100644 yarn-project/end-to-end/src/benchmarks/bench_tx_size_fees.test.ts delete mode 100644 yarn-project/foundation/src/trees/unbalanced_merkle_root.ts create mode 100644 yarn-project/foundation/src/trees/unbalanced_merkle_tree.test.ts create mode 100644 yarn-project/foundation/src/trees/unbalanced_merkle_tree.ts create mode 100644 yarn-project/foundation/src/trees/unbalanced_tree_store.ts create mode 100644 yarn-project/jest.root.config.js delete mode 100644 yarn-project/noir-protocol-circuits-types/src/artifacts/client.ts create mode 100644 yarn-project/noir-protocol-circuits-types/src/artifacts/client/bundle.ts create mode 100644 yarn-project/noir-protocol-circuits-types/src/artifacts/client/lazy.ts delete mode 100644 yarn-project/noir-protocol-circuits-types/src/artifacts/index.ts create mode 100644 yarn-project/noir-protocol-circuits-types/src/artifacts/types.ts delete mode 100644 yarn-project/noir-protocol-circuits-types/src/client.ts create mode 100644 yarn-project/noir-protocol-circuits-types/src/entrypoint/client/bundle.ts create mode 100644 yarn-project/noir-protocol-circuits-types/src/entrypoint/client/common.ts create mode 100644 yarn-project/noir-protocol-circuits-types/src/entrypoint/client/lazy.ts create mode 100644 yarn-project/noir-protocol-circuits-types/src/entrypoint/server.ts rename yarn-project/noir-protocol-circuits-types/src/{ => entrypoint}/vks.ts (66%) delete mode 100644 yarn-project/noir-protocol-circuits-types/src/execution/index.ts delete mode 100644 yarn-project/noir-protocol-circuits-types/src/index.ts create mode 100644 yarn-project/noir-protocol-circuits-types/src/scripts/generate_client_artifacts_helper.ts create mode 100644 yarn-project/p2p/src/msg_validators/tx_validator/block_header_validator.test.ts create mode 100644 yarn-project/p2p/src/msg_validators/tx_validator/block_header_validator.ts create mode 100644 yarn-project/prover-client/src/orchestrator/block_building_helpers.test.ts create mode 100644 yarn-project/prover-client/src/prover-client/server-epoch-prover.ts create mode 100644 yarn-project/prover-client/src/proving_broker/config.ts create mode 100644 yarn-project/prover-client/src/proving_broker/fixtures.ts create mode 100644 yarn-project/prover-client/src/proving_broker/proving_broker_database/broker_persisted_database.test.ts delete mode 100644 yarn-project/prover-client/src/test/bb_prover_base_rollup.test.ts create mode 100644 yarn-project/prover-node/src/job/epoch-proving-job.test.ts create mode 100644 yarn-project/prover-node/src/test/index.ts delete mode 100644 yarn-project/pxe/src/kernel_prover/test/test_circuit_prover.ts delete mode 100644 yarn-project/scripts/Earthfile delete mode 100644 yarn-project/scripts/src/benchmarks/aggregate.ts delete mode 100644 yarn-project/scripts/src/benchmarks/markdown.ts delete mode 100644 yarn-project/scripts/src/benchmarks/paths.ts delete mode 100644 yarn-project/scripts/src/bin/bench-aggregate.ts delete mode 100644 yarn-project/scripts/src/bin/bench-comment.ts delete mode 100644 yarn-project/scripts/src/bin/bench-markdown.ts delete mode 100644 yarn-project/sequencer-client/src/publisher/utils.ts create mode 100644 yarn-project/sequencer-client/src/sequencer/timetable.test.ts create mode 100644 yarn-project/sequencer-client/src/sequencer/timetable.ts create mode 100644 yarn-project/sequencer-client/src/test/index.ts rename yarn-project/sequencer-client/src/{publisher => test}/test-l1-publisher.ts (92%) create mode 100644 yarn-project/sequencer-client/src/tx_validator/archive_cache.test.ts create mode 100644 yarn-project/sequencer-client/src/tx_validator/archive_cache.ts create mode 100644 yarn-project/simulator/src/common.ts create mode 100644 yarn-project/simulator/src/common/hashed_values_cache.ts create mode 100644 yarn-project/simulator/src/common/message_load_oracle_inputs.ts delete mode 100644 yarn-project/simulator/src/common/packed_values_cache.ts create mode 100644 yarn-project/simulator/src/common/simulation_provider.ts delete mode 100644 yarn-project/simulator/src/providers/simulation_provider.ts rename yarn-project/simulator/src/{index.ts => server.ts} (71%) create mode 100644 yarn-project/telemetry-client/src/bench.ts create mode 100644 yarn-project/telemetry-client/src/event_loop_monitor.ts create mode 100644 yarn-project/world-state/src/native/world_state_ops_queue.ts create mode 100644 yarn.lock diff --git a/.github/ensure-builder/install b/.github/ensure-builder/install index 336b20d68d0..a6b53973ba1 100755 --- a/.github/ensure-builder/install +++ b/.github/ensure-builder/install @@ -38,4 +38,4 @@ export -f install_parallel if ! command -v parallel >/dev/null; then DENOISE=1 ci3/denoise ci3/retry install_parallel fi -[ -x /usr/local/bin/earthly ] || ci3/dump_fail ci3/earthly_install \ No newline at end of file +[ -x /usr/local/bin/earthly ] || ci3/dump_fail ci3/earthly_install diff --git a/.github/ensure-builder/run b/.github/ensure-builder/run index fe1b3ff8d0b..1284fc0dd33 100755 --- a/.github/ensure-builder/run +++ b/.github/ensure-builder/run @@ -31,4 +31,4 @@ fi echo "exit_code=$exit_code" >> $GITHUB_OUTPUT if [ $exit_code = 155 ]; then echo "Spot eviction detected - retrying with on-demand." -fi \ No newline at end of file +fi diff --git a/.github/ensure-tester/action.yml b/.github/ensure-tester/action.yml index d96e117e3c0..47dc913627e 100644 --- a/.github/ensure-tester/action.yml +++ b/.github/ensure-tester/action.yml @@ -18,6 +18,7 @@ inputs: default: BestEffort runs: # define an action, runs in OS of caller + # ami-052a1e16394277fdf is an ubuntu 22.04.4 jammy using: composite steps: - name: Select Instance Type and AMI diff --git a/.github/ensure-tester/run b/.github/ensure-tester/run index 0bf096e1517..947e799872d 100755 --- a/.github/ensure-tester/run +++ b/.github/ensure-tester/run @@ -17,6 +17,12 @@ scripts/run_on_tester " } export RUN_ID GIT_COMMIT export -f clone + + # update fs limits for k8s + sudo sysctl -w fs.inotify.max_user_watches=65536 + sudo sysctl -w fs.inotify.max_user_instances=65536 + ulimit -n 32768 + flock /var/lock/clone.lock bash -c clone cd ~/run-$RUN_ID # reuse script from ensure-builder, but don't set up chron diff --git a/.github/workflows/ci-arm.yml b/.github/workflows/ci-arm.yml index d763bfbf395..77b4c150bdf 100644 --- a/.github/workflows/ci-arm.yml +++ b/.github/workflows/ci-arm.yml @@ -85,9 +85,8 @@ jobs: ./bootstrap.sh image-e2e - name: "Test" timeout-minutes: 40 - continue-on-error: true run: | - ./bootstrap.sh e2e-test uniswap_trade_on_l1_from_l2 + ./bootstrap.sh test-e2e uniswap_trade_on_l1_from_l2 rerun-check: runs-on: ubuntu-20.04 diff --git a/.github/workflows/ci-mac.yml b/.github/workflows/ci-mac.yml index de82dcba8ce..6f97da53e39 100644 --- a/.github/workflows/ci-mac.yml +++ b/.github/workflows/ci-mac.yml @@ -1,19 +1,25 @@ name: CI (Mac) + on: push: branches: - master - '*/*mac-build' + pull_request: + types: [synchronize, labeled] jobs: build-mac-intel: name: Build on Mac x86_64-apple-darwin + # Run this job if it's a direct push OR if a PR is labeled with "macos-ci". + if: > + github.event_name == 'push' || + (github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'macos-ci')) runs-on: macos-13 steps: - name: Checkout uses: actions/checkout@v3 - with: - ref: ${{ inputs.tag || env.GITHUB_REF }} - name: Create Mac Build Environment run: brew install cmake ninja llvm@16 @@ -29,12 +35,15 @@ jobs: build-mac-m1: name: Build on Mac aarch64-apple-darwin + # Run this job if it's a direct push OR if a PR is labeled with "macos-ci". + if: > + github.event_name == 'push' || + (github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'macos-ci')) runs-on: macos-14 steps: - name: Checkout uses: actions/checkout@v3 - with: - ref: ${{ inputs.tag || env.GITHUB_REF }} - name: Create Mac Build Environment run: brew install cmake ninja @@ -48,7 +57,7 @@ jobs: build-check: name: Check builds are successful needs: [build-mac-intel, build-mac-m1] - if: ${{ always() }} + if: always() runs-on: ubuntu-latest steps: - name: Report overall success diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b44fa96c76..0f43050e5d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,6 +91,8 @@ jobs: id: filter with: filters: | + base-images: + - 'build-images/**' noir: - 'noir/noir-repo/**' bb: @@ -127,6 +129,8 @@ jobs: runner_type: builder-x86 username: ${{ needs.configure.outputs.username }} run: | + sudo apt install unzip + curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && unzip awscliv2.zip && sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && rm -rf aws awscliv2.zip echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin ./build-images/bootstrap.sh ci @@ -235,7 +239,7 @@ jobs: ci3/cache_upload_flag "$artifact" fi - # all the benchmarking end-to-end integration tests for aztec (not required to merge) + # All the benchmarking end-to-end integration tests for aztec (not required to merge) bench-e2e: needs: [images-e2e, configure] if: needs.configure.outputs.e2e-all == 'true' || needs.configure.outputs.bench-list != '[]' @@ -256,15 +260,28 @@ jobs: if ci3/test_should_run "$artifact"; then docker pull aztecprotocol/aztec:${{ env.GIT_COMMIT }} docker pull aztecprotocol/end-to-end:${{ env.GIT_COMMIT }} - export FORCE_COLOR=1 - export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" - ./yarn-project/end-to-end/scripts/e2e_test.sh ${{ matrix.test }} - export COMMIT_HASH=${{ env.GIT_COMMIT }} - export PULL_REQUEST=${{ github.event.pull_request.number }} - export BRANCH=${{ github.ref_name }} - scripts/logs/upload_logs_to_s3.sh /usr/var/log + FORCE_COLOR=1 ./yarn-project/end-to-end/scripts/e2e_test.sh ${{ matrix.test }} ci3/cache_upload_flag "$artifact" fi + - name: Inspect data folder + continue-on-error: true + run: tree ./yarn-project/end-to-end/out + - name: Store benchmark result + if: github.ref == 'refs/heads/master' + continue-on-error: true + uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29 + with: + name: "End-to-end Benchmark" + benchmark-data-dir-path: "dev/e2e-bench" + tool: "customSmallerIsBetter" + output-file-path: ./yarn-project/end-to-end/out/bench.json + github-token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} + auto-push: true + alert-threshold: "150%" + comment-on-alert: true + fail-on-alert: false + alert-comment-cc-users: "@philwindle @spalladino" + max-items-in-chart: 50 # Only e2e test that can't run on standard github runner e2e-prover-full: @@ -316,49 +333,6 @@ jobs: ci3/cache_upload_flag acir-bench-$(./barretenberg/acir_tests/bootstrap.sh hash) fi - # TODO(ci3) fix and reinstate - # bench-summary: - # if: needs.configure.outputs.e2e-all == 'true' - # needs: - # - acir-bench - # - bench-e2e - # - configure - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # with: - # fetch-depth: 100 # Downloading base benchmark from master requires access to history - # ref: "${{ github.event.pull_request.head.sha }}" - # - uses: ./.github/ci-setup-action - # - name: "Build and upload bench aggregate file" - # uses: ./.github/ensure-builder - # with: - # runner_type: builder-x86 - # username: ${{ needs.configure.outputs.username }} - # run: scripts/earthly-ci ./yarn-project/scripts/+bench-aggregate - # - name: "Download base benchmark and package into earthly" - # if: github.event_name == 'pull_request' - # uses: ./.github/run-on-builder - # env: - # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # BENCH_FOLDER: "./scripts/logs/tmp/bench" - # PULL_REQUEST: "${{ github.event.pull_request.number }}" - # with: - # run: | - # # Download the base benchmark locally (requires AWS creds and .git history) - # mkdir -p $BENCH_FOLDER - # ./scripts/logs/download_base_benchmark_from_s3.sh - # # Package it into an earthly artifact to read from bench-comment - # scripts/earthly-ci ./scripts/logs+pack-base-benchmark - # - name: "Generate summary comment if pull request" - # if: github.event_name == 'pull_request' - # uses: ./.github/run-on-builder - # env: - # AZTEC_BOT_GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} - # with: - # run: scripts/earthly-ci ./yarn-project/scripts/+bench-comment - # barretenberg (prover) native, AVM (public VM) and Merkle tree (world state) tests # ran on own runner for resource reasons (memory x cpu intensive) bb-native-tests: @@ -405,6 +379,15 @@ jobs: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aztecprotocolci --password-stdin cd yarn-project/end-to-end NAMESPACE=smoke FRESH_INSTALL=true VALUES_FILE=ci-smoke.yaml ./scripts/network_test.sh ./src/spartan/smoke.test.ts + - name: Copy Network Logs + if: always() + run: scripts/copy_from_tester yarn-project/end-to-end/scripts/network-test.log network-test.log || true + - name: Upload Network Logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: kind-network-smoke.log + path: network-test.log kind-network-test: needs: [images-e2e, configure] @@ -414,10 +397,10 @@ jobs: fail-fast: false matrix: config: - - test: reorg.test.ts - values: ci - runner_type: 16core-tester-x86-high-memory - timeout: 60 + # - test: reorg.test.ts + # values: ci + # runner_type: 16core-tester-x86-high-memory + # timeout: 60 - test: 4epochs.test.ts values: ci runner_type: 16core-tester-x86 @@ -514,6 +497,7 @@ jobs: - uses: actions/checkout@v4 with: { ref: "${{ github.event.pull_request.head.sha }}" } - uses: ./.github/ci-setup-action + - name: Build Boxes uses: ./.github/ensure-builder timeout-minutes: 40 @@ -600,7 +584,7 @@ jobs: public-functions-size-report: needs: [ci-rest, configure] - if: github.ref_name == 'master' || needs.configure.outputs.non-docs == 'true' + if: github.ref_name == 'master' || needs.configure.outputs.non-docs == 'true' runs-on: ubuntu-latest permissions: pull-requests: write diff --git a/.github/workflows/devnet-deploy.yml b/.github/workflows/devnet-deploy.yml index 73e70ae5e1a..04a22d5713f 100644 --- a/.github/workflows/devnet-deploy.yml +++ b/.github/workflows/devnet-deploy.yml @@ -111,7 +111,7 @@ jobs: PXE_PORT="$(jq -r .pxe.service.nodePort helm_values.json)" FAUCET_PORT="$(jq -r .faucet.apiServerPort helm_values.json)" - ETHEREUM_PORT="$(jq -r .ethereum.service.port helm_values.json)" + ETHEREUM_PORT="$(jq -r .ethereum.execution.service.port helm_values.json)" L1_CHAIN_ID="$(jq -r .ethereum.chainId helm_values.json)" MNEMONIC="$(jq -r .aztec.l1DeploymentMnemonic helm_values.json)" diff --git a/.noir-sync-commit b/.noir-sync-commit index ba95bd5998e..b64f398c068 100644 --- a/.noir-sync-commit +++ b/.noir-sync-commit @@ -1 +1 @@ -ebc4d2cf2b91658a10393733407f33d50a0faaf1 +9471e28ad6f02bf2fae3782c3db68106b615595f diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 01cabacb75a..24a97324e1f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,7 +1,7 @@ { - ".": "0.69.1", + ".": "0.70.0", "yarn-project/cli": "0.35.1", - "yarn-project/aztec": "0.69.1", - "barretenberg": "0.69.1", - "barretenberg/ts": "0.69.1" + "yarn-project/aztec": "0.70.0", + "barretenberg": "0.70.0", + "barretenberg/ts": "0.70.0" } diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz new file mode 100644 index 0000000000000000000000000000000000000000..3c5726bddda6971f2d267efe200e7ce6a0c0d010 GIT binary patch literal 719 zcmV;=0x$e5` zRK}CGAmugqXJ0SL?ZQ~8y`%|sQb|Q;P)IbvvY=^{HW?9;P>#lsyn`6H(!qpi6`^q6)=N|LA1byaZDr~rIk#PWrZ>zCHvbi_1##? z^y)(y*LCoKuV~PWOR|a&BHriyU&~0Aqt6#e4jyuCk8hUk-si6Wj%_7}Jl!u&7C;oyFg?#e7Y8!_RC8U8*GjBCByWiftCtp4+-bx$zJ~r444K}%n+Y_3u!KOB|ryLH5;~5T^ zBWCEZZo&8n_ys3FgWvv>dH(=kgr;lq9PMV+?vca3!1_(s!*~{0W>S$=Trt000lG BV}1Yt literal 0 HcmV?d00001 diff --git a/CHANGELOG.md b/CHANGELOG.md index b4bc4fb2117..0eab6533c91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,209 @@ # Changelog +## [0.70.0](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.69.1...aztec-packages-v0.70.0) (2025-01-15) + + +### ⚠ BREAKING CHANGES + +* Handle generic fields in `StructDefinition::fields` and move old functionality to `StructDefinition::fields_as_written` (https://github.com/noir-lang/noir/pull/7067) +* disallow calling unconstrained functions outside of `unsafe` blocks and passing unconstrained functions in place of constrained functions (https://github.com/noir-lang/noir/pull/6938) +* Disable mocks in `execute` (https://github.com/noir-lang/noir/pull/6869) +* require trait primitive functions/calls to have their trait in scope (https://github.com/noir-lang/noir/pull/6901) +* Reserve `enum` and `match` keywords (https://github.com/noir-lang/noir/pull/6961) +* require trait method calls (`foo.bar()`) to have the trait in scope (imported) (https://github.com/noir-lang/noir/pull/6895) +* type-check trait default methods (https://github.com/noir-lang/noir/pull/6645) +* update `aes128_encrypt` to return an array (https://github.com/noir-lang/noir/pull/6973) +* turn TypeIsMorePrivateThenItem into an error (https://github.com/noir-lang/noir/pull/6953) +* turn CannotReexportItemWithLessVisibility into an error (https://github.com/noir-lang/noir/pull/6952) + +### Features + +* `--pedantic-solving` flag (https://github.com/noir-lang/noir/pull/6716) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* 7 bit long `note_type_id` ([#10951](https://github.com/AztecProtocol/aztec-packages/issues/10951)) ([6fc5673](https://github.com/AztecProtocol/aztec-packages/commit/6fc56734cbacd743afec9b8e9f37eefb59e31430)) +* Allow associated types to be ellided from trait constraints (https://github.com/noir-lang/noir/pull/7026) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Allow concurrent world state access ([#11216](https://github.com/AztecProtocol/aztec-packages/issues/11216)) ([17aa4b4](https://github.com/AztecProtocol/aztec-packages/commit/17aa4b4cf2164d29d24d4da29d4b55d273802747)) +* Auto-import traits when suggesting trait methods (https://github.com/noir-lang/noir/pull/7037) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* **avm2:** Avm redesign init ([#10906](https://github.com/AztecProtocol/aztec-packages/issues/10906)) ([231f017](https://github.com/AztecProtocol/aztec-packages/commit/231f017d14c3d261b28ab19dcbdf368c561d0cc7)) +* Avoid generating a new witness when checking if linear expression is zero (https://github.com/noir-lang/noir/pull/7031) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Avoid inserting `inc_rc` instructions into ACIR (https://github.com/noir-lang/noir/pull/7036) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Blob sink in sandbox without extra process ([#11032](https://github.com/AztecProtocol/aztec-packages/issues/11032)) ([4600f54](https://github.com/AztecProtocol/aztec-packages/commit/4600f540e519e1b80b4e780491be29707ccf9f40)) +* Browser chunking ([#11102](https://github.com/AztecProtocol/aztec-packages/issues/11102)) ([393e843](https://github.com/AztecProtocol/aztec-packages/commit/393e8438b082db7d45a45c78e0bf39719b11c56b)) +* Build blocks using txs with higher fee first ([#11093](https://github.com/AztecProtocol/aztec-packages/issues/11093)) ([def7cd7](https://github.com/AztecProtocol/aztec-packages/commit/def7cd7762f45b19c9c94bf7aa42a9c50c46c8fa)), closes [#11084](https://github.com/AztecProtocol/aztec-packages/issues/11084) +* **cli:** Add CLI option to filter by contract function name (https://github.com/noir-lang/noir/pull/7018) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* **comptime:** Implement to_be_bits and to_le_bits in the interpreter (https://github.com/noir-lang/noir/pull/7008) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Contract class must be registered before deployment ([#10949](https://github.com/AztecProtocol/aztec-packages/issues/10949)) ([7176a70](https://github.com/AztecProtocol/aztec-packages/commit/7176a70de718e2d061d4a86065a6ccb006a54684)) +* Dashboard in gcp ([#11201](https://github.com/AztecProtocol/aztec-packages/issues/11201)) ([2790bd7](https://github.com/AztecProtocol/aztec-packages/commit/2790bd7382195706d569207a2a48ffe2053cb3ea)) +* Disable mocks in `execute` (https://github.com/noir-lang/noir/pull/6869) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Disallow calling unconstrained functions outside of `unsafe` blocks and passing unconstrained functions in place of constrained functions (https://github.com/noir-lang/noir/pull/6938) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Don't report warnings for dependencies (https://github.com/noir-lang/noir/pull/6926) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Don't simplify SSA instructions when creating them from a string (https://github.com/noir-lang/noir/pull/6948) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Expose getL2ToL1Membership on the pxe ([#11215](https://github.com/AztecProtocol/aztec-packages/issues/11215)) ([ffd3625](https://github.com/AztecProtocol/aztec-packages/commit/ffd36258b1c5bc8e0823410b19b1774aa58496a1)) +* Handle generic fields in `StructDefinition::fields` and move old functionality to `StructDefinition::fields_as_written` (https://github.com/noir-lang/noir/pull/7067) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Impl Default for U128 (https://github.com/noir-lang/noir/pull/6984) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Inject protocol nullifier conditionally ([#11155](https://github.com/AztecProtocol/aztec-packages/issues/11155)) ([93ade26](https://github.com/AztecProtocol/aztec-packages/commit/93ade26408ace2ddd0d9dfe6ce7100e76c775cc0)) +* Kickoff tube circuits at the beginning of proving job ([#11139](https://github.com/AztecProtocol/aztec-packages/issues/11139)) ([85d389f](https://github.com/AztecProtocol/aztec-packages/commit/85d389fd8344f2a6cba04ab8d8bd577b9698a0ca)), closes [#10998](https://github.com/AztecProtocol/aztec-packages/issues/10998) +* Lock on Nargo.toml on several nargo commands (https://github.com/noir-lang/noir/pull/6941) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* **LSP:** Code action to import trait in a method call (https://github.com/noir-lang/noir/pull/7066) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* **lsp:** Use trait method docs for trait impl method docs on hover (https://github.com/noir-lang/noir/pull/7003) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Monitor event loop lag ([#11127](https://github.com/AztecProtocol/aztec-packages/issues/11127)) ([422f125](https://github.com/AztecProtocol/aztec-packages/commit/422f125f086c67850cb944ead969409c79ae3a6d)) +* Permutation argument optimizations ([#10960](https://github.com/AztecProtocol/aztec-packages/issues/10960)) ([de99603](https://github.com/AztecProtocol/aztec-packages/commit/de9960345da17e97464d2c36c35e3eada4fa3680)) +* PXE db contract store ([#10867](https://github.com/AztecProtocol/aztec-packages/issues/10867)) ([b5d51eb](https://github.com/AztecProtocol/aztec-packages/commit/b5d51ebe8c1c9b0f4104f8f04995018bea2b701a)) +* Require trait function calls (`Foo::bar()`) to have the trait in scope (imported) (https://github.com/noir-lang/noir/pull/6882) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Require trait method calls (`foo.bar()`) to have the trait in scope (imported) (https://github.com/noir-lang/noir/pull/6895) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Require trait primitive functions/calls to have their trait in scope (https://github.com/noir-lang/noir/pull/6901) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Simulator split ([#11144](https://github.com/AztecProtocol/aztec-packages/issues/11144)) ([9b99126](https://github.com/AztecProtocol/aztec-packages/commit/9b99126bb97b1beb1d922a3c404aecdaed0bee69)) +* Single tx block root rollup ([#11096](https://github.com/AztecProtocol/aztec-packages/issues/11096)) ([bcc0168](https://github.com/AztecProtocol/aztec-packages/commit/bcc01681ed8b1c3ee567258589e776e031fb1884)) +* Skip codegen of zero iteration loops (https://github.com/noir-lang/noir/pull/7030) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* SSA globals in monomorphization and SSA gen (https://github.com/noir-lang/noir/pull/6985) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* **ssa:** Immediately simplify away RefCount instructions in ACIR functions (https://github.com/noir-lang/noir/pull/6893) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* **test:** Enable the test fuzzer for Wasm (https://github.com/noir-lang/noir/pull/6835) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Track nodejs runtime metrics ([#11160](https://github.com/AztecProtocol/aztec-packages/issues/11160)) ([1d24fab](https://github.com/AztecProtocol/aztec-packages/commit/1d24fab7152b827e91738ff87fb9aef9398c589a)) +* Turn CannotReexportItemWithLessVisibility into an error (https://github.com/noir-lang/noir/pull/6952) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Turn TypeIsMorePrivateThenItem into an error (https://github.com/noir-lang/noir/pull/6953) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Type-check trait default methods (https://github.com/noir-lang/noir/pull/6645) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Unchecked math operations in SSA (https://github.com/noir-lang/noir/pull/7011) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Update `aes128_encrypt` to return an array (https://github.com/noir-lang/noir/pull/6973) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Use tail public inputs as transaction hash ([#11100](https://github.com/AztecProtocol/aztec-packages/issues/11100)) ([34be2c3](https://github.com/AztecProtocol/aztec-packages/commit/34be2c3800c2d99c11fe3448e01c77abf60c726d)) +* Validator deadline for reexecution ([#11050](https://github.com/AztecProtocol/aztec-packages/issues/11050)) ([1aa34e7](https://github.com/AztecProtocol/aztec-packages/commit/1aa34e78f4f40a47f587feecb338d3c2ba108c1d)), closes [#10959](https://github.com/AztecProtocol/aztec-packages/issues/10959) + + +### Bug Fixes + +* Added start/stop guards to running promise and serial queue ([#11120](https://github.com/AztecProtocol/aztec-packages/issues/11120)) ([23e642f](https://github.com/AztecProtocol/aztec-packages/commit/23e642f85009a3a4779bc762cf36484771014b57)) +* Allow multiple trait impls for the same trait as long as one is in scope (https://github.com/noir-lang/noir/pull/6987) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* **avm:** AVM circuit fixes related calldata, returndata and call_ptr ([#11207](https://github.com/AztecProtocol/aztec-packages/issues/11207)) ([2f05dc0](https://github.com/AztecProtocol/aztec-packages/commit/2f05dc02fe7b147c7cd6fc235134279dbf332c08)) +* **avm:** Mac build ([#11195](https://github.com/AztecProtocol/aztec-packages/issues/11195)) ([c4f4452](https://github.com/AztecProtocol/aztec-packages/commit/c4f44520a8cc234219f7e9e021b0574a894aa06e)) +* **avm:** Mac build (retry) ([#11197](https://github.com/AztecProtocol/aztec-packages/issues/11197)) ([0a4b763](https://github.com/AztecProtocol/aztec-packages/commit/0a4b763a39fde0f37ac5baa3bd1e3052c01ca946)) +* Aztec-spartan config var ([#11137](https://github.com/AztecProtocol/aztec-packages/issues/11137)) ([acbfad4](https://github.com/AztecProtocol/aztec-packages/commit/acbfad463c2cf8140c7fc6f4272f3b8f3c81f297)) +* Blob fees & l1-publisher logging ([#11029](https://github.com/AztecProtocol/aztec-packages/issues/11029)) ([c2c0bc6](https://github.com/AztecProtocol/aztec-packages/commit/c2c0bc697312fe4f63337d66b7419b662d9f55ee)) +* **bootstrap:** Don't download bad cache if unstaged changes ([#11198](https://github.com/AztecProtocol/aztec-packages/issues/11198)) ([2bd895b](https://github.com/AztecProtocol/aztec-packages/commit/2bd895bb0887fddc45433224b3ebef04660f744c)) +* **boxes:** Fix attempt 2 ([#11175](https://github.com/AztecProtocol/aztec-packages/issues/11175)) ([e87b11a](https://github.com/AztecProtocol/aztec-packages/commit/e87b11ac388ef72524e248804902e56b66da061b)) +* Bump inotify limits on tester ([#11217](https://github.com/AztecProtocol/aztec-packages/issues/11217)) ([60bdf1d](https://github.com/AztecProtocol/aztec-packages/commit/60bdf1da7460303f9a478f83c0f6754e0985118a)) +* Do not emit range check for multiplication by bool (https://github.com/noir-lang/noir/pull/6983) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Do not panic on indices which are not valid `u32`s (https://github.com/noir-lang/noir/pull/6976) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Docs rebuild patterns ([#11191](https://github.com/AztecProtocol/aztec-packages/issues/11191)) ([1999990](https://github.com/AztecProtocol/aztec-packages/commit/1999990417dfaa7a877d8e91f15299defbfa09d2)) +* Don't always select trait impl when verifying trait constraints (https://github.com/noir-lang/noir/pull/7041) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Don't fail parsing macro if there are parser warnings (https://github.com/noir-lang/noir/pull/6969) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Don't retransmit txs upon node restart ([#11123](https://github.com/AztecProtocol/aztec-packages/issues/11123)) ([39535c9](https://github.com/AztecProtocol/aztec-packages/commit/39535c97c6ee70f53709ab03a5b36b256c024048)) +* Duplicate env vars ([#11166](https://github.com/AztecProtocol/aztec-packages/issues/11166)) ([2507b6f](https://github.com/AztecProtocol/aztec-packages/commit/2507b6fd1e1c79e7f27a2d3c357155670634aad5)) +* Error on missing function parameters (https://github.com/noir-lang/noir/pull/6967) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Foundry image doesn't have curl ([#11242](https://github.com/AztecProtocol/aztec-packages/issues/11242)) ([57da116](https://github.com/AztecProtocol/aztec-packages/commit/57da116a11f238c180983196cc59b309a44da8c4)) +* Get_next_power_exponent off by 1 ([#11169](https://github.com/AztecProtocol/aztec-packages/issues/11169)) ([80ec19e](https://github.com/AztecProtocol/aztec-packages/commit/80ec19e35017b44f9b2a5267aeb19b7aca38e57e)) +* Let static_assert fail with the provided message (https://github.com/noir-lang/noir/pull/7005) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* **lsp:** Suggest all possible trait methods, but only visible ones (https://github.com/noir-lang/noir/pull/7027) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Max_note_len computation ([#10438](https://github.com/AztecProtocol/aztec-packages/issues/10438)) ([099c17b](https://github.com/AztecProtocol/aztec-packages/commit/099c17b0c83ef5c0b4368ce2167d3d5422fa0c6e)) +* **nargo_fmt:** Don't consider identifiers the same if they are equal… (https://github.com/noir-lang/noir/pull/7043) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* **nargo_fmt:** Let doc comment could come after regular comment (https://github.com/noir-lang/noir/pull/7046) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Non-determinism from under constrained checks (https://github.com/noir-lang/noir/pull/6945) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Prover node aborts execution at epoch end ([#11111](https://github.com/AztecProtocol/aztec-packages/issues/11111)) ([2a77616](https://github.com/AztecProtocol/aztec-packages/commit/2a77616d6ef34d64fc8df2629d90d0677c86fe2f)), closes [#10802](https://github.com/AztecProtocol/aztec-packages/issues/10802) +* Prover node does not err upon an empty epoch ([#11204](https://github.com/AztecProtocol/aztec-packages/issues/11204)) ([2c3ab84](https://github.com/AztecProtocol/aztec-packages/commit/2c3ab8480583fa1d7df07e985a1495e1db50e1db)) +* Reduce memory usage in mem2reg (https://github.com/noir-lang/noir/pull/7053) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Remove arch tag in sandbox images ([#11233](https://github.com/AztecProtocol/aztec-packages/issues/11233)) ([80a872d](https://github.com/AztecProtocol/aztec-packages/commit/80a872df68b0594d6dab442edcbf963a7c257152)) +* Remove max lookup table size constant (for now) ([#11095](https://github.com/AztecProtocol/aztec-packages/issues/11095)) ([7e9e268](https://github.com/AztecProtocol/aztec-packages/commit/7e9e2681e314145237f95f79ffdc95ad25a0e319)) +* Reproduce and fix bytecode blowup (https://github.com/noir-lang/noir/pull/6972) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Require generic trait impls to be in scope to call them (https://github.com/noir-lang/noir/pull/6913) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Restore upload_logs script in use by acir bench ([2d88497](https://github.com/AztecProtocol/aztec-packages/commit/2d884974e0b7fb13b525c06b7781bb5838537637)) +* Return trait impl method as FuncId if there's only one (https://github.com/noir-lang/noir/pull/6989) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Revert "chore: use L1 Tx Utils" ([#11167](https://github.com/AztecProtocol/aztec-packages/issues/11167)) ([f4e5c79](https://github.com/AztecProtocol/aztec-packages/commit/f4e5c7998c7915923a33e2b26146eebc61775b14)) +* Sequencer times out L1 tx at end of L2 slot ([#11112](https://github.com/AztecProtocol/aztec-packages/issues/11112)) ([1b88a34](https://github.com/AztecProtocol/aztec-packages/commit/1b88a3446e775a738dee9ea1c442b734cad0dffd)) +* Show output of `test_program_is_idempotent` on failure (https://github.com/noir-lang/noir/pull/6942) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Start RC at 1 again (https://github.com/noir-lang/noir/pull/6958) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Underconstrained bug ([#11174](https://github.com/AztecProtocol/aztec-packages/issues/11174)) ([0b3088b](https://github.com/AztecProtocol/aztec-packages/commit/0b3088be1944903410992ccfc462869fde026b93)) +* Update fs max user instances for k8s ([#11220](https://github.com/AztecProtocol/aztec-packages/issues/11220)) ([b42da6d](https://github.com/AztecProtocol/aztec-packages/commit/b42da6daa0d715afb4259ac7c0a1d6a71adca89d)) +* Use absolute path for docker bind in e2e-test ([f2885ec](https://github.com/AztecProtocol/aztec-packages/commit/f2885ec188a6e74afb18e44b8f66c331ab42e108)) +* Wrong module to lookup trait when using crate or super (https://github.com/noir-lang/noir/pull/6974) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) + + +### Miscellaneous + +* Add `noir_check_shuffle` as a critical library (https://github.com/noir-lang/noir/pull/7056) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Add cli option to specify withdrawer address in the add-l1-validator … ([#11199](https://github.com/AztecProtocol/aztec-packages/issues/11199)) ([107f175](https://github.com/AztecProtocol/aztec-packages/commit/107f1754c7fc33cda1c3afb820b3b099745882ed)) +* Add end step for formatting workflow (https://github.com/noir-lang/noir/pull/7070) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Add memsuspend to parallel in bootstrap ([#11040](https://github.com/AztecProtocol/aztec-packages/issues/11040)) ([c78cb82](https://github.com/AztecProtocol/aztec-packages/commit/c78cb82a5ec751437794c34dcfddcd2025e4e3b7)) +* Add more Field use info (https://github.com/noir-lang/noir/pull/7019) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Add more protocol circuits to reports (https://github.com/noir-lang/noir/pull/6977) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Add reproduction case for bignum test failure (https://github.com/noir-lang/noir/pull/6464) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Add short circuit in ssa-gen for known if conditions (https://github.com/noir-lang/noir/pull/7007) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Also print test output to stdout in CI (https://github.com/noir-lang/noir/pull/6930) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* **avm:** Fix mac build ([#11147](https://github.com/AztecProtocol/aztec-packages/issues/11147)) ([1775e53](https://github.com/AztecProtocol/aztec-packages/commit/1775e53025f9946ba26b8b624a0f15f4ccdabd2f)) +* **avm:** Improve column stats ([#11135](https://github.com/AztecProtocol/aztec-packages/issues/11135)) ([535a14c](https://github.com/AztecProtocol/aztec-packages/commit/535a14c8c59399ce7579c69f6aec862f71981699)) +* **avm:** Re-enable bb-prover tests in CI, change some to check-circuit-only, enable multi-enqueued call tests ([#11180](https://github.com/AztecProtocol/aztec-packages/issues/11180)) ([3092212](https://github.com/AztecProtocol/aztec-packages/commit/3092212d61cb1359d10b1741b48627518e5437d7)) +* **avm:** Vm2 followup cleanup ([#11186](https://github.com/AztecProtocol/aztec-packages/issues/11186)) ([6de4013](https://github.com/AztecProtocol/aztec-packages/commit/6de4013c1204b3478b6d444c0cff5ca9c5c6cd03)) +* Block building benchmark via github-action-benchmark ([#11202](https://github.com/AztecProtocol/aztec-packages/issues/11202)) ([c107b6b](https://github.com/AztecProtocol/aztec-packages/commit/c107b6bb84f68d4d9bf8dca604f86fbdc7a8e88c)), closes [#11154](https://github.com/AztecProtocol/aztec-packages/issues/11154) +* Bump `noir-gates-diff` (https://github.com/noir-lang/noir/pull/6943) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Bump `noir-gates-diff` (https://github.com/noir-lang/noir/pull/6944) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Bump `noir-gates-diff` (https://github.com/noir-lang/noir/pull/6949) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Bump arkworks to version `0.5.0` (https://github.com/noir-lang/noir/pull/6871) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Change default loglevel for sandbox ([#11237](https://github.com/AztecProtocol/aztec-packages/issues/11237)) ([4712870](https://github.com/AztecProtocol/aztec-packages/commit/4712870d53788f63b89550981b6cdd960178b706)) +* **ci:** Check various inliner aggressiveness setttings in Brillig reports (https://github.com/noir-lang/noir/pull/7049) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* **ci:** Easier to use mac ci ([#11194](https://github.com/AztecProtocol/aztec-packages/issues/11194)) ([9ab4cee](https://github.com/AztecProtocol/aztec-packages/commit/9ab4ceeb8dce38c52609623566b9ea424b99825a)) +* **ci:** Ensure that prover.toml files in protocol circuits are in sync ([#11141](https://github.com/AztecProtocol/aztec-packages/issues/11141)) ([db769bd](https://github.com/AztecProtocol/aztec-packages/commit/db769bd54a1bfb21bc9aeebb5d2baed52599df8e)) +* **ci:** Fail properly in `external-repo-checks` (https://github.com/noir-lang/noir/pull/6988) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* **ci:** Try fix boxes-test ([#11162](https://github.com/AztecProtocol/aztec-packages/issues/11162)) ([a66349f](https://github.com/AztecProtocol/aztec-packages/commit/a66349fa2b60fb397008cd7e0571cc3a3e5fae02)) +* **ci:** Unify compilation/execution report jobs that take averages with single runs (https://github.com/noir-lang/noir/pull/7048) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Clarity fix in docs (https://github.com/noir-lang/noir/pull/7016) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Clippy warning fix (https://github.com/noir-lang/noir/pull/7051) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Delete a bunch of dead code from `noirc_evaluator` (https://github.com/noir-lang/noir/pull/6939) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Delete docs for versions which aren't used (https://github.com/noir-lang/noir/pull/7020) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Disable reorg test ([#11176](https://github.com/AztecProtocol/aztec-packages/issues/11176)) ([78bec44](https://github.com/AztecProtocol/aztec-packages/commit/78bec44912790ea8fe35383ea2f29983e36e4557)) +* Disallow inserting ACIR-only instructions into brillig functions (https://github.com/noir-lang/noir/pull/7017) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* **docs:** Backport 1.0.0-beta.0 doc fixes (https://github.com/noir-lang/noir/pull/7014) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* **docs:** Edit Aztec.nr Guide section ([#10866](https://github.com/AztecProtocol/aztec-packages/issues/10866)) ([4051ba8](https://github.com/AztecProtocol/aztec-packages/commit/4051ba8f4710fa6fee8f10d42a1deee917525ac9)) +* **docs:** Remove node pages ([#11161](https://github.com/AztecProtocol/aztec-packages/issues/11161)) ([e494f6b](https://github.com/AztecProtocol/aztec-packages/commit/e494f6b4fab122c436f1e8b1f4b60a038f201e33)) +* **docs:** Update tx concepts page ([#10947](https://github.com/AztecProtocol/aztec-packages/issues/10947)) ([d9d9798](https://github.com/AztecProtocol/aztec-packages/commit/d9d9798f90cce34ff03cc89d8aa18bb9db0414f1)) +* Document aztec-nargo in readme ([#11173](https://github.com/AztecProtocol/aztec-packages/issues/11173)) ([927eabf](https://github.com/AztecProtocol/aztec-packages/commit/927eabffed26ca5d243a6c389d62ff28e91c6d1a)) +* Greater stability at 1TPS ([#10981](https://github.com/AztecProtocol/aztec-packages/issues/10981)) ([1c23662](https://github.com/AztecProtocol/aztec-packages/commit/1c23662f1bbf132680540fbb61afb49b6ead91f5)) +* Jest reporters for CI ([#11125](https://github.com/AztecProtocol/aztec-packages/issues/11125)) ([90cd9d2](https://github.com/AztecProtocol/aztec-packages/commit/90cd9d22b5da29ef0c989fb9a41f91b9401cc294)) +* Log number of instructions executed for call in AVM. Misc fix. ([#11110](https://github.com/AztecProtocol/aztec-packages/issues/11110)) ([44e01f4](https://github.com/AztecProtocol/aztec-packages/commit/44e01f4cdd6515990a7233fcb79fc2c01baf46d5)) +* Mark `aztec-nr` as expected to compile (https://github.com/noir-lang/noir/pull/7015) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Mark casts as able to be deduplicated (https://github.com/noir-lang/noir/pull/6996) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Mark some critical libraries as good again (https://github.com/noir-lang/noir/pull/7065) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Missed test account retrieval simplification in one spot ([#11172](https://github.com/AztecProtocol/aztec-packages/issues/11172)) ([b72234e](https://github.com/AztecProtocol/aztec-packages/commit/b72234ed0db0652f14044eec5e2899adc5bb7001)) +* Move comment as part of [#6945](https://github.com/AztecProtocol/aztec-packages/issues/6945) (https://github.com/noir-lang/noir/pull/6959) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Move witness computation into class plus some other cleanup ([#11140](https://github.com/AztecProtocol/aztec-packages/issues/11140)) ([d41e9ab](https://github.com/AztecProtocol/aztec-packages/commit/d41e9abc8c2428be224400ec43f4844adfd954c3)) +* Nuke unused `getSiblingPath` oracle ([#11090](https://github.com/AztecProtocol/aztec-packages/issues/11090)) ([36b640a](https://github.com/AztecProtocol/aztec-packages/commit/36b640aed54fd4da0f9899300bf7b0d05faf5b8d)) +* Nuking mental model of "packing into a hash" ([#11200](https://github.com/AztecProtocol/aztec-packages/issues/11200)) ([e1ebcc0](https://github.com/AztecProtocol/aztec-packages/commit/e1ebcc0b7c0ee2822ff7c203f58c0545647778cc)) +* Only resolved globals monomorphization (https://github.com/noir-lang/noir/pull/7006) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* **perf:** Try using vec-collections's VecSet in AliasSet (https://github.com/noir-lang/noir/pull/7058) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Prover db config ([#11126](https://github.com/AztecProtocol/aztec-packages/issues/11126)) ([9d49393](https://github.com/AztecProtocol/aztec-packages/commit/9d49393e66eb38054e0ecf8202aab05919b1bfd4)), closes [#10267](https://github.com/AztecProtocol/aztec-packages/issues/10267) +* Redo typo PR by longxiangqiao ([#11109](https://github.com/AztecProtocol/aztec-packages/issues/11109)) ([b8ef30e](https://github.com/AztecProtocol/aztec-packages/commit/b8ef30e2a147b5318b70ff2146186dfbae70af42)) +* Reduce number of iterations of `acvm::compiler::compile` (https://github.com/noir-lang/noir/pull/7050) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Reenable reports on rollup root circuits (https://github.com/noir-lang/noir/pull/7061) ([3ed22ed](https://github.com/AztecProtocol/aztec-packages/commit/3ed22edf614df01161844785226c9a705a5d9f0e)) +* Refactor `get_tx_effects_hash_input_helper` ([#11213](https://github.com/AztecProtocol/aztec-packages/issues/11213)) ([5becb99](https://github.com/AztecProtocol/aztec-packages/commit/5becb99dabf9ea75f23cc2b94e96b00f57733175)) +* Refactor Solidity Transcript and improve error handling in sol_honk flow ([#11158](https://github.com/AztecProtocol/aztec-packages/issues/11158)) ([58fdf87](https://github.com/AztecProtocol/aztec-packages/commit/58fdf87560fc2c43255675c83dbc36eb370ca5b0)) +* Remove explicit collector address ([#11227](https://github.com/AztecProtocol/aztec-packages/issues/11227)) ([dfb0db5](https://github.com/AztecProtocol/aztec-packages/commit/dfb0db572868896bea27a13606da2a7e3c10f31e)) +* Remove resolve_is_unconstrained pass (https://github.com/noir-lang/noir/pull/7004) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Removing noir bug workaround ([#10535](https://github.com/AztecProtocol/aztec-packages/issues/10535)) ([8be882f](https://github.com/AztecProtocol/aztec-packages/commit/8be882f3f00a0652abe1a70709eeb9374a768b22)) +* Replace relative paths to noir-protocol-circuits ([d8619fa](https://github.com/AztecProtocol/aztec-packages/commit/d8619faca9b125ce471bd936d9ac297d83754062)) +* Replace relative paths to noir-protocol-circuits ([70cad1c](https://github.com/AztecProtocol/aztec-packages/commit/70cad1c01614d8a5d50e76372fef4ed02c7e5407)) +* Replace relative paths to noir-protocol-circuits ([e962534](https://github.com/AztecProtocol/aztec-packages/commit/e962534d7d3c98941bede6cfd6247ac9446eca4c)) +* Replace relative paths to noir-protocol-circuits ([ba5a589](https://github.com/AztecProtocol/aztec-packages/commit/ba5a589b07639367f80978850871251bde703751)) +* Replace relative paths to noir-protocol-circuits ([b7c3fa2](https://github.com/AztecProtocol/aztec-packages/commit/b7c3fa2627408207b975d0d8b738a54a8fa94e2c)) +* Replace relative paths to noir-protocol-circuits ([32840c6](https://github.com/AztecProtocol/aztec-packages/commit/32840c62235d8aeeea0ce64385fb6885ad9467f4)) +* Require safety doc comment for unsafe instead of `//[@safety](https://github.com/safety)` (https://github.com/noir-lang/noir/pull/6992) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Reserve `enum` and `match` keywords (https://github.com/noir-lang/noir/pull/6961) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Rpc server cleanup & misc fixes ([#11145](https://github.com/AztecProtocol/aztec-packages/issues/11145)) ([8a927eb](https://github.com/AztecProtocol/aztec-packages/commit/8a927ebad0c70eaf2aecebbfe9d32eff0990d6f4)) +* Sanity checking of proving job IDs ([#11134](https://github.com/AztecProtocol/aztec-packages/issues/11134)) ([61c3e95](https://github.com/AztecProtocol/aztec-packages/commit/61c3e95aaa7fc6c6c4583242cf0263f39b29d084)) +* Save kind smoke test logs as artifact ([#11212](https://github.com/AztecProtocol/aztec-packages/issues/11212)) ([1389a5b](https://github.com/AztecProtocol/aztec-packages/commit/1389a5b797fd89397a2c53c2b42299dda75bc53e)) +* Separate unconstrained functions during monomorphization (https://github.com/noir-lang/noir/pull/6894) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* Simplify a couple of enum variants (https://github.com/noir-lang/noir/pull/7025) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Simplify boolean in a mul of a mul (https://github.com/noir-lang/noir/pull/6951) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* SmallSubgroupIPA tests ([#11106](https://github.com/AztecProtocol/aztec-packages/issues/11106)) ([f034e2a](https://github.com/AztecProtocol/aztec-packages/commit/f034e2af6f372e393b63ff19ca6d118d03506e1f)) +* **spartan:** Making the spartan script install jq ([#11231](https://github.com/AztecProtocol/aztec-packages/issues/11231)) ([7e628cc](https://github.com/AztecProtocol/aztec-packages/commit/7e628cc5785ba26683ddd0a3aa20348adfa37cef)) +* Test:e2e defaults to no-docker ([#10966](https://github.com/AztecProtocol/aztec-packages/issues/10966)) ([15e0d71](https://github.com/AztecProtocol/aztec-packages/commit/15e0d71c49161faa2e1bfb152be8af8f6ee65268)) +* Turn on averaging for protocol circuits metrics in CI (https://github.com/noir-lang/noir/pull/6999) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Update aztec-spartan.sh script ([#11228](https://github.com/AztecProtocol/aztec-packages/issues/11228)) ([52b3a87](https://github.com/AztecProtocol/aztec-packages/commit/52b3a873d3b6cc91d46e22b50e5f367c1828c74b)) +* Use DFG in SSA printer (https://github.com/noir-lang/noir/pull/6986) ([9189120](https://github.com/AztecProtocol/aztec-packages/commit/9189120ea510c3bfe824c2e08ba61e7fa5408a97)) +* Use L1 Tx Utils ([#10759](https://github.com/AztecProtocol/aztec-packages/issues/10759)) ([ccf28f5](https://github.com/AztecProtocol/aztec-packages/commit/ccf28f56c408381867a4ac9435c5f0cc46690271)), closes [#10464](https://github.com/AztecProtocol/aztec-packages/issues/10464) +* Use logs for benchmarking (https://github.com/noir-lang/noir/pull/6911) ([3883a0e](https://github.com/AztecProtocol/aztec-packages/commit/3883a0ead074506ccc263d77477affe017d5c29e)) +* VariableMerkleTree readability improvements ([#11165](https://github.com/AztecProtocol/aztec-packages/issues/11165)) ([010d1b0](https://github.com/AztecProtocol/aztec-packages/commit/010d1b0717bae313938de62c9c26df8bef7375b5)) +* Wait for ethereum in each pod ([#11238](https://github.com/AztecProtocol/aztec-packages/issues/11238)) ([9c08e00](https://github.com/AztecProtocol/aztec-packages/commit/9c08e00d0b297d08f923c96533e24c19f48f565b)) + + +### Documentation + +* Enable protocol specs for docs in dev mode ([#11219](https://github.com/AztecProtocol/aztec-packages/issues/11219)) ([10c8afe](https://github.com/AztecProtocol/aztec-packages/commit/10c8afed6ea5fd186e4f14820c4eb259cba85460)) + ## [0.69.1](https://github.com/AztecProtocol/aztec-packages/compare/aztec-packages-v0.69.0...aztec-packages-v0.69.1) (2025-01-08) diff --git a/Dockerfile.boxes b/Dockerfile.boxes index 869395adf01..1949c745dee 100644 --- a/Dockerfile.boxes +++ b/Dockerfile.boxes @@ -1,5 +1,5 @@ -FROM aztecprotocol/ci:2.0 +FROM aztecprotocol/ci:2.2 COPY /usr/src /usr/src WORKDIR /usr/src/boxes RUN ls /usr/src/boxes -RUN /usr/local/share/docker-init.sh &> /dev/null && ./bootstrap.sh test \ No newline at end of file +RUN /usr/local/share/docker-init.sh &> /dev/null && ./bootstrap.sh test diff --git a/Dockerfile.end-to-end b/Dockerfile.end-to-end index 9022084db3b..fa3684649f0 100644 --- a/Dockerfile.end-to-end +++ b/Dockerfile.end-to-end @@ -15,4 +15,4 @@ COPY /usr/src /usr/src COPY /anvil /opt/foundry/bin/anvil WORKDIR /usr/src/yarn-project/end-to-end -ENTRYPOINT ["yarn", "test:e2e-no-docker"] +ENTRYPOINT ["yarn", "test:e2e"] diff --git a/Earthfile b/Earthfile index ca980143f3f..ba5a728c1fb 100644 --- a/Earthfile +++ b/Earthfile @@ -23,6 +23,7 @@ bootstrap-noir-bb: git remote add origin https://github.com/aztecprotocol/aztec-packages >/dev/null 2>&1 && (git fetch --depth 1 origin $EARTHLY_GIT_HASH >/dev/null 2>&1 || (echo "The commit was not pushed, run aborted." && exit 1)) && git reset --hard FETCH_HEAD >/dev/null 2>&1 && + ./build-images/adhoc-installs.sh && DENOISE=1 CI=1 ./noir/bootstrap.sh fast && DENOISE=1 CI=1 ./barretenberg/bootstrap.sh fast && mv $(ls -A) /usr/src' diff --git a/avm-transpiler/Cargo.lock b/avm-transpiler/Cargo.lock index 4997bffb9e3..d8332dbab13 100644 --- a/avm-transpiler/Cargo.lock +++ b/avm-transpiler/Cargo.lock @@ -87,6 +87,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -153,9 +159,9 @@ dependencies = [ [[package]] name = "ark-bn254" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" dependencies = [ "ark-ec", "ark-ff", @@ -164,105 +170,112 @@ dependencies = [ [[package]] name = "ark-ec" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" dependencies = [ + "ahash", "ark-ff", "ark-poly", "ark-serialize", "ark-std", - "derivative", - "hashbrown 0.13.2", + "educe", + "fnv", + "hashbrown 0.15.2", "itertools", + "num-bigint", + "num-integer", "num-traits", "zeroize", ] [[package]] name = "ark-ff" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" dependencies = [ "ark-ff-asm", "ark-ff-macros", "ark-serialize", "ark-std", - "derivative", + "arrayvec", "digest", + "educe", "itertools", "num-bigint", "num-traits", "paste", - "rustc_version", "zeroize", ] [[package]] name = "ark-ff-asm" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] name = "ark-ff-macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" dependencies = [ "num-bigint", "num-traits", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] name = "ark-poly" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" dependencies = [ + "ahash", "ark-ff", "ark-serialize", "ark-std", - "derivative", - "hashbrown 0.13.2", + "educe", + "fnv", + "hashbrown 0.15.2", ] [[package]] name = "ark-serialize" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" dependencies = [ "ark-serialize-derive", "ark-std", + "arrayvec", "digest", "num-bigint", ] [[package]] name = "ark-serialize-derive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] name = "ark-std" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" dependencies = [ "num-traits", "rand", @@ -559,17 +572,6 @@ dependencies = [ "serde", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "digest" version = "0.10.7" @@ -593,6 +595,18 @@ dependencies = [ "signature", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "either" version = "1.13.0" @@ -619,6 +633,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "env_filter" version = "0.1.1" @@ -732,18 +766,18 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", +] [[package]] name = "heck" @@ -835,9 +869,9 @@ version = "1.0.0-beta.1" [[package]] name = "itertools" -version = "0.10.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -1108,15 +1142,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - [[package]] name = "rustversion" version = "1.0.18" @@ -1143,12 +1168,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - [[package]] name = "serde" version = "1.0.204" diff --git a/avm-transpiler/rust-toolchain.toml b/avm-transpiler/rust-toolchain.toml index 77b50d3cfe1..4329c5358c9 100644 --- a/avm-transpiler/rust-toolchain.toml +++ b/avm-transpiler/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.74.1" +channel = "1.75.0" components = ["rust-src"] targets = [] profile = "default" diff --git a/aztec-nargo/README.md b/aztec-nargo/README.md new file mode 100644 index 00000000000..79e3187a375 --- /dev/null +++ b/aztec-nargo/README.md @@ -0,0 +1,12 @@ +## `aztec-nargo` + +The `aztec-nargo` utility is packaged with docker and does the following: +1. If the first argument to `aztec-nargo` is not `compile`, it just forwards args to `nargo` and exits. +1. If the first argument _is_ `compile`, it forwards args to `nargo` with some added options (like `--inliner-aggressiveness 0 --show-artifact-paths`) +3. Extracts all artifacts modified by `nargo` +4. Transpiles each artifact using the `avm-transpiler` +5. Generates verification keys for each artifact using `bb` (`barretenberg`'s binary) + +Example usage: `aztec-nargo compile` + +Note: uses versions of each tool from this repository (`nargo` version is from `../noir`). diff --git a/aztec-up/README.md b/aztec-up/README.md index d3cc08d04fd..26f5e97ae6f 100644 --- a/aztec-up/README.md +++ b/aztec-up/README.md @@ -11,7 +11,7 @@ the user's `PATH` variable in their shell startup script so they can be found. - `aztec` - The infrastructure container. - `aztec-cli` - A command-line tool for interacting with infrastructure. -- `aztec-nargo` - A build of `nargo` from `noir` that is guaranteed to be version-aligned. Provides compiler, lsp and more. +- `aztec-nargo` - A build of `nargo` from `noir` that is guaranteed to be version-aligned. Provides compiler, lsp and more. On `aztec-nargo compile <...>`, automatically transpiles artifacts using `avm-transpiler` and generates verification keys using `bb`. - `aztec-sandbox` - A wrapper around docker-compose that launches services needed for sandbox testing. - `aztec-up` - A tool to upgrade the aztec toolchain to the latest, or specific versions. - `aztec-builder` - A useful tool for projects to generate ABIs and update their dependencies. diff --git a/aztec-up/bin/docker-compose.sandbox.yml b/aztec-up/bin/docker-compose.sandbox.yml index 999aa567685..b40cff1755f 100644 --- a/aztec-up/bin/docker-compose.sandbox.yml +++ b/aztec-up/bin/docker-compose.sandbox.yml @@ -1,6 +1,6 @@ services: ethereum: - image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc-${ARCH_TAG:-amd64} + image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc entrypoint: > sh -c ' if [ -n "$$FORK_BLOCK_NUMBER" ] && [ -n "$$FORK_URL" ]; then @@ -20,7 +20,7 @@ services: ports: - "${PXE_PORT:-8080}:${PXE_PORT:-8080}" environment: - LOG_LEVEL: # Loaded from the user shell if explicitly set + LOG_LEVEL: '${LOG_LEVEL:-info; verbose: simulator:avm:debug_log}' HOST_WORKDIR: "${PWD}" # Loaded from the user shell to show log files absolute path in host ETHEREUM_HOST: ${ETHEREUM_HOST:-http://ethereum}:${ANVIL_PORT:-8545} L1_CHAIN_ID: 31337 diff --git a/barretenberg/.gitrepo b/barretenberg/.gitrepo index 7c20ad8725f..a93a9a4faf5 100644 --- a/barretenberg/.gitrepo +++ b/barretenberg/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/AztecProtocol/barretenberg branch = master - commit = e66e46848abe6b5b192eed7b23a7d2522b5bb096 - parent = cd5a615f154446878cb8681d70b9e55c14511690 + commit = 340beaa9461e86e62e32e19c77e5d16bd18c5fe1 + parent = 2790bd7382195706d569207a2a48ffe2053cb3ea method = merge cmdver = 0.4.6 diff --git a/barretenberg/CHANGELOG.md b/barretenberg/CHANGELOG.md index b8700378ddc..dfe7cb781db 100644 --- a/barretenberg/CHANGELOG.md +++ b/barretenberg/CHANGELOG.md @@ -1,5 +1,37 @@ # Changelog +## [0.70.0](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.69.1...barretenberg-v0.70.0) (2025-01-15) + + +### Features + +* Allow concurrent world state access ([#11216](https://github.com/AztecProtocol/aztec-packages/issues/11216)) ([17aa4b4](https://github.com/AztecProtocol/aztec-packages/commit/17aa4b4cf2164d29d24d4da29d4b55d273802747)) +* **avm2:** Avm redesign init ([#10906](https://github.com/AztecProtocol/aztec-packages/issues/10906)) ([231f017](https://github.com/AztecProtocol/aztec-packages/commit/231f017d14c3d261b28ab19dcbdf368c561d0cc7)) +* Permutation argument optimizations ([#10960](https://github.com/AztecProtocol/aztec-packages/issues/10960)) ([de99603](https://github.com/AztecProtocol/aztec-packages/commit/de9960345da17e97464d2c36c35e3eada4fa3680)) +* Use tail public inputs as transaction hash ([#11100](https://github.com/AztecProtocol/aztec-packages/issues/11100)) ([34be2c3](https://github.com/AztecProtocol/aztec-packages/commit/34be2c3800c2d99c11fe3448e01c77abf60c726d)) + + +### Bug Fixes + +* **avm:** AVM circuit fixes related calldata, returndata and call_ptr ([#11207](https://github.com/AztecProtocol/aztec-packages/issues/11207)) ([2f05dc0](https://github.com/AztecProtocol/aztec-packages/commit/2f05dc02fe7b147c7cd6fc235134279dbf332c08)) +* **avm:** Mac build ([#11195](https://github.com/AztecProtocol/aztec-packages/issues/11195)) ([c4f4452](https://github.com/AztecProtocol/aztec-packages/commit/c4f44520a8cc234219f7e9e021b0574a894aa06e)) +* **avm:** Mac build (retry) ([#11197](https://github.com/AztecProtocol/aztec-packages/issues/11197)) ([0a4b763](https://github.com/AztecProtocol/aztec-packages/commit/0a4b763a39fde0f37ac5baa3bd1e3052c01ca946)) +* **bootstrap:** Don't download bad cache if unstaged changes ([#11198](https://github.com/AztecProtocol/aztec-packages/issues/11198)) ([2bd895b](https://github.com/AztecProtocol/aztec-packages/commit/2bd895bb0887fddc45433224b3ebef04660f744c)) +* Remove max lookup table size constant (for now) ([#11095](https://github.com/AztecProtocol/aztec-packages/issues/11095)) ([7e9e268](https://github.com/AztecProtocol/aztec-packages/commit/7e9e2681e314145237f95f79ffdc95ad25a0e319)) + + +### Miscellaneous + +* **avm:** Fix mac build ([#11147](https://github.com/AztecProtocol/aztec-packages/issues/11147)) ([1775e53](https://github.com/AztecProtocol/aztec-packages/commit/1775e53025f9946ba26b8b624a0f15f4ccdabd2f)) +* **avm:** Improve column stats ([#11135](https://github.com/AztecProtocol/aztec-packages/issues/11135)) ([535a14c](https://github.com/AztecProtocol/aztec-packages/commit/535a14c8c59399ce7579c69f6aec862f71981699)) +* **avm:** Re-enable bb-prover tests in CI, change some to check-circuit-only, enable multi-enqueued call tests ([#11180](https://github.com/AztecProtocol/aztec-packages/issues/11180)) ([3092212](https://github.com/AztecProtocol/aztec-packages/commit/3092212d61cb1359d10b1741b48627518e5437d7)) +* **avm:** Vm2 followup cleanup ([#11186](https://github.com/AztecProtocol/aztec-packages/issues/11186)) ([6de4013](https://github.com/AztecProtocol/aztec-packages/commit/6de4013c1204b3478b6d444c0cff5ca9c5c6cd03)) +* **docs:** Update tx concepts page ([#10947](https://github.com/AztecProtocol/aztec-packages/issues/10947)) ([d9d9798](https://github.com/AztecProtocol/aztec-packages/commit/d9d9798f90cce34ff03cc89d8aa18bb9db0414f1)) +* Move witness computation into class plus some other cleanup ([#11140](https://github.com/AztecProtocol/aztec-packages/issues/11140)) ([d41e9ab](https://github.com/AztecProtocol/aztec-packages/commit/d41e9abc8c2428be224400ec43f4844adfd954c3)) +* Redo typo PR by longxiangqiao ([#11109](https://github.com/AztecProtocol/aztec-packages/issues/11109)) ([b8ef30e](https://github.com/AztecProtocol/aztec-packages/commit/b8ef30e2a147b5318b70ff2146186dfbae70af42)) +* Refactor Solidity Transcript and improve error handling in sol_honk flow ([#11158](https://github.com/AztecProtocol/aztec-packages/issues/11158)) ([58fdf87](https://github.com/AztecProtocol/aztec-packages/commit/58fdf87560fc2c43255675c83dbc36eb370ca5b0)) +* SmallSubgroupIPA tests ([#11106](https://github.com/AztecProtocol/aztec-packages/issues/11106)) ([f034e2a](https://github.com/AztecProtocol/aztec-packages/commit/f034e2af6f372e393b63ff19ca6d118d03506e1f)) + ## [0.69.1](https://github.com/AztecProtocol/aztec-packages/compare/barretenberg-v0.69.0...barretenberg-v0.69.1) (2025-01-08) diff --git a/barretenberg/acir_tests/bootstrap.sh b/barretenberg/acir_tests/bootstrap.sh index ad6ced2c2d1..a8ca58ae1dc 100755 --- a/barretenberg/acir_tests/bootstrap.sh +++ b/barretenberg/acir_tests/bootstrap.sh @@ -21,9 +21,8 @@ function prepare_tests { COMPILE=2 ./run_test.sh assert_statement local bb=$(realpath ../cpp/build/bin/bb) (cd ./acir_tests/assert_statement && \ - $bb write_recursion_inputs_ultra_honk -b ./target/program.json -o ../../../../noir/noir-repo/test_programs/execution_success/verify_honk_proof --recursive && \ - $bb write_recursion_inputs_rollup_honk -b ./target/program.json -o ../../../../noir/noir-repo/test_programs/execution_success/verify_rollup_honk_proof --recursive && \ - cp -R ../../../../noir/noir-repo/test_programs/execution_success/verify_honk_proof .. && cp -R ../../../../noir/noir-repo/test_programs/execution_success/verify_rollup_honk_proof ..) + $bb write_recursion_inputs_ultra_honk -b ./target/program.json -o ../verify_honk_proof --recursive && \ + $bb write_recursion_inputs_rollup_honk -b ./target/program.json -o ../verify_rollup_honk_proof --recursive) # COMPILE=2 only compiles the test. denoise "parallel --joblog joblog.txt --line-buffered 'COMPILE=2 ./run_test.sh \$(basename {})' ::: ./acir_tests/*" @@ -74,7 +73,7 @@ function test { # local jobs=$(($(nproc) / HARDWARE_CONCURRENCY)) local jobs=64 - test_cmds | (cd $root; parallel -j$jobs --tag --line-buffered --joblog joblog.txt) + test_cmds | (cd $root; parallel --memsuspend 64G -j$jobs --tag --line-buffered --joblog joblog.txt) cache_upload_flag barretenberg-acir-tests-$hash github_endgroup diff --git a/barretenberg/acir_tests/sol-test/src/index.js b/barretenberg/acir_tests/sol-test/src/index.js index ca402b06182..e8ceb1dc260 100644 --- a/barretenberg/acir_tests/sol-test/src/index.js +++ b/barretenberg/acir_tests/sol-test/src/index.js @@ -8,6 +8,10 @@ import solc from "solc"; const NUMBER_OF_FIELDS_IN_PLONK_PROOF = 93; const NUMBER_OF_FIELDS_IN_HONK_PROOF = 443; +const WRONG_PUBLIC_INPUTS_LENGTH = "0xfa066593"; +const SUMCHECK_FAILED = "0x9fc3a218"; +const SHPLEMINI_FAILED = "0xa5d82e8a"; + // We use the solcjs compiler version in this test, although it is slower than foundry, to run the test end to end // it simplifies of parallelising the test suite @@ -94,7 +98,7 @@ if (!testingHonk) { } var output = JSON.parse(solc.compile(JSON.stringify(compilationInput))); -if (output.errors.some((e) => e.type == "Error")) { +if (output.errors.some((e) => e.severity == "error")) { throw new Error(JSON.stringify(output.errors, null, 2)); } const contract = output.contracts["Test.sol"]["Test"]; @@ -236,8 +240,20 @@ try { const result = await contract.test(proofStr, publicInputs); if (!result) throw new Error("Test failed"); } catch (e) { - console.error(testName, " failed"); - console.log(e); + console.error(testName, "failed"); + if (testingHonk) { + var errorType = e.data; + switch (errorType) { + case WRONG_PUBLIC_INPUTS_LENGTH: + throw new Error("Number of inputs in the proof is wrong"); + case SUMCHECK_FAILED: + throw new Error("Sumcheck round failed"); + case SHPLEMINI_FAILED: + throw new Error("PCS round failed"); + default: + throw e; + } + } throw e; } finally { // Kill anvil at the end of running diff --git a/barretenberg/cpp/CMakeLists.txt b/barretenberg/cpp/CMakeLists.txt index 3714ce82cab..4655156fdb7 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.69.1 # x-release-please-version + VERSION 0.70.0 # x-release-please-version LANGUAGES CXX C ) # Insert version into `bb` config file diff --git a/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil b/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil index 2fa6f61afe6..1f0b9ee3dd3 100644 --- a/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil +++ b/barretenberg/cpp/pil/avm/gadgets/mem_slice.pil @@ -40,8 +40,10 @@ namespace slice(256); sel_mem_active * (cnt - 1 - cnt') = 0; #[ADDR_INCREMENT] sel_mem_active * (addr + 1 - addr') = 0; - #[COL_OFFSET_INCREMENT] - sel_mem_active * (col_offset + 1 - col_offset') = 0; + + // #[COL_OFFSET_INCREMENT] + // sel_mem_active * (col_offset + 1 - col_offset') = 0; + #[SAME_CLK] sel_mem_active * (clk - clk') = 0; #[SAME_SPACE_ID] diff --git a/barretenberg/cpp/pil/vm2/README.md b/barretenberg/cpp/pil/vm2/README.md new file mode 100644 index 00000000000..4194d164843 --- /dev/null +++ b/barretenberg/cpp/pil/vm2/README.md @@ -0,0 +1,7 @@ +Compile with: + +``` +~/aztec-packages/bb-pilcom/target/release/bb_pil pil/vm2/execution.pil --name Avm2 -y -o src/barretenberg/vm2/generated && ./format.sh changed +``` + +while on the `barretenberg/cpp` directory. diff --git a/barretenberg/cpp/pil/vm2/addressing.pil b/barretenberg/cpp/pil/vm2/addressing.pil new file mode 100644 index 00000000000..de1efa22c0c --- /dev/null +++ b/barretenberg/cpp/pil/vm2/addressing.pil @@ -0,0 +1,21 @@ +// This is a virtual gadget, which is part of the execution trace. +namespace execution; + +pol commit base_address_val; +pol commit base_address_tag; +pol commit sel_addressing_error; // true if any error type +pol commit addressing_error_kind; // TODO: might need to be selectors +pol commit addressing_error_idx; // operand index for error, if any + +// whether each operand is an address for the given opcode. +// retrieved from the instruction spec. +pol commit sel_op1_is_address; +pol commit sel_op2_is_address; +pol commit sel_op3_is_address; +pol commit sel_op4_is_address; +// operands after relative resolution +pol commit op1_after_relative; +pol commit op2_after_relative; +pol commit op3_after_relative; +pol commit op4_after_relative; +// operands after indirect resolution are the resolved_operands rop1, ... diff --git a/barretenberg/cpp/pil/vm2/alu.pil b/barretenberg/cpp/pil/vm2/alu.pil new file mode 100644 index 00000000000..287ee0c9563 --- /dev/null +++ b/barretenberg/cpp/pil/vm2/alu.pil @@ -0,0 +1,16 @@ +namespace alu; + +pol commit sel_op_add; +pol commit ia; +pol commit ib; +pol commit ic; +pol commit op; +pol commit ia_addr; +pol commit ib_addr; +pol commit dst_addr; + +#[SEL_ADD_BINARY] +sel_op_add * (1 - sel_op_add) = 0; + +#[ALU_ADD] +ia + ib = ic; \ No newline at end of file diff --git a/barretenberg/cpp/pil/vm2/execution.pil b/barretenberg/cpp/pil/vm2/execution.pil new file mode 100644 index 00000000000..ecd5d733a14 --- /dev/null +++ b/barretenberg/cpp/pil/vm2/execution.pil @@ -0,0 +1,55 @@ +include "alu.pil"; +include "addressing.pil"; +include "precomputed.pil"; + +namespace execution; + +pol commit sel; // subtrace selector + +pol commit ex_opcode; +pol commit indirect; +// operands +pol commit op1; +pol commit op2; +pol commit op3; +pol commit op4; +// resolved operands +pol commit rop1; +pol commit rop2; +pol commit rop3; +pol commit rop4; + +pol commit pc; +pol commit clk; +pol commit last; + +// Selector constraints +sel * (1 - sel) = 0; +last * (1 - last) = 0; + +// If the current row is an execution row, then either +// the next row is an execution row, or the current row is marked as the last row. +// sel => (sel' v last) = 1 iff +// ¬sel v (sel' v last) = 1 iff +// ¬(¬sel v (sel' v last)) = 0 iff +// sel ^ (¬sel' ^ ¬last) = 0 iff +// sel * (1 - sel') * (1 - last) = 0 +#[TRACE_CONTINUITY_1] +sel * (1 - sel') * (1 - last) = 0; +// If the current row is not an execution row, then there are no more execution rows after that. +// (not enforced for the first row) +#[TRACE_CONTINUITY_2] +(1 - precomputed.first_row) * (1 - sel) * sel' = 0; +// If the current row is the last row, then the next row is not an execution row. +#[LAST_IS_LAST] +last * sel' = 0; + +// These are needed to have a non-empty set of columns for each type. +pol public input; +#[LOOKUP_DUMMY_PRECOMPUTED] +sel {/*will be 1=OR*/ sel, clk, clk, clk} in +precomputed.sel_bitwise {precomputed.bitwise_op_id, precomputed.bitwise_input_a, precomputed.bitwise_input_b, precomputed.bitwise_output}; +#[LOOKUP_DUMMY_DYNAMIC] // Just a self-lookup for now, for testing. +sel {op1, op2, op3, op4} in sel {op1, op2, op3, op4}; +#[PERM_DUMMY_DYNAMIC] // Just a self-permutation for now, for testing. +sel {op1, op2, op3, op4} is sel {op1, op2, op3, op4}; \ No newline at end of file diff --git a/barretenberg/cpp/pil/vm2/precomputed.pil b/barretenberg/cpp/pil/vm2/precomputed.pil new file mode 100644 index 00000000000..d7e0015ebaf --- /dev/null +++ b/barretenberg/cpp/pil/vm2/precomputed.pil @@ -0,0 +1,17 @@ +// General/shared precomputed columns. +namespace precomputed; + +// From 0 and incrementing up to the size of the circuit (2^21). +pol constant clk; + +// 1 only at row 0. +pol constant first_row; + +// AND/OR/XOR of all 8-bit numbers. +// The tables are "stacked". First AND, then OR, then XOR. +// Note: think if we can avoid the selector. +pol constant sel_bitwise; // 1 in the first 3 * 256 rows. +pol constant bitwise_op_id; // identifies if operation is AND/OR/XOR. +pol constant bitwise_input_a; // column of all 8-bit numbers. +pol constant bitwise_input_b; // column of all 8-bit numbers. +pol constant bitwise_output; // output = a AND/OR/XOR b. \ No newline at end of file diff --git a/barretenberg/cpp/src/CMakeLists.txt b/barretenberg/cpp/src/CMakeLists.txt index fd992566082..cd0965babb9 100644 --- a/barretenberg/cpp/src/CMakeLists.txt +++ b/barretenberg/cpp/src/CMakeLists.txt @@ -95,6 +95,7 @@ add_subdirectory(barretenberg/transcript) add_subdirectory(barretenberg/translator_vm) add_subdirectory(barretenberg/ultra_honk) add_subdirectory(barretenberg/vm) +add_subdirectory(barretenberg/vm2) add_subdirectory(barretenberg/wasi) add_subdirectory(barretenberg/world_state) @@ -171,6 +172,7 @@ set(BARRETENBERG_TARGET_OBJECTS if(NOT DISABLE_AZTEC_VM) # enable AVM list(APPEND BARRETENBERG_TARGET_OBJECTS $) + list(APPEND BARRETENBERG_TARGET_OBJECTS $) endif() if(NOT WASM) diff --git a/barretenberg/cpp/src/barretenberg/bb/main.cpp b/barretenberg/cpp/src/barretenberg/bb/main.cpp index cf6f7fefba1..4552e66deb5 100644 --- a/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -3,6 +3,7 @@ #include "barretenberg/bb/file_io.hpp" #include "barretenberg/client_ivc/client_ivc.hpp" #include "barretenberg/common/benchmark.hpp" +#include "barretenberg/common/log.hpp" #include "barretenberg/common/map.hpp" #include "barretenberg/common/serialize.hpp" #include "barretenberg/common/timer.hpp" @@ -13,7 +14,6 @@ #include "barretenberg/dsl/acir_format/proof_surgeon.hpp" #include "barretenberg/dsl/acir_proofs/acir_composer.hpp" #include "barretenberg/dsl/acir_proofs/honk_contract.hpp" -#include "barretenberg/flavor/flavor.hpp" #include "barretenberg/honk/proof_system/types/proof.hpp" #include "barretenberg/numeric/bitop/get_msb.hpp" #include "barretenberg/plonk/proof_system/proving_key/serialize.hpp" @@ -24,15 +24,17 @@ #include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_keccak_flavor.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_rollup_flavor.hpp" -#include "barretenberg/vm/avm/trace/public_inputs.hpp" -#include #ifndef DISABLE_AZTEC_VM #include "barretenberg/vm/avm/generated/flavor.hpp" #include "barretenberg/vm/avm/trace/common.hpp" #include "barretenberg/vm/avm/trace/execution.hpp" +#include "barretenberg/vm/avm/trace/public_inputs.hpp" #include "barretenberg/vm/aztec_constants.hpp" #include "barretenberg/vm/stats.hpp" +#include "barretenberg/vm2/avm_api.hpp" +#include "barretenberg/vm2/common/aztec_types.hpp" +#include "barretenberg/vm2/common/constants.hpp" #endif using namespace bb; @@ -671,6 +673,37 @@ void vk_as_fields(const std::string& vk_path, const std::string& output_path) } #ifndef DISABLE_AZTEC_VM +void print_avm_stats() +{ +#ifdef AVM_TRACK_STATS + info("------- STATS -------"); + const auto& stats = avm_trace::Stats::get(); + const int levels = std::getenv("AVM_STATS_DEPTH") != nullptr ? std::stoi(std::getenv("AVM_STATS_DEPTH")) : 2; + info(stats.to_string(levels)); +#endif +} + +/** + * @brief Performs "check circuit" on the AVM circuit for the given public inputs and hints. + * + * @param public_inputs_path Path to the file containing the serialised avm public inputs + * @param hints_path Path to the file containing the serialised avm circuit hints + */ +void avm_check_circuit(const std::filesystem::path& public_inputs_path, const std::filesystem::path& hints_path) +{ + + const auto avm_public_inputs = AvmPublicInputs::from(read_file(public_inputs_path)); + const auto avm_hints = bb::avm_trace::ExecutionHints::from(read_file(hints_path)); + avm_hints.print_sizes(); + + vinfo("initializing crs with size: ", avm_trace::Execution::SRS_SIZE); + init_bn254_crs(avm_trace::Execution::SRS_SIZE); + + avm_trace::Execution::check_circuit(avm_public_inputs, avm_hints); + + print_avm_stats(); +} + /** * @brief Writes an avm proof and corresponding (incomplete) verification key to files. * @@ -688,18 +721,7 @@ void avm_prove(const std::filesystem::path& public_inputs_path, const auto avm_public_inputs = AvmPublicInputs::from(read_file(public_inputs_path)); const auto avm_hints = bb::avm_trace::ExecutionHints::from(read_file(hints_path)); - - // Using [0] is fine now for the top-level call, but we might need to index by address in future - vinfo("bytecode size: ", avm_hints.all_contract_bytecode[0].bytecode.size()); - vinfo("hints.storage_read_hints size: ", avm_hints.storage_read_hints.size()); - vinfo("hints.storage_write_hints size: ", avm_hints.storage_write_hints.size()); - vinfo("hints.nullifier_read_hints size: ", avm_hints.nullifier_read_hints.size()); - vinfo("hints.nullifier_write_hints size: ", avm_hints.nullifier_write_hints.size()); - vinfo("hints.note_hash_read_hints size: ", avm_hints.note_hash_read_hints.size()); - vinfo("hints.note_hash_write_hints size: ", avm_hints.note_hash_write_hints.size()); - vinfo("hints.l1_to_l2_message_read_hints size: ", avm_hints.l1_to_l2_message_read_hints.size()); - vinfo("hints.contract_instance_hints size: ", avm_hints.contract_instance_hints.size()); - vinfo("hints.contract_bytecode_hints size: ", avm_hints.all_contract_bytecode.size()); + avm_hints.print_sizes(); vinfo("initializing crs with size: ", avm_trace::Execution::SRS_SIZE); init_bn254_crs(avm_trace::Execution::SRS_SIZE); @@ -726,12 +748,34 @@ void avm_prove(const std::filesystem::path& public_inputs_path, write_file(vk_fields_path, { vk_json.begin(), vk_json.end() }); vinfo("vk as fields written to: ", vk_fields_path); -#ifdef AVM_TRACK_STATS - info("------- STATS -------"); - const auto& stats = avm_trace::Stats::get(); - const int levels = std::getenv("AVM_STATS_DEPTH") != nullptr ? std::stoi(std::getenv("AVM_STATS_DEPTH")) : 2; - info(stats.to_string(levels)); -#endif + print_avm_stats(); +} + +void avm2_prove(const std::filesystem::path& inputs_path, const std::filesystem::path& output_path) +{ + avm2::AvmAPI avm; + auto inputs = avm2::AvmAPI::ProvingInputs::from(read_file(inputs_path)); + + // This is bigger than CIRCUIT_SUBGROUP_SIZE because of BB inefficiencies. + init_bn254_crs(avm2::CIRCUIT_SUBGROUP_SIZE * 2); + auto [proof, vk] = avm.prove(inputs); + + // NOTE: As opposed to Avm1 and other proof systems, the public inputs are NOT part of the proof. + write_file(output_path / "proof", to_buffer(proof)); + write_file(output_path / "vk", vk); + + print_avm_stats(); +} + +void avm2_check_circuit(const std::filesystem::path& inputs_path) +{ + avm2::AvmAPI avm; + auto inputs = avm2::AvmAPI::ProvingInputs::from(read_file(inputs_path)); + + bool res = avm.check_circuit(inputs); + info("circuit check: ", res ? "success" : "failure"); + + print_avm_stats(); } /** @@ -783,8 +827,28 @@ bool avm_verify(const std::filesystem::path& proof_path, const std::filesystem:: const bool verified = AVM_TRACK_TIME_V("verify/all", avm_trace::Execution::verify(vk, proof)); vinfo("verified: ", verified); + + print_avm_stats(); return verified; } + +// NOTE: The proof should NOT include the public inputs. +bool avm2_verify(const std::filesystem::path& proof_path, + const std::filesystem::path& public_inputs_path, + const std::filesystem::path& vk_path) +{ + const auto proof = many_from_buffer(read_file(proof_path)); + std::vector vk_bytes = read_file(vk_path); + auto public_inputs = avm2::PublicInputs::from(read_file(public_inputs_path)); + + init_bn254_crs(1); + avm2::AvmAPI avm; + bool res = avm.verify(proof, public_inputs, vk_bytes); + info("verification: ", res ? "success" : "failure"); + + print_avm_stats(); + return res; +} #endif /** @@ -1382,6 +1446,25 @@ int main(int argc, char* argv[]) std::string output_path = get_option(args, "-o", "./target"); write_recursion_inputs_honk(bytecode_path, witness_path, output_path, recursive); #ifndef DISABLE_AZTEC_VM + } else if (command == "avm2_prove") { + std::filesystem::path inputs_path = get_option(args, "--avm-inputs", "./target/avm_inputs.bin"); + // This outputs both files: proof and vk, under the given directory. + std::filesystem::path output_path = get_option(args, "-o", "./proofs"); + avm2_prove(inputs_path, output_path); + } else if (command == "avm2_check_circuit") { + std::filesystem::path inputs_path = get_option(args, "--avm-inputs", "./target/avm_inputs.bin"); + avm2_check_circuit(inputs_path); + } else if (command == "avm2_verify") { + std::filesystem::path public_inputs_path = + get_option(args, "--avm-public-inputs", "./target/avm_public_inputs.bin"); + return avm2_verify(proof_path, public_inputs_path, vk_path) ? 0 : 1; + } else if (command == "avm_check_circuit") { + std::filesystem::path avm_public_inputs_path = + get_option(args, "--avm-public-inputs", "./target/avm_public_inputs.bin"); + std::filesystem::path avm_hints_path = get_option(args, "--avm-hints", "./target/avm_hints.bin"); + extern std::filesystem::path avm_dump_trace_path; + avm_dump_trace_path = get_option(args, "--avm-dump-trace", ""); + avm_check_circuit(avm_public_inputs_path, avm_hints_path); } else if (command == "avm_prove") { std::filesystem::path avm_public_inputs_path = get_option(args, "--avm-public-inputs", "./target/avm_public_inputs.bin"); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/mega_memory_bench/mega_memory.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/mega_memory_bench/mega_memory.bench.cpp index e180ea2963c..c5497d01b97 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/mega_memory_bench/mega_memory.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/mega_memory_bench/mega_memory.bench.cpp @@ -1,3 +1,4 @@ +#include "barretenberg/benchmark/mega_memory_bench/memory_estimator.hpp" #include "barretenberg/stdlib/primitives/field/field.hpp" #include "barretenberg/stdlib/primitives/plookup/plookup.hpp" #include "barretenberg/stdlib_circuit_builders/plookup_tables/fixed_base/fixed_base.hpp" @@ -312,10 +313,10 @@ void fill_trace(State& state, TraceSettings settings) } builder.finalize_circuit(/* ensure_nonzero */ true); - uint64_t builder_estimate = builder.estimate_memory(); + uint64_t builder_estimate = MegaMemoryEstimator::estimate_builder_memory(builder); for (auto _ : state) { DeciderProvingKey proving_key(builder, settings); - uint64_t memory_estimate = proving_key.proving_key.estimate_memory(); + uint64_t memory_estimate = MegaMemoryEstimator::estimate_proving_key_memory(proving_key.proving_key); state.counters["poly_mem_est"] = static_cast(memory_estimate); state.counters["builder_mem_est"] = static_cast(builder_estimate); benchmark::DoNotOptimize(proving_key); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/mega_memory_bench/memory_estimator.hpp b/barretenberg/cpp/src/barretenberg/benchmark/mega_memory_bench/memory_estimator.hpp new file mode 100644 index 00000000000..610ebc9c92b --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/benchmark/mega_memory_bench/memory_estimator.hpp @@ -0,0 +1,77 @@ +#pragma once + +#include "barretenberg/stdlib_circuit_builders/mega_flavor.hpp" +#include + +namespace bb { + +/** + * @brief Methods for estimating memory in key components of MegaHonk + * + */ +class MegaMemoryEstimator { + using FF = MegaFlavor::FF; + + public: + static uint64_t estimate_proving_key_memory(MegaFlavor::ProvingKey& proving_key) + { + vinfo("++Estimating proving key memory++"); + + auto& polynomials = proving_key.polynomials; + + for (auto [polynomial, label] : zip_view(polynomials.get_all(), polynomials.get_labels())) { + uint64_t size = polynomial.size(); + vinfo(label, " num: ", size, " size: ", (size * sizeof(FF)) >> 10, " KiB"); + } + + uint64_t result(0); + for (auto& polynomial : polynomials.get_unshifted()) { + result += polynomial.size() * sizeof(FF); + } + + result += proving_key.public_inputs.capacity() * sizeof(FF); + + return result; + } + + static uint64_t estimate_builder_memory(MegaFlavor::CircuitBuilder& builder) + { + vinfo("++Estimating builder memory++"); + uint64_t result{ 0 }; + + // gates: + for (auto [block, label] : zip_view(builder.blocks.get(), builder.blocks.get_labels())) { + uint64_t size{ 0 }; + for (const auto& wire : block.wires) { + size += wire.capacity() * sizeof(uint32_t); + } + for (const auto& selector : block.selectors) { + size += selector.capacity() * sizeof(FF); + } + vinfo(label, " size ", size >> 10, " KiB"); + result += size; + } + + // variables + size_t to_add{ builder.variables.capacity() * sizeof(FF) }; + result += to_add; + vinfo("variables: ", to_add); + + // public inputs + to_add = builder.public_inputs.capacity() * sizeof(uint32_t); + result += to_add; + vinfo("public inputs: ", to_add); + + // other variable indices + to_add = builder.next_var_index.capacity() * sizeof(uint32_t); + to_add += builder.prev_var_index.capacity() * sizeof(uint32_t); + to_add += builder.real_variable_index.capacity() * sizeof(uint32_t); + to_add += builder.real_variable_tags.capacity() * sizeof(uint32_t); + result += to_add; + vinfo("variable indices: ", to_add); + + return result; + } +}; + +} // namespace bb \ No newline at end of file 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 adafef90c7c..de417753927 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.test.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.test.hpp @@ -14,44 +14,54 @@ namespace bb { constexpr size_t COMMITMENT_TEST_NUM_BN254_POINTS = 4096; constexpr size_t COMMITMENT_TEST_NUM_GRUMPKIN_POINTS = 1 << CONST_ECCVM_LOG_N; -template inline std::shared_ptr CreateCommitmentKey(); +template inline std::shared_ptr create_commitment_key(const size_t num_points = 0); -template <> inline std::shared_ptr> CreateCommitmentKey>() +template <> +inline std::shared_ptr> create_commitment_key>( + const size_t num_points) { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + if (num_points != 0) { + return std::make_shared>(num_points); + }; return std::make_shared>(COMMITMENT_TEST_NUM_BN254_POINTS); } // For IPA -template <> inline std::shared_ptr> CreateCommitmentKey>() +template <> +inline std::shared_ptr> create_commitment_key>( + const size_t num_points) { srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); + if (num_points != 0) { + return std::make_shared>(num_points); + } return std::make_shared>(COMMITMENT_TEST_NUM_GRUMPKIN_POINTS); } -template inline std::shared_ptr CreateCommitmentKey() +template inline std::shared_ptr create_commitment_key(size_t num_points) // requires std::default_initializable { - return std::make_shared(); + return std::make_shared(num_points); } -template inline std::shared_ptr CreateVerifierCommitmentKey(); +template inline std::shared_ptr create_verifier_commitment_key(); template <> -inline std::shared_ptr> CreateVerifierCommitmentKey< +inline std::shared_ptr> create_verifier_commitment_key< VerifierCommitmentKey>() { return std::make_shared>(); } // For IPA template <> -inline std::shared_ptr> CreateVerifierCommitmentKey< +inline std::shared_ptr> create_verifier_commitment_key< VerifierCommitmentKey>() { auto crs_factory = std::make_shared>( 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() +template inline std::shared_ptr create_verifier_commitment_key() // requires std::default_initializable { return std::make_shared(); @@ -149,10 +159,10 @@ template class CommitmentTest : public ::testing::Test { { // Avoid reallocating static objects if called in subclasses of FooTest. if (commitment_key == nullptr) { - commitment_key = CreateCommitmentKey(); + commitment_key = create_commitment_key(); } if (verification_key == nullptr) { - verification_key = CreateVerifierCommitmentKey(); + verification_key = create_verifier_commitment_key(); } } diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/gemini/gemini_impl.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/gemini/gemini_impl.hpp index a66387474d1..3828a009b6b 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/gemini/gemini_impl.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/gemini/gemini_impl.hpp @@ -124,6 +124,15 @@ std::vector::Claim> GeminiProver_::prove( } const Fr r_challenge = transcript->template get_challenge("Gemini:r"); + const bool gemini_challenge_in_small_subgroup = (has_zk) && (r_challenge.pow(Curve::SUBGROUP_SIZE) == Fr(1)); + + // If Gemini evaluation challenge lands in the multiplicative subgroup used by SmallSubgroupIPA protocol, the + // evaluations of prover polynomials at this challenge would leak witness data. + // TODO(https://github.com/AztecProtocol/barretenberg/issues/1194). Handle edge cases in PCS + if (gemini_challenge_in_small_subgroup) { + throw_or_abort("Gemini evaluation challenge is in the SmallSubgroup."); + } + std::vector claims = compute_fold_polynomial_evaluations(log_n, std::move(fold_polynomials), r_challenge, std::move(batched_group)); diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.hpp index 7e83b477ef7..ec31de7ac8d 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.hpp @@ -981,4 +981,4 @@ template class IPA { } }; -} // namespace bb \ No newline at end of file +} // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.test.cpp index bfb9fd93169..2bcc54538b2 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.test.cpp @@ -5,8 +5,10 @@ #include "../kzg/kzg.hpp" #include "../shplonk/shplonk.hpp" #include "../utils/batch_mul_native.hpp" -#include "barretenberg/commitment_schemes/claim.hpp" #include "barretenberg/commitment_schemes/ipa/ipa.hpp" +#include "barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.hpp" +#include "barretenberg/commitment_schemes/utils/instance_witness_generator.hpp" +#include "barretenberg/commitment_schemes/utils/test_settings.hpp" #include "barretenberg/ecc/curves/bn254/g1.hpp" #include @@ -14,29 +16,29 @@ namespace bb { -template class ShpleminiTest : public CommitmentTest { +template class ShpleminiTest : public CommitmentTest { public: - using Fr = typename Curve::ScalarField; - using Commitment = typename Curve::AffineElement; - using GroupElement = typename Curve::Element; - using Polynomial = bb::Polynomial; + static constexpr size_t n = 32; + static constexpr size_t log_n = 5; + static constexpr size_t num_polynomials = 5; + static constexpr size_t num_shiftable = 2; }; -using CurveTypes = ::testing::Types; +using TestSettings = ::testing::Types; -TYPED_TEST_SUITE(ShpleminiTest, CurveTypes); +TYPED_TEST_SUITE(ShpleminiTest, TestSettings); // This test checks that batch_multivariate_opening_claims method operates correctly TYPED_TEST(ShpleminiTest, CorrectnessOfMultivariateClaimBatching) { - using ShpleminiVerifier = ShpleminiVerifier_; - using Fr = typename TypeParam::ScalarField; - using GroupElement = typename TypeParam::Element; - using Commitment = typename TypeParam::AffineElement; - using Polynomial = typename bb::Polynomial; + using Curve = typename TypeParam::Curve; + using ShpleminiVerifier = ShpleminiVerifier_; + using Fr = typename Curve::ScalarField; + using GroupElement = typename Curve::Element; + using Commitment = typename Curve::AffineElement; + using CK = typename TypeParam::CommitmentKey; - const size_t n = 16; - const size_t log_n = 4; + std::shared_ptr ck = create_commitment_key(this->n); // Generate mock challenges Fr rho = Fr::random_element(); @@ -45,37 +47,40 @@ TYPED_TEST(ShpleminiTest, CorrectnessOfMultivariateClaimBatching) Fr shplonk_eval_challenge = Fr::random_element(); // Generate multilinear polynomials and compute their commitments - auto mle_opening_point = this->random_evaluation_point(log_n); - auto poly1 = Polynomial::random(n); - auto poly2 = Polynomial::random(n, /*shiftable*/ 1); - Polynomial poly3(n); - - Commitment commitment1 = this->commit(poly1); - Commitment commitment2 = this->commit(poly2); - Commitment commitment3 = this->commit(poly3); - EXPECT_TRUE(commitment3.is_point_at_infinity()); - - std::vector unshifted_commitments = { commitment1, commitment2, commitment3 }; - std::vector shifted_commitments = { commitment2, commitment3 }; - - // Evaluate the polynomials at the multivariate challenge, poly3 is not evaluated, because it is 0. - auto eval1 = poly1.evaluate_mle(mle_opening_point); - auto eval2 = poly2.evaluate_mle(mle_opening_point); - Fr eval3{ 0 }; - Fr eval3_shift{ 0 }; - auto eval2_shift = poly2.evaluate_mle(mle_opening_point, true); + auto mle_opening_point = this->random_evaluation_point(this->log_n); + + auto pcs_instance_witness = + InstanceWitnessGenerator(this->n, this->num_polynomials, this->num_shiftable, mle_opening_point, ck); // Collect multilinear evaluations - std::vector multilinear_evaluations = { eval1, eval2, eval3, eval2_shift, eval3_shift }; - std::vector rhos = gemini::powers_of_rho(rho, multilinear_evaluations.size()); + std::vector rhos = gemini::powers_of_rho(rho, this->num_polynomials + this->num_shiftable); // Compute batched multivariate evaluation - Fr batched_evaluation = - std::inner_product(multilinear_evaluations.begin(), multilinear_evaluations.end(), rhos.begin(), Fr::zero()); + Fr batched_evaluation = Fr(0); + size_t idx = 0; + for (auto& eval : pcs_instance_witness.unshifted_evals) { + batched_evaluation += eval * rhos[idx]; + idx++; + } + + for (auto& eval : pcs_instance_witness.shifted_evals) { + batched_evaluation += eval * rhos[idx]; + idx++; + } // Compute batched commitments manually - GroupElement batched_commitment_unshifted = commitment1 * rhos[0] + commitment2 * rhos[1] + commitment3 * rhos[2]; - GroupElement batched_commitment_to_be_shifted = commitment2 * rhos[3] + commitment3 * rhos[4]; + idx = 0; + GroupElement batched_commitment_unshifted = GroupElement::zero(); + for (auto& comm : pcs_instance_witness.unshifted_commitments) { + batched_commitment_unshifted += comm * rhos[idx]; + idx++; + } + + GroupElement batched_commitment_to_be_shifted = GroupElement::zero(); + for (auto& comm : pcs_instance_witness.to_be_shifted_commitments) { + batched_commitment_to_be_shifted += comm * rhos[idx]; + idx++; + } // Compute expected result manually GroupElement commitment_to_univariate = @@ -93,17 +98,17 @@ TYPED_TEST(ShpleminiTest, CorrectnessOfMultivariateClaimBatching) std::vector scalars; Fr verifier_batched_evaluation{ 0 }; - Fr unshifted_scalar = (shplonk_eval_challenge - gemini_eval_challenge).invert() + - shplonk_batching_challenge * (shplonk_eval_challenge + gemini_eval_challenge).invert(); + const Fr unshifted_scalar = (shplonk_eval_challenge - gemini_eval_challenge).invert() + + shplonk_batching_challenge * (shplonk_eval_challenge + gemini_eval_challenge).invert(); - Fr shifted_scalar = gemini_eval_challenge.invert() * - ((shplonk_eval_challenge - gemini_eval_challenge).invert() - - shplonk_batching_challenge * (shplonk_eval_challenge + gemini_eval_challenge).invert()); + const Fr shifted_scalar = gemini_eval_challenge.invert() * + ((shplonk_eval_challenge - gemini_eval_challenge).invert() - + shplonk_batching_challenge * (shplonk_eval_challenge + gemini_eval_challenge).invert()); - ShpleminiVerifier::batch_multivariate_opening_claims(RefVector(unshifted_commitments), - RefVector(shifted_commitments), - RefArray{ eval1, eval2, eval3 }, - RefArray{ eval2_shift, eval3_shift }, + ShpleminiVerifier::batch_multivariate_opening_claims(RefVector(pcs_instance_witness.unshifted_commitments), + RefVector(pcs_instance_witness.to_be_shifted_commitments), + RefVector(pcs_instance_witness.unshifted_evals), + RefVector(pcs_instance_witness.shifted_evals), rho, unshifted_scalar, shifted_scalar, @@ -114,22 +119,25 @@ TYPED_TEST(ShpleminiTest, CorrectnessOfMultivariateClaimBatching) // Final pairing check GroupElement shplemini_result = batch_mul_native(commitments, scalars); - EXPECT_EQ(commitments.size(), unshifted_commitments.size() + shifted_commitments.size()); + EXPECT_EQ(commitments.size(), + pcs_instance_witness.unshifted_commitments.size() + + pcs_instance_witness.to_be_shifted_commitments.size()); EXPECT_EQ(batched_evaluation, verifier_batched_evaluation); EXPECT_EQ(-expected_result, shplemini_result); } TYPED_TEST(ShpleminiTest, CorrectnessOfGeminiClaimBatching) { - using GeminiProver = GeminiProver_; - using ShpleminiVerifier = ShpleminiVerifier_; - using ShplonkVerifier = ShplonkVerifier_; - using Fr = typename TypeParam::ScalarField; - using GroupElement = typename TypeParam::Element; - using Commitment = typename TypeParam::AffineElement; + using Curve = TypeParam::Curve; + using GeminiProver = GeminiProver_; + using ShpleminiVerifier = ShpleminiVerifier_; + using ShplonkVerifier = ShplonkVerifier_; + using Fr = typename Curve::ScalarField; + using GroupElement = typename Curve::Element; + using Commitment = typename Curve::AffineElement; using Polynomial = typename bb::Polynomial; + using CK = typename TypeParam::CommitmentKey; - const size_t n = 16; - const size_t log_n = 4; + std::shared_ptr ck = create_commitment_key(this->n); // Generate mock challenges Fr rho = Fr::random_element(); @@ -137,62 +145,58 @@ TYPED_TEST(ShpleminiTest, CorrectnessOfGeminiClaimBatching) Fr shplonk_batching_challenge = Fr::random_element(); Fr shplonk_eval_challenge = Fr::random_element(); - // Generate multilinear polynomials and compute their commitments - auto mle_opening_point = this->random_evaluation_point(log_n); - auto poly1 = Polynomial::random(n); - auto poly2 = Polynomial::random(n, /*shiftable*/ 1); - Polynomial poly3 = Polynomial::shiftable(n); - - // Evaluate the polynomials at the multivariate challenge, poly3 is not evaluated, because it is 0. - auto eval1 = poly1.evaluate_mle(mle_opening_point); - auto eval2 = poly2.evaluate_mle(mle_opening_point); - Fr eval3{ 0 }; - Fr eval3_shift{ 0 }; - auto eval2_shift = poly2.evaluate_mle(mle_opening_point, true); + std::vector mle_opening_point = this->random_evaluation_point(this->log_n); + + auto pcs_instance_witness = + InstanceWitnessGenerator(this->n, this->num_polynomials, this->num_shiftable, mle_opening_point, ck); // Collect multilinear evaluations - std::vector multilinear_evaluations = { eval1, eval2, eval3, eval2_shift, eval3_shift }; - std::vector rhos = gemini::powers_of_rho(rho, multilinear_evaluations.size()); + std::vector rhos = gemini::powers_of_rho(rho, this->num_polynomials + this->num_shiftable); + + Polynomial batched_unshifted(this->n); + Polynomial batched_to_be_shifted = Polynomial::shiftable(this->n); - Polynomial batched_unshifted(n); - Polynomial batched_to_be_shifted = Polynomial::shiftable(n); - batched_unshifted.add_scaled(poly1, rhos[0]); - batched_unshifted.add_scaled(poly2, rhos[1]); - batched_unshifted.add_scaled(poly3, rhos[2]); - batched_to_be_shifted.add_scaled(poly2, rhos[3]); - batched_to_be_shifted.add_scaled(poly3, rhos[4]); + size_t idx = 0; + for (auto& poly : pcs_instance_witness.unshifted_polynomials) { + batched_unshifted.add_scaled(poly, rhos[idx]); + idx++; + } + + for (auto& poly : pcs_instance_witness.to_be_shifted_polynomials) { + batched_unshifted.add_scaled(poly, rhos[idx]); + idx++; + } // Compute: // - (d+1) opening pairs: {r, \hat{a}_0}, {-r^{2^i}, a_i}, i = 0, ..., d-1 // - (d+1) Fold polynomials Fold_{r}^(0), Fold_{-r}^(0), and Fold^(i), i = 0, ..., d-1 auto fold_polynomials = GeminiProver::compute_fold_polynomials( - log_n, mle_opening_point, std::move(batched_unshifted), std::move(batched_to_be_shifted)); + this->log_n, mle_opening_point, std::move(batched_unshifted), std::move(batched_to_be_shifted)); std::vector prover_commitments; - for (size_t l = 0; l < log_n - 1; ++l) { - auto commitment = this->ck()->commit(fold_polynomials[l + 2]); + for (size_t l = 0; l < this->log_n - 1; ++l) { + auto commitment = ck->commit(fold_polynomials[l + 2]); prover_commitments.emplace_back(commitment); } - const auto opening_claims = - GeminiProver::compute_fold_polynomial_evaluations(log_n, std::move(fold_polynomials), gemini_eval_challenge); + const auto opening_claims = GeminiProver::compute_fold_polynomial_evaluations( + this->log_n, std::move(fold_polynomials), gemini_eval_challenge); std::vector prover_evaluations; - for (size_t l = 0; l < log_n; ++l) { + for (size_t l = 0; l < this->log_n; ++l) { const auto& evaluation = opening_claims[l + 1].opening_pair.evaluation; prover_evaluations.emplace_back(evaluation); } - std::vector r_squares = gemini::powers_of_evaluation_challenge(gemini_eval_challenge, log_n); + std::vector r_squares = gemini::powers_of_evaluation_challenge(gemini_eval_challenge, this->log_n); GroupElement expected_result = GroupElement::zero(); - std::vector expected_inverse_vanishing_evals(log_n + 1); + std::vector expected_inverse_vanishing_evals(this->log_n + 1); // Compute expected inverses expected_inverse_vanishing_evals[0] = (shplonk_eval_challenge - r_squares[0]).invert(); - expected_inverse_vanishing_evals[1] = (shplonk_eval_challenge + r_squares[0]).invert(); - expected_inverse_vanishing_evals[2] = (shplonk_eval_challenge + r_squares[1]).invert(); - expected_inverse_vanishing_evals[3] = (shplonk_eval_challenge + r_squares[2]).invert(); - expected_inverse_vanishing_evals[4] = (shplonk_eval_challenge + r_squares[3]).invert(); + for (size_t idx = 1; idx < this->log_n + 1; idx++) { + expected_inverse_vanishing_evals[idx] = (shplonk_eval_challenge + r_squares[idx - 1]).invert(); + } Fr current_challenge{ shplonk_batching_challenge * shplonk_batching_challenge }; for (size_t idx = 0; idx < prover_commitments.size(); ++idx) { @@ -202,13 +206,13 @@ TYPED_TEST(ShpleminiTest, CorrectnessOfGeminiClaimBatching) // Run the ShepliminiVerifier batching method std::vector inverse_vanishing_evals = - ShplonkVerifier::compute_inverted_gemini_denominators(log_n + 1, shplonk_eval_challenge, r_squares); + ShplonkVerifier::compute_inverted_gemini_denominators(this->log_n + 1, shplonk_eval_challenge, r_squares); std::vector commitments; std::vector scalars; Fr expected_constant_term_accumulator{ 0 }; - ShpleminiVerifier::batch_gemini_claims_received_from_prover(log_n, + ShpleminiVerifier::batch_gemini_claims_received_from_prover(this->log_n, prover_commitments, prover_evaluations, inverse_vanishing_evals, @@ -223,4 +227,118 @@ TYPED_TEST(ShpleminiTest, CorrectnessOfGeminiClaimBatching) EXPECT_EQ(shplemini_result, expected_result); } -} // namespace bb +/** + * @brief Test Shplemini with ZK data consisting of a hiding polynomial generated by GeminiProver and Libra polynomials + * used to mask Sumcheck Round Univariates. + * + */ +TYPED_TEST(ShpleminiTest, ShpleminiWithZK) +{ + using ZKData = ZKSumcheckData; + using Curve = TypeParam::Curve; + using ShpleminiProver = ShpleminiProver_; + using ShpleminiVerifier = ShpleminiVerifier_; + using Fr = typename Curve::ScalarField; + using Commitment = typename Curve::AffineElement; + using CK = typename TypeParam::CommitmentKey; + + // Initialize transcript and commitment key + auto prover_transcript = TypeParam::Transcript::prover_init_empty(); + + // SmallSubgroupIPAProver requires at least CURVE::SUBGROUP_SIZE + 3 elements in the ck. + static constexpr size_t log_subgroup_size = static_cast(numeric::get_msb(Curve::SUBGROUP_SIZE)); + std::shared_ptr ck = create_commitment_key(std::max(this->n, 1ULL << (log_subgroup_size + 1))); + + // Generate Libra polynomials, compute masked concatenated Libra polynomial, commit to it + ZKData zk_sumcheck_data(this->log_n, prover_transcript, ck); + + // Generate multivariate challenge of size CONST_PROOF_SIZE_LOG_N + std::vector const_size_mle_opening_point = this->random_evaluation_point(CONST_PROOF_SIZE_LOG_N); + // Truncate the multivariate challenge to evaluate prover polynomials (As in Sumcheck) + const std::vector mle_opening_point(const_size_mle_opening_point.begin(), + const_size_mle_opening_point.begin() + this->log_n); + + // Generate random prover polynomials, compute their evaluations and commitments + auto pcs_instance_witness = + InstanceWitnessGenerator(this->n, this->num_polynomials, this->num_shiftable, mle_opening_point, ck); + + // Compute the sum of the Libra constant term and Libra univariates evaluated at Sumcheck challenges + const Fr claimed_inner_product = SmallSubgroupIPAProver::compute_claimed_inner_product( + zk_sumcheck_data, const_size_mle_opening_point, this->log_n); + + prover_transcript->template send_to_verifier("Libra:claimed_evaluation", claimed_inner_product); + + // Instantiate SmallSubgroupIPAProver, this prover sends commitments to Big Sum and Quotient polynomials + auto small_subgroup_ipa_prover = SmallSubgroupIPAProver( + zk_sumcheck_data, const_size_mle_opening_point, claimed_inner_product, prover_transcript, ck); + + // Reduce to KZG or IPA based on the curve used in the test Flavor + const auto opening_claim = ShpleminiProver::prove(this->n, + RefVector(pcs_instance_witness.unshifted_polynomials), + RefVector(pcs_instance_witness.to_be_shifted_polynomials), + const_size_mle_opening_point, + ck, + prover_transcript, + small_subgroup_ipa_prover.get_witness_polynomials()); + + if constexpr (std::is_same_v) { + IPA::compute_opening_proof(this->ck(), opening_claim, prover_transcript); + } else { + KZG::compute_opening_proof(this->ck(), opening_claim, prover_transcript); + } + + // Initialize verifier's transcript + auto verifier_transcript = NativeTranscript::verifier_init_empty(prover_transcript); + + // Start populating Verifier's array of Libra commitments + std::array libra_commitments = {}; + libra_commitments[0] = + verifier_transcript->template receive_from_prover("Libra:concatenation_commitment"); + + // Place Libra data to the transcript + const Fr libra_total_sum = verifier_transcript->template receive_from_prover("Libra:Sum"); + const Fr libra_challenge = verifier_transcript->template get_challenge("Libra:Challenge"); + const Fr libra_evaluation = verifier_transcript->template receive_from_prover("Libra:claimed_evaluation"); + + // Check that transcript is consistent + EXPECT_EQ(libra_total_sum, zk_sumcheck_data.libra_total_sum); + EXPECT_EQ(libra_challenge, zk_sumcheck_data.libra_challenge); + EXPECT_EQ(libra_evaluation, claimed_inner_product); + + // Finalize the array of Libra/SmallSubgroupIpa commitments + libra_commitments[1] = verifier_transcript->template receive_from_prover("Libra:big_sum_commitment"); + libra_commitments[2] = verifier_transcript->template receive_from_prover("Libra:quotient_commitment"); + + // Used to verify the consistency of the evaluations of the concatenated libra polynomial, big sum polynomial, and + // the quotient polynomial computed by SmallSubgroupIPAProver + bool consistency_checked = true; + + // Run Shplemini + const auto batch_opening_claim = + ShpleminiVerifier::compute_batch_opening_claim(this->n, + RefVector(pcs_instance_witness.unshifted_commitments), + RefVector(pcs_instance_witness.to_be_shifted_commitments), + RefVector(pcs_instance_witness.unshifted_evals), + RefVector(pcs_instance_witness.shifted_evals), + const_size_mle_opening_point, + this->vk()->get_g1_identity(), + verifier_transcript, + {}, + true, + &consistency_checked, + libra_commitments, + libra_evaluation); + // Verify claim using KZG or IPA + if constexpr (std::is_same_v) { + auto result = + IPA::reduce_verify_batch_opening_claim(batch_opening_claim, this->vk(), verifier_transcript); + EXPECT_EQ(result, true); + } else { + const auto pairing_points = + KZG::reduce_verify_batch_opening_claim(batch_opening_claim, verifier_transcript); + // Final pairing check: e([Q] - [Q_z] + z[W], [1]_2) = e([W], [x]_2) + EXPECT_EQ(this->vk()->pairing_check(pairing_points[0], pairing_points[1]), true); + } +} + +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.hpp index 39f9b27b625..54af7999a2a 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.hpp @@ -374,6 +374,32 @@ template class SmallSubgroupIPAProver { remainder.at(idx - SUBGROUP_SIZE) += remainder.at(idx); } } + + /** + * @brief For test purposes: Compute the sum of the Libra constant term and Libra univariates evaluated at Sumcheck + * challenges. + * + * @param zk_sumcheck_data Contains Libra constant term and scaled Libra univariates + * @param multivariate_challenge Sumcheck challenge + * @param log_circuit_size + */ + static FF compute_claimed_inner_product(ZKSumcheckData& zk_sumcheck_data, + const std::vector& multivariate_challenge, + const size_t& log_circuit_size) + { + const FF libra_challenge_inv = zk_sumcheck_data.libra_challenge.invert(); + // Compute claimed inner product similarly to the SumcheckProver + FF claimed_inner_product = FF{ 0 }; + size_t idx = 0; + for (const auto& univariate : zk_sumcheck_data.libra_univariates) { + claimed_inner_product += univariate.evaluate(multivariate_challenge[idx]); + idx++; + } + // Libra Univariates are mutiplied by the Libra challenge in setup_auxiliary_data(), needs to be undone + claimed_inner_product *= libra_challenge_inv / FF(1 << (log_circuit_size - 1)); + claimed_inner_product += zk_sumcheck_data.constant_term; + return claimed_inner_product; + } }; /** @@ -426,6 +452,18 @@ template class SmallSubgroupIPAVerifier { // Compute the evaluation of the vanishing polynomia Z_H(X) at X = gemini_evaluation_challenge const FF vanishing_poly_eval = gemini_evaluation_challenge.pow(SUBGROUP_SIZE) - FF(1); + // TODO(https://github.com/AztecProtocol/barretenberg/issues/1194). Handle edge cases in PCS + // TODO(https://github.com/AztecProtocol/barretenberg/issues/1186). Insecure pattern. + bool gemini_challenge_in_small_subgroup = false; + if constexpr (Curve::is_stdlib_type) { + gemini_challenge_in_small_subgroup = (vanishing_poly_eval.get_value() == FF(0).get_value()); + } else { + gemini_challenge_in_small_subgroup = (vanishing_poly_eval == FF(0)); + } + // The probability of this event is negligible but it has to be processed correctly + if (gemini_challenge_in_small_subgroup) { + throw_or_abort("Gemini evaluation challenge is in the SmallSubgroup."); + } // Construct the challenge polynomial from the sumcheck challenge, the verifier has to evaluate it on its own const std::vector challenge_polynomial_lagrange = compute_challenge_polynomial(multilinear_challenge); @@ -542,4 +580,4 @@ template class SmallSubgroupIPAVerifier { return result; } }; -} // namespace bb +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.test.cpp new file mode 100644 index 00000000000..cc445d3a394 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.test.cpp @@ -0,0 +1,248 @@ +#include "barretenberg/commitment_schemes/small_subgroup_ipa/small_subgroup_ipa.hpp" +#include "../commitment_key.test.hpp" +#include "barretenberg/commitment_schemes/shplonk/shplemini.hpp" +#include "barretenberg/commitment_schemes/utils/test_settings.hpp" + +#include +#include +#include + +namespace bb { +template class SmallSubgroupIPATest : public ::testing::Test { + public: + using Curve = typename Flavor::Curve; + using Transcript = typename Flavor::Transcript; + using FF = typename Curve::ScalarField; + + static constexpr size_t log_circuit_size = 7; + static constexpr size_t circuit_size = 1ULL << log_circuit_size; + + FF evaluation_challenge; + + void SetUp() override { evaluation_challenge = FF::random_element(); } + + static std::vector generate_random_vector(const size_t size) + { + std::vector multivariate_challenge(size); + for (auto& challenge : multivariate_challenge) { + challenge = FF::random_element(); + } + return multivariate_challenge; + } +}; + +using TestFlavors = ::testing::Types; +TYPED_TEST_SUITE(SmallSubgroupIPATest, TestFlavors); + +// Check the correctness of the computation of the claimed inner product and various polynomials needed for the +// SmallSubgroupIPA. +TYPED_TEST(SmallSubgroupIPATest, ProverComputationsCorrectness) +{ + using ZKData = ZKSumcheckData; + using SmallSubgroupIPA = SmallSubgroupIPAProver; + using FF = typename TypeParam::FF; + static constexpr size_t SUBGROUP_SIZE = TypeParam::SUBGROUP_SIZE; + + using CK = typename TypeParam::CommitmentKey; + + // SmallSubgroupIPAProver requires at least CURVE::SUBGROUP_SIZE + 3 elements in the ck. + static constexpr size_t log_subgroup_size = static_cast(numeric::get_msb(SUBGROUP_SIZE)); + std::shared_ptr ck = + create_commitment_key(std::max(this->circuit_size, 1ULL << (log_subgroup_size + 1))); + + auto prover_transcript = TypeParam::Transcript::prover_init_empty(); + + ZKData zk_sumcheck_data(this->log_circuit_size, prover_transcript, ck); + std::vector multivariate_challenge = this->generate_random_vector(this->log_circuit_size); + + const FF claimed_inner_product = SmallSubgroupIPA::compute_claimed_inner_product( + zk_sumcheck_data, multivariate_challenge, this->log_circuit_size); + + SmallSubgroupIPA small_subgroup_ipa_prover = + SmallSubgroupIPA(zk_sumcheck_data, multivariate_challenge, claimed_inner_product, prover_transcript, ck); + + const Polynomial batched_polynomial = small_subgroup_ipa_prover.get_batched_polynomial(); + const Polynomial libra_concatenated_polynomial = small_subgroup_ipa_prover.get_witness_polynomials()[0]; + const Polynomial batched_quotient = small_subgroup_ipa_prover.get_witness_polynomials()[3]; + const Polynomial challenge_polynomial = small_subgroup_ipa_prover.get_challenge_polynomial(); + + // Check that claimed inner product coincides with the inner product of libra_concatenated_polynomial and + // challenge_polynomial. Since libra_concatenated_polynomial is masked, we also check that masking does not affect + // the evaluations over H + FF inner_product = FF(0); + const std::array domain = zk_sumcheck_data.interpolation_domain; + for (size_t idx = 0; idx < SUBGROUP_SIZE; idx++) { + inner_product += + challenge_polynomial.evaluate(domain[idx]) * libra_concatenated_polynomial.evaluate(domain[idx]); + } + EXPECT_TRUE(inner_product == claimed_inner_product); + + // Check that batched polynomial is divisible by Z_H(X) + bool ipa_claim_consistency = true; + for (size_t idx = 0; idx < SUBGROUP_SIZE; idx++) { + ipa_claim_consistency = (batched_polynomial.evaluate(zk_sumcheck_data.interpolation_domain[idx]) == FF{ 0 }) && + ipa_claim_consistency; + } + EXPECT_EQ(ipa_claim_consistency, true); + + // Check that Z_H(X) * Q(X) = batched_polynomial + std::vector Z_H(SUBGROUP_SIZE + 1); + Z_H[0] = -FF(1); + Z_H[SUBGROUP_SIZE] = FF(1); + Polynomial product(batched_polynomial.size()); + + for (size_t i = 0; i < Z_H.size(); i++) { + for (size_t j = 0; j < batched_quotient.size(); j++) { + product.at(i + j) += Z_H[i] * batched_quotient.at(j); + } + } + bool quotient_is_correct = true; + for (const auto& [coeff_expected, coeff] : zip_view(product.coeffs(), batched_polynomial.coeffs())) { + quotient_is_correct = (coeff_expected == coeff) && quotient_is_correct; + } + EXPECT_EQ(quotient_is_correct, true); +} + +// Check the correctness of the evaluations of the challenge_polynomial, Lagrange first, and Lagrange last that the +// verifier has to compute on its own. Compare the values against the evaluations obtaned by applying Lagrange +// interpolation method used by Polynomial class constructor. +TYPED_TEST(SmallSubgroupIPATest, VerifierEvaluations) +{ + using FF = typename TypeParam::FF; + using Curve = typename TypeParam::Curve; + using SmallSubgroupIPA = SmallSubgroupIPAVerifier; + + // Extract the constants + static constexpr size_t SUBGROUP_SIZE = TypeParam::SUBGROUP_SIZE; + const FF subgroup_generator_inverse = Curve::subgroup_generator_inverse; + const FF subgroup_generator = subgroup_generator_inverse.invert(); + + // Sample random Lagrange coefficients over H + std::vector challenge_poly_lagrange = this->generate_random_vector(SUBGROUP_SIZE); + + // Evaluate Verifier's polynomials at the challenge + const FF vanishing_poly_eval = this->evaluation_challenge.pow(SUBGROUP_SIZE) - 1; + + // Compute required evaluations using efficient batch evaluation + const auto [challenge_poly_eval, lagrange_first, lagrange_last] = + SmallSubgroupIPA::compute_batched_barycentric_evaluations( + challenge_poly_lagrange, this->evaluation_challenge, subgroup_generator_inverse, vanishing_poly_eval); + + // Compute the evaluations differently, namely, using Lagrange interpolation + std::array interpolation_domain; + interpolation_domain[0] = FF(1); + for (size_t idx = 1; idx < SUBGROUP_SIZE; idx++) { + interpolation_domain[idx] = interpolation_domain[idx - 1] * subgroup_generator; + } + Polynomial challenge_poly_monomial = + Polynomial(interpolation_domain, challenge_poly_lagrange, SUBGROUP_SIZE); + + // Evaluate at the challenge + const FF challenge_poly_expected_eval = challenge_poly_monomial.evaluate(this->evaluation_challenge); + + EXPECT_EQ(challenge_poly_eval, challenge_poly_expected_eval); + + // Compute Lagrange polynomials using interpolation + std::vector lagrange_poly(SUBGROUP_SIZE); + lagrange_poly.at(0) = FF(1); + Polynomial lagrange_first_monomial = Polynomial(interpolation_domain, lagrange_poly, SUBGROUP_SIZE); + EXPECT_EQ(lagrange_first, lagrange_first_monomial.evaluate(this->evaluation_challenge)); + + lagrange_poly.at(0) = FF(0); + lagrange_poly.at(SUBGROUP_SIZE - 1) = FF(1); + Polynomial lagrange_last_monomial = Polynomial(interpolation_domain, lagrange_poly, SUBGROUP_SIZE); + EXPECT_EQ(lagrange_last, lagrange_last_monomial.evaluate(this->evaluation_challenge)); +} + +// Simulate the interaction between the prover and the verifier leading to the consistency check performed by the +// verifier. +TYPED_TEST(SmallSubgroupIPATest, ProverAndVerifierSimple) +{ + using FF = typename TypeParam::FF; + using Curve = typename TypeParam::Curve; + using Verifier = SmallSubgroupIPAVerifier; + using Prover = SmallSubgroupIPAProver; + using ZKData = ZKSumcheckData; + using CK = typename TypeParam::CommitmentKey; + + auto prover_transcript = TypeParam::Transcript::prover_init_empty(); + + // SmallSubgroupIPAProver requires at least CURVE::SUBGROUP_SIZE + 3 elements in the ck. + static constexpr size_t log_subgroup_size = static_cast(numeric::get_msb(Curve::SUBGROUP_SIZE)); + std::shared_ptr ck = + create_commitment_key(std::max(this->circuit_size, 1ULL << (log_subgroup_size + 1))); + + ZKData zk_sumcheck_data(this->log_circuit_size, prover_transcript, ck); + + std::vector multivariate_challenge = this->generate_random_vector(CONST_PROOF_SIZE_LOG_N); + + const FF claimed_inner_product = + Prover::compute_claimed_inner_product(zk_sumcheck_data, multivariate_challenge, this->log_circuit_size); + + Prover small_subgroup_ipa_prover = + Prover(zk_sumcheck_data, multivariate_challenge, claimed_inner_product, prover_transcript, ck); + + const std::array, NUM_LIBRA_EVALUATIONS> witness_polynomials = + small_subgroup_ipa_prover.get_witness_polynomials(); + + std::array libra_evaluations = { + witness_polynomials[0].evaluate(this->evaluation_challenge), + witness_polynomials[1].evaluate(this->evaluation_challenge * Curve::subgroup_generator), + witness_polynomials[2].evaluate(this->evaluation_challenge), + witness_polynomials[3].evaluate(this->evaluation_challenge) + }; + + bool consistency_checked = Verifier::check_evaluations_consistency( + libra_evaluations, this->evaluation_challenge, multivariate_challenge, claimed_inner_product); + + EXPECT_TRUE(consistency_checked); +} + +// Check that consistency check fails when some of the prover's data is corrupted. +TYPED_TEST(SmallSubgroupIPATest, ProverAndVerifierSimpleFailure) +{ + using FF = typename TypeParam::FF; + using Curve = typename TypeParam::Curve; + using Verifier = SmallSubgroupIPAVerifier; + using Prover = SmallSubgroupIPAProver; + using ZKData = ZKSumcheckData; + using CK = typename TypeParam::CommitmentKey; + + auto prover_transcript = TypeParam::Transcript::prover_init_empty(); + + // SmallSubgroupIPAProver requires at least CURVE::SUBGROUP_SIZE + 3 elements in the ck. + static constexpr size_t log_subgroup_size = static_cast(numeric::get_msb(Curve::SUBGROUP_SIZE)); + std::shared_ptr ck = + create_commitment_key(std::max(this->circuit_size, 1ULL << (log_subgroup_size + 1))); + + ZKData zk_sumcheck_data(this->log_circuit_size, prover_transcript, ck); + + std::vector multivariate_challenge = this->generate_random_vector(CONST_PROOF_SIZE_LOG_N); + + const FF claimed_inner_product = + Prover::compute_claimed_inner_product(zk_sumcheck_data, multivariate_challenge, this->log_circuit_size); + + Prover small_subgroup_ipa_prover = + Prover(zk_sumcheck_data, multivariate_challenge, claimed_inner_product, prover_transcript, ck); + + std::array, NUM_LIBRA_EVALUATIONS> witness_polynomials = + small_subgroup_ipa_prover.get_witness_polynomials(); + + // Tamper with witness polynomials + witness_polynomials[0].at(0) = FF::random_element(); + + std::array libra_evaluations = { + witness_polynomials[0].evaluate(this->evaluation_challenge), + witness_polynomials[1].evaluate(this->evaluation_challenge * Curve::subgroup_generator), + witness_polynomials[2].evaluate(this->evaluation_challenge), + witness_polynomials[3].evaluate(this->evaluation_challenge) + }; + + bool consistency_checked = Verifier::check_evaluations_consistency( + libra_evaluations, this->evaluation_challenge, multivariate_challenge, claimed_inner_product); + + // Since witness polynomials were modified, the consistency check must fail + EXPECT_FALSE(consistency_checked); +} + +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/utils/instance_witness_generator.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/utils/instance_witness_generator.hpp new file mode 100644 index 00000000000..f3b99924b9f --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/utils/instance_witness_generator.hpp @@ -0,0 +1,70 @@ +#pragma once + +#include "barretenberg/commitment_schemes/commitment_key.hpp" +#include "barretenberg/ecc/curves/bn254/bn254.hpp" +#include "barretenberg/polynomials/polynomial.hpp" +#include "barretenberg/transcript/transcript.hpp" + +namespace bb { +/** + * @brief Constructs random polynomials, computes commitments and corresponding evaluations. + * + * @tparam Curve + */ +template struct InstanceWitnessGenerator { + public: + using CommitmentKey = bb::CommitmentKey; + using Fr = typename Curve::ScalarField; + using Commitment = typename Curve::AffineElement; + using Polynomial = bb::Polynomial; + + std::shared_ptr ck; + std::vector unshifted_polynomials; + std::vector to_be_shifted_polynomials; + std::vector const_size_mle_opening_point; + std::vector unshifted_commitments; + std::vector to_be_shifted_commitments; + std::vector unshifted_evals; + std::vector shifted_evals; + + InstanceWitnessGenerator(const size_t n, + const size_t num_polynomials, + const size_t num_shiftable, + const std::vector& mle_opening_point, + std::shared_ptr& commitment_key) + : ck(commitment_key) // Initialize the commitment key + , unshifted_polynomials(num_polynomials) + , to_be_shifted_polynomials(num_shiftable) + + { + construct_instance_and_witnesses(n, mle_opening_point); + } + + void construct_instance_and_witnesses(size_t n, const std::vector& mle_opening_point) + { + + const size_t num_unshifted = unshifted_polynomials.size() - to_be_shifted_polynomials.size(); + + // Constructs polynomials that are not shifted + for (size_t idx = 0; idx < num_unshifted; idx++) { + unshifted_polynomials[idx] = Polynomial::random(n); + unshifted_commitments.push_back(ck->commit(unshifted_polynomials[idx])); + unshifted_evals.push_back(unshifted_polynomials[idx].evaluate_mle(mle_opening_point)); + } + + // Constructs polynomials that are being shifted + size_t idx = num_unshifted; + for (auto& poly : to_be_shifted_polynomials) { + poly = Polynomial::random(n, /*shiftable*/ 1); + unshifted_polynomials[idx] = poly; + const Commitment comm = this->ck->commit(poly); + unshifted_commitments.push_back(comm); + to_be_shifted_commitments.push_back(comm); + unshifted_evals.push_back(poly.evaluate_mle(mle_opening_point)); + shifted_evals.push_back(poly.evaluate_mle(mle_opening_point, true)); + idx++; + } + } +}; + +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/utils/test_settings.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/utils/test_settings.hpp new file mode 100644 index 00000000000..5023d02a8f7 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/utils/test_settings.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include "barretenberg/commitment_schemes/commitment_key.hpp" +#include "barretenberg/ecc/curves/bn254/bn254.hpp" +#include "barretenberg/transcript/transcript.hpp" + +namespace bb { +/** + * @brief Mock Flavors to use ZKSumcheckData and SmallSubgroupIPAProver in the PCS tests. + * + */ +class BN254Settings { + public: + using Curve = curve::BN254; + using CommitmentKey = bb::CommitmentKey; + using Transcript = NativeTranscript; + using FF = typename Curve::ScalarField; + static constexpr size_t SUBGROUP_SIZE = Curve::SUBGROUP_SIZE; +}; + +class GrumpkinSettings { + public: + using Curve = curve::Grumpkin; + using CommitmentKey = bb::CommitmentKey; + using Transcript = NativeTranscript; + using FF = typename Curve::ScalarField; + static constexpr size_t SUBGROUP_SIZE = Curve::SUBGROUP_SIZE; +}; +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/common/thread.cpp b/barretenberg/cpp/src/barretenberg/common/thread.cpp index 11fafc1c43a..2fdefc82f65 100644 --- a/barretenberg/cpp/src/barretenberg/common/thread.cpp +++ b/barretenberg/cpp/src/barretenberg/common/thread.cpp @@ -170,6 +170,22 @@ void parallel_for_heuristic(size_t num_points, }); }; +MultithreadData calculate_thread_data(size_t num_iterations, size_t min_iterations_per_thread) +{ + size_t num_threads = calculate_num_threads(num_iterations, min_iterations_per_thread); + const size_t thread_size = num_iterations / num_threads; + + // Cumpute the index bounds for each thread + std::vector start(num_threads); + std::vector end(num_threads); + for (size_t thread_idx = 0; thread_idx < num_threads; ++thread_idx) { + start[thread_idx] = thread_idx * thread_size; + end[thread_idx] = (thread_idx == num_threads - 1) ? num_iterations : (thread_idx + 1) * thread_size; + } + + return MultithreadData{ num_threads, start, end }; +} + /** * @brief calculates number of threads to create based on minimum iterations per thread * @details Finds the number of cpus with get_num_cpus(), and calculates `desired_num_threads` diff --git a/barretenberg/cpp/src/barretenberg/common/thread.hpp b/barretenberg/cpp/src/barretenberg/common/thread.hpp index ebf0d037200..c97aab48462 100644 --- a/barretenberg/cpp/src/barretenberg/common/thread.hpp +++ b/barretenberg/cpp/src/barretenberg/common/thread.hpp @@ -88,6 +88,24 @@ std::vector parallel_for_heuristic(size_t num_points, const size_t DEFAULT_MIN_ITERS_PER_THREAD = 1 << 4; +struct MultithreadData { + size_t num_threads; + // index bounds for each thread + std::vector start; + std::vector end; +}; + +/** + * @brief Calculates number of threads and index bounds for each thread + * @details Finds the number of cpus with calculate_num_threads() then divides domain evenly amongst threads + * + * @param num_iterations + * @param min_iterations_per_thread + * @return size_t + */ +MultithreadData calculate_thread_data(size_t num_iterations, + size_t min_iterations_per_thread = DEFAULT_MIN_ITERS_PER_THREAD); + /** * @brief calculates number of threads to create based on minimum iterations per thread * @details Finds the number of cpus with get_num_cpus(), and calculates `desired_num_threads` diff --git a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/append_only_tree/content_addressed_append_only_tree.hpp b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/append_only_tree/content_addressed_append_only_tree.hpp index b27be4d3aae..d25507954eb 100644 --- a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/append_only_tree/content_addressed_append_only_tree.hpp +++ b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/append_only_tree/content_addressed_append_only_tree.hpp @@ -651,7 +651,7 @@ void ContentAddressedAppendOnlyTree::get_leaf(const index_ RequestContext requestContext; requestContext.includeUncommitted = includeUncommitted; requestContext.root = store_->get_current_root(*tx, includeUncommitted); - std::optional leaf_hash = find_leaf_hash(leaf_index, requestContext, *tx); + std::optional leaf_hash = find_leaf_hash(leaf_index, requestContext, *tx, false); response.success = leaf_hash.has_value(); if (response.success) { response.inner.leaf = leaf_hash.value(); @@ -690,7 +690,7 @@ void ContentAddressedAppendOnlyTree::get_leaf(const index_ leaf_index, " for block ", blockNumber, - ", leaf index is too high."); + ", leaf index out of range."); response.success = false; return; } @@ -698,7 +698,7 @@ void ContentAddressedAppendOnlyTree::get_leaf(const index_ requestContext.blockNumber = blockNumber; requestContext.includeUncommitted = includeUncommitted; requestContext.root = blockData.root; - std::optional leaf_hash = find_leaf_hash(leaf_index, requestContext, *tx); + std::optional leaf_hash = find_leaf_hash(leaf_index, requestContext, *tx, false); response.success = leaf_hash.has_value(); if (response.success) { response.inner.leaf = leaf_hash.value(); @@ -746,7 +746,6 @@ void ContentAddressedAppendOnlyTree::find_leaf_indices_fro RequestContext requestContext; requestContext.includeUncommitted = includeUncommitted; - requestContext.root = store_->get_current_root(*tx, includeUncommitted); for (const auto& leaf : leaves) { std::optional leaf_index = @@ -787,7 +786,6 @@ void ContentAddressedAppendOnlyTree::find_leaf_indices_fro RequestContext requestContext; requestContext.blockNumber = blockNumber; requestContext.includeUncommitted = includeUncommitted; - requestContext.root = blockData.root; requestContext.maxIndex = blockData.size; for (const auto& leaf : leaves) { diff --git a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/indexed_tree/content_addressed_indexed_tree.hpp b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/indexed_tree/content_addressed_indexed_tree.hpp index 94b8d2723bf..4144bb206d1 100644 --- a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/indexed_tree/content_addressed_indexed_tree.hpp +++ b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/indexed_tree/content_addressed_indexed_tree.hpp @@ -344,7 +344,7 @@ void ContentAddressedIndexedTree::get_leaf(const index_t& RequestContext requestContext; requestContext.includeUncommitted = includeUncommitted; requestContext.root = store_->get_current_root(*tx, includeUncommitted); - std::optional leaf_hash = find_leaf_hash(index, requestContext, *tx); + std::optional leaf_hash = find_leaf_hash(index, requestContext, *tx, false); if (!leaf_hash.has_value()) { response.success = false; response.message = "Failed to find leaf hash for current root"; @@ -390,7 +390,7 @@ void ContentAddressedIndexedTree::get_leaf(const index_t& requestContext.blockNumber = blockNumber; requestContext.includeUncommitted = includeUncommitted; requestContext.root = blockData.root; - std::optional leaf_hash = find_leaf_hash(index, requestContext, *tx); + std::optional leaf_hash = find_leaf_hash(index, requestContext, *tx, false); if (!leaf_hash.has_value()) { response.success = false; response.message = format("Failed to find leaf hash for root of block ", blockNumber); diff --git a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_database.hpp b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_database.hpp index 6443c996ec3..8f071901414 100644 --- a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_database.hpp +++ b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_database.hpp @@ -12,6 +12,7 @@ class LMDBDatabaseCreationTransaction; class LMDBDatabase { public: using Ptr = std::unique_ptr; + using SharedPtr = std::shared_ptr; LMDBDatabase(LMDBEnvironment::SharedPtr env, const LMDBDatabaseCreationTransaction& transaction, diff --git a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_environment.test.cpp b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_environment.test.cpp new file mode 100644 index 00000000000..c8f13c5bdf7 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_environment.test.cpp @@ -0,0 +1,203 @@ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "barretenberg/common/serialize.hpp" +#include "barretenberg/common/streams.hpp" +#include "barretenberg/common/test.hpp" +#include "barretenberg/crypto/merkle_tree/fixtures.hpp" +#include "barretenberg/crypto/merkle_tree/lmdb_store/lmdb_database.hpp" +#include "barretenberg/crypto/merkle_tree/lmdb_store/lmdb_db_transaction.hpp" +#include "barretenberg/crypto/merkle_tree/lmdb_store/lmdb_environment.hpp" +#include "barretenberg/crypto/merkle_tree/lmdb_store/queries.hpp" +#include "barretenberg/crypto/merkle_tree/signal.hpp" +#include "barretenberg/crypto/merkle_tree/types.hpp" +#include "barretenberg/numeric/random/engine.hpp" +#include "barretenberg/numeric/uint128/uint128.hpp" +#include "barretenberg/numeric/uint256/uint256.hpp" +#include "barretenberg/polynomials/serialize.hpp" +#include "barretenberg/stdlib/primitives/field/field.hpp" +#include "lmdb_tree_store.hpp" + +using namespace bb::stdlib; +using namespace bb::crypto::merkle_tree; + +class LMDBEnvironmentTest : public testing::Test { + protected: + void SetUp() override + { + _directory = random_temp_directory(); + _mapSize = 1024 * 1024; + _maxReaders = 16; + std::filesystem::create_directories(_directory); + } + + void TearDown() override { std::filesystem::remove_all(_directory); } + + static std::string _directory; + static uint32_t _maxReaders; + static uint64_t _mapSize; +}; + +std::string LMDBEnvironmentTest::_directory; +uint32_t LMDBEnvironmentTest::_maxReaders; +uint64_t LMDBEnvironmentTest::_mapSize; + +std::vector serialise(std::string key) +{ + std::vector data(key.begin(), key.end()); + return data; +} + +TEST_F(LMDBEnvironmentTest, can_create_environment) +{ + EXPECT_NO_THROW(LMDBEnvironment environment( + LMDBEnvironmentTest::_directory, LMDBEnvironmentTest::_mapSize, 1, LMDBEnvironmentTest::_maxReaders)); +} + +TEST_F(LMDBEnvironmentTest, can_create_database) +{ + LMDBEnvironment::SharedPtr environment = std::make_shared( + LMDBEnvironmentTest::_directory, LMDBEnvironmentTest::_mapSize, 1, LMDBEnvironmentTest::_maxReaders); + + { + LMDBDatabaseCreationTransaction tx(environment); + LMDBDatabase::SharedPtr db = std::make_unique(environment, tx, "DB", false, false); + EXPECT_NO_THROW(tx.commit()); + } +} + +TEST_F(LMDBEnvironmentTest, can_write_to_database) +{ + LMDBEnvironment::SharedPtr environment = std::make_shared( + LMDBEnvironmentTest::_directory, LMDBEnvironmentTest::_mapSize, 1, LMDBEnvironmentTest::_maxReaders); + + LMDBDatabaseCreationTransaction tx(environment); + LMDBDatabase::SharedPtr db = std::make_unique(environment, tx, "DB", false, false); + EXPECT_NO_THROW(tx.commit()); + + { + LMDBTreeWriteTransaction::SharedPtr tx = std::make_shared(environment); + auto key = serialise(std::string("Key")); + auto data = serialise(std::string("TestData")); + EXPECT_NO_THROW(tx->put_value(key, data, *db)); + EXPECT_NO_THROW(tx->commit()); + } +} + +TEST_F(LMDBEnvironmentTest, can_read_from_database) +{ + LMDBEnvironment::SharedPtr environment = std::make_shared( + LMDBEnvironmentTest::_directory, LMDBEnvironmentTest::_mapSize, 1, LMDBEnvironmentTest::_maxReaders); + + LMDBDatabaseCreationTransaction tx(environment); + LMDBDatabase::SharedPtr db = std::make_unique(environment, tx, "DB", false, false); + EXPECT_NO_THROW(tx.commit()); + + { + LMDBTreeWriteTransaction::SharedPtr tx = std::make_shared(environment); + auto key = serialise(std::string("Key")); + auto data = serialise(std::string("TestData")); + EXPECT_NO_THROW(tx->put_value(key, data, *db)); + EXPECT_NO_THROW(tx->commit()); + } + + { + environment->wait_for_reader(); + LMDBTreeReadTransaction::SharedPtr tx = std::make_shared(environment); + auto key = serialise(std::string("Key")); + auto expected = serialise(std::string("TestData")); + std::vector data; + tx->get_value(key, data, *db); + EXPECT_EQ(data, expected); + } +} + +TEST_F(LMDBEnvironmentTest, can_write_and_read_multiple) +{ + LMDBEnvironment::SharedPtr environment = std::make_shared( + LMDBEnvironmentTest::_directory, LMDBEnvironmentTest::_mapSize, 1, LMDBEnvironmentTest::_maxReaders); + + LMDBDatabaseCreationTransaction tx(environment); + LMDBDatabase::SharedPtr db = std::make_unique(environment, tx, "DB", false, false); + EXPECT_NO_THROW(tx.commit()); + + uint64_t numValues = 10; + + { + for (uint64_t count = 0; count < numValues; count++) { + LMDBTreeWriteTransaction::SharedPtr tx = std::make_shared(environment); + auto key = serialise((std::stringstream() << "Key" << count).str()); + auto data = serialise((std::stringstream() << "TestData" << count).str()); + EXPECT_NO_THROW(tx->put_value(key, data, *db)); + EXPECT_NO_THROW(tx->commit()); + } + } + + { + for (uint64_t count = 0; count < numValues; count++) { + environment->wait_for_reader(); + LMDBTreeReadTransaction::SharedPtr tx = std::make_shared(environment); + auto key = serialise((std::stringstream() << "Key" << count).str()); + auto expected = serialise((std::stringstream() << "TestData" << count).str()); + std::vector data; + tx->get_value(key, data, *db); + EXPECT_EQ(data, expected); + } + } +} + +TEST_F(LMDBEnvironmentTest, can_read_multiple_threads) +{ + LMDBEnvironment::SharedPtr environment = + std::make_shared(LMDBEnvironmentTest::_directory, LMDBEnvironmentTest::_mapSize, 1, 2); + + LMDBDatabaseCreationTransaction tx(environment); + LMDBDatabase::SharedPtr db = std::make_unique(environment, tx, "DB", false, false); + EXPECT_NO_THROW(tx.commit()); + + uint64_t numValues = 10; + uint64_t numIterationsPerThread = 1000; + uint32_t numThreads = 16; + + { + for (uint64_t count = 0; count < numValues; count++) { + LMDBTreeWriteTransaction::SharedPtr tx = std::make_shared(environment); + auto key = serialise((std::stringstream() << "Key" << count).str()); + auto data = serialise((std::stringstream() << "TestData" << count).str()); + EXPECT_NO_THROW(tx->put_value(key, data, *db)); + EXPECT_NO_THROW(tx->commit()); + } + } + + { + auto func = [&]() -> void { + for (uint64_t iteration = 0; iteration < numIterationsPerThread; iteration++) { + for (uint64_t count = 0; count < numValues; count++) { + environment->wait_for_reader(); + LMDBTreeReadTransaction::SharedPtr tx = std::make_shared(environment); + auto key = serialise((std::stringstream() << "Key" << count).str()); + auto expected = serialise((std::stringstream() << "TestData" << count).str()); + std::vector data; + tx->get_value(key, data, *db); + EXPECT_EQ(data, expected); + } + } + }; + std::vector> threads; + for (uint64_t count = 0; count < numThreads; count++) { + threads.emplace_back(std::make_unique(func)); + } + for (uint64_t count = 0; count < numThreads; count++) { + threads[count]->join(); + } + } +} diff --git a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_read_transaction.hpp b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_read_transaction.hpp index 89a20df8e7a..dd94b88b441 100644 --- a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_read_transaction.hpp +++ b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_read_transaction.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include namespace bb::crypto::merkle_tree { @@ -22,6 +23,7 @@ namespace bb::crypto::merkle_tree { class LMDBTreeReadTransaction : public LMDBTransaction { public: using Ptr = std::unique_ptr; + using SharedPtr = std::shared_ptr; LMDBTreeReadTransaction(LMDBEnvironment::SharedPtr env); LMDBTreeReadTransaction(const LMDBTreeReadTransaction& other) = delete; diff --git a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_store.test.cpp b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_store.test.cpp index c33eb42bc23..f7bcbf009f5 100644 --- a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_store.test.cpp +++ b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_store.test.cpp @@ -104,6 +104,48 @@ TEST_F(LMDBTreeStoreTest, can_write_and_read_meta_data) } } +TEST_F(LMDBTreeStoreTest, can_read_data_from_multiple_threads) +{ + TreeMeta metaData; + metaData.committedSize = 56; + metaData.initialSize = 12; + metaData.initialRoot = VALUES[1]; + metaData.root = VALUES[2]; + metaData.depth = 40; + metaData.oldestHistoricBlock = 87; + metaData.unfinalisedBlockHeight = 95; + metaData.name = "Note hash tree"; + metaData.size = 60; + LMDBTreeStore store(_directory, "DB1", _mapSize, 2); + { + LMDBTreeWriteTransaction::Ptr transaction = store.create_write_transaction(); + store.write_meta_data(metaData, *transaction); + transaction->commit(); + } + + uint64_t numIterationsPerThread = 1000; + uint32_t numThreads = 16; + + { + auto func = [&]() -> void { + for (uint64_t iteration = 0; iteration < numIterationsPerThread; iteration++) { + LMDBTreeReadTransaction::Ptr transaction = store.create_read_transaction(); + TreeMeta readBack; + bool success = store.read_meta_data(readBack, *transaction); + EXPECT_TRUE(success); + EXPECT_EQ(readBack, metaData); + } + }; + std::vector> threads; + for (uint64_t count = 0; count < numThreads; count++) { + threads.emplace_back(std::make_unique(func)); + } + for (uint64_t count = 0; count < numThreads; count++) { + threads[count]->join(); + } + } +} + TEST_F(LMDBTreeStoreTest, can_write_and_read_multiple_blocks_with_meta) { LMDBTreeStore store(_directory, "DB1", _mapSize, _maxReaders); diff --git a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_write_transaction.hpp b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_write_transaction.hpp index 927e14fb4fa..0ad9cdd5a9f 100644 --- a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_write_transaction.hpp +++ b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/lmdb_store/lmdb_tree_write_transaction.hpp @@ -22,6 +22,7 @@ namespace bb::crypto::merkle_tree { class LMDBTreeWriteTransaction : public LMDBTransaction { public: using Ptr = std::unique_ptr; + using SharedPtr = std::shared_ptr; LMDBTreeWriteTransaction(LMDBEnvironment::SharedPtr env); LMDBTreeWriteTransaction(const LMDBTreeWriteTransaction& other) = delete; diff --git a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/node_store/cached_content_addressed_tree_store.hpp b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/node_store/cached_content_addressed_tree_store.hpp index cdd5e102754..5fce392b619 100644 --- a/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/node_store/cached_content_addressed_tree_store.hpp +++ b/barretenberg/cpp/src/barretenberg/crypto/merkle_tree/node_store/cached_content_addressed_tree_store.hpp @@ -157,7 +157,7 @@ template class ContentAddressedCachedTreeStore { /** * @brief Returns the name of the tree */ - std::string get_name() const { return name_; } + std::string get_name() const { return forkConstantData_.name_; } /** * @brief Returns a read transaction against the underlying store. @@ -187,9 +187,12 @@ template class ContentAddressedCachedTreeStore { std::optional find_block_for_index(const index_t& index, ReadTransaction& tx) const; private: - std::string name_; - uint32_t depth_; - std::optional initialised_from_block_; + struct ForkConstantData { + std::string name_; + uint32_t depth_; + std::optional initialised_from_block_; + }; + ForkConstantData forkConstantData_; // This is a mapping between the node hash and it's payload (children and ref count) for every node in the tree, // including leaves. As indexed trees are updated, this will end up containing many nodes that are not part of the @@ -217,7 +220,7 @@ template class ContentAddressedCachedTreeStore { bool read_persisted_meta(TreeMeta& m, ReadTransaction& tx) const; - void enrich_meta_from_block(TreeMeta& m) const; + void enrich_meta_from_fork_constant_data(TreeMeta& m) const; void persist_meta(TreeMeta& m, WriteTransaction& tx); @@ -242,7 +245,7 @@ template class ContentAddressedCachedTreeStore { void delete_block_for_index(const block_number_t& blockNumber, const index_t& index, WriteTransaction& tx); - index_t constrain_tree_size(const RequestContext& requestContext, ReadTransaction& tx) const; + index_t constrain_tree_size_to_only_committed(const RequestContext& requestContext, ReadTransaction& tx) const; WriteTransactionPtr create_write_transaction() const { return dataStore_->create_write_transaction(); } }; @@ -251,10 +254,9 @@ template ContentAddressedCachedTreeStore::ContentAddressedCachedTreeStore(std::string name, uint32_t levels, PersistedStoreType::SharedPtr dataStore) - : name_(std::move(name)) - , depth_(levels) + : forkConstantData_{ .name_ = (std::move(name)), .depth_ = levels } , dataStore_(dataStore) - , nodes_by_index_(std::vector>(depth_ + 1, std::unordered_map())) + , nodes_by_index_(std::vector>(levels + 1, std::unordered_map())) { initialise(); } @@ -264,23 +266,30 @@ ContentAddressedCachedTreeStore::ContentAddressedCachedTreeStore( uint32_t levels, const index_t& referenceBlockNumber, PersistedStoreType::SharedPtr dataStore) - : name_(std::move(name)) - , depth_(levels) + : forkConstantData_{ .name_ = (std::move(name)), .depth_ = levels } , dataStore_(dataStore) - , nodes_by_index_(std::vector>(depth_ + 1, std::unordered_map())) + , nodes_by_index_(std::vector>(levels + 1, std::unordered_map())) { initialise_from_block(referenceBlockNumber); } template -index_t ContentAddressedCachedTreeStore::constrain_tree_size(const RequestContext& requestContext, - ReadTransaction& tx) const +index_t ContentAddressedCachedTreeStore::constrain_tree_size_to_only_committed( + const RequestContext& requestContext, ReadTransaction& tx) const { // We need to identify the size of the committed tree as it exists from our perspective - // To do this we read the uncommitted meta which will contained the committed size at our initialisation point - TreeMeta m; - get_meta(m, tx, true); - index_t sizeLimit = m.committedSize; + // We either take from the fork's constant data if available or we read the meta data from the store + index_t sizeLimit = 0; + if (forkConstantData_.initialised_from_block_.has_value()) { + // We are a fork. Take from constant data + sizeLimit = forkConstantData_.initialised_from_block_.value().size; + } else { + // We are the main tree. Read from the store, only use committed so as to not violate any requests for purely + // committed data + TreeMeta m; + get_meta(m, tx, false); + sizeLimit = m.committedSize; + } if (requestContext.maxIndex.has_value() && requestContext.maxIndex.value() < sizeLimit) { sizeLimit = requestContext.maxIndex.value(); } @@ -293,7 +302,7 @@ std::optional ContentAddressedCachedTreeStore::fi { RequestContext context; context.maxIndex = index + 1; - index_t constrainedSize = constrain_tree_size(context, tx); + index_t constrainedSize = constrain_tree_size_to_only_committed(context, tx); if (index >= constrainedSize) { return std::nullopt; } @@ -324,7 +333,11 @@ std::pair ContentAddressedCachedTreeStore::find_lo { auto new_value_as_number = uint256_t(new_leaf_key); index_t committed = 0; - std::optional sizeLimit = constrain_tree_size(requestContext, tx); + + // We first read committed data, so we must constrin the search to only the data committed from our perspective + // That means, if we are a fork, the committed size is the size of the tree as it was when we forked + // If we are the main tree, the committed size is the size of the tree as it is now + std::optional sizeLimit = constrain_tree_size_to_only_committed(requestContext, tx); fr found_key = dataStore_->find_low_leaf(new_leaf_key, committed, sizeLimit, tx); index_t db_index = committed; @@ -469,7 +482,10 @@ std::optional ContentAddressedCachedTreeStore::find_leaf FrKeyType key = leaf; bool success = dataStore_->read_leaf_index(key, committed, tx); if (success) { - index_t sizeLimit = constrain_tree_size(requestContext, tx); + // We must constrin the search to only the data committed from our perspective + // That means, if we are a fork, the committed size is the size of the tree as it was when we forked + // If we are the main tree, the committed size is the size of the tree as it is now + index_t sizeLimit = constrain_tree_size_to_only_committed(requestContext, tx); if (committed < start_index) { return std::nullopt; } @@ -576,18 +592,22 @@ bool ContentAddressedCachedTreeStore::read_persisted_meta(TreeMet if (!dataStore_->read_meta_data(m, tx)) { return false; } - enrich_meta_from_block(m); + // Having read the meta from the store, we need to enrich it with the fork constant data if available + enrich_meta_from_fork_constant_data(m); return true; } template -void ContentAddressedCachedTreeStore::enrich_meta_from_block(TreeMeta& m) const +void ContentAddressedCachedTreeStore::enrich_meta_from_fork_constant_data(TreeMeta& m) const { - if (initialised_from_block_.has_value()) { - m.size = initialised_from_block_->size; - m.committedSize = initialised_from_block_->size; - m.root = initialised_from_block_->root; - m.unfinalisedBlockHeight = initialised_from_block_->blockNumber; + // Here we update the given meta with properties from our constant fork data if available. + // If we are not a fork then nothing is to be updated + // If we are a fork then we will overwrite the root, size and committed size with the original fork values + if (forkConstantData_.initialised_from_block_.has_value()) { + m.size = forkConstantData_.initialised_from_block_->size; + m.committedSize = forkConstantData_.initialised_from_block_->size; + m.root = forkConstantData_.initialised_from_block_->root; + m.unfinalisedBlockHeight = forkConstantData_.initialised_from_block_->blockNumber; } } @@ -616,7 +636,7 @@ void ContentAddressedCachedTreeStore::commit(TreeMeta& finalMeta, TreeMeta uncommittedMeta; TreeMeta committedMeta; // We don't allow commits using images/forks - if (initialised_from_block_.has_value()) { + if (forkConstantData_.initialised_from_block_.has_value()) { throw std::runtime_error("Committing a fork is forbidden"); } { @@ -667,7 +687,8 @@ void ContentAddressedCachedTreeStore::commit(TreeMeta& finalMeta, tx->commit(); } catch (std::exception& e) { tx->try_abort(); - throw std::runtime_error(format("Unable to commit data to tree: ", name_, " Error: ", e.what())); + throw std::runtime_error( + format("Unable to commit data to tree: ", forkConstantData_.name_, " Error: ", e.what())); } } finalMeta = uncommittedMeta; @@ -732,7 +753,7 @@ void ContentAddressedCachedTreeStore::persist_node(const std::opt } fr hash = so.opHash.value(); - if (so.lvl == depth_) { + if (so.lvl == forkConstantData_.depth_) { // this is a leaf persist_leaf_pre_image(hash, tx); } @@ -767,7 +788,8 @@ template void ContentAddressedCachedTreeStore(); indices_ = std::map(); leaves_ = std::unordered_map(); - nodes_by_index_ = std::vector>(depth_ + 1, std::unordered_map()); + nodes_by_index_ = + std::vector>(forkConstantData_.depth_ + 1, std::unordered_map()); leaf_pre_image_by_index_ = std::unordered_map(); } @@ -784,9 +806,10 @@ void ContentAddressedCachedTreeStore::advance_finalised_block(con TreeMeta uncommittedMeta; BlockPayload blockPayload; if (blockNumber < 1) { - throw std::runtime_error(format("Unable to advance finalised block: ", blockNumber, ". Tree name: ", name_)); + throw std::runtime_error( + format("Unable to advance finalised block: ", blockNumber, ". Tree name: ", forkConstantData_.name_)); } - if (initialised_from_block_.has_value()) { + if (forkConstantData_.initialised_from_block_.has_value()) { throw std::runtime_error("Advancing the finalised block on a fork is forbidden"); } { @@ -795,8 +818,10 @@ void ContentAddressedCachedTreeStore::advance_finalised_block(con get_meta(uncommittedMeta, *tx, true); get_meta(committedMeta, *tx, false); if (!dataStore_->read_block_data(blockNumber, blockPayload, *tx)) { - throw std::runtime_error(format( - "Unable to advance finalised block: ", blockNumber, ". Failed to read block data. Tree name: ", name_)); + throw std::runtime_error(format("Unable to advance finalised block: ", + blockNumber, + ". Failed to read block data. Tree name: ", + forkConstantData_.name_)); } } // can only finalise blocks that are not finalised @@ -827,7 +852,7 @@ void ContentAddressedCachedTreeStore::advance_finalised_block(con throw std::runtime_error(format("Unable to commit advance of finalised block: ", blockNumber, ". Tree name: ", - name_, + forkConstantData_.name_, " Error: ", e.what())); } @@ -847,9 +872,10 @@ void ContentAddressedCachedTreeStore::unwind_block(const block_nu BlockPayload blockData; BlockPayload previousBlockData; if (blockNumber < 1) { - throw std::runtime_error(format("Unable to unwind block: ", blockNumber, ". Tree name: ", name_)); + throw std::runtime_error( + format("Unable to unwind block: ", blockNumber, ". Tree name: ", forkConstantData_.name_)); } - if (initialised_from_block_.has_value()) { + if (forkConstantData_.initialised_from_block_.has_value()) { throw std::runtime_error("Removing a block on a fork is forbidden"); } { @@ -861,7 +887,7 @@ void ContentAddressedCachedTreeStore::unwind_block(const block_nu format("Unable to unwind block: ", blockNumber, " Can't unwind with uncommitted data, first rollback before unwinding. Tree name: ", - name_)); + forkConstantData_.name_)); } if (blockNumber != uncommittedMeta.unfinalisedBlockHeight) { throw std::runtime_error(format("Unable to unwind block: ", @@ -869,7 +895,7 @@ void ContentAddressedCachedTreeStore::unwind_block(const block_nu " unfinalisedBlockHeight: ", committedMeta.unfinalisedBlockHeight, ". Tree name: ", - name_)); + forkConstantData_.name_)); } if (blockNumber <= uncommittedMeta.finalisedBlockHeight) { throw std::runtime_error(format("Unable to unwind block: ", @@ -877,7 +903,7 @@ void ContentAddressedCachedTreeStore::unwind_block(const block_nu " finalisedBlockHeight: ", committedMeta.finalisedBlockHeight, ". Tree name: ", - name_)); + forkConstantData_.name_)); } // populate the required data for the previous block @@ -886,14 +912,18 @@ void ContentAddressedCachedTreeStore::unwind_block(const block_nu previousBlockData.size = uncommittedMeta.initialSize; previousBlockData.blockNumber = 0; } else if (!dataStore_->read_block_data(blockNumber - 1, previousBlockData, *tx)) { - throw std::runtime_error(format( - "Unable to unwind block: ", blockNumber, ". Failed to read previous block data. Tree name: ", name_)); + throw std::runtime_error(format("Unable to unwind block: ", + blockNumber, + ". Failed to read previous block data. Tree name: ", + forkConstantData_.name_)); } // now get the root for the block we want to unwind if (!dataStore_->read_block_data(blockNumber, blockData, *tx)) { - throw std::runtime_error( - format("Unable to unwind block: ", blockNumber, ". Failed to read block data. Tree name: ", name_)); + throw std::runtime_error(format("Unable to unwind block: ", + blockNumber, + ". Failed to read block data. Tree name: ", + forkConstantData_.name_)); } } WriteTransactionPtr writeTx = create_write_transaction(); @@ -916,8 +946,12 @@ void ContentAddressedCachedTreeStore::unwind_block(const block_nu writeTx->commit(); } catch (std::exception& e) { writeTx->try_abort(); - throw std::runtime_error( - format("Unable to commit unwind of block: ", blockNumber, ". Tree name: ", name_, " Error: ", e.what())); + throw std::runtime_error(format("Unable to commit unwind of block: ", + blockNumber, + ". Tree name: ", + forkConstantData_.name_, + " Error: ", + e.what())); } // now update the uncommitted meta @@ -936,9 +970,10 @@ void ContentAddressedCachedTreeStore::remove_historical_block(con TreeMeta uncommittedMeta; BlockPayload blockData; if (blockNumber < 1) { - throw std::runtime_error(format("Unable to remove historical block: ", blockNumber, ". Tree name: ", name_)); + throw std::runtime_error( + format("Unable to remove historical block: ", blockNumber, ". Tree name: ", forkConstantData_.name_)); } - if (initialised_from_block_.has_value()) { + if (forkConstantData_.initialised_from_block_.has_value()) { throw std::runtime_error("Removing a block on a fork is forbidden"); } { @@ -953,7 +988,7 @@ void ContentAddressedCachedTreeStore::remove_historical_block(con " oldestHistoricBlock: ", committedMeta.oldestHistoricBlock, ". Tree name: ", - name_)); + forkConstantData_.name_)); } if (blockNumber >= committedMeta.finalisedBlockHeight) { throw std::runtime_error(format("Unable to remove historical block: ", @@ -961,12 +996,14 @@ void ContentAddressedCachedTreeStore::remove_historical_block(con " oldestHistoricBlock: ", committedMeta.finalisedBlockHeight, ". Tree name: ", - name_)); + forkConstantData_.name_)); } if (!dataStore_->read_block_data(blockNumber, blockData, *tx)) { - throw std::runtime_error(format( - "Unable to remove historical block: ", blockNumber, ". Failed to read block data. Tree name: ", name_)); + throw std::runtime_error(format("Unable to remove historical block: ", + blockNumber, + ". Failed to read block data. Tree name: ", + forkConstantData_.name_)); } } WriteTransactionPtr writeTx = create_write_transaction(); @@ -985,7 +1022,7 @@ void ContentAddressedCachedTreeStore::remove_historical_block(con throw std::runtime_error(format("Unable to commit removal of historical block: ", blockNumber, ". Tree name: ", - name_, + forkConstantData_.name_, " Error: ", e.what())); } @@ -1072,7 +1109,7 @@ void ContentAddressedCachedTreeStore::remove_node(const std::opti continue; } // the node was deleted, if it was a leaf then we need to remove the pre-image - if (so.lvl == depth_) { + if (so.lvl == forkConstantData_.depth_) { remove_leaf(hash, maxIndex, tx); } // push the child nodes to the stack @@ -1090,20 +1127,21 @@ template void ContentAddressedCachedTreeStore::initialise_from_block(const ReadTransactionPtr tx = create_read_transaction(); bool success = read_persisted_meta(meta_, *tx); if (success) { - if (name_ != meta_.name || depth_ != meta_.depth) { + if (forkConstantData_.name_ != meta_.name || forkConstantData_.depth_ != meta_.depth) { throw std::runtime_error(format("Inconsistent tree meta data when initialising ", - name_, + forkConstantData_.name_, " with depth ", - depth_, + forkConstantData_.depth_, " from block ", blockNumber, " stored name: ", @@ -1142,8 +1180,10 @@ void ContentAddressedCachedTreeStore::initialise_from_block(const } } else { - throw std::runtime_error(format( - "Tree found to be uninitialised when attempting to create ", name_, " from block ", blockNumber)); + throw std::runtime_error(format("Tree found to be uninitialised when attempting to create ", + forkConstantData_.name_, + " from block ", + blockNumber)); } if (meta_.unfinalisedBlockHeight < blockNumber) { @@ -1152,7 +1192,7 @@ void ContentAddressedCachedTreeStore::initialise_from_block(const " unfinalisedBlockHeight: ", meta_.unfinalisedBlockHeight, ". Tree name: ", - name_)); + forkConstantData_.name_)); } if (meta_.oldestHistoricBlock > blockNumber && blockNumber != 0) { throw std::runtime_error(format("Unable to fork from expired historical block: ", @@ -1160,7 +1200,7 @@ void ContentAddressedCachedTreeStore::initialise_from_block(const " unfinalisedBlockHeight: ", meta_.oldestHistoricBlock, ". Tree name: ", - name_)); + forkConstantData_.name_)); } BlockPayload blockData; if (blockNumber == 0) { @@ -1168,18 +1208,20 @@ void ContentAddressedCachedTreeStore::initialise_from_block(const blockData.root = meta_.initialRoot; blockData.size = meta_.initialSize; } else if (get_block_data(blockNumber, blockData, *tx) == false) { - throw std::runtime_error(format("Failed to retrieve block data: ", blockNumber, ". Tree name: ", name_)); + throw std::runtime_error( + format("Failed to retrieve block data: ", blockNumber, ". Tree name: ", forkConstantData_.name_)); } - initialised_from_block_ = blockData; - enrich_meta_from_block(meta_); + forkConstantData_.initialised_from_block_ = blockData; + // Ensure the meta reflects the fork constant data + enrich_meta_from_fork_constant_data(meta_); } } template std::optional ContentAddressedCachedTreeStore::get_fork_block() const { - if (initialised_from_block_.has_value()) { - return initialised_from_block_->blockNumber; + if (forkConstantData_.initialised_from_block_.has_value()) { + return forkConstantData_.initialised_from_block_->blockNumber; } return std::nullopt; } diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp index 98c352bcb32..45b72b21ba6 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp @@ -254,6 +254,18 @@ library Honk { G1Point lagrangeLast; } + struct RelationParameters { + // challenges + Fr eta; + Fr etaTwo; + Fr etaThree; + Fr beta; + Fr gamma; + // derived + Fr publicInputsDelta; + } + + struct Proof { uint256 circuitSize; uint256 publicInputsSize; @@ -280,24 +292,20 @@ library Honk { } } - // Transcript library to generate fiat shamir challenges struct Transcript { - Fr eta; - Fr etaTwo; - Fr etaThree; - Fr beta; - Fr gamma; + // Oink + Honk.RelationParameters relationParameters; Fr[NUMBER_OF_ALPHAS] alphas; Fr[CONST_PROOF_SIZE_LOG_N] gateChallenges; + // Sumcheck Fr[CONST_PROOF_SIZE_LOG_N] sumCheckUChallenges; - // Shplemini + // Gemini Fr rho; Fr geminiR; + // Shplonk Fr shplonkNu; Fr shplonkZ; - // Derived - Fr publicInputsDelta; } library TranscriptLib { @@ -307,9 +315,9 @@ library TranscriptLib { returns (Transcript memory t) { Fr previousChallenge; - (t.eta, t.etaTwo, t.etaThree, previousChallenge) = generateEtaChallenge(proof, publicInputs, publicInputsSize); + (t.relationParameters, previousChallenge) = + generateRelationParametersChallenges(proof, publicInputs, publicInputsSize, previousChallenge); - (t.beta, t.gamma, previousChallenge) = generateBetaAndGammaChallenges(previousChallenge, proof); (t.alphas, previousChallenge) = generateAlphaChallenges(previousChallenge, proof); @@ -336,6 +344,19 @@ library TranscriptLib { second = FrLib.fromBytes32(bytes32(hi)); } + function generateRelationParametersChallenges( + Honk.Proof memory proof, + bytes32[] calldata publicInputs, + uint256 publicInputsSize, + Fr previousChallenge + ) internal pure returns (Honk.RelationParameters memory rp, Fr nextPreviousChallenge) { + (rp.eta, rp.etaTwo, rp.etaThree, previousChallenge) = + generateEtaChallenge(proof, publicInputs, publicInputsSize); + + (rp.beta, rp.gamma, nextPreviousChallenge) = generateBetaAndGammaChallenges(previousChallenge, proof); + + } + function generateEtaChallenge(Honk.Proof memory proof, bytes32[] calldata publicInputs, uint256 publicInputsSize) internal pure @@ -531,152 +552,83 @@ library TranscriptLib { (shplonkZ, unused) = splitChallenge(nextPreviousChallenge); } - function loadProof(bytes calldata proof) internal pure returns (Honk.Proof memory) { - Honk.Proof memory p; - + function loadProof(bytes calldata proof) internal pure returns (Honk.Proof memory p) { // Metadata p.circuitSize = uint256(bytes32(proof[0x00:0x20])); p.publicInputsSize = uint256(bytes32(proof[0x20:0x40])); p.publicInputsOffset = uint256(bytes32(proof[0x40:0x60])); // Commitments - p.w1 = Honk.G1ProofPoint({ - x_0: uint256(bytes32(proof[0x60:0x80])), - x_1: uint256(bytes32(proof[0x80:0xa0])), - y_0: uint256(bytes32(proof[0xa0:0xc0])), - y_1: uint256(bytes32(proof[0xc0:0xe0])) - }); - - p.w2 = Honk.G1ProofPoint({ - x_0: uint256(bytes32(proof[0xe0:0x100])), - x_1: uint256(bytes32(proof[0x100:0x120])), - y_0: uint256(bytes32(proof[0x120:0x140])), - y_1: uint256(bytes32(proof[0x140:0x160])) - }); - p.w3 = Honk.G1ProofPoint({ - x_0: uint256(bytes32(proof[0x160:0x180])), - x_1: uint256(bytes32(proof[0x180:0x1a0])), - y_0: uint256(bytes32(proof[0x1a0:0x1c0])), - y_1: uint256(bytes32(proof[0x1c0:0x1e0])) - }); + p.w1 = bytesToG1ProofPoint(proof[0x60:0xe0]); + + p.w2 = bytesToG1ProofPoint(proof[0xe0:0x160]); + p.w3 = bytesToG1ProofPoint(proof[0x160:0x1e0]); // Lookup / Permutation Helper Commitments - p.lookupReadCounts = Honk.G1ProofPoint({ - x_0: uint256(bytes32(proof[0x1e0:0x200])), - x_1: uint256(bytes32(proof[0x200:0x220])), - y_0: uint256(bytes32(proof[0x220:0x240])), - y_1: uint256(bytes32(proof[0x240:0x260])) - }); - p.lookupReadTags = Honk.G1ProofPoint({ - x_0: uint256(bytes32(proof[0x260:0x280])), - x_1: uint256(bytes32(proof[0x280:0x2a0])), - y_0: uint256(bytes32(proof[0x2a0:0x2c0])), - y_1: uint256(bytes32(proof[0x2c0:0x2e0])) - }); - p.w4 = Honk.G1ProofPoint({ - x_0: uint256(bytes32(proof[0x2e0:0x300])), - x_1: uint256(bytes32(proof[0x300:0x320])), - y_0: uint256(bytes32(proof[0x320:0x340])), - y_1: uint256(bytes32(proof[0x340:0x360])) - }); - p.lookupInverses = Honk.G1ProofPoint({ - x_0: uint256(bytes32(proof[0x360:0x380])), - x_1: uint256(bytes32(proof[0x380:0x3a0])), - y_0: uint256(bytes32(proof[0x3a0:0x3c0])), - y_1: uint256(bytes32(proof[0x3c0:0x3e0])) - }); - p.zPerm = Honk.G1ProofPoint({ - x_0: uint256(bytes32(proof[0x3e0:0x400])), - x_1: uint256(bytes32(proof[0x400:0x420])), - y_0: uint256(bytes32(proof[0x420:0x440])), - y_1: uint256(bytes32(proof[0x440:0x460])) - }); - - // Boundary represents a pointer to the head of the unread part of the proof + p.lookupReadCounts = bytesToG1ProofPoint(proof[0x1e0:0x260]); + p.lookupReadTags = bytesToG1ProofPoint(proof[0x260:0x2e0]); + p.w4 = bytesToG1ProofPoint(proof[0x2e0:0x360]); + p.lookupInverses = bytesToG1ProofPoint(proof[0x360:0x3e0]); + p.zPerm = bytesToG1ProofPoint(proof[0x3e0:0x460]); uint256 boundary = 0x460; // Sumcheck univariates for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) { - // The loop boundary of i, this will shift forward on each evaluation - uint256 loop_boundary = boundary + (i * 0x20 * BATCHED_RELATION_PARTIAL_LENGTH); - for (uint256 j = 0; j < BATCHED_RELATION_PARTIAL_LENGTH; j++) { - uint256 start = loop_boundary + (j * 0x20); - uint256 end = start + 0x20; - p.sumcheckUnivariates[i][j] = FrLib.fromBytes32(bytes32(proof[start:end])); + p.sumcheckUnivariates[i][j] = bytesToFr(proof[boundary:boundary + 0x20]); + boundary += 0x20; } } - - boundary = boundary + (CONST_PROOF_SIZE_LOG_N * BATCHED_RELATION_PARTIAL_LENGTH * 0x20); // Sumcheck evaluations for (uint256 i = 0; i < NUMBER_OF_ENTITIES; i++) { - uint256 start = boundary + (i * 0x20); - uint256 end = start + 0x20; - p.sumcheckEvaluations[i] = FrLib.fromBytes32(bytes32(proof[start:end])); + p.sumcheckEvaluations[i] = bytesToFr(proof[boundary:boundary + 0x20]); + boundary += 0x20; } - boundary = boundary + (NUMBER_OF_ENTITIES * 0x20); - // Gemini // Read gemini fold univariates for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N - 1; i++) { - uint256 xStart = boundary + (i * 0x80); - uint256 xEnd = xStart + 0x20; - - uint256 x1Start = xEnd; - uint256 x1End = x1Start + 0x20; - - uint256 yStart = x1End; - uint256 yEnd = yStart + 0x20; - - uint256 y1Start = yEnd; - uint256 y1End = y1Start + 0x20; - p.geminiFoldComms[i] = Honk.G1ProofPoint({ - x_0: uint256(bytes32(proof[xStart:xEnd])), - x_1: uint256(bytes32(proof[x1Start:x1End])), - y_0: uint256(bytes32(proof[yStart:yEnd])), - y_1: uint256(bytes32(proof[y1Start:y1End])) - }); + p.geminiFoldComms[i] = bytesToG1ProofPoint(proof[boundary:boundary + 0x80]); + boundary += 0x80; } - boundary = boundary + ((CONST_PROOF_SIZE_LOG_N - 1) * 0x80); - // Read gemini a evaluations for (uint256 i = 0; i < CONST_PROOF_SIZE_LOG_N; i++) { - uint256 start = boundary + (i * 0x20); - uint256 end = start + 0x20; - p.geminiAEvaluations[i] = FrLib.fromBytes32(bytes32(proof[start:end])); + p.geminiAEvaluations[i] = bytesToFr(proof[boundary:boundary + 0x20]); + boundary += 0x20; } - boundary = boundary + (CONST_PROOF_SIZE_LOG_N * 0x20); - // Shplonk - p.shplonkQ = Honk.G1ProofPoint({ - x_0: uint256(bytes32(proof[boundary:boundary + 0x20])), - x_1: uint256(bytes32(proof[boundary + 0x20:boundary + 0x40])), - y_0: uint256(bytes32(proof[boundary + 0x40:boundary + 0x60])), - y_1: uint256(bytes32(proof[boundary + 0x60:boundary + 0x80])) - }); - + p.shplonkQ = bytesToG1ProofPoint(proof[boundary:boundary + 0x80]); boundary = boundary + 0x80; - // KZG - p.kzgQuotient = Honk.G1ProofPoint({ - x_0: uint256(bytes32(proof[boundary:boundary + 0x20])), - x_1: uint256(bytes32(proof[boundary + 0x20:boundary + 0x40])), - y_0: uint256(bytes32(proof[boundary + 0x40:boundary + 0x60])), - y_1: uint256(bytes32(proof[boundary + 0x60:boundary + 0x80])) - }); - - return p; + p.kzgQuotient = bytesToG1ProofPoint(proof[boundary:boundary + 0x80]); } } + +// Fr utility + +function bytesToFr(bytes calldata proofSection) pure returns (Fr scalar) { + require(proofSection.length == 0x20, "invalid bytes scalar"); + scalar = FrLib.fromBytes32(bytes32(proofSection)); +} + // EC Point utilities function convertProofPoint(Honk.G1ProofPoint memory input) pure returns (Honk.G1Point memory) { return Honk.G1Point({x: input.x_0 | (input.x_1 << 136), y: input.y_0 | (input.y_1 << 136)}); } +function bytesToG1ProofPoint(bytes calldata proofSection) pure returns (Honk.G1ProofPoint memory point) { + require(proofSection.length == 0x80, "invalid bytes point"); + point = Honk.G1ProofPoint({ + x_0: uint256(bytes32(proofSection[0x00:0x20])), + x_1: uint256(bytes32(proofSection[0x20:0x40])), + y_0: uint256(bytes32(proofSection[0x40:0x60])), + y_1: uint256(bytes32(proofSection[0x60:0x80])) + }); +} + function ecMul(Honk.G1Point memory point, Fr scalar) view returns (Honk.G1Point memory) { bytes memory input = abi.encodePacked(point.x, point.y, Fr.unwrap(scalar)); (bool success, bytes memory result) = address(0x07).staticcall(input); @@ -715,25 +667,26 @@ function negateInplace(Honk.G1Point memory point) pure returns (Honk.G1Point mem library RelationsLib { Fr internal constant GRUMPKIN_CURVE_B_PARAMETER_NEGATED = Fr.wrap(17); // -(-17) - function accumulateRelationEvaluations(Honk.Proof memory proof, Transcript memory tp, Fr powPartialEval) - internal - pure - returns (Fr accumulator) - { + function accumulateRelationEvaluations( + Honk.Proof memory proof, + Honk.RelationParameters memory rp, + Fr[NUMBER_OF_ALPHAS] memory alphas, + Fr powPartialEval + ) internal pure returns (Fr accumulator) { Fr[NUMBER_OF_ENTITIES] memory purportedEvaluations = proof.sumcheckEvaluations; Fr[NUMBER_OF_SUBRELATIONS] memory evaluations; // Accumulate all relations in Ultra Honk - each with varying number of subrelations accumulateArithmeticRelation(purportedEvaluations, evaluations, powPartialEval); - accumulatePermutationRelation(purportedEvaluations, tp, evaluations, powPartialEval); - accumulateLogDerivativeLookupRelation(purportedEvaluations, tp, evaluations, powPartialEval); + accumulatePermutationRelation(purportedEvaluations, rp, evaluations, powPartialEval); + accumulateLogDerivativeLookupRelation(purportedEvaluations, rp, evaluations, powPartialEval); accumulateDeltaRangeRelation(purportedEvaluations, evaluations, powPartialEval); accumulateEllipticRelation(purportedEvaluations, evaluations, powPartialEval); - accumulateAuxillaryRelation(purportedEvaluations, tp, evaluations, powPartialEval); + accumulateAuxillaryRelation(purportedEvaluations, rp, evaluations, powPartialEval); accumulatePoseidonExternalRelation(purportedEvaluations, evaluations, powPartialEval); accumulatePoseidonInternalRelation(purportedEvaluations, evaluations, powPartialEval); // batch the subrelations with the alpha challenges to obtain the full honk relation - accumulator = scaleAndBatchSubrelations(evaluations, tp.alphas); + accumulator = scaleAndBatchSubrelations(evaluations, alphas); } /** @@ -782,7 +735,7 @@ library RelationsLib { function accumulatePermutationRelation( Fr[NUMBER_OF_ENTITIES] memory p, - Transcript memory tp, + Honk.RelationParameters memory rp, Fr[NUMBER_OF_SUBRELATIONS] memory evals, Fr domainSep ) internal pure { @@ -790,18 +743,18 @@ library RelationsLib { Fr grand_product_denominator; { - Fr num = wire(p, WIRE.W_L) + wire(p, WIRE.ID_1) * tp.beta + tp.gamma; - num = num * (wire(p, WIRE.W_R) + wire(p, WIRE.ID_2) * tp.beta + tp.gamma); - num = num * (wire(p, WIRE.W_O) + wire(p, WIRE.ID_3) * tp.beta + tp.gamma); - num = num * (wire(p, WIRE.W_4) + wire(p, WIRE.ID_4) * tp.beta + tp.gamma); + Fr num = wire(p, WIRE.W_L) + wire(p, WIRE.ID_1) * rp.beta + rp.gamma; + num = num * (wire(p, WIRE.W_R) + wire(p, WIRE.ID_2) * rp.beta + rp.gamma); + num = num * (wire(p, WIRE.W_O) + wire(p, WIRE.ID_3) * rp.beta + rp.gamma); + num = num * (wire(p, WIRE.W_4) + wire(p, WIRE.ID_4) * rp.beta + rp.gamma); grand_product_numerator = num; } { - Fr den = wire(p, WIRE.W_L) + wire(p, WIRE.SIGMA_1) * tp.beta + tp.gamma; - den = den * (wire(p, WIRE.W_R) + wire(p, WIRE.SIGMA_2) * tp.beta + tp.gamma); - den = den * (wire(p, WIRE.W_O) + wire(p, WIRE.SIGMA_3) * tp.beta + tp.gamma); - den = den * (wire(p, WIRE.W_4) + wire(p, WIRE.SIGMA_4) * tp.beta + tp.gamma); + Fr den = wire(p, WIRE.W_L) + wire(p, WIRE.SIGMA_1) * rp.beta + rp.gamma; + den = den * (wire(p, WIRE.W_R) + wire(p, WIRE.SIGMA_2) * rp.beta + rp.gamma); + den = den * (wire(p, WIRE.W_O) + wire(p, WIRE.SIGMA_3) * rp.beta + rp.gamma); + den = den * (wire(p, WIRE.W_4) + wire(p, WIRE.SIGMA_4) * rp.beta + rp.gamma); grand_product_denominator = den; } @@ -812,7 +765,7 @@ library RelationsLib { acc = acc - ( - (wire(p, WIRE.Z_PERM_SHIFT) + (wire(p, WIRE.LAGRANGE_LAST) * tp.publicInputsDelta)) + (wire(p, WIRE.Z_PERM_SHIFT) + (wire(p, WIRE.LAGRANGE_LAST) * rp.publicInputsDelta)) * grand_product_denominator ); acc = acc * domainSep; @@ -828,7 +781,7 @@ library RelationsLib { function accumulateLogDerivativeLookupRelation( Fr[NUMBER_OF_ENTITIES] memory p, - Transcript memory tp, + Honk.RelationParameters memory rp, Fr[NUMBER_OF_SUBRELATIONS] memory evals, Fr domainSep ) internal pure { @@ -837,18 +790,18 @@ library RelationsLib { // Calculate the write term (the table accumulation) { - write_term = wire(p, WIRE.TABLE_1) + tp.gamma + (wire(p, WIRE.TABLE_2) * tp.eta) - + (wire(p, WIRE.TABLE_3) * tp.etaTwo) + (wire(p, WIRE.TABLE_4) * tp.etaThree); + write_term = wire(p, WIRE.TABLE_1) + rp.gamma + (wire(p, WIRE.TABLE_2) * rp.eta) + + (wire(p, WIRE.TABLE_3) * rp.etaTwo) + (wire(p, WIRE.TABLE_4) * rp.etaThree); } // Calculate the write term { - Fr derived_entry_1 = wire(p, WIRE.W_L) + tp.gamma + (wire(p, WIRE.Q_R) * wire(p, WIRE.W_L_SHIFT)); + Fr derived_entry_1 = wire(p, WIRE.W_L) + rp.gamma + (wire(p, WIRE.Q_R) * wire(p, WIRE.W_L_SHIFT)); Fr derived_entry_2 = wire(p, WIRE.W_R) + wire(p, WIRE.Q_M) * wire(p, WIRE.W_R_SHIFT); Fr derived_entry_3 = wire(p, WIRE.W_O) + wire(p, WIRE.Q_C) * wire(p, WIRE.W_O_SHIFT); - read_term = derived_entry_1 + (derived_entry_2 * tp.eta) + (derived_entry_3 * tp.etaTwo) - + (wire(p, WIRE.Q_O) * tp.etaThree); + read_term = derived_entry_1 + (derived_entry_2 * rp.eta) + (derived_entry_3 * rp.etaTwo) + + (wire(p, WIRE.Q_O) * rp.etaThree); } Fr read_inverse = wire(p, WIRE.LOOKUP_INVERSES) * write_term; @@ -1041,7 +994,7 @@ library RelationsLib { function accumulateAuxillaryRelation( Fr[NUMBER_OF_ENTITIES] memory p, - Transcript memory tp, + Honk.RelationParameters memory rp, Fr[NUMBER_OF_SUBRELATIONS] memory evals, Fr domainSep ) internal pure { @@ -1152,9 +1105,9 @@ library RelationsLib { * * For ROM gates, qc = 0 */ - ap.memory_record_check = wire(p, WIRE.W_O) * tp.etaThree; - ap.memory_record_check = ap.memory_record_check + (wire(p, WIRE.W_R) * tp.etaTwo); - ap.memory_record_check = ap.memory_record_check + (wire(p, WIRE.W_L) * tp.eta); + ap.memory_record_check = wire(p, WIRE.W_O) * rp.etaThree; + ap.memory_record_check = ap.memory_record_check + (wire(p, WIRE.W_R) * rp.etaTwo); + ap.memory_record_check = ap.memory_record_check + (wire(p, WIRE.W_L) * rp.eta); ap.memory_record_check = ap.memory_record_check + wire(p, WIRE.Q_C); ap.partial_record_check = ap.memory_record_check; // used in RAM consistency check; deg 1 or 4 ap.memory_record_check = ap.memory_record_check - wire(p, WIRE.W_4); @@ -1211,9 +1164,9 @@ library RelationsLib { Fr access_type = (wire(p, WIRE.W_4) - ap.partial_record_check); // will be 0 or 1 for honest Prover; deg 1 or 4 ap.access_check = access_type * access_type - access_type; // check value is 0 or 1; deg 2 or 8 - ap.next_gate_access_type = wire(p, WIRE.W_O_SHIFT) * tp.etaThree; - ap.next_gate_access_type = ap.next_gate_access_type + (wire(p, WIRE.W_R_SHIFT) * tp.etaTwo); - ap.next_gate_access_type = ap.next_gate_access_type + (wire(p, WIRE.W_L_SHIFT) * tp.eta); + ap.next_gate_access_type = wire(p, WIRE.W_O_SHIFT) * rp.etaThree; + ap.next_gate_access_type = ap.next_gate_access_type + (wire(p, WIRE.W_R_SHIFT) * rp.etaTwo); + ap.next_gate_access_type = ap.next_gate_access_type + (wire(p, WIRE.W_L_SHIFT) * rp.eta); ap.next_gate_access_type = wire(p, WIRE.W_4_SHIFT) - ap.next_gate_access_type; Fr value_delta = wire(p, WIRE.W_O_SHIFT) - wire(p, WIRE.W_O); @@ -1434,9 +1387,10 @@ abstract contract BaseHonkVerifier is IVerifier { // Generate the fiat shamir challenges for the whole protocol Transcript memory t = TranscriptLib.generateTranscript(p, publicInputs, vk.publicInputsSize); - // Compute the public input delta - t.publicInputsDelta = - computePublicInputDelta(publicInputs, t.beta, t.gamma, vk.circuitSize, p.publicInputsOffset); + // Derive public input delta + t.relationParameters.publicInputsDelta = computePublicInputDelta( + publicInputs, t.relationParameters.beta, t.relationParameters.gamma, p.publicInputsOffset + ); // Sumcheck bool sumcheckVerified = verifySumcheck(p, t); @@ -1448,17 +1402,15 @@ abstract contract BaseHonkVerifier is IVerifier { return sumcheckVerified && shpleminiVerified; // Boolean condition not required - nice for vanity :) } - function computePublicInputDelta( - bytes32[] memory publicInputs, - Fr beta, - Fr gamma, - uint256 domainSize, - uint256 offset - ) internal view returns (Fr publicInputDelta) { + function computePublicInputDelta(bytes32[] memory publicInputs, Fr beta, Fr gamma, uint256 offset) + internal + view + returns (Fr publicInputDelta) + { Fr numerator = Fr.wrap(1); Fr denominator = Fr.wrap(1); - Fr numeratorAcc = gamma + (beta * FrLib.from(domainSize + offset)); + Fr numeratorAcc = gamma + (beta * FrLib.from(N + offset)); Fr denominatorAcc = gamma - (beta * FrLib.from(offset + 1)); { @@ -1497,7 +1449,8 @@ abstract contract BaseHonkVerifier is IVerifier { } // Last round - Fr grandHonkRelationSum = RelationsLib.accumulateRelationEvaluations(proof, tp, powPartialEvaluation); + Fr grandHonkRelationSum = + RelationsLib.accumulateRelationEvaluations(proof, tp.relationParameters, tp.alphas, powPartialEvaluation); verified = (grandHonkRelationSum == roundTarget); } diff --git a/barretenberg/cpp/src/barretenberg/ecc/groups/affine_element.hpp b/barretenberg/cpp/src/barretenberg/ecc/groups/affine_element.hpp index 883f8bcb017..3372899d730 100644 --- a/barretenberg/cpp/src/barretenberg/ecc/groups/affine_element.hpp +++ b/barretenberg/cpp/src/barretenberg/ecc/groups/affine_element.hpp @@ -170,6 +170,9 @@ template class alignas(64) affine_ } Fq x; Fq y; + + // Note: this serialization from typescript does not support infinity. + MSGPACK_FIELDS(x, y); }; template diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp index 7afbebf92d6..37c0e0d7003 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp @@ -338,13 +338,6 @@ class ECCVMFlavor { // this getter is necessary for more uniform zk verifiers auto get_shifted_witnesses() { return ShiftedEntities::get_all(); }; auto get_precomputed() { return PrecomputedEntities::get_all(); }; - // the getter for all witnesses including derived and shifted ones - auto get_all_witnesses() - { - return concatenate(WitnessEntities::get_all(), ShiftedEntities::get_all()); - }; - // this getter is necessary for a universal ZK Sumcheck - auto get_non_witnesses() { return PrecomputedEntities::get_all(); }; }; public: diff --git a/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp b/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp index 9e6b652d0dc..35092b67aeb 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/flavor.hpp @@ -98,6 +98,29 @@ class PrecomputedEntitiesBase { uint64_t log_circuit_size; uint64_t num_public_inputs; }; +// Specifies the regions of the execution trace containing non-trivial wire values +struct ActiveRegionData { + void add_range(const size_t start, const size_t end) + { + ASSERT(start >= current_end); // ranges should be non-overlapping and increasing + ranges.emplace_back(start, end); + for (size_t i = start; i < end; ++i) { + idxs.push_back(i); + } + current_end = end; + } + + std::vector> get_ranges() const { return ranges; } + size_t get_idx(const size_t idx) const { return idxs[idx]; } + std::pair get_range(const size_t idx) const { return ranges.at(idx); } + size_t size() const { return idxs.size(); } + size_t num_ranges() const { return ranges.size(); } + + private: + std::vector> ranges; // active ranges [start_i, end_i) of the execution trace + std::vector idxs; // full set of poly indices corresposponding to active ranges + size_t current_end{ 0 }; // end of last range; for ensuring monotonicity of ranges +}; /** * @brief Base proving key class. @@ -123,8 +146,7 @@ template class ProvingKey_ { // folded element by element. std::vector public_inputs; - // Ranges of the form [start, end) where witnesses have non-zero values (hence the execution trace is "active") - std::vector> active_block_ranges; + ActiveRegionData active_region_data; // specifies active regions of execution trace ProvingKey_() = default; ProvingKey_(const size_t dyadic_circuit_size, diff --git a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp index ccf28006546..0609f3da42b 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp +++ b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp @@ -191,7 +191,6 @@ class GoblinMockCircuits { static void construct_simple_circuit(MegaBuilder& builder) { PROFILE_THIS(); - add_some_ecc_op_gates(builder); MockCircuits::construct_arithmetic_circuit(builder); } diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/permutation_lib.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/permutation_lib.hpp index d391d425af3..a2f2e4a813f 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/permutation_lib.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/permutation_lib.hpp @@ -224,33 +224,43 @@ void compute_honk_style_permutation_lagrange_polynomials_from_mapping( using FF = typename Flavor::FF; const size_t num_gates = proving_key->circuit_size; + size_t domain_size = proving_key->active_region_data.size(); + + const MultithreadData thread_data = calculate_thread_data(domain_size); + size_t wire_idx = 0; for (auto& current_permutation_poly : permutation_polynomials) { - ITERATE_OVER_DOMAIN_START(proving_key->evaluation_domain); - auto idx = static_cast(i); - const auto& current_row_idx = permutation_mappings[wire_idx].row_idx[idx]; - const auto& current_col_idx = permutation_mappings[wire_idx].col_idx[idx]; - const auto& current_is_tag = permutation_mappings[wire_idx].is_tag[idx]; - const auto& current_is_public_input = permutation_mappings[wire_idx].is_public_input[idx]; - if (current_is_public_input) { - // We intentionally want to break the cycles of the public input variables. - // During the witness generation, the left and right wire polynomials at idx i contain the i-th public - // input. The CyclicPermutation created for these variables always start with (i) -> (n+i), followed by - // the indices of the variables in the "real" gates. We make i point to -(i+1), so that the only way of - // repairing the cycle is add the mapping - // -(i+1) -> (n+i) - // These indices are chosen so they can easily be computed by the verifier. They can expect the running - // product to be equal to the "public input delta" that is computed in - current_permutation_poly.at(i) = -FF(current_row_idx + 1 + num_gates * current_col_idx); - } else if (current_is_tag) { - // Set evaluations to (arbitrary) values disjoint from non-tag values - current_permutation_poly.at(i) = num_gates * Flavor::NUM_WIRES + current_row_idx; - } else { - // For the regular permutation we simply point to the next location by setting the evaluation to its - // idx - current_permutation_poly.at(i) = FF(current_row_idx + num_gates * current_col_idx); - } - ITERATE_OVER_DOMAIN_END; + parallel_for(thread_data.num_threads, [&](size_t j) { + const size_t start = thread_data.start[j]; + const size_t end = thread_data.end[j]; + for (size_t i = start; i < end; ++i) { + const size_t poly_idx = proving_key->active_region_data.get_idx(i); + const auto idx = static_cast(poly_idx); + const auto& current_row_idx = permutation_mappings[wire_idx].row_idx[idx]; + const auto& current_col_idx = permutation_mappings[wire_idx].col_idx[idx]; + const auto& current_is_tag = permutation_mappings[wire_idx].is_tag[idx]; + const auto& current_is_public_input = permutation_mappings[wire_idx].is_public_input[idx]; + if (current_is_public_input) { + // We intentionally want to break the cycles of the public input variables. + // During the witness generation, the left and right wire polynomials at idx i contain the i-th + // public input. The CyclicPermutation created for these variables always start with (i) -> (n+i), + // followed by the indices of the variables in the "real" gates. We make i point to + // -(i+1), so that the only way of repairing the cycle is add the mapping + // -(i+1) -> (n+i) + // These indices are chosen so they can easily be computed by the verifier. They can expect + // the running product to be equal to the "public input delta" that is computed + // in + current_permutation_poly.at(poly_idx) = -FF(current_row_idx + 1 + num_gates * current_col_idx); + } else if (current_is_tag) { + // Set evaluations to (arbitrary) values disjoint from non-tag values + current_permutation_poly.at(poly_idx) = num_gates * Flavor::NUM_WIRES + current_row_idx; + } else { + // For the regular permutation we simply point to the next location by setting the + // evaluation to its idx + current_permutation_poly.at(poly_idx) = FF(current_row_idx + num_gates * current_col_idx); + } + } + }); wire_idx++; } } diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/library/grand_product_library.hpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/library/grand_product_library.hpp index ee7eeb3c437..3bdd810136a 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/library/grand_product_library.hpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/library/grand_product_library.hpp @@ -3,8 +3,10 @@ #include "barretenberg/common/debug_log.hpp" #include "barretenberg/common/thread.hpp" #include "barretenberg/common/zip_view.hpp" +#include "barretenberg/flavor/flavor.hpp" #include "barretenberg/plonk/proof_system/proving_key/proving_key.hpp" #include "barretenberg/relations/relation_parameters.hpp" +#include "barretenberg/trace_to_polynomials/trace_to_polynomials.hpp" #include namespace bb { @@ -47,17 +49,23 @@ namespace bb { * * Note: Step (3) utilizes Montgomery batch inversion to replace n-many inversions with * + * @note This method makes use of the fact that there are at most as many unique entries in the grand product as active + * rows in the execution trace to efficiently compute the grand product when a structured trace is in use. I.e. the + * computation peformed herein is proportional to the number of active rows in the trace and the constant values in the + * inactive regions are simply populated from known values on the last step. + * * @tparam Flavor * @tparam GrandProdRelation * @param full_polynomials * @param relation_parameters * @param size_override optional size of the domain; otherwise based on dyadic polynomial domain + * @param active_region_data optional specification of active region of execution trace */ template void compute_grand_product(typename Flavor::ProverPolynomials& full_polynomials, bb::RelationParameters& relation_parameters, size_t size_override = 0, - std::vector> active_block_ranges = {}) + const ActiveRegionData& active_region_data = ActiveRegionData{}) { PROFILE_THIS_NAME("compute_grand_product"); @@ -65,56 +73,44 @@ void compute_grand_product(typename Flavor::ProverPolynomials& full_polynomials, using Polynomial = typename Flavor::Polynomial; using Accumulator = std::tuple_element_t<0, typename GrandProdRelation::SumcheckArrayOfValuesOverSubrelations>; + const bool has_active_ranges = active_region_data.size() > 0; + // Set the domain over which the grand product must be computed. This may be less than the dyadic circuit size, e.g // the permutation grand product does not need to be computed beyond the index of the last active wire size_t domain_size = size_override == 0 ? full_polynomials.get_polynomial_size() : size_override; - const size_t num_threads = domain_size >= get_num_cpus_pow2() ? get_num_cpus_pow2() : 1; - const size_t block_size = domain_size / num_threads; - const size_t final_idx = domain_size - 1; - - // Cumpute the index bounds for each thread for reuse in the computations below - std::vector> idx_bounds; - idx_bounds.reserve(num_threads); - for (size_t thread_idx = 0; thread_idx < num_threads; ++thread_idx) { - const size_t start = thread_idx * block_size; - const size_t end = (thread_idx == num_threads - 1) ? final_idx : (thread_idx + 1) * block_size; - idx_bounds.push_back(std::make_pair(start, end)); - } + // Returns the ith active index if specified, otherwise acts as the identity map on the input + auto get_active_range_poly_idx = [&](size_t i) { return has_active_ranges ? active_region_data.get_idx(i) : i; }; + + size_t active_domain_size = has_active_ranges ? active_region_data.size() : domain_size; + + // The size of the iteration domain is one less than the number of active rows since the final value of the + // grand product is constructed only in the relation and not explicitly in the polynomial + const MultithreadData active_range_thread_data = calculate_thread_data(active_domain_size - 1); // Allocate numerator/denominator polynomials that will serve as scratch space // TODO(zac) we can re-use the permutation polynomial as the numerator polynomial. Reduces readability - Polynomial numerator{ domain_size, domain_size }; - Polynomial denominator{ domain_size, domain_size }; - - auto check_is_active = [&](size_t idx) { - if (active_block_ranges.empty()) { - return true; - } - return std::any_of(active_block_ranges.begin(), active_block_ranges.end(), [idx](const auto& range) { - return idx >= range.first && idx < range.second; - }); - }; + Polynomial numerator{ active_domain_size }; + Polynomial denominator{ active_domain_size }; // Step (1) // Populate `numerator` and `denominator` with the algebra described by Relation - FF gamma_fourth = relation_parameters.gamma.pow(4); - parallel_for(num_threads, [&](size_t thread_idx) { + parallel_for(active_range_thread_data.num_threads, [&](size_t thread_idx) { + const size_t start = active_range_thread_data.start[thread_idx]; + const size_t end = active_range_thread_data.end[thread_idx]; typename Flavor::AllValues row; - const size_t start = idx_bounds[thread_idx].first; - const size_t end = idx_bounds[thread_idx].second; for (size_t i = start; i < end; ++i) { - if (check_is_active(i)) { - // TODO(https://github.com/AztecProtocol/barretenberg/issues/940):consider avoiding get_row if possible. - row = full_polynomials.get_row(i); - numerator.at(i) = - GrandProdRelation::template compute_grand_product_numerator(row, relation_parameters); - denominator.at(i) = GrandProdRelation::template compute_grand_product_denominator( - row, relation_parameters); + // TODO(https://github.com/AztecProtocol/barretenberg/issues/940):consider avoiding get_row if possible. + auto row_idx = get_active_range_poly_idx(i); + if constexpr (IsUltraFlavor) { + row = full_polynomials.get_row_for_permutation_arg(row_idx); } else { - numerator.at(i) = gamma_fourth; - denominator.at(i) = gamma_fourth; + row = full_polynomials.get_row(row_idx); } + numerator.at(i) = + GrandProdRelation::template compute_grand_product_numerator(row, relation_parameters); + denominator.at(i) = + GrandProdRelation::template compute_grand_product_denominator(row, relation_parameters); } }); @@ -133,12 +129,12 @@ void compute_grand_product(typename Flavor::ProverPolynomials& full_polynomials, // (ii) Take partial products P = { 1, a0a1, a2a3, a4a5 } // (iii) Each thread j computes N[i][j]*P[j]= // {{a0,a0a1},{a0a1a2,a0a1a2a3},{a0a1a2a3a4,a0a1a2a3a4a5},{a0a1a2a3a4a5a6,a0a1a2a3a4a5a6a7}} - std::vector partial_numerators(num_threads); - std::vector partial_denominators(num_threads); + std::vector partial_numerators(active_range_thread_data.num_threads); + std::vector partial_denominators(active_range_thread_data.num_threads); - parallel_for(num_threads, [&](size_t thread_idx) { - const size_t start = idx_bounds[thread_idx].first; - const size_t end = idx_bounds[thread_idx].second; + parallel_for(active_range_thread_data.num_threads, [&](size_t thread_idx) { + const size_t start = active_range_thread_data.start[thread_idx]; + const size_t end = active_range_thread_data.end[thread_idx]; for (size_t i = start; i < end - 1; ++i) { numerator.at(i + 1) *= numerator[i]; denominator.at(i + 1) *= denominator[i]; @@ -150,9 +146,9 @@ void compute_grand_product(typename Flavor::ProverPolynomials& full_polynomials, DEBUG_LOG_ALL(partial_numerators); DEBUG_LOG_ALL(partial_denominators); - parallel_for(num_threads, [&](size_t thread_idx) { - const size_t start = idx_bounds[thread_idx].first; - const size_t end = idx_bounds[thread_idx].second; + parallel_for(active_range_thread_data.num_threads, [&](size_t thread_idx) { + const size_t start = active_range_thread_data.start[thread_idx]; + const size_t end = active_range_thread_data.end[thread_idx]; if (thread_idx > 0) { FF numerator_scaling = 1; FF denominator_scaling = 1; @@ -179,14 +175,44 @@ void compute_grand_product(typename Flavor::ProverPolynomials& full_polynomials, // We have a 'virtual' 0 at the start (as this is a to-be-shifted polynomial) ASSERT(grand_product_polynomial.start_index() == 1); - parallel_for(num_threads, [&](size_t thread_idx) { - const size_t start = idx_bounds[thread_idx].first; - const size_t end = idx_bounds[thread_idx].second; + // For Ultra/Mega, the first row is an inactive zero row thus the grand prod takes value 1 at both i = 0 and i = 1 + if constexpr (IsUltraFlavor) { + grand_product_polynomial.at(1) = 1; + } + + // Compute grand product values corresponding only to the active regions of the trace + parallel_for(active_range_thread_data.num_threads, [&](size_t thread_idx) { + const size_t start = active_range_thread_data.start[thread_idx]; + const size_t end = active_range_thread_data.end[thread_idx]; for (size_t i = start; i < end; ++i) { - grand_product_polynomial.at(i + 1) = numerator[i] * denominator[i]; + const auto poly_idx = get_active_range_poly_idx(i + 1); + grand_product_polynomial.at(poly_idx) = numerator[i] * denominator[i]; } }); + // Final step: If active/inactive regions have been specified, the value of the grand product in the inactive + // regions have not yet been set. The polynomial takes an already computed constant value across each inactive + // region (since no copy constraints are present there) equal to the value of the grand product at the first index + // of the subsequent active region. + if (has_active_ranges) { + MultithreadData full_domain_thread_data = calculate_thread_data(domain_size); + parallel_for(full_domain_thread_data.num_threads, [&](size_t thread_idx) { + const size_t start = full_domain_thread_data.start[thread_idx]; + const size_t end = full_domain_thread_data.end[thread_idx]; + for (size_t i = start; i < end; ++i) { + for (size_t j = 0; j < active_region_data.num_ranges() - 1; ++j) { + const size_t previous_range_end = active_region_data.get_range(j).second; + const size_t next_range_start = active_region_data.get_range(j + 1).first; + // Set the value of the polynomial if the index falls in an inactive region + if (i >= previous_range_end && i < next_range_start) { + grand_product_polynomial.at(i) = grand_product_polynomial[next_range_start]; + break; + } + } + } + }); + } + DEBUG_LOG_ALL(grand_product_polynomial.coeffs()); } diff --git a/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp b/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp index 79ee95fe7ef..fdb196d06f8 100644 --- a/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp +++ b/barretenberg/cpp/src/barretenberg/polynomials/polynomial.hpp @@ -388,10 +388,6 @@ template class Polynomial { // safety check for in place operations bool in_place_operation_viable(size_t domain_size) { return (size() >= domain_size); } - // When a polynomial is instantiated from a size alone, the memory allocated corresponds to - // input size + MAXIMUM_COEFFICIENT_SHIFT to support 'shifted' coefficients efficiently. - const static size_t MAXIMUM_COEFFICIENT_SHIFT = 1; - // The underlying memory, with a bespoke (but minimal) shared array struct that fits our needs. // Namely, it supports polynomial shifts and 'virtual' zeroes past a size up until a 'virtual' size. SharedShiftedVirtualZeroesArray coefficients_; diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp index d7d3e0418fa..ef8927b9702 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp @@ -8,6 +8,7 @@ #include "barretenberg/stdlib_circuit_builders/mock_circuits.hpp" #include "barretenberg/ultra_honk/decider_prover.hpp" #include "barretenberg/ultra_honk/decider_verifier.hpp" +#include "barretenberg/ultra_honk/witness_computation.hpp" #include @@ -116,18 +117,7 @@ template class ProtogalaxyTests : public testing::Test { auto decider_pk = std::make_shared(builder); - decider_pk->relation_parameters.eta = FF::random_element(); - decider_pk->relation_parameters.eta_two = FF::random_element(); - decider_pk->relation_parameters.eta_three = FF::random_element(); - decider_pk->relation_parameters.beta = FF::random_element(); - decider_pk->relation_parameters.gamma = FF::random_element(); - - decider_pk->proving_key.add_ram_rom_memory_records_to_wire_4(decider_pk->relation_parameters.eta, - decider_pk->relation_parameters.eta_two, - decider_pk->relation_parameters.eta_three); - decider_pk->proving_key.compute_logderivative_inverses(decider_pk->relation_parameters); - decider_pk->proving_key.compute_grand_product_polynomial(decider_pk->relation_parameters, - decider_pk->final_active_wire_idx + 1); + WitnessComputation::complete_proving_key_for_test(decider_pk); for (auto& alpha : decider_pk->alphas) { alpha = FF::random_element(); @@ -137,7 +127,7 @@ template class ProtogalaxyTests : public testing::Test { decider_pk->proving_key.polynomials, decider_pk->alphas, decider_pk->relation_parameters); // Evaluations should be 0 for valid circuit - for (const auto& eval : full_honk_evals) { + for (const auto& eval : full_honk_evals.coeffs()) { EXPECT_EQ(eval, FF(0)); } } @@ -152,7 +142,11 @@ template class ProtogalaxyTests : public testing::Test { std::vector betas = { FF(5), FF(8), FF(11) }; std::vector deltas = { FF(2), FF(4), FF(8) }; std::vector full_honk_evaluations = { FF(1), FF(1), FF(1), FF(1), FF(1), FF(1), FF(1), FF(1) }; - auto perturbator = PGInternal::construct_perturbator_coefficients(betas, deltas, full_honk_evaluations); + Polynomial honk_evaluations_poly(full_honk_evaluations.size()); + for (auto [poly_val, val] : zip_view(honk_evaluations_poly.coeffs(), full_honk_evaluations)) { + poly_val = val; + } + auto perturbator = PGInternal::construct_perturbator_coefficients(betas, deltas, honk_evaluations_poly); std::vector expected_values = { FF(648), FF(936), FF(432), FF(64) }; EXPECT_EQ(perturbator.size(), 4); // log(size) + 1 for (size_t i = 0; i < perturbator.size(); i++) { diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp index 221d732a796..0acc9469143 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover_internal.hpp @@ -136,16 +136,16 @@ template class ProtogalaxyProverInternal { * representing the sum f_0(ω) + α_j*g(ω) where f_0 represents the full honk evaluation at row 0, g(ω) is the * linearly dependent subrelation and α_j is its corresponding batching challenge. */ - std::vector compute_row_evaluations(const ProverPolynomials& polynomials, - const RelationSeparator& alphas_, - const RelationParameters& relation_parameters) + Polynomial compute_row_evaluations(const ProverPolynomials& polynomials, + const RelationSeparator& alphas_, + const RelationParameters& relation_parameters) { PROFILE_THIS_NAME("ProtogalaxyProver_::compute_row_evaluations"); const size_t polynomial_size = polynomials.get_polynomial_size(); - std::vector aggregated_relation_evaluations(polynomial_size); + Polynomial aggregated_relation_evaluations(polynomial_size); const std::array alphas = [&alphas_]() { std::array tmp; @@ -176,13 +176,13 @@ template class ProtogalaxyProverInternal { RelationUtils::accumulate_relation_evaluations(row, relation_parameters, FF(1)); // Sum against challenges alpha - aggregated_relation_evaluations[idx] = process_subrelation_evaluations( + aggregated_relation_evaluations.at(idx) = process_subrelation_evaluations( evals, alphas, linearly_dependent_contribution_accumulators[thread_idx]); } } }); - aggregated_relation_evaluations[0] += sum(linearly_dependent_contribution_accumulators); + aggregated_relation_evaluations.at(0) += sum(linearly_dependent_contribution_accumulators); return aggregated_relation_evaluations; } @@ -263,7 +263,7 @@ template class ProtogalaxyProverInternal { */ static std::vector construct_perturbator_coefficients(std::span betas, std::span deltas, - const std::vector& full_honk_evaluations) + const Polynomial& full_honk_evaluations) { const size_t width = full_honk_evaluations.size() / 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 fcd1a878f25..18e8643ab3b 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 @@ -386,6 +386,7 @@ template class ProtogalaxyRecursiveTests : public tes auto verification_key = std::make_shared(prover_inst->proving_key); auto verifier_inst = std::make_shared(verification_key); + // Corrupt a wire value in the accumulator prover_accumulator->proving_key.polynomials.w_l.at(1) = FF::random_element(&engine); // Generate a folding proof with the incorrect polynomials which would result in the prover having the wrong diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp index af513c5509b..d796755d46a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp @@ -237,44 +237,6 @@ template class MegaCircuitBuilder_ : public UltraCircuitBuilder_(BusId::CALLDATA)]; } const BusVector& get_secondary_calldata() const { return databus[static_cast(BusId::SECONDARY_CALLDATA)]; } const BusVector& get_return_data() const { return databus[static_cast(BusId::RETURNDATA)]; } - uint64_t estimate_memory() const - { - vinfo("++Estimating builder memory++"); - uint64_t result{ 0 }; - - // gates: - for (auto [block, label] : zip_view(this->blocks.get(), this->blocks.get_labels())) { - uint64_t size{ 0 }; - for (const auto& wire : block.wires) { - size += wire.capacity() * sizeof(uint32_t); - } - for (const auto& selector : block.selectors) { - size += selector.capacity() * sizeof(FF); - } - vinfo(label, " size ", size >> 10, " KiB"); - result += size; - } - - // variables - size_t to_add{ this->variables.capacity() * sizeof(FF) }; - result += to_add; - vinfo("variables: ", to_add); - - // public inputs - to_add = this->public_inputs.capacity() * sizeof(uint32_t); - result += to_add; - vinfo("public inputs: ", to_add); - - // other variable indices - to_add = this->next_var_index.capacity() * sizeof(uint32_t); - to_add += this->prev_var_index.capacity() * sizeof(uint32_t); - to_add += this->real_variable_index.capacity() * sizeof(uint32_t); - to_add += this->real_variable_tags.capacity() * sizeof(uint32_t); - result += to_add; - vinfo("variable indices: ", to_add); - - return result; - } }; using MegaCircuitBuilder = MegaCircuitBuilder_; } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp index 926aec49abc..1bf82af322a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/mega_flavor.hpp @@ -5,9 +5,6 @@ #include "barretenberg/flavor/flavor_macros.hpp" #include "barretenberg/flavor/relation_definitions.hpp" #include "barretenberg/flavor/repeated_commitments_data.hpp" -#include "barretenberg/honk/proof_system/types/proof.hpp" -#include "barretenberg/plonk_honk_shared/library/grand_product_delta.hpp" -#include "barretenberg/plonk_honk_shared/library/grand_product_library.hpp" #include "barretenberg/polynomials/univariate.hpp" #include "barretenberg/relations/auxiliary_relation.hpp" #include "barretenberg/relations/databus_lookup_relation.hpp" @@ -18,7 +15,6 @@ #include "barretenberg/relations/permutation_relation.hpp" #include "barretenberg/relations/poseidon2_external_relation.hpp" #include "barretenberg/relations/poseidon2_internal_relation.hpp" -#include "barretenberg/relations/relation_parameters.hpp" #include "barretenberg/relations/ultra_arithmetic_relation.hpp" #include "barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp" #include "barretenberg/transcript/transcript.hpp" @@ -86,8 +82,8 @@ class MegaFlavor { static constexpr size_t NUM_ALL_WITNESS_ENTITIES = NUM_WITNESS_ENTITIES + NUM_SHIFTED_WITNESSES; // For instances of this flavour, used in folding, we need a unique sumcheck batching challenges for each - // subrelation. This - // is because using powers of alpha would increase the degree of Protogalaxy polynomial $G$ (the combiner) too much. + // subrelation. This is because using powers of alpha would increase the degree of Protogalaxy polynomial $G$ (the + // combiner) too much. static constexpr size_t NUM_SUBRELATIONS = compute_number_of_subrelations(); using RelationSeparator = std::array; @@ -172,7 +168,7 @@ class MegaFlavor { // Mega needs to expose more public classes than most flavors due to MegaRecursive reuse, but these // are internal: - public: + // WireEntities for basic witness entities template class WireEntities { public: @@ -284,8 +280,6 @@ class MegaFlavor { w_o_shift, // column 2 w_4_shift, // column 3 z_perm_shift) // column 4 - - auto get_shifted() { return RefArray{ w_l_shift, w_r_shift, w_o_shift, w_4_shift, z_perm_shift }; }; }; public: @@ -320,13 +314,6 @@ class MegaFlavor { auto get_witness() { return WitnessEntities::get_all(); }; auto get_to_be_shifted() { return WitnessEntities::get_to_be_shifted(); }; auto get_shifted() { return ShiftedEntities::get_all(); }; - // this getter is used in ZK Sumcheck, where all witness evaluations (including shifts) have to be masked - auto get_all_witnesses() - { - return concatenate(WitnessEntities::get_all(), ShiftedEntities::get_all()); - }; - // getter for the complement of all witnesses inside all entities - auto get_non_witnesses() { return PrecomputedEntities::get_all(); }; }; /** @@ -383,6 +370,21 @@ class MegaFlavor { return result; } + [[nodiscard]] AllValues get_row_for_permutation_arg(size_t row_idx) + { + AllValues result; + for (auto [result_field, polynomial] : zip_view(result.get_sigma_polynomials(), get_sigma_polynomials())) { + result_field = polynomial[row_idx]; + } + for (auto [result_field, polynomial] : zip_view(result.get_id_polynomials(), get_id_polynomials())) { + result_field = polynomial[row_idx]; + } + for (auto [result_field, polynomial] : zip_view(result.get_wires(), get_wires())) { + result_field = polynomial[row_idx]; + } + return result; + } + void set_shifted() { for (auto [shifted, to_be_shifted] : zip_view(get_shifted(), get_to_be_shifted())) { @@ -418,107 +420,10 @@ class MegaFlavor { // Data pertaining to transfer of databus return data via public inputs DatabusPropagationData databus_propagation_data; - - /** - * @brief Add plookup memory records to the fourth wire polynomial - * - * @details This operation must be performed after the first three wires have been committed to, hence the - * dependence on the `eta` challenge. - * - * @tparam Flavor - * @param eta challenge produced after commitment to first three wire polynomials - */ - void add_ram_rom_memory_records_to_wire_4(const FF& eta, const FF& eta_two, const FF& eta_three) - { - // The plookup memory record values are computed at the indicated indices as - // w4 = w3 * eta^3 + w2 * eta^2 + w1 * eta + read_write_flag; - // (See plookup_auxiliary_widget.hpp for details) - auto wires = polynomials.get_wires(); - - // Compute read record values - for (const auto& gate_idx : memory_read_records) { - wires[3].at(gate_idx) += wires[2][gate_idx] * eta_three; - wires[3].at(gate_idx) += wires[1][gate_idx] * eta_two; - wires[3].at(gate_idx) += wires[0][gate_idx] * eta; - } - - // Compute write record values - for (const auto& gate_idx : memory_write_records) { - wires[3].at(gate_idx) += wires[2][gate_idx] * eta_three; - wires[3].at(gate_idx) += wires[1][gate_idx] * eta_two; - wires[3].at(gate_idx) += wires[0][gate_idx] * eta; - wires[3].at(gate_idx) += 1; - } - } - - /** - * @brief Compute the inverse polynomials used in the log derivative lookup relations - * - * @tparam Flavor - * @param beta - * @param gamma - */ - void compute_logderivative_inverses(const RelationParameters& relation_parameters) - { - PROFILE_THIS_NAME("compute_logderivative_inverses"); - - // Compute inverses for conventional lookups - LogDerivLookupRelation::compute_logderivative_inverse( - this->polynomials, relation_parameters, this->circuit_size); - - // Compute inverses for calldata reads - DatabusLookupRelation::compute_logderivative_inverse( - this->polynomials, relation_parameters, this->circuit_size); - - // Compute inverses for secondary_calldata reads - DatabusLookupRelation::compute_logderivative_inverse( - this->polynomials, relation_parameters, this->circuit_size); - - // Compute inverses for return data reads - DatabusLookupRelation::compute_logderivative_inverse( - this->polynomials, relation_parameters, this->circuit_size); - } - - /** - * @brief Computes public_input_delta and the permutation grand product polynomial - * - * @param relation_parameters - * @param size_override override the size of the domain over which to compute the grand product - */ - void compute_grand_product_polynomial(RelationParameters& relation_parameters, size_t size_override = 0) - { - relation_parameters.public_input_delta = compute_public_input_delta(this->public_inputs, - relation_parameters.beta, - relation_parameters.gamma, - this->circuit_size, - this->pub_inputs_offset); - - // Compute permutation grand product polynomial - compute_grand_product>( - this->polynomials, relation_parameters, size_override, this->active_block_ranges); - } - - uint64_t estimate_memory() - { - vinfo("++Estimating proving key memory++"); - for (auto [polynomial, label] : zip_view(polynomials.get_all(), polynomials.get_labels())) { - uint64_t size = polynomial.size(); - vinfo(label, " num: ", size, " size: ", (size * sizeof(FF)) >> 10, " KiB"); - } - - uint64_t result(0); - for (auto& polynomial : polynomials.get_unshifted()) { - result += polynomial.size() * sizeof(FF); - } - - result += public_inputs.capacity() * sizeof(FF); - - return result; - } }; /** - * @brief The verification key is responsible for storing the commitments to the precomputed (non-witnessk) + * @brief The verification key is responsible for storing the commitments to the precomputed (non-witness) * polynomials used by the verifier. * * @note Note the discrepancy with what sort of data is stored here vs in the proving key. We may want to resolve @@ -526,7 +431,6 @@ class MegaFlavor { * circuits. * @todo TODO(https://github.com/AztecProtocol/barretenberg/issues/876) */ - // using VerificationKey = VerificationKey_, VerifierCommitmentKey>; class VerificationKey : public VerificationKey_, VerifierCommitmentKey> { public: // Data pertaining to transfer of databus return data via public inputs of the proof being recursively verified @@ -599,6 +503,7 @@ class MegaFlavor { } // TODO(https://github.com/AztecProtocol/barretenberg/issues/964): Clean the boilerplate up. + // Explicit constructor for msgpack serialization VerificationKey(const size_t circuit_size, const size_t num_public_inputs, const size_t pub_inputs_offset, diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp index 204dc177391..2ed5aa7003a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/ultra_flavor.hpp @@ -249,14 +249,6 @@ class UltraFlavor { auto get_precomputed() { return PrecomputedEntities::get_all(); } auto get_witness() { return WitnessEntities::get_all(); }; auto get_to_be_shifted() { return WitnessEntities::get_to_be_shifted(); }; - - // getter for all witnesses including shifted ones - auto get_all_witnesses() - { - return concatenate(WitnessEntities::get_all(), ShiftedEntities::get_shifted()); - }; - // getter for the complement of all witnesses inside all entities - auto get_non_witnesses() { return PrecomputedEntities::get_all(); }; }; /** @@ -311,6 +303,21 @@ class UltraFlavor { return result; } + [[nodiscard]] AllValues get_row_for_permutation_arg(size_t row_idx) + { + AllValues result; + for (auto [result_field, polynomial] : zip_view(result.get_sigma_polynomials(), get_sigma_polynomials())) { + result_field = polynomial[row_idx]; + } + for (auto [result_field, polynomial] : zip_view(result.get_id_polynomials(), get_id_polynomials())) { + result_field = polynomial[row_idx]; + } + for (auto [result_field, polynomial] : zip_view(result.get_wires(), get_wires())) { + result_field = polynomial[row_idx]; + } + return result; + } + // Set all shifted polynomials based on their to-be-shifted counterpart void set_shifted() { @@ -343,71 +350,6 @@ class UltraFlavor { std::vector memory_read_records; std::vector memory_write_records; ProverPolynomials polynomials; // storage for all polynomials evaluated by the prover - - /** - * @brief Add RAM/ROM memory records to the fourth wire polynomial - * - * @details This operation must be performed after the first three wires have been - * committed to, hence the dependence on the `eta` challenge. - * - * @tparam Flavor - * @param eta challenge produced after commitment to first three wire polynomials - */ - void add_ram_rom_memory_records_to_wire_4(const FF& eta, const FF& eta_two, const FF& eta_three) - { - // The memory record values are computed at the indicated indices as - // w4 = w3 * eta^3 + w2 * eta^2 + w1 * eta + read_write_flag; - // (See the Auxiliary relation for details) - auto wires = polynomials.get_wires(); - - // Compute read record values - for (const auto& gate_idx : memory_read_records) { - wires[3].at(gate_idx) += wires[2][gate_idx] * eta_three; - wires[3].at(gate_idx) += wires[1][gate_idx] * eta_two; - wires[3].at(gate_idx) += wires[0][gate_idx] * eta; - } - - // Compute write record values - for (const auto& gate_idx : memory_write_records) { - wires[3].at(gate_idx) += wires[2][gate_idx] * eta_three; - wires[3].at(gate_idx) += wires[1][gate_idx] * eta_two; - wires[3].at(gate_idx) += wires[0][gate_idx] * eta; - wires[3].at(gate_idx) += 1; - } - } - - /** - * @brief Compute the inverse polynomial used in the log derivative lookup argument - * - * @tparam Flavor - * @param beta - * @param gamma - */ - void compute_logderivative_inverses(const RelationParameters& relation_parameters) - { - // Compute inverses for conventional lookups - compute_logderivative_inverse>( - this->polynomials, relation_parameters, this->circuit_size); - } - - /** - * @brief Computes public_input_delta and the permutation grand product polynomial - * - * @param relation_parameters - * @param size_override override the size of the domain over which to compute the grand product - */ - void compute_grand_product_polynomial(RelationParameters& relation_parameters, size_t size_override = 0) - { - relation_parameters.public_input_delta = compute_public_input_delta(this->public_inputs, - relation_parameters.beta, - relation_parameters.gamma, - this->circuit_size, - this->pub_inputs_offset); - - // Compute permutation grand product polynomial - compute_grand_product>( - this->polynomials, relation_parameters, size_override); - } }; /** diff --git a/barretenberg/cpp/src/barretenberg/trace_to_polynomials/trace_to_polynomials.cpp b/barretenberg/cpp/src/barretenberg/trace_to_polynomials/trace_to_polynomials.cpp index b1aaccb49d1..bd44c7cebc8 100644 --- a/barretenberg/cpp/src/barretenberg/trace_to_polynomials/trace_to_polynomials.cpp +++ b/barretenberg/cpp/src/barretenberg/trace_to_polynomials/trace_to_polynomials.cpp @@ -104,8 +104,9 @@ typename TraceToPolynomials::TraceData TraceToPolynomials::const // Save ranges over which the blocks are "active" for use in structured commitments if constexpr (IsUltraFlavor) { // Mega and Ultra + PROFILE_THIS_NAME("construct_active_indices"); if (block.size() > 0) { - proving_key.active_block_ranges.emplace_back(offset, offset + block.size()); + proving_key.active_region_data.add_range(offset, offset + block.size()); } } diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp index 904c65f5acc..2dd0f7a249f 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_flavor.hpp @@ -587,14 +587,6 @@ class TranslatorFlavor { return WitnessEntities::get_wires_and_ordered_range_constraints(); }; - // Get witness polynomials including shifts. This getter is required by ZK-Sumcheck. - auto get_all_witnesses() - { - return concatenate(WitnessEntities::get_all(), ShiftedEntities::get_all()); - }; - // Get all non-witness polynomials. In this case, contains only PrecomputedEntities. - auto get_non_witnesses() { return PrecomputedEntities::get_all(); }; - friend std::ostream& operator<<(std::ostream& os, const AllEntities& a) { os << "{ "; 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 b4a502c6747..ab2917d65de 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_honk.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_honk.test.cpp @@ -126,6 +126,12 @@ TYPED_TEST(MegaHonkTests, BasicStructured) auto verification_key = std::make_shared(proving_key->proving_key); Verifier verifier(verification_key); auto proof = prover.construct_proof(); + + // Sanity check: ensure z_perm is not zero everywhere + EXPECT_TRUE(!proving_key->proving_key.polynomials.z_perm.is_zero()); + + RelationChecker::check_all(proving_key->proving_key.polynomials, proving_key->relation_parameters); + EXPECT_TRUE(verifier.verify_proof(proof)); } @@ -390,7 +396,12 @@ TYPED_TEST(MegaHonkTests, PolySwap) auto proving_key_2 = std::make_shared(builder_copy, trace_settings); // Tamper with the polys of pkey 1 in such a way that verification should fail - proving_key_1->proving_key.polynomials.w_l.at(5) = 10; + for (size_t i = 0; i < proving_key_1->proving_key.circuit_size; ++i) { + if (proving_key_1->proving_key.polynomials.q_arith[i] != 0) { + proving_key_1->proving_key.polynomials.w_l.at(i) += 1; + break; + } + } // Swap the polys of the two proving keys; result should be pkey 1 is valid and pkey 2 should fail std::swap(proving_key_1->proving_key.polynomials, proving_key_2->proving_key.polynomials); diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp index 6012c9551f0..9d0c068e5b9 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/oink_prover.cpp @@ -2,6 +2,7 @@ #include "barretenberg/common/op_count.hpp" #include "barretenberg/plonk_honk_shared/proving_key_inspector.hpp" #include "barretenberg/relations/logderiv_lookup_relation.hpp" +#include "barretenberg/ultra_honk/witness_computation.hpp" namespace bb { @@ -100,11 +101,11 @@ template void OinkProver::execute_wire_commitment PROFILE_THIS_NAME("COMMIT::wires"); if (proving_key->get_is_structured()) { witness_commitments.w_l = proving_key->proving_key.commitment_key->commit_structured( - proving_key->proving_key.polynomials.w_l, proving_key->proving_key.active_block_ranges); + proving_key->proving_key.polynomials.w_l, proving_key->proving_key.active_region_data.get_ranges()); witness_commitments.w_r = proving_key->proving_key.commitment_key->commit_structured( - proving_key->proving_key.polynomials.w_r, proving_key->proving_key.active_block_ranges); + proving_key->proving_key.polynomials.w_r, proving_key->proving_key.active_region_data.get_ranges()); witness_commitments.w_o = proving_key->proving_key.commitment_key->commit_structured( - proving_key->proving_key.polynomials.w_o, proving_key->proving_key.active_block_ranges); + proving_key->proving_key.polynomials.w_o, proving_key->proving_key.active_region_data.get_ranges()); } else { witness_commitments.w_l = proving_key->proving_key.commitment_key->commit(proving_key->proving_key.polynomials.w_l); @@ -162,7 +163,7 @@ template void OinkProver::execute_sorted_list_acc proving_key->relation_parameters.eta_two = eta_two; proving_key->relation_parameters.eta_three = eta_three; - proving_key->proving_key.add_ram_rom_memory_records_to_wire_4(eta, eta_two, eta_three); + WitnessComputation::add_ram_rom_memory_records_to_wire_4(proving_key->proving_key, eta, eta_two, eta_three); // Commit to lookup argument polynomials and the finalized (i.e. with memory records) fourth wire polynomial { @@ -176,7 +177,7 @@ template void OinkProver::execute_sorted_list_acc PROFILE_THIS_NAME("COMMIT::wires"); if (proving_key->get_is_structured()) { witness_commitments.w_4 = proving_key->proving_key.commitment_key->commit_structured( - proving_key->proving_key.polynomials.w_4, proving_key->proving_key.active_block_ranges); + proving_key->proving_key.polynomials.w_4, proving_key->proving_key.active_region_data.get_ranges()); } else { witness_commitments.w_4 = proving_key->proving_key.commitment_key->commit(proving_key->proving_key.polynomials.w_4); @@ -202,7 +203,8 @@ template void OinkProver::execute_log_derivative_ proving_key->relation_parameters.gamma = gamma; // Compute the inverses used in log-derivative lookup relations - proving_key->proving_key.compute_logderivative_inverses(proving_key->relation_parameters); + WitnessComputation::compute_logderivative_inverses(proving_key->proving_key, + proving_key->relation_parameters); { PROFILE_THIS_NAME("COMMIT::lookup_inverses"); @@ -236,8 +238,8 @@ template void OinkProver::execute_grand_product_c PROFILE_THIS_NAME("OinkProver::execute_grand_product_computation_round"); // Compute the permutation grand product polynomial - proving_key->proving_key.compute_grand_product_polynomial(proving_key->relation_parameters, - proving_key->final_active_wire_idx + 1); + WitnessComputation::compute_grand_product_polynomial( + proving_key->proving_key, proving_key->relation_parameters, proving_key->final_active_wire_idx + 1); { PROFILE_THIS_NAME("COMMIT::z_perm"); @@ -245,7 +247,7 @@ template void OinkProver::execute_grand_product_c witness_commitments.z_perm = proving_key->proving_key.commitment_key->commit_structured_with_nonzero_complement( proving_key->proving_key.polynomials.z_perm, - proving_key->proving_key.active_block_ranges, + proving_key->proving_key.active_region_data.get_ranges(), proving_key->final_active_wire_idx + 1); } else { witness_commitments.z_perm = 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 23c90a2bea8..cf58de7cf06 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/relation_correctness.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/relation_correctness.test.cpp @@ -11,6 +11,7 @@ #include "barretenberg/stdlib_circuit_builders/plookup_tables/fixed_base/fixed_base.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" #include "barretenberg/ultra_honk/decider_proving_key.hpp" +#include "barretenberg/ultra_honk/witness_computation.hpp" #include using namespace bb; @@ -264,19 +265,7 @@ TEST_F(UltraRelationCorrectnessTests, Ultra) auto& proving_key = decider_pk->proving_key; auto circuit_size = proving_key.circuit_size; - // Generate eta, beta and gamma - decider_pk->relation_parameters.eta = FF::random_element(); - decider_pk->relation_parameters.eta_two = FF::random_element(); - decider_pk->relation_parameters.eta_three = FF::random_element(); - decider_pk->relation_parameters.beta = FF::random_element(); - decider_pk->relation_parameters.gamma = FF::random_element(); - - decider_pk->proving_key.add_ram_rom_memory_records_to_wire_4(decider_pk->relation_parameters.eta, - decider_pk->relation_parameters.eta_two, - decider_pk->relation_parameters.eta_three); - decider_pk->proving_key.compute_logderivative_inverses(decider_pk->relation_parameters); - decider_pk->proving_key.compute_grand_product_polynomial(decider_pk->relation_parameters, - decider_pk->final_active_wire_idx + 1); + WitnessComputation::complete_proving_key_for_test(decider_pk); // Check that selectors are nonzero to ensure corresponding relation has nontrivial contribution ensure_non_zero(proving_key.polynomials.q_arith); @@ -318,19 +307,7 @@ TEST_F(UltraRelationCorrectnessTests, Mega) auto& proving_key = decider_pk->proving_key; auto circuit_size = proving_key.circuit_size; - // Generate eta, beta and gamma - decider_pk->relation_parameters.eta = FF::random_element(); - decider_pk->relation_parameters.eta_two = FF::random_element(); - decider_pk->relation_parameters.eta_three = FF::random_element(); - decider_pk->relation_parameters.beta = FF::random_element(); - decider_pk->relation_parameters.gamma = FF::random_element(); - - decider_pk->proving_key.add_ram_rom_memory_records_to_wire_4(decider_pk->relation_parameters.eta, - decider_pk->relation_parameters.eta_two, - decider_pk->relation_parameters.eta_three); - decider_pk->proving_key.compute_logderivative_inverses(decider_pk->relation_parameters); - decider_pk->proving_key.compute_grand_product_polynomial(decider_pk->relation_parameters, - decider_pk->final_active_wire_idx + 1); + WitnessComputation::complete_proving_key_for_test(decider_pk); // Check that selectors are nonzero to ensure corresponding relation has nontrivial contribution ensure_non_zero(proving_key.polynomials.q_arith); diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp index 8595d8f17ae..5a84fb27069 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp @@ -9,6 +9,7 @@ #include "barretenberg/relations/ultra_arithmetic_relation.hpp" #include "barretenberg/stdlib_circuit_builders/plookup_tables/fixed_base/fixed_base.hpp" #include "barretenberg/transcript/transcript.hpp" +#include "barretenberg/ultra_honk/witness_computation.hpp" #include @@ -148,20 +149,7 @@ TEST_F(SumcheckTestsRealCircuit, Ultra) // Create a prover (it will compute proving key and witness) auto decider_pk = std::make_shared>(builder); - // Generate eta, beta and gamma - decider_pk->relation_parameters.eta = FF::random_element(); - decider_pk->relation_parameters.eta = FF::random_element(); - decider_pk->relation_parameters.eta_two = FF::random_element(); - decider_pk->relation_parameters.eta_three = FF::random_element(); - decider_pk->relation_parameters.beta = FF::random_element(); - decider_pk->relation_parameters.gamma = FF::random_element(); - - decider_pk->proving_key.add_ram_rom_memory_records_to_wire_4(decider_pk->relation_parameters.eta, - decider_pk->relation_parameters.eta_two, - decider_pk->relation_parameters.eta_three); - decider_pk->proving_key.compute_logderivative_inverses(decider_pk->relation_parameters); - decider_pk->proving_key.compute_grand_product_polynomial(decider_pk->relation_parameters, - decider_pk->final_active_wire_idx + 1); + WitnessComputation::complete_proving_key_for_test(decider_pk); auto prover_transcript = Transcript::prover_init_empty(); auto circuit_size = decider_pk->proving_key.circuit_size; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/witness_computation.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/witness_computation.cpp new file mode 100644 index 00000000000..29bbfe450ad --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/witness_computation.cpp @@ -0,0 +1,144 @@ +#include "barretenberg/ultra_honk/witness_computation.hpp" +#include "barretenberg/common/op_count.hpp" +#include "barretenberg/plonk_honk_shared/library/grand_product_delta.hpp" +#include "barretenberg/plonk_honk_shared/library/grand_product_library.hpp" +#include "barretenberg/plonk_honk_shared/proving_key_inspector.hpp" +#include "barretenberg/relations/databus_lookup_relation.hpp" +#include "barretenberg/relations/logderiv_lookup_relation.hpp" +#include "barretenberg/relations/permutation_relation.hpp" +#include "barretenberg/stdlib_circuit_builders/mega_zk_flavor.hpp" +#include "barretenberg/stdlib_circuit_builders/ultra_keccak_flavor.hpp" +#include "barretenberg/stdlib_circuit_builders/ultra_keccak_zk_flavor.hpp" +#include "barretenberg/stdlib_circuit_builders/ultra_rollup_flavor.hpp" +#include "barretenberg/stdlib_circuit_builders/ultra_zk_flavor.hpp" + +namespace bb { + +/** + * @brief Add RAM/ROM memory records to the fourth wire polynomial + * + * @details This operation must be performed after the first three wires have been + * committed to, hence the dependence on the `eta` challenge. + * + * @tparam Flavor + * @param eta challenge produced after commitment to first three wire polynomials + */ +template +void WitnessComputation::add_ram_rom_memory_records_to_wire_4(typename Flavor::ProvingKey& proving_key, + const typename Flavor::FF& eta, + const typename Flavor::FF& eta_two, + const typename Flavor::FF& eta_three) +{ + // The memory record values are computed at the indicated indices as + // w4 = w3 * eta^3 + w2 * eta^2 + w1 * eta + read_write_flag; + // (See the Auxiliary relation for details) + auto wires = proving_key.polynomials.get_wires(); + + // Compute read record values + for (const auto& gate_idx : proving_key.memory_read_records) { + wires[3].at(gate_idx) += wires[2][gate_idx] * eta_three; + wires[3].at(gate_idx) += wires[1][gate_idx] * eta_two; + wires[3].at(gate_idx) += wires[0][gate_idx] * eta; + } + + // Compute write record values + for (const auto& gate_idx : proving_key.memory_write_records) { + wires[3].at(gate_idx) += wires[2][gate_idx] * eta_three; + wires[3].at(gate_idx) += wires[1][gate_idx] * eta_two; + wires[3].at(gate_idx) += wires[0][gate_idx] * eta; + wires[3].at(gate_idx) += 1; + } +} + +/** + * @brief Compute the inverse polynomials used in the log derivative lookup relations + * + * @tparam Flavor + * @param beta + * @param gamma + */ +template +void WitnessComputation::compute_logderivative_inverses(Flavor::ProvingKey& proving_key, + RelationParameters& relation_parameters) +{ + PROFILE_THIS_NAME("compute_logderivative_inverses"); + + // Compute inverses for conventional lookups + LogDerivLookupRelation::compute_logderivative_inverse( + proving_key.polynomials, relation_parameters, proving_key.circuit_size); + + if constexpr (HasDataBus) { + // Compute inverses for calldata reads + DatabusLookupRelation::template compute_logderivative_inverse( + proving_key.polynomials, relation_parameters, proving_key.circuit_size); + + // Compute inverses for secondary_calldata reads + DatabusLookupRelation::template compute_logderivative_inverse( + proving_key.polynomials, relation_parameters, proving_key.circuit_size); + + // Compute inverses for return data reads + DatabusLookupRelation::template compute_logderivative_inverse( + proving_key.polynomials, relation_parameters, proving_key.circuit_size); + } +} + +/** + * @brief Computes public_input_delta and the permutation grand product polynomial + * + * @param relation_parameters + * @param size_override override the size of the domain over which to compute the grand product + */ +template +void WitnessComputation::compute_grand_product_polynomial(Flavor::ProvingKey& proving_key, + RelationParameters& relation_parameters, + size_t size_override) +{ + relation_parameters.public_input_delta = compute_public_input_delta(proving_key.public_inputs, + relation_parameters.beta, + relation_parameters.gamma, + proving_key.circuit_size, + proving_key.pub_inputs_offset); + + // Compute permutation grand product polynomial + compute_grand_product>( + proving_key.polynomials, relation_parameters, size_override, proving_key.active_region_data); +} + +/** + * @brief TEST only method for completing computation of the prover polynomials using random challenges + * + * @tparam Flavor + * @param decider_pk + */ +template +void WitnessComputation::complete_proving_key_for_test( + const std::shared_ptr>& decider_pk) +{ + // Generate random eta, beta and gamma + decider_pk->relation_parameters.eta = FF::random_element(); + decider_pk->relation_parameters.eta = FF::random_element(); + decider_pk->relation_parameters.eta_two = FF::random_element(); + decider_pk->relation_parameters.eta_three = FF::random_element(); + decider_pk->relation_parameters.beta = FF::random_element(); + decider_pk->relation_parameters.gamma = FF::random_element(); + + add_ram_rom_memory_records_to_wire_4(decider_pk->proving_key, + decider_pk->relation_parameters.eta, + decider_pk->relation_parameters.eta_two, + decider_pk->relation_parameters.eta_three); + + compute_logderivative_inverses(decider_pk->proving_key, decider_pk->relation_parameters); + + compute_grand_product_polynomial( + decider_pk->proving_key, decider_pk->relation_parameters, decider_pk->final_active_wire_idx + 1); +} + +template class WitnessComputation; +template class WitnessComputation; +template class WitnessComputation; +template class WitnessComputation; +template class WitnessComputation; +template class WitnessComputation; +template class WitnessComputation; + +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/witness_computation.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/witness_computation.hpp new file mode 100644 index 00000000000..b53aafa6254 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/witness_computation.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include "barretenberg/flavor/flavor.hpp" +#include "barretenberg/relations/relation_parameters.hpp" +#include "barretenberg/ultra_honk/decider_proving_key.hpp" +namespace bb { +/** + * @brief Methods for managing the compututation of derived witness polynomials such as the permutation grand product, + * log-derivative lookup inverses, and RAM/RAM memory records + * + * @tparam Flavor + */ +template class WitnessComputation { + using FF = typename Flavor::FF; + + public: + static void add_ram_rom_memory_records_to_wire_4(Flavor::ProvingKey& proving_key, + const FF& eta, + const FF& eta_two, + const FF& eta_three); + + static void compute_logderivative_inverses(Flavor::ProvingKey& proving_key, + RelationParameters& relation_parameters); + + static void compute_grand_product_polynomial(Flavor::ProvingKey& proving_key, + RelationParameters& relation_parameters, + size_t size_override = 0); + + static void complete_proving_key_for_test(const std::shared_ptr>& decider_pk); +}; + +} // namespace bb \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/columns.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/columns.hpp index 7e2047bca2a..09a9096ca92 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/columns.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/columns.hpp @@ -10,13 +10,13 @@ namespace bb::avm { #define AVM_PRECOMPUTED_ENTITIES byte_lookup_sel_bin, byte_lookup_table_byte_lengths, byte_lookup_table_in_tags, byte_lookup_table_input_a, byte_lookup_table_input_b, byte_lookup_table_op_id, byte_lookup_table_output, gas_base_da_gas_fixed_table, gas_base_l2_gas_fixed_table, gas_dyn_da_gas_fixed_table, gas_dyn_l2_gas_fixed_table, gas_sel_gas_cost, main_clk, main_sel_da_end_gas_kernel_input, main_sel_da_start_gas_kernel_input, main_sel_first, main_sel_l2_end_gas_kernel_input, main_sel_l2_start_gas_kernel_input, main_sel_start_exec, main_zeroes, powers_power_of_2 #define AVM_WIRE_ENTITIES main_kernel_inputs, main_kernel_value_out, main_kernel_side_effect_out, main_kernel_metadata_out, main_calldata, main_returndata, alu_a_hi, alu_a_lo, alu_b_hi, alu_b_lo, alu_b_pow, alu_c_hi, alu_c_lo, alu_cf, alu_clk, alu_cmp_gadget_gt, alu_cmp_gadget_input_a, alu_cmp_gadget_input_b, alu_cmp_gadget_non_ff_gt, alu_cmp_gadget_result, alu_cmp_gadget_sel, alu_ff_tag, alu_ia, alu_ib, alu_ic, alu_in_tag, alu_max_bits_sub_b_bits, alu_max_bits_sub_b_pow, alu_op_add, alu_op_cast, alu_op_div, alu_op_eq, alu_op_lt, alu_op_lte, alu_op_mul, alu_op_not, alu_op_shl, alu_op_shr, alu_op_sub, alu_partial_prod_hi, alu_partial_prod_lo, alu_range_check_input_value, alu_range_check_num_bits, alu_range_check_sel, alu_remainder, alu_sel_alu, alu_sel_cmp, alu_sel_shift_which, alu_u128_tag, alu_u16_tag, alu_u1_tag, alu_u32_tag, alu_u64_tag, alu_u8_tag, alu_zero_shift, binary_acc_ia, binary_acc_ib, binary_acc_ic, binary_clk, binary_ia_bytes, binary_ib_bytes, binary_ic_bytes, binary_in_tag, binary_mem_tag_ctr, binary_mem_tag_ctr_inv, binary_op_id, binary_sel_bin, binary_start, bytecode_arifact_hash, bytecode_as_fields, bytecode_bytes, bytecode_bytes_pc, bytecode_class_id, bytecode_contract_address, bytecode_decomposed, bytecode_deployer_addr, bytecode_end_latch, bytecode_incoming_viewing_key_x, bytecode_incoming_viewing_key_y, bytecode_initialization_hash, bytecode_length_remaining, bytecode_nullifier_key_x, bytecode_nullifier_key_y, bytecode_outgoing_viewing_key_x, bytecode_outgoing_viewing_key_y, bytecode_private_fn_root, bytecode_public_key_hash, bytecode_running_hash, bytecode_salt, bytecode_tagging_key_x, bytecode_tagging_key_y, cmp_a_hi, cmp_a_lo, cmp_b_hi, cmp_b_lo, cmp_borrow, cmp_clk, cmp_cmp_rng_ctr, cmp_diff, cmp_input_a, cmp_input_b, cmp_op_eq, cmp_op_eq_diff_inv, cmp_op_gt, cmp_op_non_ff_gt, cmp_p_a_borrow, cmp_p_b_borrow, cmp_p_sub_a_hi, cmp_p_sub_a_lo, cmp_p_sub_b_hi, cmp_p_sub_b_lo, cmp_range_chk_clk, cmp_res_hi, cmp_res_lo, cmp_result, cmp_sel_cmp, cmp_sel_rng_chk, cmp_shift_sel, conversion_clk, conversion_input, conversion_num_limbs, conversion_output_bits, conversion_radix, conversion_sel_to_radix_be, keccakf1600_clk, keccakf1600_input, keccakf1600_output, keccakf1600_sel_keccakf1600, main_abs_da_rem_gas, main_abs_l2_rem_gas, main_alu_in_tag, main_base_da_gas_op_cost, main_base_l2_gas_op_cost, main_bin_op_id, main_call_ptr, main_da_gas_remaining, main_da_gas_u16_r0, main_da_gas_u16_r1, main_da_out_of_gas, main_dyn_da_gas_op_cost, main_dyn_gas_multiplier, main_dyn_l2_gas_op_cost, main_ia, main_ib, main_ic, main_id, main_id_zero, main_ind_addr_a, main_ind_addr_b, main_ind_addr_c, main_ind_addr_d, main_internal_return_ptr, main_inv, main_is_fake_row, main_is_gas_accounted, main_l2_gas_remaining, main_l2_gas_u16_r0, main_l2_gas_u16_r1, main_l2_out_of_gas, main_mem_addr_a, main_mem_addr_b, main_mem_addr_c, main_mem_addr_d, main_op_err, main_opcode_val, main_pc, main_r_in_tag, main_rwa, main_rwb, main_rwc, main_rwd, main_sel_alu, main_sel_bin, main_sel_calldata, main_sel_execution_end, main_sel_execution_row, main_sel_mem_op_a, main_sel_mem_op_b, main_sel_mem_op_c, main_sel_mem_op_d, main_sel_mov_ia_to_ic, main_sel_mov_ib_to_ic, main_sel_op_add, main_sel_op_address, main_sel_op_and, main_sel_op_block_number, main_sel_op_calldata_copy, main_sel_op_cast, main_sel_op_chain_id, main_sel_op_dagasleft, main_sel_op_debug_log, main_sel_op_div, main_sel_op_ecadd, main_sel_op_emit_l2_to_l1_msg, main_sel_op_emit_note_hash, main_sel_op_emit_nullifier, main_sel_op_emit_unencrypted_log, main_sel_op_eq, main_sel_op_external_call, main_sel_op_external_return, main_sel_op_external_revert, main_sel_op_fdiv, main_sel_op_fee_per_da_gas, main_sel_op_fee_per_l2_gas, main_sel_op_get_contract_instance, main_sel_op_internal_call, main_sel_op_internal_return, main_sel_op_is_static_call, main_sel_op_jump, main_sel_op_jumpi, main_sel_op_keccak, main_sel_op_l1_to_l2_msg_exists, main_sel_op_l2gasleft, main_sel_op_lt, main_sel_op_lte, main_sel_op_mov, main_sel_op_msm, main_sel_op_mul, main_sel_op_not, main_sel_op_note_hash_exists, main_sel_op_nullifier_exists, main_sel_op_or, main_sel_op_poseidon2, main_sel_op_radix_be, main_sel_op_returndata_copy, main_sel_op_returndata_size, main_sel_op_sender, main_sel_op_set, main_sel_op_sha256, main_sel_op_shl, main_sel_op_shr, main_sel_op_sload, main_sel_op_sstore, main_sel_op_static_call, main_sel_op_sub, main_sel_op_timestamp, main_sel_op_transaction_fee, main_sel_op_version, main_sel_op_xor, main_sel_q_kernel_lookup, main_sel_q_kernel_output_lookup, main_sel_resolve_ind_addr_a, main_sel_resolve_ind_addr_b, main_sel_resolve_ind_addr_c, main_sel_resolve_ind_addr_d, main_sel_returndata, main_sel_rng_16, main_sel_rng_8, main_sel_slice_gadget, main_space_id, main_tag_err, main_w_in_tag, mem_addr, mem_clk, mem_diff, mem_glob_addr, mem_last, mem_lastAccess, mem_one_min_inv, mem_r_in_tag, mem_rw, mem_sel_mem, mem_sel_mov_ia_to_ic, mem_sel_mov_ib_to_ic, mem_sel_op_a, mem_sel_op_b, mem_sel_op_c, mem_sel_op_d, mem_sel_op_poseidon_read_a, mem_sel_op_poseidon_read_b, mem_sel_op_poseidon_read_c, mem_sel_op_poseidon_read_d, mem_sel_op_poseidon_write_a, mem_sel_op_poseidon_write_b, mem_sel_op_poseidon_write_c, mem_sel_op_poseidon_write_d, mem_sel_op_slice, mem_sel_resolve_ind_addr_a, mem_sel_resolve_ind_addr_b, mem_sel_resolve_ind_addr_c, mem_sel_resolve_ind_addr_d, mem_sel_rng_chk, mem_skip_check_tag, mem_space_id, mem_tag, mem_tag_err, mem_tsp, mem_u16_r0, mem_u16_r1, mem_u8_r0, mem_val, mem_w_in_tag, merkle_tree_clk, merkle_tree_expected_tree_root, merkle_tree_latch, merkle_tree_leaf_index, merkle_tree_leaf_index_is_even, merkle_tree_leaf_value, merkle_tree_left_hash, merkle_tree_output_hash, merkle_tree_path_len, merkle_tree_path_len_inv, merkle_tree_right_hash, merkle_tree_sel_merkle_tree, merkle_tree_sibling_value, poseidon2_B_10_0, poseidon2_B_10_1, poseidon2_B_10_2, poseidon2_B_10_3, poseidon2_B_11_0, poseidon2_B_11_1, poseidon2_B_11_2, poseidon2_B_11_3, poseidon2_B_12_0, poseidon2_B_12_1, poseidon2_B_12_2, poseidon2_B_12_3, poseidon2_B_13_0, poseidon2_B_13_1, poseidon2_B_13_2, poseidon2_B_13_3, poseidon2_B_14_0, poseidon2_B_14_1, poseidon2_B_14_2, poseidon2_B_14_3, poseidon2_B_15_0, poseidon2_B_15_1, poseidon2_B_15_2, poseidon2_B_15_3, poseidon2_B_16_0, poseidon2_B_16_1, poseidon2_B_16_2, poseidon2_B_16_3, poseidon2_B_17_0, poseidon2_B_17_1, poseidon2_B_17_2, poseidon2_B_17_3, poseidon2_B_18_0, poseidon2_B_18_1, poseidon2_B_18_2, poseidon2_B_18_3, poseidon2_B_19_0, poseidon2_B_19_1, poseidon2_B_19_2, poseidon2_B_19_3, poseidon2_B_20_0, poseidon2_B_20_1, poseidon2_B_20_2, poseidon2_B_20_3, poseidon2_B_21_0, poseidon2_B_21_1, poseidon2_B_21_2, poseidon2_B_21_3, poseidon2_B_22_0, poseidon2_B_22_1, poseidon2_B_22_2, poseidon2_B_22_3, poseidon2_B_23_0, poseidon2_B_23_1, poseidon2_B_23_2, poseidon2_B_23_3, poseidon2_B_24_0, poseidon2_B_24_1, poseidon2_B_24_2, poseidon2_B_24_3, poseidon2_B_25_0, poseidon2_B_25_1, poseidon2_B_25_2, poseidon2_B_25_3, poseidon2_B_26_0, poseidon2_B_26_1, poseidon2_B_26_2, poseidon2_B_26_3, poseidon2_B_27_0, poseidon2_B_27_1, poseidon2_B_27_2, poseidon2_B_27_3, poseidon2_B_28_0, poseidon2_B_28_1, poseidon2_B_28_2, poseidon2_B_28_3, poseidon2_B_29_0, poseidon2_B_29_1, poseidon2_B_29_2, poseidon2_B_29_3, poseidon2_B_30_0, poseidon2_B_30_1, poseidon2_B_30_2, poseidon2_B_30_3, poseidon2_B_31_0, poseidon2_B_31_1, poseidon2_B_31_2, poseidon2_B_31_3, poseidon2_B_32_0, poseidon2_B_32_1, poseidon2_B_32_2, poseidon2_B_32_3, poseidon2_B_33_0, poseidon2_B_33_1, poseidon2_B_33_2, poseidon2_B_33_3, poseidon2_B_34_0, poseidon2_B_34_1, poseidon2_B_34_2, poseidon2_B_34_3, poseidon2_B_35_0, poseidon2_B_35_1, poseidon2_B_35_2, poseidon2_B_35_3, poseidon2_B_36_0, poseidon2_B_36_1, poseidon2_B_36_2, poseidon2_B_36_3, poseidon2_B_37_0, poseidon2_B_37_1, poseidon2_B_37_2, poseidon2_B_37_3, poseidon2_B_38_0, poseidon2_B_38_1, poseidon2_B_38_2, poseidon2_B_38_3, poseidon2_B_39_0, poseidon2_B_39_1, poseidon2_B_39_2, poseidon2_B_39_3, poseidon2_B_40_0, poseidon2_B_40_1, poseidon2_B_40_2, poseidon2_B_40_3, poseidon2_B_41_0, poseidon2_B_41_1, poseidon2_B_41_2, poseidon2_B_41_3, poseidon2_B_42_0, poseidon2_B_42_1, poseidon2_B_42_2, poseidon2_B_42_3, poseidon2_B_43_0, poseidon2_B_43_1, poseidon2_B_43_2, poseidon2_B_43_3, poseidon2_B_44_0, poseidon2_B_44_1, poseidon2_B_44_2, poseidon2_B_44_3, poseidon2_B_45_0, poseidon2_B_45_1, poseidon2_B_45_2, poseidon2_B_45_3, poseidon2_B_46_0, poseidon2_B_46_1, poseidon2_B_46_2, poseidon2_B_46_3, poseidon2_B_47_0, poseidon2_B_47_1, poseidon2_B_47_2, poseidon2_B_47_3, poseidon2_B_48_0, poseidon2_B_48_1, poseidon2_B_48_2, poseidon2_B_48_3, poseidon2_B_49_0, poseidon2_B_49_1, poseidon2_B_49_2, poseidon2_B_49_3, poseidon2_B_4_0, poseidon2_B_4_1, poseidon2_B_4_2, poseidon2_B_4_3, poseidon2_B_50_0, poseidon2_B_50_1, poseidon2_B_50_2, poseidon2_B_50_3, poseidon2_B_51_0, poseidon2_B_51_1, poseidon2_B_51_2, poseidon2_B_51_3, poseidon2_B_52_0, poseidon2_B_52_1, poseidon2_B_52_2, poseidon2_B_52_3, poseidon2_B_53_0, poseidon2_B_53_1, poseidon2_B_53_2, poseidon2_B_53_3, poseidon2_B_54_0, poseidon2_B_54_1, poseidon2_B_54_2, poseidon2_B_54_3, poseidon2_B_55_0, poseidon2_B_55_1, poseidon2_B_55_2, poseidon2_B_55_3, poseidon2_B_56_0, poseidon2_B_56_1, poseidon2_B_56_2, poseidon2_B_56_3, poseidon2_B_57_0, poseidon2_B_57_1, poseidon2_B_57_2, poseidon2_B_57_3, poseidon2_B_58_0, poseidon2_B_58_1, poseidon2_B_58_2, poseidon2_B_58_3, poseidon2_B_59_0, poseidon2_B_59_1, poseidon2_B_59_2, poseidon2_B_59_3, poseidon2_B_5_0, poseidon2_B_5_1, poseidon2_B_5_2, poseidon2_B_5_3, poseidon2_B_6_0, poseidon2_B_6_1, poseidon2_B_6_2, poseidon2_B_6_3, poseidon2_B_7_0, poseidon2_B_7_1, poseidon2_B_7_2, poseidon2_B_7_3, poseidon2_B_8_0, poseidon2_B_8_1, poseidon2_B_8_2, poseidon2_B_8_3, poseidon2_B_9_0, poseidon2_B_9_1, poseidon2_B_9_2, poseidon2_B_9_3, poseidon2_EXT_LAYER_4, poseidon2_EXT_LAYER_5, poseidon2_EXT_LAYER_6, poseidon2_EXT_LAYER_7, poseidon2_T_0_4, poseidon2_T_0_5, poseidon2_T_0_6, poseidon2_T_0_7, poseidon2_T_1_4, poseidon2_T_1_5, poseidon2_T_1_6, poseidon2_T_1_7, poseidon2_T_2_4, poseidon2_T_2_5, poseidon2_T_2_6, poseidon2_T_2_7, poseidon2_T_3_4, poseidon2_T_3_5, poseidon2_T_3_6, poseidon2_T_3_7, poseidon2_T_60_4, poseidon2_T_60_5, poseidon2_T_60_6, poseidon2_T_60_7, poseidon2_T_61_4, poseidon2_T_61_5, poseidon2_T_61_6, poseidon2_T_61_7, poseidon2_T_62_4, poseidon2_T_62_5, poseidon2_T_62_6, poseidon2_T_62_7, poseidon2_T_63_4, poseidon2_T_63_5, poseidon2_T_63_6, poseidon2_T_63_7, poseidon2_a_0, poseidon2_a_1, poseidon2_a_2, poseidon2_a_3, poseidon2_b_0, poseidon2_b_1, poseidon2_b_2, poseidon2_b_3, poseidon2_clk, poseidon2_full_a_0, poseidon2_full_a_1, poseidon2_full_a_2, poseidon2_full_a_3, poseidon2_full_b_0, poseidon2_full_b_1, poseidon2_full_b_2, poseidon2_full_b_3, poseidon2_full_clk, poseidon2_full_end_poseidon, poseidon2_full_execute_poseidon_perm, poseidon2_full_input_0, poseidon2_full_input_1, poseidon2_full_input_2, poseidon2_full_input_len, poseidon2_full_num_perm_rounds_rem, poseidon2_full_num_perm_rounds_rem_inv, poseidon2_full_output, poseidon2_full_padding, poseidon2_full_sel_merkle_tree, poseidon2_full_sel_poseidon, poseidon2_full_start_poseidon, poseidon2_input_addr, poseidon2_mem_addr_read_a, poseidon2_mem_addr_read_b, poseidon2_mem_addr_read_c, poseidon2_mem_addr_read_d, poseidon2_mem_addr_write_a, poseidon2_mem_addr_write_b, poseidon2_mem_addr_write_c, poseidon2_mem_addr_write_d, poseidon2_output_addr, poseidon2_sel_poseidon_perm, poseidon2_sel_poseidon_perm_immediate, poseidon2_sel_poseidon_perm_mem_op, poseidon2_space_id, range_check_alu_rng_chk, range_check_clk, range_check_cmp_hi_bits_rng_chk, range_check_cmp_lo_bits_rng_chk, range_check_cmp_non_ff_rng_chk, range_check_dyn_diff, range_check_dyn_rng_chk_bits, range_check_dyn_rng_chk_pow_2, range_check_gas_da_rng_chk, range_check_gas_l2_rng_chk, range_check_is_lte_u112, range_check_is_lte_u128, range_check_is_lte_u16, range_check_is_lte_u32, range_check_is_lte_u48, range_check_is_lte_u64, range_check_is_lte_u80, range_check_is_lte_u96, range_check_rng_chk_bits, range_check_sel_lookup_0, range_check_sel_lookup_1, range_check_sel_lookup_2, range_check_sel_lookup_3, range_check_sel_lookup_4, range_check_sel_lookup_5, range_check_sel_lookup_6, range_check_sel_rng_chk, range_check_u16_r0, range_check_u16_r1, range_check_u16_r2, range_check_u16_r3, range_check_u16_r4, range_check_u16_r5, range_check_u16_r6, range_check_u16_r7, range_check_value, sha256_clk, sha256_input, sha256_output, sha256_sel_sha256_compression, sha256_state, slice_addr, slice_clk, slice_cnt, slice_col_offset, slice_one_min_inv, slice_sel_cd_cpy, slice_sel_mem_active, slice_sel_return, slice_sel_start, slice_space_id, slice_val, lookup_rng_chk_pow_2_counts, lookup_rng_chk_diff_counts, lookup_rng_chk_0_counts, lookup_rng_chk_1_counts, lookup_rng_chk_2_counts, lookup_rng_chk_3_counts, lookup_rng_chk_4_counts, lookup_rng_chk_5_counts, lookup_rng_chk_6_counts, lookup_rng_chk_7_counts, lookup_mem_rng_chk_0_counts, lookup_mem_rng_chk_1_counts, lookup_mem_rng_chk_2_counts, lookup_pow_2_0_counts, lookup_pow_2_1_counts, lookup_byte_lengths_counts, lookup_byte_operations_counts, lookup_opcode_gas_counts, lookup_l2_gas_rng_chk_0_counts, lookup_l2_gas_rng_chk_1_counts, lookup_da_gas_rng_chk_0_counts, lookup_da_gas_rng_chk_1_counts, lookup_cd_value_counts, lookup_ret_value_counts, incl_main_tag_err_counts, incl_mem_tag_err_counts #define AVM_DERIVED_WITNESS_ENTITIES perm_rng_non_ff_cmp_inv, perm_rng_cmp_lo_inv, perm_rng_cmp_hi_inv, perm_rng_alu_inv, perm_cmp_alu_inv, perm_pos_mem_read_a_inv, perm_pos_mem_read_b_inv, perm_pos_mem_read_c_inv, perm_pos_mem_read_d_inv, perm_pos_mem_write_a_inv, perm_pos_mem_write_b_inv, perm_pos_mem_write_c_inv, perm_pos_mem_write_d_inv, perm_pos2_fixed_pos2_perm_inv, perm_slice_mem_inv, perm_merkle_poseidon2_inv, perm_main_alu_inv, perm_main_bin_inv, perm_main_conv_inv, perm_main_sha256_inv, perm_main_pos2_perm_inv, perm_main_mem_a_inv, perm_main_mem_b_inv, perm_main_mem_c_inv, perm_main_mem_d_inv, perm_main_mem_ind_addr_a_inv, perm_main_mem_ind_addr_b_inv, perm_main_mem_ind_addr_c_inv, perm_main_mem_ind_addr_d_inv, lookup_rng_chk_pow_2_inv, lookup_rng_chk_diff_inv, lookup_rng_chk_0_inv, lookup_rng_chk_1_inv, lookup_rng_chk_2_inv, lookup_rng_chk_3_inv, lookup_rng_chk_4_inv, lookup_rng_chk_5_inv, lookup_rng_chk_6_inv, lookup_rng_chk_7_inv, lookup_mem_rng_chk_0_inv, lookup_mem_rng_chk_1_inv, lookup_mem_rng_chk_2_inv, lookup_pow_2_0_inv, lookup_pow_2_1_inv, lookup_byte_lengths_inv, lookup_byte_operations_inv, lookup_opcode_gas_inv, lookup_l2_gas_rng_chk_0_inv, lookup_l2_gas_rng_chk_1_inv, lookup_da_gas_rng_chk_0_inv, lookup_da_gas_rng_chk_1_inv, lookup_cd_value_inv, lookup_ret_value_inv, incl_main_tag_err_inv, incl_mem_tag_err_inv -#define AVM_SHIFTED_ENTITIES binary_acc_ia_shift, binary_acc_ib_shift, binary_acc_ic_shift, binary_mem_tag_ctr_shift, binary_op_id_shift, cmp_a_hi_shift, cmp_a_lo_shift, cmp_b_hi_shift, cmp_b_lo_shift, cmp_cmp_rng_ctr_shift, cmp_op_gt_shift, cmp_p_sub_a_hi_shift, cmp_p_sub_a_lo_shift, cmp_p_sub_b_hi_shift, cmp_p_sub_b_lo_shift, cmp_sel_rng_chk_shift, main_da_gas_remaining_shift, main_l2_gas_remaining_shift, main_pc_shift, main_sel_execution_end_shift, main_sel_execution_row_shift, mem_glob_addr_shift, mem_rw_shift, mem_sel_mem_shift, mem_tag_shift, mem_tsp_shift, mem_val_shift, merkle_tree_leaf_index_shift, merkle_tree_leaf_value_shift, merkle_tree_path_len_shift, poseidon2_full_a_0_shift, poseidon2_full_a_1_shift, poseidon2_full_a_2_shift, poseidon2_full_a_3_shift, poseidon2_full_execute_poseidon_perm_shift, poseidon2_full_input_0_shift, poseidon2_full_input_1_shift, poseidon2_full_input_2_shift, poseidon2_full_num_perm_rounds_rem_shift, poseidon2_full_sel_poseidon_shift, poseidon2_full_start_poseidon_shift, slice_addr_shift, slice_clk_shift, slice_cnt_shift, slice_col_offset_shift, slice_sel_cd_cpy_shift, slice_sel_mem_active_shift, slice_sel_return_shift, slice_sel_start_shift, slice_space_id_shift -#define AVM_TO_BE_SHIFTED(e) e.binary_acc_ia, e.binary_acc_ib, e.binary_acc_ic, e.binary_mem_tag_ctr, e.binary_op_id, e.cmp_a_hi, e.cmp_a_lo, e.cmp_b_hi, e.cmp_b_lo, e.cmp_cmp_rng_ctr, e.cmp_op_gt, e.cmp_p_sub_a_hi, e.cmp_p_sub_a_lo, e.cmp_p_sub_b_hi, e.cmp_p_sub_b_lo, e.cmp_sel_rng_chk, e.main_da_gas_remaining, e.main_l2_gas_remaining, e.main_pc, e.main_sel_execution_end, e.main_sel_execution_row, e.mem_glob_addr, e.mem_rw, e.mem_sel_mem, e.mem_tag, e.mem_tsp, e.mem_val, e.merkle_tree_leaf_index, e.merkle_tree_leaf_value, e.merkle_tree_path_len, e.poseidon2_full_a_0, e.poseidon2_full_a_1, e.poseidon2_full_a_2, e.poseidon2_full_a_3, e.poseidon2_full_execute_poseidon_perm, e.poseidon2_full_input_0, e.poseidon2_full_input_1, e.poseidon2_full_input_2, e.poseidon2_full_num_perm_rounds_rem, e.poseidon2_full_sel_poseidon, e.poseidon2_full_start_poseidon, e.slice_addr, e.slice_clk, e.slice_cnt, e.slice_col_offset, e.slice_sel_cd_cpy, e.slice_sel_mem_active, e.slice_sel_return, e.slice_sel_start, e.slice_space_id +#define AVM_SHIFTED_ENTITIES binary_acc_ia_shift, binary_acc_ib_shift, binary_acc_ic_shift, binary_mem_tag_ctr_shift, binary_op_id_shift, cmp_a_hi_shift, cmp_a_lo_shift, cmp_b_hi_shift, cmp_b_lo_shift, cmp_cmp_rng_ctr_shift, cmp_op_gt_shift, cmp_p_sub_a_hi_shift, cmp_p_sub_a_lo_shift, cmp_p_sub_b_hi_shift, cmp_p_sub_b_lo_shift, cmp_sel_rng_chk_shift, main_da_gas_remaining_shift, main_l2_gas_remaining_shift, main_pc_shift, main_sel_execution_end_shift, main_sel_execution_row_shift, mem_glob_addr_shift, mem_rw_shift, mem_sel_mem_shift, mem_tag_shift, mem_tsp_shift, mem_val_shift, merkle_tree_leaf_index_shift, merkle_tree_leaf_value_shift, merkle_tree_path_len_shift, poseidon2_full_a_0_shift, poseidon2_full_a_1_shift, poseidon2_full_a_2_shift, poseidon2_full_a_3_shift, poseidon2_full_execute_poseidon_perm_shift, poseidon2_full_input_0_shift, poseidon2_full_input_1_shift, poseidon2_full_input_2_shift, poseidon2_full_num_perm_rounds_rem_shift, poseidon2_full_sel_poseidon_shift, poseidon2_full_start_poseidon_shift, slice_addr_shift, slice_clk_shift, slice_cnt_shift, slice_sel_cd_cpy_shift, slice_sel_mem_active_shift, slice_sel_return_shift, slice_sel_start_shift, slice_space_id_shift +#define AVM_TO_BE_SHIFTED(e) e.binary_acc_ia, e.binary_acc_ib, e.binary_acc_ic, e.binary_mem_tag_ctr, e.binary_op_id, e.cmp_a_hi, e.cmp_a_lo, e.cmp_b_hi, e.cmp_b_lo, e.cmp_cmp_rng_ctr, e.cmp_op_gt, e.cmp_p_sub_a_hi, e.cmp_p_sub_a_lo, e.cmp_p_sub_b_hi, e.cmp_p_sub_b_lo, e.cmp_sel_rng_chk, e.main_da_gas_remaining, e.main_l2_gas_remaining, e.main_pc, e.main_sel_execution_end, e.main_sel_execution_row, e.mem_glob_addr, e.mem_rw, e.mem_sel_mem, e.mem_tag, e.mem_tsp, e.mem_val, e.merkle_tree_leaf_index, e.merkle_tree_leaf_value, e.merkle_tree_path_len, e.poseidon2_full_a_0, e.poseidon2_full_a_1, e.poseidon2_full_a_2, e.poseidon2_full_a_3, e.poseidon2_full_execute_poseidon_perm, e.poseidon2_full_input_0, e.poseidon2_full_input_1, e.poseidon2_full_input_2, e.poseidon2_full_num_perm_rounds_rem, e.poseidon2_full_sel_poseidon, e.poseidon2_full_start_poseidon, e.slice_addr, e.slice_clk, e.slice_cnt, e.slice_sel_cd_cpy, e.slice_sel_mem_active, e.slice_sel_return, e.slice_sel_start, e.slice_space_id #define AVM_ALL_ENTITIES AVM_PRECOMPUTED_ENTITIES, AVM_WIRE_ENTITIES, AVM_DERIVED_WITNESS_ENTITIES, AVM_SHIFTED_ENTITIES #define AVM_UNSHIFTED_ENTITIES AVM_PRECOMPUTED_ENTITIES, AVM_WIRE_ENTITIES, AVM_DERIVED_WITNESS_ENTITIES -#define AVM_TO_BE_SHIFTED_COLUMNS Column::binary_acc_ia, Column::binary_acc_ib, Column::binary_acc_ic, Column::binary_mem_tag_ctr, Column::binary_op_id, Column::cmp_a_hi, Column::cmp_a_lo, Column::cmp_b_hi, Column::cmp_b_lo, Column::cmp_cmp_rng_ctr, Column::cmp_op_gt, Column::cmp_p_sub_a_hi, Column::cmp_p_sub_a_lo, Column::cmp_p_sub_b_hi, Column::cmp_p_sub_b_lo, Column::cmp_sel_rng_chk, Column::main_da_gas_remaining, Column::main_l2_gas_remaining, Column::main_pc, Column::main_sel_execution_end, Column::main_sel_execution_row, Column::mem_glob_addr, Column::mem_rw, Column::mem_sel_mem, Column::mem_tag, Column::mem_tsp, Column::mem_val, Column::merkle_tree_leaf_index, Column::merkle_tree_leaf_value, Column::merkle_tree_path_len, Column::poseidon2_full_a_0, Column::poseidon2_full_a_1, Column::poseidon2_full_a_2, Column::poseidon2_full_a_3, Column::poseidon2_full_execute_poseidon_perm, Column::poseidon2_full_input_0, Column::poseidon2_full_input_1, Column::poseidon2_full_input_2, Column::poseidon2_full_num_perm_rounds_rem, Column::poseidon2_full_sel_poseidon, Column::poseidon2_full_start_poseidon, Column::slice_addr, Column::slice_clk, Column::slice_cnt, Column::slice_col_offset, Column::slice_sel_cd_cpy, Column::slice_sel_mem_active, Column::slice_sel_return, Column::slice_sel_start, Column::slice_space_id -#define AVM_SHIFTED_COLUMNS ColumnAndShifts::binary_acc_ia_shift, ColumnAndShifts::binary_acc_ib_shift, ColumnAndShifts::binary_acc_ic_shift, ColumnAndShifts::binary_mem_tag_ctr_shift, ColumnAndShifts::binary_op_id_shift, ColumnAndShifts::cmp_a_hi_shift, ColumnAndShifts::cmp_a_lo_shift, ColumnAndShifts::cmp_b_hi_shift, ColumnAndShifts::cmp_b_lo_shift, ColumnAndShifts::cmp_cmp_rng_ctr_shift, ColumnAndShifts::cmp_op_gt_shift, ColumnAndShifts::cmp_p_sub_a_hi_shift, ColumnAndShifts::cmp_p_sub_a_lo_shift, ColumnAndShifts::cmp_p_sub_b_hi_shift, ColumnAndShifts::cmp_p_sub_b_lo_shift, ColumnAndShifts::cmp_sel_rng_chk_shift, ColumnAndShifts::main_da_gas_remaining_shift, ColumnAndShifts::main_l2_gas_remaining_shift, ColumnAndShifts::main_pc_shift, ColumnAndShifts::main_sel_execution_end_shift, ColumnAndShifts::main_sel_execution_row_shift, ColumnAndShifts::mem_glob_addr_shift, ColumnAndShifts::mem_rw_shift, ColumnAndShifts::mem_sel_mem_shift, ColumnAndShifts::mem_tag_shift, ColumnAndShifts::mem_tsp_shift, ColumnAndShifts::mem_val_shift, ColumnAndShifts::merkle_tree_leaf_index_shift, ColumnAndShifts::merkle_tree_leaf_value_shift, ColumnAndShifts::merkle_tree_path_len_shift, ColumnAndShifts::poseidon2_full_a_0_shift, ColumnAndShifts::poseidon2_full_a_1_shift, ColumnAndShifts::poseidon2_full_a_2_shift, ColumnAndShifts::poseidon2_full_a_3_shift, ColumnAndShifts::poseidon2_full_execute_poseidon_perm_shift, ColumnAndShifts::poseidon2_full_input_0_shift, ColumnAndShifts::poseidon2_full_input_1_shift, ColumnAndShifts::poseidon2_full_input_2_shift, ColumnAndShifts::poseidon2_full_num_perm_rounds_rem_shift, ColumnAndShifts::poseidon2_full_sel_poseidon_shift, ColumnAndShifts::poseidon2_full_start_poseidon_shift, ColumnAndShifts::slice_addr_shift, ColumnAndShifts::slice_clk_shift, ColumnAndShifts::slice_cnt_shift, ColumnAndShifts::slice_col_offset_shift, ColumnAndShifts::slice_sel_cd_cpy_shift, ColumnAndShifts::slice_sel_mem_active_shift, ColumnAndShifts::slice_sel_return_shift, ColumnAndShifts::slice_sel_start_shift, ColumnAndShifts::slice_space_id_shift +#define AVM_TO_BE_SHIFTED_COLUMNS Column::binary_acc_ia, Column::binary_acc_ib, Column::binary_acc_ic, Column::binary_mem_tag_ctr, Column::binary_op_id, Column::cmp_a_hi, Column::cmp_a_lo, Column::cmp_b_hi, Column::cmp_b_lo, Column::cmp_cmp_rng_ctr, Column::cmp_op_gt, Column::cmp_p_sub_a_hi, Column::cmp_p_sub_a_lo, Column::cmp_p_sub_b_hi, Column::cmp_p_sub_b_lo, Column::cmp_sel_rng_chk, Column::main_da_gas_remaining, Column::main_l2_gas_remaining, Column::main_pc, Column::main_sel_execution_end, Column::main_sel_execution_row, Column::mem_glob_addr, Column::mem_rw, Column::mem_sel_mem, Column::mem_tag, Column::mem_tsp, Column::mem_val, Column::merkle_tree_leaf_index, Column::merkle_tree_leaf_value, Column::merkle_tree_path_len, Column::poseidon2_full_a_0, Column::poseidon2_full_a_1, Column::poseidon2_full_a_2, Column::poseidon2_full_a_3, Column::poseidon2_full_execute_poseidon_perm, Column::poseidon2_full_input_0, Column::poseidon2_full_input_1, Column::poseidon2_full_input_2, Column::poseidon2_full_num_perm_rounds_rem, Column::poseidon2_full_sel_poseidon, Column::poseidon2_full_start_poseidon, Column::slice_addr, Column::slice_clk, Column::slice_cnt, Column::slice_sel_cd_cpy, Column::slice_sel_mem_active, Column::slice_sel_return, Column::slice_sel_start, Column::slice_space_id +#define AVM_SHIFTED_COLUMNS ColumnAndShifts::binary_acc_ia_shift, ColumnAndShifts::binary_acc_ib_shift, ColumnAndShifts::binary_acc_ic_shift, ColumnAndShifts::binary_mem_tag_ctr_shift, ColumnAndShifts::binary_op_id_shift, ColumnAndShifts::cmp_a_hi_shift, ColumnAndShifts::cmp_a_lo_shift, ColumnAndShifts::cmp_b_hi_shift, ColumnAndShifts::cmp_b_lo_shift, ColumnAndShifts::cmp_cmp_rng_ctr_shift, ColumnAndShifts::cmp_op_gt_shift, ColumnAndShifts::cmp_p_sub_a_hi_shift, ColumnAndShifts::cmp_p_sub_a_lo_shift, ColumnAndShifts::cmp_p_sub_b_hi_shift, ColumnAndShifts::cmp_p_sub_b_lo_shift, ColumnAndShifts::cmp_sel_rng_chk_shift, ColumnAndShifts::main_da_gas_remaining_shift, ColumnAndShifts::main_l2_gas_remaining_shift, ColumnAndShifts::main_pc_shift, ColumnAndShifts::main_sel_execution_end_shift, ColumnAndShifts::main_sel_execution_row_shift, ColumnAndShifts::mem_glob_addr_shift, ColumnAndShifts::mem_rw_shift, ColumnAndShifts::mem_sel_mem_shift, ColumnAndShifts::mem_tag_shift, ColumnAndShifts::mem_tsp_shift, ColumnAndShifts::mem_val_shift, ColumnAndShifts::merkle_tree_leaf_index_shift, ColumnAndShifts::merkle_tree_leaf_value_shift, ColumnAndShifts::merkle_tree_path_len_shift, ColumnAndShifts::poseidon2_full_a_0_shift, ColumnAndShifts::poseidon2_full_a_1_shift, ColumnAndShifts::poseidon2_full_a_2_shift, ColumnAndShifts::poseidon2_full_a_3_shift, ColumnAndShifts::poseidon2_full_execute_poseidon_perm_shift, ColumnAndShifts::poseidon2_full_input_0_shift, ColumnAndShifts::poseidon2_full_input_1_shift, ColumnAndShifts::poseidon2_full_input_2_shift, ColumnAndShifts::poseidon2_full_num_perm_rounds_rem_shift, ColumnAndShifts::poseidon2_full_sel_poseidon_shift, ColumnAndShifts::poseidon2_full_start_poseidon_shift, ColumnAndShifts::slice_addr_shift, ColumnAndShifts::slice_clk_shift, ColumnAndShifts::slice_cnt_shift, ColumnAndShifts::slice_sel_cd_cpy_shift, ColumnAndShifts::slice_sel_mem_active_shift, ColumnAndShifts::slice_sel_return_shift, ColumnAndShifts::slice_sel_start_shift, ColumnAndShifts::slice_space_id_shift // clang-format on // All columns minus shifts. diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp index f67fe0aefd6..e535592b9ee 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.cpp @@ -813,12 +813,11 @@ AvmFlavor::AllConstRefValues::AllConstRefValues( , slice_addr_shift(il[805]) , slice_clk_shift(il[806]) , slice_cnt_shift(il[807]) - , slice_col_offset_shift(il[808]) - , slice_sel_cd_cpy_shift(il[809]) - , slice_sel_mem_active_shift(il[810]) - , slice_sel_return_shift(il[811]) - , slice_sel_start_shift(il[812]) - , slice_space_id_shift(il[813]) + , slice_sel_cd_cpy_shift(il[808]) + , slice_sel_mem_active_shift(il[809]) + , slice_sel_return_shift(il[810]) + , slice_sel_start_shift(il[811]) + , slice_space_id_shift(il[812]) {} AvmFlavor::ProverPolynomials::ProverPolynomials(ProvingKey& proving_key) @@ -1643,7 +1642,6 @@ AvmFlavor::AllConstRefValues AvmFlavor::ProverPolynomials::get_row(size_t row_id slice_addr_shift[row_idx], slice_clk_shift[row_idx], slice_cnt_shift[row_idx], - slice_col_offset_shift[row_idx], slice_sel_cd_cpy_shift[row_idx], slice_sel_mem_active_shift[row_idx], slice_sel_return_shift[row_idx], diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp index 29b5757a5ad..7b40402879a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/flavor.hpp @@ -119,11 +119,11 @@ class AvmFlavor { static constexpr size_t NUM_PRECOMPUTED_ENTITIES = 21; static constexpr size_t NUM_WITNESS_ENTITIES = 743; - static constexpr size_t NUM_SHIFTED_ENTITIES = 50; + static constexpr size_t NUM_SHIFTED_ENTITIES = 49; static constexpr size_t NUM_WIRES = NUM_WITNESS_ENTITIES + NUM_PRECOMPUTED_ENTITIES; // We have two copies of the witness entities, so we subtract the number of fixed ones (they have no shift), one for // the unshifted and one for the shifted - static constexpr size_t NUM_ALL_ENTITIES = 814; + static constexpr size_t NUM_ALL_ENTITIES = 813; // The total number of witnesses including shifts and derived entities. static constexpr size_t NUM_ALL_WITNESS_ENTITIES = NUM_WITNESS_ENTITIES + NUM_SHIFTED_ENTITIES; @@ -351,6 +351,7 @@ class AvmFlavor { class VerificationKey : public VerificationKey_, VerifierCommitmentKey> { public: using FF = VerificationKey_::FF; + static constexpr size_t NUM_PRECOMPUTED_COMMITMENTS = NUM_PRECOMPUTED_ENTITIES; VerificationKey() = default; @@ -366,7 +367,7 @@ class AvmFlavor { VerificationKey(const size_t circuit_size, const size_t num_public_inputs, - std::array const& precomputed_cmts) + std::array const& precomputed_cmts) : VerificationKey_(circuit_size, num_public_inputs) { for (auto [vk_cmt, cmt] : zip_view(this->get_all(), precomputed_cmts)) { diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp index 09d8e1059df..27f50876a73 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/full_row.hpp @@ -29,7 +29,7 @@ template struct AvmFullRow { const FF& get_column(ColumnAndShifts col) const { static_assert(sizeof(*this) == sizeof(FF) * static_cast(ColumnAndShifts::NUM_COLUMNS)); - return reinterpret_cast(this)[static_cast(col)]; + return reinterpret_cast(this)[static_cast(col)]; } }; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/prover.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/prover.hpp index e0122ba364a..c437180593e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/prover.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/prover.hpp @@ -10,6 +10,7 @@ namespace bb::avm { class AvmProver { + public: using Flavor = AvmFlavor; using FF = Flavor::FF; using PCS = Flavor::PCS; @@ -20,8 +21,8 @@ class AvmProver { using ProverPolynomials = Flavor::ProverPolynomials; using CommitmentLabels = Flavor::CommitmentLabels; using Transcript = Flavor::Transcript; + using Proof = HonkProof; - public: explicit AvmProver(std::shared_ptr input_key, std::shared_ptr commitment_key); AvmProver(AvmProver&& prover) = default; virtual ~AvmProver() = default; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem_slice.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem_slice.hpp index 0b99138760f..507e4a2742d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem_slice.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/relations/mem_slice.hpp @@ -10,7 +10,7 @@ template class mem_sliceImpl { public: using FF = FF_; - static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4 }; + static constexpr std::array SUBRELATION_PARTIAL_LENGTHS = { 2, 3, 3, 3, 3, 3, 3, 4, 4, 4 }; template void static accumulate(ContainerOverSubrelations& evals, @@ -51,43 +51,36 @@ template class mem_sliceImpl { } { using Accumulator = typename std::tuple_element_t<5, ContainerOverSubrelations>; - auto tmp = (new_term.slice_sel_mem_active * - ((new_term.slice_col_offset + FF(1)) - new_term.slice_col_offset_shift)); + auto tmp = (new_term.slice_sel_mem_active * (new_term.slice_clk - new_term.slice_clk_shift)); tmp *= scaling_factor; std::get<5>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<6, ContainerOverSubrelations>; - auto tmp = (new_term.slice_sel_mem_active * (new_term.slice_clk - new_term.slice_clk_shift)); + auto tmp = (new_term.slice_sel_mem_active * (new_term.slice_space_id - new_term.slice_space_id_shift)); tmp *= scaling_factor; std::get<6>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<7, ContainerOverSubrelations>; - auto tmp = (new_term.slice_sel_mem_active * (new_term.slice_space_id - new_term.slice_space_id_shift)); + auto tmp = ((new_term.slice_sel_mem_active * new_term.slice_sel_mem_active_shift) * + (new_term.slice_sel_return - new_term.slice_sel_return_shift)); tmp *= scaling_factor; std::get<7>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<8, ContainerOverSubrelations>; auto tmp = ((new_term.slice_sel_mem_active * new_term.slice_sel_mem_active_shift) * - (new_term.slice_sel_return - new_term.slice_sel_return_shift)); + (new_term.slice_sel_cd_cpy - new_term.slice_sel_cd_cpy_shift)); tmp *= scaling_factor; std::get<8>(evals) += typename Accumulator::View(tmp); } { using Accumulator = typename std::tuple_element_t<9, ContainerOverSubrelations>; - auto tmp = ((new_term.slice_sel_mem_active * new_term.slice_sel_mem_active_shift) * - (new_term.slice_sel_cd_cpy - new_term.slice_sel_cd_cpy_shift)); - tmp *= scaling_factor; - std::get<9>(evals) += typename Accumulator::View(tmp); - } - { - using Accumulator = typename std::tuple_element_t<10, ContainerOverSubrelations>; auto tmp = (((FF(1) - new_term.slice_sel_mem_active) * new_term.slice_sel_mem_active_shift) * (FF(1) - new_term.slice_sel_start_shift)); tmp *= scaling_factor; - std::get<10>(evals) += typename Accumulator::View(tmp); + std::get<9>(evals) += typename Accumulator::View(tmp); } } }; @@ -108,16 +101,14 @@ template class mem_slice : public Relation> { case 4: return "ADDR_INCREMENT"; case 5: - return "COL_OFFSET_INCREMENT"; - case 6: return "SAME_CLK"; - case 7: + case 6: return "SAME_SPACE_ID"; - case 8: + case 7: return "SAME_SEL_RETURN"; - case 9: + case 8: return "SAME_SEL_CD_CPY"; - case 10: + case 9: return "SEL_MEM_INACTIVE"; } return std::to_string(index); @@ -128,12 +119,11 @@ template class mem_slice : public Relation> { static constexpr size_t SR_SLICE_CNT_ZERO_TEST2 = 2; static constexpr size_t SR_SLICE_CNT_DECREMENT = 3; static constexpr size_t SR_ADDR_INCREMENT = 4; - static constexpr size_t SR_COL_OFFSET_INCREMENT = 5; - static constexpr size_t SR_SAME_CLK = 6; - static constexpr size_t SR_SAME_SPACE_ID = 7; - static constexpr size_t SR_SAME_SEL_RETURN = 8; - static constexpr size_t SR_SAME_SEL_CD_CPY = 9; - static constexpr size_t SR_SEL_MEM_INACTIVE = 10; + static constexpr size_t SR_SAME_CLK = 5; + static constexpr size_t SR_SAME_SPACE_ID = 6; + static constexpr size_t SR_SAME_SEL_RETURN = 7; + static constexpr size_t SR_SAME_SEL_CD_CPY = 8; + static constexpr size_t SR_SEL_MEM_INACTIVE = 9; }; } // namespace bb::avm \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/generated/verifier.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/generated/verifier.hpp index 3031ca298da..fc4c771a729 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/generated/verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/generated/verifier.hpp @@ -8,6 +8,7 @@ namespace bb::avm { class AvmVerifier { + public: using Flavor = AvmFlavor; using FF = Flavor::FF; using Commitment = Flavor::Commitment; @@ -15,7 +16,6 @@ class AvmVerifier { using VerifierCommitmentKey = Flavor::VerifierCommitmentKey; using Transcript = Flavor::Transcript; - public: explicit AvmVerifier(std::shared_ptr verifier_key); AvmVerifier(AvmVerifier&& other) noexcept; AvmVerifier(const AvmVerifier& other) = delete; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp index d177f4ef455..97f465c2463 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.cpp @@ -1,11 +1,15 @@ #include "barretenberg/vm/avm/trace/execution.hpp" #include "barretenberg/bb/log.hpp" +#include "barretenberg/common/log.hpp" #include "barretenberg/common/serialize.hpp" +#include "barretenberg/common/thread.hpp" #include "barretenberg/common/throw_or_abort.hpp" #include "barretenberg/numeric/uint256/uint256.hpp" #include "barretenberg/vm/avm/generated/circuit_builder.hpp" +#include "barretenberg/vm/avm/generated/columns.hpp" #include "barretenberg/vm/avm/generated/composer.hpp" #include "barretenberg/vm/avm/generated/flavor.hpp" +#include "barretenberg/vm/avm/generated/full_row.hpp" #include "barretenberg/vm/avm/generated/verifier.hpp" #include "barretenberg/vm/avm/trace/common.hpp" #include "barretenberg/vm/avm/trace/deserialization.hpp" @@ -28,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -139,44 +144,79 @@ void show_trace_info(const auto& trace) return; } - const size_t total_elements = trace.front().SIZE * trace.size(); - const size_t nonzero_elements = [&]() { - size_t count = 0; - for (auto const& row : trace) { - for (const auto& ff : row.as_vector()) { - if (!ff.is_zero()) { - count++; - } + // Calculate number of non-zero entries in each column. + struct ColumnStats { + size_t column_number = 0; + size_t non_zero_entries = 0; + size_t total_entries = 0; + size_t fullness = 0; // 0 to 100. + }; + std::vector column_stats(static_cast(avm::ColumnAndShifts::NUM_COLUMNS)); + bb::parallel_for(static_cast(avm::ColumnAndShifts::NUM_COLUMNS), [&](size_t col) { + size_t non_zero_entries = 0; + ssize_t last_non_zero_row = -1; + for (uint32_t row_n = 0; row_n < trace.size(); row_n++) { + const auto& row = trace.at(row_n); + if (!row.get_column(static_cast(col)).is_zero()) { + non_zero_entries++; + last_non_zero_row = row_n; } } - return count; - }(); - vinfo("Number of non-zero elements: ", - nonzero_elements, - "/", - total_elements, - " (", - 100 * nonzero_elements / total_elements, - "%)"); - const size_t non_zero_columns = [&]() { - std::vector column_is_nonzero(trace.front().SIZE, false); - for (auto const& row : trace) { - const auto row_vec = row.as_vector(); - for (size_t col = 0; col < row.SIZE; col++) { - if (!row_vec[col].is_zero()) { - column_is_nonzero[col] = true; - } + size_t size = static_cast(last_non_zero_row + 1); + column_stats[col] = { .column_number = col, + .non_zero_entries = non_zero_entries, + .total_entries = size, + .fullness = size > 0 ? non_zero_entries * 100 / size : 0 }; + }); + // ignore empty columns because they don't cost anything. + std::erase_if(column_stats, [](const ColumnStats& stat) { return stat.total_entries == 0; }); + std::sort(column_stats.begin(), column_stats.end(), [](const ColumnStats& a, const ColumnStats& b) { + return a.fullness > b.fullness; + }); + vinfo( + "Median column fullness: ", + [&]() { + const auto& median_stat = column_stats.at(column_stats.size() / 2); + return median_stat.fullness; + }(), + "%"); + vinfo( + "Average column fullness: ", + [&]() { + size_t fullness_sum = 0; + for (const auto& stat : column_stats) { + fullness_sum += stat.fullness; } + return static_cast(fullness_sum / column_stats.size()); + }(), + "%"); + if (getenv("AVM_FULL_COLUMN_STATS") != nullptr) { + vinfo("Fullness of all columns, ignoring empty ones:"); + // Print fullness of all columns in descending order and batches of 10. + for (size_t i = 0; i < column_stats.size(); i += 10) { + std::string fullnesses; + for (size_t j = i; j < i + 10 && j < column_stats.size(); j++) { + const auto& stat = column_stats.at(j); + fullnesses += format(std::setw(3), stat.column_number, ": ", std::setw(3), stat.fullness, "% "); + } + vinfo(fullnesses); + } + + vinfo("Details for 20 most sparse columns:"); + const auto names = AvmFullRow::names(); + for (size_t i = 0; i < 20; i++) { + const auto& stat = column_stats.at(column_stats.size() - i - 1); + vinfo("Column \"", + names.at(stat.column_number), + "\": ", + stat.non_zero_entries, + " non-zero entries out of ", + stat.total_entries, + " (", + stat.fullness, + "%)"); } - return static_cast(std::count(column_is_nonzero.begin(), column_is_nonzero.end(), true)); - }(); - vinfo("Number of non-zero columns: ", - non_zero_columns, - "/", - trace.front().SIZE, - " (", - 100 * non_zero_columns / trace.front().SIZE, - "%)"); + } } } // namespace @@ -203,6 +243,40 @@ std::vector Execution::getDefaultPublicInputs() return public_inputs_vec; } +/** + * @brief Run the bytecode, generate the corresponding execution trace and check the circuit for + * execution of the supplied bytecode. + * + * @throws runtime_error exception when the bytecode is invalid. + */ +void Execution::check_circuit(AvmPublicInputs const& public_inputs, ExecutionHints const& execution_hints) +{ + std::vector returndata; + std::vector calldata; + for (const auto& enqueued_call_hints : execution_hints.enqueued_call_hints) { + calldata.insert(calldata.end(), enqueued_call_hints.calldata.begin(), enqueued_call_hints.calldata.end()); + } + std::vector trace = AVM_TRACK_TIME_V( + "prove/gen_trace", gen_trace(public_inputs, returndata, execution_hints, /*apply_e2e_assertions=*/true)); + if (!avm_dump_trace_path.empty()) { + info("Dumping trace as CSV to: " + avm_dump_trace_path.string()); + dump_trace_as_csv(trace, avm_dump_trace_path); + } + auto circuit_builder = bb::avm::AvmCircuitBuilder(); + circuit_builder.set_trace(std::move(trace)); + vinfo("Circuit subgroup size: 2^", + // this calculates the integer log2 + std::bit_width(circuit_builder.get_circuit_subgroup_size()) - 1); + + if (circuit_builder.get_circuit_subgroup_size() > SRS_SIZE) { + throw_or_abort("Circuit subgroup size (" + std::to_string(circuit_builder.get_circuit_subgroup_size()) + + ") exceeds SRS_SIZE (" + std::to_string(SRS_SIZE) + ")"); + } + + vinfo("------- CHECKING CIRCUIT -------"); + AVM_TRACK_TIME("prove/check_circuit", circuit_builder.check_circuit()); +} + /** * @brief Run the bytecode, generate the corresponding execution trace and prove the correctness * of the execution of the supplied bytecode. @@ -312,8 +386,8 @@ std::vector Execution::gen_trace(AvmPublicInputs const& public_inputs, uint32_t start_side_effect_counter = 0; // Temporary until we get proper nested call handling std::vector calldata; - for (const auto& enqueued_call_hints : execution_hints.enqueued_call_hints) { - calldata.insert(calldata.end(), enqueued_call_hints.calldata.begin(), enqueued_call_hints.calldata.end()); + for (const auto& enqueued_call_hint : execution_hints.enqueued_call_hints) { + calldata.insert(calldata.end(), enqueued_call_hint.calldata.begin(), enqueued_call_hint.calldata.end()); } AvmTraceBuilder trace_builder = Execution::trace_builder_constructor(public_inputs, execution_hints, start_side_effect_counter); @@ -446,6 +520,7 @@ AvmError Execution::execute_enqueued_call(AvmTraceBuilder& trace_builder, .internal_return_ptr_stack = {}, }; trace_builder.next_context_id++; + trace_builder.update_calldata_size_values(static_cast(enqueued_call_hint.calldata.size())); // Find the bytecode based on contract address of the public call request std::vector bytecode; try { diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.hpp index c570a5ffe53..288535364fd 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution.hpp @@ -53,6 +53,8 @@ class Execution { static std::tuple prove( AvmPublicInputs const& public_inputs = AvmPublicInputs(), ExecutionHints const& execution_hints = {}); + static void check_circuit(AvmPublicInputs const& public_inputs = AvmPublicInputs(), + ExecutionHints const& execution_hints = {}); static bool verify(bb::avm::AvmFlavor::VerificationKey vk, HonkProof const& proof); private: diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution_hints.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution_hints.hpp index dc554ebd2b5..568af787cf0 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution_hints.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/execution_hints.hpp @@ -257,6 +257,24 @@ struct ExecutionHints { return *this; } + void print_sizes() const + { + vinfo("hints.enqueued_call_hints size: ", enqueued_call_hints.size()); + vinfo("hints.contract_instance_hints size: ", contract_instance_hints.size()); + vinfo("hints.contract_bytecode_hints size: ", all_contract_bytecode.size()); + if (all_contract_bytecode.size() > 0) { + // Using [0] is fine now for the top-level call, but we might need to index by address in future + vinfo("0th bytecode size: ", all_contract_bytecode[0].bytecode.size()); + } + vinfo("hints.storage_read_hints size: ", storage_read_hints.size()); + vinfo("hints.storage_write_hints size: ", storage_write_hints.size()); + vinfo("hints.nullifier_read_hints size: ", nullifier_read_hints.size()); + vinfo("hints.nullifier_write_hints size: ", nullifier_write_hints.size()); + vinfo("hints.note_hash_read_hints size: ", note_hash_read_hints.size()); + vinfo("hints.note_hash_write_hints size: ", note_hash_write_hints.size()); + vinfo("hints.l1_to_l2_message_read_hints size: ", l1_to_l2_message_read_hints.size()); + } + static void push_vec_into_map(std::unordered_map& into_map, const std::vector>& from_pair_vec) { diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/slice_trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/slice_trace.cpp index 78629d1e93c..224422b188e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/slice_trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/slice_trace.cpp @@ -23,15 +23,20 @@ void AvmSliceTraceBuilder::create_calldata_copy_slice(std::vector const& cal uint8_t space_id, uint32_t col_offset, uint32_t copy_size, - uint32_t direct_dst_offset) + uint32_t direct_dst_offset, + uint32_t top_calldata_offset) { - create_slice(calldata, clk, space_id, col_offset, copy_size, direct_dst_offset, true); + create_slice(calldata, clk, space_id, col_offset, copy_size, direct_dst_offset, top_calldata_offset, true); } -void AvmSliceTraceBuilder::create_return_slice( - std::vector const& returndata, uint32_t clk, uint8_t space_id, uint32_t direct_ret_offset, uint32_t ret_size) +void AvmSliceTraceBuilder::create_return_slice(std::vector const& returndata, + uint32_t clk, + uint8_t space_id, + uint32_t direct_ret_offset, + uint32_t ret_size, + uint32_t top_returndata_offset) { - create_slice(returndata, clk, space_id, 0, ret_size, direct_ret_offset, false); + create_slice(returndata, clk, space_id, 0, ret_size, direct_ret_offset, top_returndata_offset, false); } void AvmSliceTraceBuilder::create_slice(std::vector const& col_data, @@ -40,6 +45,7 @@ void AvmSliceTraceBuilder::create_slice(std::vector const& col_data, uint32_t col_offset, uint32_t copy_size, uint32_t addr, + uint32_t top_column_offset, bool rw) { for (uint32_t i = 0; i < copy_size; i++) { @@ -48,7 +54,7 @@ void AvmSliceTraceBuilder::create_slice(std::vector const& col_data, .space_id = space_id, .addr_ff = FF(addr + i), .val = col_data.at(col_offset + i), - .col_offset = col_offset + i, + .col_offset = top_column_offset + col_offset + i, .cnt = copy_size - i, .one_min_inv = FF(1) - FF(copy_size - i).invert(), .sel_start = i == 0, @@ -56,7 +62,8 @@ void AvmSliceTraceBuilder::create_slice(std::vector const& col_data, .sel_return = !rw, }); - rw ? cd_lookup_counts[col_offset + i]++ : ret_lookup_counts[col_offset + i]++; + rw ? cd_lookup_counts[top_column_offset + col_offset + i]++ + : ret_lookup_counts[top_column_offset + col_offset + i]++; } // Last extra row for a slice operation. cnt is zero and we have to add extra dummy diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/slice_trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/slice_trace.hpp index 7621d1389b3..3891807fd2b 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/slice_trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/gadgets/slice_trace.hpp @@ -39,12 +39,14 @@ class AvmSliceTraceBuilder { uint8_t space_id, uint32_t col_offset, uint32_t copy_size, - uint32_t direct_dst_offset); + uint32_t direct_dst_offset, + uint32_t top_calldata_offset); void create_return_slice(std::vector const& returndata, uint32_t clk, uint8_t space_id, uint32_t direct_ret_offset, - uint32_t ret_size); + uint32_t ret_size, + uint32_t top_returndata_offset); private: std::vector slice_trace; @@ -54,6 +56,7 @@ class AvmSliceTraceBuilder { uint32_t col_offset, uint32_t copy_size, uint32_t addr, + uint32_t top_column_offset, bool rw); }; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp index cd7e26908bd..e1b01de044c 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp @@ -288,7 +288,8 @@ void AvmTraceBuilder::insert_private_revertible_state(const std::vector& sil for (size_t i = 0; i < siloed_note_hashes.size(); i++) { size_t note_index_in_tx = i + get_inserted_note_hashes_count(); - FF nonce = AvmMerkleTreeTraceBuilder::unconstrained_compute_note_hash_nonce(get_tx_hash(), note_index_in_tx); + FF nonce = + AvmMerkleTreeTraceBuilder::unconstrained_compute_note_hash_nonce(get_first_nullifier(), note_index_in_tx); unique_note_hashes.push_back( AvmMerkleTreeTraceBuilder::unconstrained_compute_unique_note_hash(nonce, siloed_note_hashes.at(i))); } @@ -2168,7 +2169,7 @@ AvmError AvmTraceBuilder::op_calldata_copy(uint8_t indirect, error = AvmError::MEM_SLICE_OUT_OF_RANGE; } else { slice_trace_builder.create_calldata_copy_slice( - calldata, clk, call_ptr, cd_offset, copy_size, dst_offset_resolved); + calldata, clk, call_ptr, cd_offset, copy_size, dst_offset_resolved, top_calldata_offset); mem_trace_builder.write_calldata_copy( calldata, clk, call_ptr, cd_offset, copy_size, dst_offset_resolved); } @@ -2282,6 +2283,7 @@ AvmError AvmTraceBuilder::op_returndata_copy(uint8_t indirect, main_trace.push_back(Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = FF(internal_return_ptr), .main_op_err = static_cast(!is_ok(error)), .main_pc = FF(pc), @@ -2724,6 +2726,7 @@ RowWithError AvmTraceBuilder::create_kernel_output_opcode(uint8_t indirect, uint return RowWithError{ .row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_ia = read_a.val, .main_ind_addr_a = FF(read_a.indirect_address), .main_internal_return_ptr = internal_return_ptr, @@ -2779,6 +2782,7 @@ RowWithError AvmTraceBuilder::create_kernel_output_opcode_with_metadata(uint8_t return RowWithError{ .row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_ia = read_a.val, .main_ib = read_b.val, .main_ind_addr_a = FF(read_a.indirect_address), @@ -2850,6 +2854,7 @@ AvmError AvmTraceBuilder::op_sload(uint8_t indirect, uint32_t slot_offset, uint3 // TODO(8945): remove fake rows auto row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_ia = value, .main_ib = read_slot, .main_ind_addr_a = write_a.indirect_address, @@ -2897,6 +2902,7 @@ AvmError AvmTraceBuilder::op_sstore(uint8_t indirect, uint32_t src_offset, uint3 // made for the fee juice storage write made after teardown. auto row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = internal_return_ptr, .main_op_err = FF(static_cast(!is_ok(error))), .main_pc = pc, @@ -2943,6 +2949,7 @@ AvmError AvmTraceBuilder::op_sstore(uint8_t indirect, uint32_t src_offset, uint3 // TODO(8945): remove fake rows Row row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_ia = read_a.val, .main_ib = read_slot, .main_ind_addr_a = read_a.indirect_address, @@ -3022,6 +3029,7 @@ AvmError AvmTraceBuilder::op_note_hash_exists(uint8_t indirect, row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_ia = read_a.val, .main_ib = write_b.val, .main_ind_addr_a = FF(read_a.indirect_address), @@ -3049,6 +3057,7 @@ AvmError AvmTraceBuilder::op_note_hash_exists(uint8_t indirect, } else { row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = internal_return_ptr, .main_op_err = FF(1), .main_pc = pc, @@ -3080,6 +3089,7 @@ AvmError AvmTraceBuilder::op_emit_note_hash(uint8_t indirect, uint32_t note_hash if (!is_ok(error)) { auto row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = internal_return_ptr, .main_op_err = FF(static_cast(!is_ok(error))), .main_pc = pc, @@ -3101,8 +3111,8 @@ AvmError AvmTraceBuilder::op_emit_note_hash(uint8_t indirect, uint32_t note_hash AppendTreeHint note_hash_write_hint = execution_hints.note_hash_write_hints.at(note_hash_write_counter++); FF siloed_note_hash = AvmMerkleTreeTraceBuilder::unconstrained_silo_note_hash( current_public_call_request.contract_address, row.main_ia); - FF nonce = - AvmMerkleTreeTraceBuilder::unconstrained_compute_note_hash_nonce(get_tx_hash(), inserted_note_hashes_count); + FF nonce = AvmMerkleTreeTraceBuilder::unconstrained_compute_note_hash_nonce(get_first_nullifier(), + inserted_note_hashes_count); FF unique_note_hash = AvmMerkleTreeTraceBuilder::unconstrained_compute_unique_note_hash(nonce, siloed_note_hash); ASSERT(unique_note_hash == note_hash_write_hint.leaf_value); @@ -3181,6 +3191,7 @@ AvmError AvmTraceBuilder::op_nullifier_exists(uint8_t indirect, bool tag_match = read_a.tag_match && write_b.tag_match; row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_ia = read_a.val, .main_ib = write_b.val, .main_ind_addr_a = FF(read_a.indirect_address), @@ -3208,6 +3219,7 @@ AvmError AvmTraceBuilder::op_nullifier_exists(uint8_t indirect, } else { row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = internal_return_ptr, .main_op_err = FF(1), .main_pc = pc, @@ -3242,6 +3254,7 @@ AvmError AvmTraceBuilder::op_emit_nullifier(uint8_t indirect, uint32_t nullifier if (!is_ok(error)) { auto row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = internal_return_ptr, .main_op_err = FF(static_cast(!is_ok(error))), .main_pc = pc, @@ -3358,6 +3371,7 @@ AvmError AvmTraceBuilder::op_l1_to_l2_msg_exists(uint8_t indirect, row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_ia = read_a.val, .main_ib = write_b.val, .main_ind_addr_a = FF(read_a.indirect_address), @@ -3385,6 +3399,7 @@ AvmError AvmTraceBuilder::op_l1_to_l2_msg_exists(uint8_t indirect, } else { row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = internal_return_ptr, .main_op_err = FF(1), .main_pc = pc, @@ -3624,6 +3639,7 @@ AvmError AvmTraceBuilder::op_emit_unencrypted_log(uint8_t indirect, uint32_t log error = AvmError::SIDE_EFFECT_LIMIT_REACHED; auto row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = internal_return_ptr, .main_op_err = FF(static_cast(!is_ok(error))), .main_pc = pc, @@ -3658,6 +3674,7 @@ AvmError AvmTraceBuilder::op_emit_unencrypted_log(uint8_t indirect, uint32_t log FF metadata_log_length = length_of_preimage + 4; row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_ia = trunc_hash, .main_ib = metadata_log_length, .main_internal_return_ptr = internal_return_ptr, @@ -3669,6 +3686,7 @@ AvmError AvmTraceBuilder::op_emit_unencrypted_log(uint8_t indirect, uint32_t log } else { row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = internal_return_ptr, .main_op_err = FF(1), .main_pc = pc, @@ -3700,6 +3718,7 @@ AvmError AvmTraceBuilder::op_emit_l2_to_l1_msg(uint8_t indirect, uint32_t recipi error = AvmError::SIDE_EFFECT_LIMIT_REACHED; auto row = Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = internal_return_ptr, .main_op_err = FF(static_cast(!is_ok(error))), .main_pc = pc, @@ -3797,6 +3816,7 @@ AvmError AvmTraceBuilder::constrain_external_call(OpCode opcode, main_trace.push_back(Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_ia = read_gas_l2.val, /* gas_offset_l2 */ .main_ib = read_gas_da.val, /* gas_offset_da */ .main_ic = read_addr.val, /* addr_offset */ @@ -4004,7 +4024,8 @@ ReturnDataError AvmTraceBuilder::op_return(uint8_t indirect, uint32_t ret_offset // direct destination offset stored in main_mem_addr_c. // All the other memory operations are triggered by the slice gadget. returndata = mem_trace_builder.read_return_opcode(clk, call_ptr, resolved_ret_offset, ret_size); - slice_trace_builder.create_return_slice(returndata, clk, call_ptr, resolved_ret_offset, ret_size); + slice_trace_builder.create_return_slice( + returndata, clk, call_ptr, resolved_ret_offset, ret_size, static_cast(all_returndata.size())); all_returndata.insert(all_returndata.end(), returndata.begin(), returndata.end()); } else { // before the nested call was made, how much gas does the parent have? @@ -4148,7 +4169,8 @@ ReturnDataError AvmTraceBuilder::op_revert(uint8_t indirect, uint32_t ret_offset // direct destination offset stored in main_mem_addr_c. // All the other memory operations are triggered by the slice gadget. returndata = mem_trace_builder.read_return_opcode(clk, call_ptr, resolved_ret_offset, ret_size); - slice_trace_builder.create_return_slice(returndata, clk, call_ptr, resolved_ret_offset, ret_size); + slice_trace_builder.create_return_slice( + returndata, clk, call_ptr, resolved_ret_offset, ret_size, static_cast(all_returndata.size())); all_returndata.insert(all_returndata.end(), returndata.begin(), returndata.end()); } else { // before the nested call was made, how much gas does the parent have? @@ -4430,6 +4452,7 @@ AvmError AvmTraceBuilder::op_poseidon2_permutation(uint8_t indirect, uint32_t in // Main trace contains on operand values from the bytecode and resolved indirects main_trace.push_back(Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = FF(internal_return_ptr), .main_mem_addr_a = resolved_input_offset, .main_mem_addr_b = resolved_output_offset, @@ -4507,6 +4530,7 @@ AvmError AvmTraceBuilder::op_sha256_compression(uint8_t indirect, // did not lay down constraints), but this is a simplification main_trace.push_back(Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_ia = read_a.val, // First element of state .main_ib = read_b.val, // First element of input .main_ind_addr_a = FF(read_a.indirect_address), @@ -4615,6 +4639,7 @@ AvmError AvmTraceBuilder::op_keccakf1600(uint8_t indirect, uint32_t output_offse main_trace.push_back(Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_ia = input_read.val, // First element of input .main_ind_addr_a = FF(input_read.indirect_address), .main_internal_return_ptr = FF(internal_return_ptr), @@ -4707,6 +4732,7 @@ AvmError AvmTraceBuilder::op_ec_add(uint16_t indirect, if (!is_ok(error)) { main_trace.push_back(Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = FF(internal_return_ptr), .main_op_err = FF(1), .main_pc = FF(pc), @@ -4827,6 +4853,7 @@ AvmError AvmTraceBuilder::op_variable_msm(uint8_t indirect, if (!is_ok(error)) { main_trace.push_back(Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = FF(internal_return_ptr), .main_op_err = FF(1), .main_pc = FF(pc), @@ -4889,6 +4916,7 @@ AvmError AvmTraceBuilder::op_variable_msm(uint8_t indirect, main_trace.push_back(Row{ .main_clk = clk, + .main_call_ptr = call_ptr, .main_internal_return_ptr = FF(internal_return_ptr), .main_pc = FF(pc), .main_sel_op_msm = 1, diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp index 0ae4e06d904..2346895b757 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.hpp @@ -239,6 +239,11 @@ class AvmTraceBuilder { void insert_private_state(const std::vector& siloed_nullifiers, const std::vector& unique_note_hashes); void insert_private_revertible_state(const std::vector& siloed_nullifiers, const std::vector& siloed_note_hashes); + void update_calldata_size_values(const uint32_t calldata_size) + { + top_calldata_offset += previous_enqueued_calldata_size; + previous_enqueued_calldata_size = calldata_size; + } void pay_fee(); void pad_trees(); void allocate_gas_for_call(uint32_t l2_gas, uint32_t da_gas); @@ -377,6 +382,15 @@ class AvmTraceBuilder { 0; // After a nested call, it should be initialized with MAX_SIZE_INTERNAL_STACK * call_ptr uint8_t call_ptr = 0; + // Calldata global offset pointing at the top of calldata values which are the concatenated + // calldata's of the top-level enqueued function calls. + // We might have more than one calldatacopy opcode per top-level function call and therefore we update + // top_calldata_offset in execute_enqueued_call(). For this, we need to keep track of the previous + // enqueued call calldata size. Note that this mechanism is not required for returndata as there can + // be only one RETURN or REVERT opcode. + uint32_t top_calldata_offset = 0; + uint32_t previous_enqueued_calldata_size = 0; + MemOp constrained_read_from_memory(uint8_t space_id, uint32_t clk, AddressWithMode addr, @@ -395,7 +409,7 @@ class AvmTraceBuilder { uint32_t get_inserted_note_hashes_count(); uint32_t get_inserted_nullifiers_count(); uint32_t get_public_data_writes_count(); - FF get_tx_hash() const { return public_inputs.previous_non_revertible_accumulated_data.nullifiers[0]; } + FF get_first_nullifier() const { return public_inputs.previous_non_revertible_accumulated_data.nullifiers[0]; } // TODO: remove these once everything is constrained. AvmMemoryTag unconstrained_get_memory_tag(AddressWithMode addr); diff --git a/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp b/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp index 67f0e9255c9..9ba67538e39 100644 --- a/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp @@ -49,7 +49,7 @@ #define AVM_CIRCUIT_PUBLIC_INPUTS_LENGTH 1011 #define AVM_VERIFICATION_KEY_LENGTH_IN_FIELDS 86 #define MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS 21 -#define AVM_PROOF_LENGTH_IN_FIELDS 4155 +#define AVM_PROOF_LENGTH_IN_FIELDS 4154 #define AVM_PUBLIC_COLUMN_MAX_SIZE 1024 #define AVM_PUBLIC_INPUTS_FLATTENED_SIZE 2912 #define MEM_TAG_FF 0 diff --git a/barretenberg/cpp/src/barretenberg/vm2/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/vm2/CMakeLists.txt new file mode 100644 index 00000000000..8084b7b8306 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/vm2/CMakeLists.txt @@ -0,0 +1,3 @@ +if(NOT DISABLE_AZTEC_VM) + barretenberg_module(vm2 sumcheck stdlib_honk_verifier) +endif() \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm2/avm_api.cpp b/barretenberg/cpp/src/barretenberg/vm2/avm_api.cpp new file mode 100644 index 00000000000..8dddc62058d --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/vm2/avm_api.cpp @@ -0,0 +1,58 @@ +#include "barretenberg/vm2/avm_api.hpp" + +#include "barretenberg/vm/stats.hpp" +#include "barretenberg/vm2/proving_helper.hpp" +#include "barretenberg/vm2/simulation_helper.hpp" +#include "barretenberg/vm2/tracegen_helper.hpp" + +namespace bb::avm2 { + +using namespace bb::avm2::simulation; + +std::pair AvmAPI::prove(const AvmAPI::ProvingInputs& inputs) +{ + // Simulate. + info("Simulating..."); + AvmSimulationHelper simulation_helper(inputs); + auto events = AVM_TRACK_TIME_V("simulation/all", simulation_helper.simulate()); + + // Generate trace. + info("Generating trace..."); + AvmTraceGenHelper tracegen_helper; + auto trace = AVM_TRACK_TIME_V("tracegen/all", tracegen_helper.generate_trace(std::move(events))); + + // Prove. + info("Proving..."); + AvmProvingHelper proving_helper; + auto [proof, vk] = AVM_TRACK_TIME_V("proving/all", proving_helper.prove(std::move(trace))); + + info("Done!"); + return { std::move(proof), std::move(vk) }; +} + +bool AvmAPI::check_circuit(const AvmAPI::ProvingInputs& inputs) +{ + // Simulate. + info("Simulating..."); + AvmSimulationHelper simulation_helper(inputs); + auto events = AVM_TRACK_TIME_V("simulation/all", simulation_helper.simulate()); + + // Generate trace. + info("Generating trace..."); + AvmTraceGenHelper tracegen_helper; + auto trace = AVM_TRACK_TIME_V("tracegen/all", tracegen_helper.generate_trace(std::move(events))); + + // Check circuit. + info("Checking circuit..."); + AvmProvingHelper proving_helper; + return proving_helper.check_circuit(std::move(trace)); +} + +bool AvmAPI::verify(const AvmProof& proof, const PublicInputs& pi, const AvmVerificationKey& vk_data) +{ + info("Verifying..."); + AvmProvingHelper proving_helper; + return AVM_TRACK_TIME_V("verifing/all", proving_helper.verify(proof, pi, vk_data)); +} + +} // namespace bb::avm2 \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm2/avm_api.hpp b/barretenberg/cpp/src/barretenberg/vm2/avm_api.hpp new file mode 100644 index 00000000000..9e94e922c5a --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/vm2/avm_api.hpp @@ -0,0 +1,24 @@ +#pragma once + +#include + +#include "barretenberg/vm2/common/avm_inputs.hpp" +#include "barretenberg/vm2/proving_helper.hpp" + +namespace bb::avm2 { + +class AvmAPI { + public: + using AvmProof = AvmProvingHelper::Proof; + using AvmVerificationKey = std::vector; + using ProvingInputs = AvmProvingInputs; + + AvmAPI() = default; + + // NOTE: The public inputs are NOT part of the proof. + std::pair prove(const ProvingInputs& inputs); + bool check_circuit(const ProvingInputs& inputs); + bool verify(const AvmProof& proof, const PublicInputs& pi, const AvmVerificationKey& vk_data); +}; + +} // namespace bb::avm2 \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/vm2/common/ankerl_map.hpp b/barretenberg/cpp/src/barretenberg/vm2/common/ankerl_map.hpp new file mode 100644 index 00000000000..6342ce0171a --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/vm2/common/ankerl_map.hpp @@ -0,0 +1,2126 @@ +///////////////////////// ankerl::unordered_dense::{map, set} ///////////////////////// + +// A fast & densely stored hashmap and hashset based on robin-hood backward shift deletion. +// Version 4.5.0 +// https://github.com/martinus/unordered_dense +// +// Licensed under the MIT License . +// SPDX-License-Identifier: MIT +// Copyright (c) 2022-2024 Martin Leitner-Ankerl +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#ifndef ANKERL_UNORDERED_DENSE_H +#define ANKERL_UNORDERED_DENSE_H + +// see https://semver.org/spec/v2.0.0.html +#define ANKERL_UNORDERED_DENSE_VERSION_MAJOR 4 // NOLINT(cppcoreguidelines-macro-usage) incompatible API changes +#define ANKERL_UNORDERED_DENSE_VERSION_MINOR \ + 5 // NOLINT(cppcoreguidelines-macro-usage) backwards compatible functionality +#define ANKERL_UNORDERED_DENSE_VERSION_PATCH 0 // NOLINT(cppcoreguidelines-macro-usage) backwards compatible bug fixes + +// API versioning with inline namespace, see https://www.foonathan.net/2018/11/inline-namespaces/ + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define ANKERL_UNORDERED_DENSE_VERSION_CONCAT1(major, minor, patch) v##major##_##minor##_##patch +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define ANKERL_UNORDERED_DENSE_VERSION_CONCAT(major, minor, patch) \ + ANKERL_UNORDERED_DENSE_VERSION_CONCAT1(major, minor, patch) +#define ANKERL_UNORDERED_DENSE_NAMESPACE \ + ANKERL_UNORDERED_DENSE_VERSION_CONCAT(ANKERL_UNORDERED_DENSE_VERSION_MAJOR, \ + ANKERL_UNORDERED_DENSE_VERSION_MINOR, \ + ANKERL_UNORDERED_DENSE_VERSION_PATCH) + +#if defined(_MSVC_LANG) +#define ANKERL_UNORDERED_DENSE_CPP_VERSION _MSVC_LANG +#else +#define ANKERL_UNORDERED_DENSE_CPP_VERSION __cplusplus +#endif + +#if defined(__GNUC__) +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define ANKERL_UNORDERED_DENSE_PACK(decl) decl __attribute__((__packed__)) +#elif defined(_MSC_VER) +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define ANKERL_UNORDERED_DENSE_PACK(decl) __pragma(pack(push, 1)) decl __pragma(pack(pop)) +#endif + +// exceptions +#if defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND) +#define ANKERL_UNORDERED_DENSE_HAS_EXCEPTIONS() 1 // NOLINT(cppcoreguidelines-macro-usage) +#else +#define ANKERL_UNORDERED_DENSE_HAS_EXCEPTIONS() 0 // NOLINT(cppcoreguidelines-macro-usage) +#endif +#ifdef _MSC_VER +#define ANKERL_UNORDERED_DENSE_NOINLINE __declspec(noinline) +#else +#define ANKERL_UNORDERED_DENSE_NOINLINE __attribute__((noinline)) +#endif + +// defined in unordered_dense.cpp +#if !defined(ANKERL_UNORDERED_DENSE_EXPORT) +#define ANKERL_UNORDERED_DENSE_EXPORT +#endif + +#if ANKERL_UNORDERED_DENSE_CPP_VERSION < 201703L +#error ankerl::unordered_dense requires C++17 or higher +#else +#include // for array +#include // for uint64_t, uint32_t, uint8_t, UINT64_C +#include // for size_t, memcpy, memset +#include // for equal_to, hash +#include // for initializer_list +#include // for pair, distance +#include // for numeric_limits +#include // for allocator, allocator_traits, shared_ptr +#include // for optional +#include // for out_of_range +#include // for basic_string +#include // for basic_string_view, hash +#include // for forward_as_tuple +#include // for enable_if_t, declval, conditional_t, ena... +#include // for forward, exchange, pair, as_const, piece... +#include // for vector +#if ANKERL_UNORDERED_DENSE_HAS_EXCEPTIONS() == 0 +#include // for abort +#endif + +#if defined(__has_include) && !defined(ANKERL_UNORDERED_DENSE_DISABLE_PMR) +#if __has_include() +#define ANKERL_UNORDERED_DENSE_PMR std::pmr // NOLINT(cppcoreguidelines-macro-usage) +#include // for polymorphic_allocator +#elif __has_include() +#define ANKERL_UNORDERED_DENSE_PMR std::experimental::pmr // NOLINT(cppcoreguidelines-macro-usage) +#include // for polymorphic_allocator +#endif +#endif + +#if defined(_MSC_VER) && defined(_M_X64) +#include +#pragma intrinsic(_umul128) +#endif + +#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__) +#define ANKERL_UNORDERED_DENSE_LIKELY(x) __builtin_expect(x, 1) // NOLINT(cppcoreguidelines-macro-usage) +#define ANKERL_UNORDERED_DENSE_UNLIKELY(x) __builtin_expect(x, 0) // NOLINT(cppcoreguidelines-macro-usage) +#else +#define ANKERL_UNORDERED_DENSE_LIKELY(x) (x) // NOLINT(cppcoreguidelines-macro-usage) +#define ANKERL_UNORDERED_DENSE_UNLIKELY(x) (x) // NOLINT(cppcoreguidelines-macro-usage) +#endif + +namespace ankerl::unordered_dense { +inline namespace ANKERL_UNORDERED_DENSE_NAMESPACE { + +namespace detail { + +#if ANKERL_UNORDERED_DENSE_HAS_EXCEPTIONS() + +// make sure this is not inlined as it is slow and dramatically enlarges code, thus making other +// inlinings more difficult. Throws are also generally the slow path. +[[noreturn]] inline ANKERL_UNORDERED_DENSE_NOINLINE void on_error_key_not_found() +{ + throw std::out_of_range("ankerl::unordered_dense::map::at(): key not found"); +} +[[noreturn]] inline ANKERL_UNORDERED_DENSE_NOINLINE void on_error_bucket_overflow() +{ + throw std::overflow_error("ankerl::unordered_dense: reached max bucket size, cannot increase size"); +} +[[noreturn]] inline ANKERL_UNORDERED_DENSE_NOINLINE void on_error_too_many_elements() +{ + throw std::out_of_range("ankerl::unordered_dense::map::replace(): too many elements"); +} + +#else + +[[noreturn]] inline void on_error_key_not_found() +{ + abort(); +} +[[noreturn]] inline void on_error_bucket_overflow() +{ + abort(); +} +[[noreturn]] inline void on_error_too_many_elements() +{ + abort(); +} + +#endif + +} // namespace detail + +// hash /////////////////////////////////////////////////////////////////////// + +// This is a stripped-down implementation of wyhash: https://github.com/wangyi-fudan/wyhash +// No big-endian support (because different values on different machines don't matter), +// hardcodes seed and the secret, reformats the code, and clang-tidy fixes. +namespace detail::wyhash { + +inline void mum(uint64_t* a, uint64_t* b) +{ +#if defined(__SIZEOF_INT128__) + __uint128_t r = *a; + r *= *b; + *a = static_cast(r); + *b = static_cast(r >> 64U); +#elif defined(_MSC_VER) && defined(_M_X64) + *a = _umul128(*a, *b, b); +#else + uint64_t ha = *a >> 32U; + uint64_t hb = *b >> 32U; + uint64_t la = static_cast(*a); + uint64_t lb = static_cast(*b); + uint64_t hi{}; + uint64_t lo{}; + uint64_t rh = ha * hb; + uint64_t rm0 = ha * lb; + uint64_t rm1 = hb * la; + uint64_t rl = la * lb; + uint64_t t = rl + (rm0 << 32U); + auto c = static_cast(t < rl); + lo = t + (rm1 << 32U); + c += static_cast(lo < t); + hi = rh + (rm0 >> 32U) + (rm1 >> 32U) + c; + *a = lo; + *b = hi; +#endif +} + +// multiply and xor mix function, aka MUM +[[nodiscard]] inline auto mix(uint64_t a, uint64_t b) -> uint64_t +{ + mum(&a, &b); + return a ^ b; +} + +// read functions. WARNING: we don't care about endianness, so results are different on big endian! +[[nodiscard]] inline auto r8(const uint8_t* p) -> uint64_t +{ + uint64_t v{}; + std::memcpy(&v, p, 8U); + return v; +} + +[[nodiscard]] inline auto r4(const uint8_t* p) -> uint64_t +{ + uint32_t v{}; + std::memcpy(&v, p, 4); + return v; +} + +// reads 1, 2, or 3 bytes +[[nodiscard]] inline auto r3(const uint8_t* p, size_t k) -> uint64_t +{ + return (static_cast(p[0]) << 16U) | (static_cast(p[k >> 1U]) << 8U) | p[k - 1]; +} + +[[maybe_unused]] [[nodiscard]] inline auto hash(void const* key, size_t len) -> uint64_t +{ + static constexpr auto secret = std::array{ UINT64_C(0xa0761d6478bd642f), + UINT64_C(0xe7037ed1a0b428db), + UINT64_C(0x8ebc6af09c88c6e3), + UINT64_C(0x589965cc75374cc3) }; + + auto const* p = static_cast(key); + uint64_t seed = secret[0]; + uint64_t a{}; + uint64_t b{}; + if (ANKERL_UNORDERED_DENSE_LIKELY(len <= 16)) { + if (ANKERL_UNORDERED_DENSE_LIKELY(len >= 4)) { + a = (r4(p) << 32U) | r4(p + ((len >> 3U) << 2U)); + b = (r4(p + len - 4) << 32U) | r4(p + len - 4 - ((len >> 3U) << 2U)); + } else if (ANKERL_UNORDERED_DENSE_LIKELY(len > 0)) { + a = r3(p, len); + b = 0; + } else { + a = 0; + b = 0; + } + } else { + size_t i = len; + if (ANKERL_UNORDERED_DENSE_UNLIKELY(i > 48)) { + uint64_t see1 = seed; + uint64_t see2 = seed; + do { + seed = mix(r8(p) ^ secret[1], r8(p + 8) ^ seed); + see1 = mix(r8(p + 16) ^ secret[2], r8(p + 24) ^ see1); + see2 = mix(r8(p + 32) ^ secret[3], r8(p + 40) ^ see2); + p += 48; + i -= 48; + } while (ANKERL_UNORDERED_DENSE_LIKELY(i > 48)); + seed ^= see1 ^ see2; + } + while (ANKERL_UNORDERED_DENSE_UNLIKELY(i > 16)) { + seed = mix(r8(p) ^ secret[1], r8(p + 8) ^ seed); + i -= 16; + p += 16; + } + a = r8(p + i - 16); + b = r8(p + i - 8); + } + + return mix(secret[1] ^ len, mix(a ^ secret[1], b ^ seed)); +} + +[[nodiscard]] inline auto hash(uint64_t x) -> uint64_t +{ + return detail::wyhash::mix(x, UINT64_C(0x9E3779B97F4A7C15)); +} + +} // namespace detail::wyhash + +ANKERL_UNORDERED_DENSE_EXPORT template struct hash { + auto operator()(T const& obj) const + noexcept(noexcept(std::declval>().operator()(std::declval()))) -> uint64_t + { + return std::hash{}(obj); + } +}; + +template struct hash::is_avalanching> { + using is_avalanching = void; + auto operator()(T const& obj) const + noexcept(noexcept(std::declval>().operator()(std::declval()))) -> uint64_t + { + return std::hash{}(obj); + } +}; + +template struct hash> { + using is_avalanching = void; + auto operator()(std::basic_string const& str) const noexcept -> uint64_t + { + return detail::wyhash::hash(str.data(), sizeof(CharT) * str.size()); + } +}; + +template struct hash> { + using is_avalanching = void; + auto operator()(std::basic_string_view const& sv) const noexcept -> uint64_t + { + return detail::wyhash::hash(sv.data(), sizeof(CharT) * sv.size()); + } +}; + +template struct hash { + using is_avalanching = void; + auto operator()(T* ptr) const noexcept -> uint64_t + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + return detail::wyhash::hash(reinterpret_cast(ptr)); + } +}; + +template struct hash> { + using is_avalanching = void; + auto operator()(std::unique_ptr const& ptr) const noexcept -> uint64_t + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + return detail::wyhash::hash(reinterpret_cast(ptr.get())); + } +}; + +template struct hash> { + using is_avalanching = void; + auto operator()(std::shared_ptr const& ptr) const noexcept -> uint64_t + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + return detail::wyhash::hash(reinterpret_cast(ptr.get())); + } +}; + +template struct hash::value>::type> { + using is_avalanching = void; + auto operator()(Enum e) const noexcept -> uint64_t + { + using underlying = typename std::underlying_type_t; + return detail::wyhash::hash(static_cast(e)); + } +}; + +template struct tuple_hash_helper { + // Converts the value into 64bit. If it is an integral type, just cast it. Mixing is doing the rest. + // If it isn't an integral we need to hash it. + template [[nodiscard]] constexpr static auto to64(Arg const& arg) -> uint64_t + { + if constexpr (std::is_integral_v || std::is_enum_v) { + return static_cast(arg); + } else { + return hash{}(arg); + } + } + + [[nodiscard]] static auto mix64(uint64_t state, uint64_t v) -> uint64_t + { + return detail::wyhash::mix(state + v, uint64_t{ 0x9ddfea08eb382d69 }); + } + + // Creates a buffer that holds all the data from each element of the tuple. If possible we memcpy the data directly. + // If not, we hash the object and use this for the array. Size of the array is known at compile time, and memcpy is + // optimized away, so filling the buffer is highly efficient. Finally, call wyhash with this buffer. + template + [[nodiscard]] static auto calc_hash(T const& t, std::index_sequence) noexcept -> uint64_t + { + auto h = uint64_t{}; + ((h = mix64(h, to64(std::get(t)))), ...); + return h; + } +}; + +template struct hash> : tuple_hash_helper { + using is_avalanching = void; + auto operator()(std::tuple const& t) const noexcept -> uint64_t + { + return tuple_hash_helper::calc_hash(t, std::index_sequence_for{}); + } +}; + +template struct hash> : tuple_hash_helper { + using is_avalanching = void; + auto operator()(std::pair const& t) const noexcept -> uint64_t + { + return tuple_hash_helper::calc_hash(t, std::index_sequence_for{}); + } +}; + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define ANKERL_UNORDERED_DENSE_HASH_STATICCAST(T) \ + template <> struct hash { \ + using is_avalanching = void; \ + auto operator()(T const& obj) const noexcept -> uint64_t \ + { \ + return detail::wyhash::hash(static_cast(obj)); \ + } \ + } + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wuseless-cast" +#endif +// see https://en.cppreference.com/w/cpp/utility/hash +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(bool); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(char); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(signed char); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(unsigned char); +#if ANKERL_UNORDERED_DENSE_CPP_VERSION >= 202002L && defined(__cpp_char8_t) +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(char8_t); +#endif +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(char16_t); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(char32_t); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(wchar_t); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(short); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(unsigned short); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(int); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(unsigned int); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(long); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(long long); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(unsigned long); +ANKERL_UNORDERED_DENSE_HASH_STATICCAST(unsigned long long); + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + +// bucket_type ////////////////////////////////////////////////////////// + +namespace bucket_type { + +struct standard { + static constexpr uint32_t dist_inc = 1U << 8U; // skip 1 byte fingerprint + static constexpr uint32_t fingerprint_mask = dist_inc - 1; // mask for 1 byte of fingerprint + + uint32_t m_dist_and_fingerprint; // upper 3 byte: distance to original bucket. lower byte: fingerprint from hash + uint32_t m_value_idx; // index into the m_values vector. +}; + +ANKERL_UNORDERED_DENSE_PACK(struct big { + static constexpr uint32_t dist_inc = 1U << 8U; // skip 1 byte fingerprint + static constexpr uint32_t fingerprint_mask = dist_inc - 1; // mask for 1 byte of fingerprint + + uint32_t m_dist_and_fingerprint; // upper 3 byte: distance to original bucket. lower byte: fingerprint from hash + size_t m_value_idx; // index into the m_values vector. +}); + +} // namespace bucket_type + +namespace detail { + +struct nonesuch {}; +struct default_container_t {}; + +template class Op, class... Args> struct detector { + using value_t = std::false_type; + using type = Default; +}; + +template class Op, class... Args> +struct detector>, Op, Args...> { + using value_t = std::true_type; + using type = Op; +}; + +template