diff --git a/.circleci/config.yml b/.circleci/config.yml index ae14946c3d81..6466bd7e8816 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -85,7 +85,7 @@ jobs: - *setup_env - run: name: "Build" - command: cond_spot_run_build barretenberg-wasm-linux-clang 64 + command: cond_spot_run_build barretenberg-wasm-linux-clang 128 barretenberg-x86_64-linux-gcc: docker: @@ -96,7 +96,7 @@ jobs: - *setup_env - run: name: "Build" - command: cond_spot_run_build barretenberg-x86_64-linux-gcc 64 + command: cond_spot_run_build barretenberg-x86_64-linux-gcc 128 barretenberg-x86_64-linux-clang: docker: @@ -107,7 +107,7 @@ jobs: - *setup_env - run: name: "Build" - command: cond_spot_run_build barretenberg-x86_64-linux-clang 64 + command: cond_spot_run_build barretenberg-x86_64-linux-clang 128 barretenberg-x86_64-linux-clang-fuzzing: docker: @@ -118,7 +118,7 @@ jobs: - *setup_env - run: name: "Build" - command: cond_spot_run_build barretenberg-x86_64-linux-clang-fuzzing 64 + command: cond_spot_run_build barretenberg-x86_64-linux-clang-fuzzing 128 barretenberg-x86_64-linux-clang-assert: docker: @@ -129,7 +129,7 @@ jobs: - *setup_env - run: name: "Build" - command: cond_spot_run_build barretenberg-x86_64-linux-clang-assert 64 + command: cond_spot_run_build barretenberg-x86_64-linux-clang-assert 128 barretenberg-stdlib-tests: docker: @@ -191,18 +191,6 @@ jobs: command: cond_spot_run_test barretenberg-x86_64-linux-clang-assert 32 ./scripts/run_tests 1 proof_system_tests - *save_logs - barretenberg-stdlib-recursion-turbo-tests: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Test" - command: cond_spot_run_test barretenberg-x86_64-linux-clang-assert 32 ./scripts/run_tests 1 stdlib_recursion_tests --gtest_filter=*turbo* - - *save_logs - barretenberg-stdlib-recursion-ultra-tests: docker: - image: aztecprotocol/alpine-build-image @@ -253,7 +241,7 @@ jobs: bb-js: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -293,7 +281,7 @@ jobs: - *setup_env - run: name: "Build" - command: cond_spot_run_build circuits-wasm-linux-clang 64 + command: cond_spot_run_build circuits-wasm-linux-clang 32 circuits-wasm-linux-clang-assert: docker: @@ -304,7 +292,7 @@ jobs: - *setup_env - run: name: "Build" - command: cond_spot_run_build circuits-wasm-linux-clang-assert 64 + command: cond_spot_run_build circuits-wasm-linux-clang-assert 32 circuits-x86_64-linux-clang-tidy: docker: @@ -315,7 +303,7 @@ jobs: - *setup_env - run: name: "Build" - command: cond_spot_run_build circuits-x86_64-linux-clang-tidy 64 + command: cond_spot_run_build circuits-x86_64-linux-clang-tidy 32 circuits-x86_64-linux-clang: docker: @@ -326,7 +314,7 @@ jobs: - *setup_env - run: name: "Build" - command: cond_spot_run_build circuits-x86_64-linux-clang 64 + command: cond_spot_run_build circuits-x86_64-linux-clang 32 circuits-x86_64-linux-clang-assert: docker: @@ -337,7 +325,7 @@ jobs: - *setup_env - run: name: "Build" - command: cond_spot_run_build circuits-x86_64-linux-clang-assert 64 + command: cond_spot_run_build circuits-x86_64-linux-clang-assert 32 circuits-wasm-tests: docker: @@ -365,7 +353,7 @@ jobs: l1-contracts: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -374,95 +362,40 @@ jobs: name: "Build and test" command: build l1-contracts - yarn-project-base: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build" - command: build yarn-project-base - - foundation: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build foundation - - aztec-js: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build aztec.js - - cli: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build cli - - types: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build types - - l1-artifacts: + noir-contracts-build: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout - *setup_env - run: - name: "Build and test" - command: build l1-artifacts + name: Build + command: build noir-contracts-build | add_timestamps - aztec-node: + yarn-project-base: machine: - image: ubuntu-2004:202010-01 - resource_class: large + image: ubuntu-2204:2023.07.2 + resource_class: xlarge steps: - *checkout - *setup_env - run: - name: "Build and test" - command: build aztec-node + name: "Build" + command: build yarn-project-base | add_timestamps - key-store: + yarn-project: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout - *setup_env - run: - name: "Build and test" - command: build key-store + name: Build + command: build yarn-project | add_timestamps - noir-contracts-build: + yarn-project-format: docker: - image: aztecprotocol/alpine-build-image resource_class: small @@ -470,111 +403,23 @@ jobs: - *checkout - *setup_env - run: - name: "Build and test" - command: cond_spot_run_build noir-contracts-build 32 - - noir-contracts: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build noir-contracts - - noir-compiler: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build noir-compiler - - world-state: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build world-state - - merkle-tree: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build merkle-tree - - p2p: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build p2p - - p2p-bootstrap: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build p2p-bootstrap + name: Build + command: cond_spot_run_script yarn-project 32 cond_run_container yarn-project formatting | add_timestamps - acir-simulator: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build acir-simulator - - archiver: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build archiver - - aztec-rpc: - machine: - image: ubuntu-2004:202010-01 - resource_class: large + yarn-project-test: + docker: + - image: aztecprotocol/alpine-build-image + resource_class: small steps: - *checkout - *setup_env - run: - name: "Build and test" - command: build aztec-rpc + name: Build + command: cond_spot_run_script yarn-project 64 cond_run_container yarn-project test | add_timestamps aztec-sandbox-base: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -585,7 +430,7 @@ jobs: aztec-sandbox-x86_64: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -596,18 +441,22 @@ jobs: aztec-sandbox-arm64: machine: - image: ubuntu-2204:2023.07.1 + image: ubuntu-2204:2023.07.2 resource_class: arm.large steps: - *checkout - *setup_env - run: name: "Build and test" - command: force_deploy_build aztec-sandbox false arm64 + # We need to force not to use docker buildkit because for some reason on arm only, it ends up making a call + # out to eu-west2 despite the image being locally tagged, resulting in unauthorised 401. Weird docker bug? + command: | + echo "export DOCKER_BUILDKIT=" > $BASH_ENV + force_deploy_build aztec-sandbox false arm64 aztec-sandbox-ecr-manifest: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -616,31 +465,9 @@ jobs: name: "Create ECR manifest" command: create_ecr_manifest aztec-sandbox-base aztec-sandbox x86_64,arm64 - circuits-js: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build circuits.js - - sequencer-client: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build and test" - command: build sequencer-client - canary: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -651,7 +478,7 @@ jobs: end-to-end: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -660,31 +487,9 @@ jobs: name: "Build" command: build end-to-end - ethereum: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build" - command: build ethereum - - rollup-provider: - machine: - image: ubuntu-2004:202010-01 - resource_class: large - steps: - - *checkout - - *setup_env - - run: - name: "Build" - command: build rollup-provider - e2e-2-rpc-servers: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -695,7 +500,7 @@ jobs: e2e-multiple-accounts-1-enc-key: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -706,7 +511,7 @@ jobs: e2e-deploy-contract: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -717,7 +522,7 @@ jobs: e2e-lending-contract: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -728,7 +533,7 @@ jobs: e2e-token-contract: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -739,7 +544,7 @@ jobs: e2e-private-airdrop: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -750,7 +555,7 @@ jobs: e2e-private-token-contract: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -761,7 +566,8 @@ jobs: e2e-sandbox-example: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -771,7 +577,8 @@ jobs: e2e-multi-transfer-contract: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -781,7 +588,7 @@ jobs: e2e-block-building: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -792,7 +599,7 @@ jobs: e2e-nested-contract: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -803,7 +610,7 @@ jobs: e2e-non-contract-account: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -814,7 +621,7 @@ jobs: e2e-cross-chain-messaging: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -825,7 +632,7 @@ jobs: e2e-public-cross-chain-messaging: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -836,7 +643,7 @@ jobs: e2e-public-to-private-messaging: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -847,7 +654,7 @@ jobs: e2e-account-contracts: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -858,7 +665,8 @@ jobs: e2e-escrow-contract: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -868,7 +676,7 @@ jobs: e2e-pending-commitments-contract: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -879,7 +687,7 @@ jobs: e2e-ordering: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -890,7 +698,7 @@ jobs: uniswap-trade-on-l1-from-l2: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -901,7 +709,7 @@ jobs: integration-archiver-l1-to-l2: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -912,7 +720,7 @@ jobs: integration-l1-publisher: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -923,7 +731,7 @@ jobs: e2e-public-token-contract: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -934,7 +742,7 @@ jobs: e2e-cli: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -945,7 +753,8 @@ jobs: e2e-p2p: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -955,7 +764,8 @@ jobs: e2e-browser-sandbox: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -965,7 +775,8 @@ jobs: e2e-card-game: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -975,7 +786,8 @@ jobs: aztec-rpc-sandbox: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -985,7 +797,8 @@ jobs: cli-docs-sandbox: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -995,7 +808,7 @@ jobs: guides-writing-an-account-contract: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -1006,7 +819,8 @@ jobs: guides-dapp-testing: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -1016,7 +830,8 @@ jobs: guides-sample-dapp: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -1026,7 +841,8 @@ jobs: guides-up-quick-start: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -1036,7 +852,8 @@ jobs: e2e-canary-test: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 + resource_class: large steps: - *checkout - *setup_env @@ -1046,7 +863,7 @@ jobs: build-docs: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -1060,7 +877,7 @@ jobs: e2e-join: docker: - - image: cimg/base:current + - image: cimg/base:2023.09 resource_class: small steps: - run: @@ -1069,7 +886,7 @@ jobs: e2e-end: docker: - - image: cimg/base:current + - image: cimg/base:2023.09 resource_class: small steps: - run: @@ -1078,132 +895,19 @@ jobs: deploy-npm: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: medium steps: - *checkout - *setup_env # Aztec.js and dependencies - run: - name: "foundation" - working_directory: foundation - command: | - deploy_ecr foundation - deploy_npm foundation - - run: - name: "circuits.js" - working_directory: circuits.js - command: | - deploy_ecr circuits.js - deploy_npm circuits.js - - run: - name: "types" - working_directory: types - command: | - deploy_ecr types - deploy_npm types - - run: - name: "aztec.js" - working_directory: aztec.js - command: | - deploy_ecr aztec.js - deploy_npm aztec.js - # Aztec CLI and dependencies - - run: - name: "l1-artifacts" - working_directory: l1-artifacts - command: | - deploy_ecr l1-artifacts - deploy_npm l1-artifacts - - run: - name: "aztec-ethereum" - working_directory: ethereum - command: | - deploy_ecr ethereum - deploy_npm ethereum - - run: - name: "noir-compiler" - working_directory: noir-compiler - command: | - deploy_ecr noir-compiler - deploy_npm noir-compiler - - run: - name: "noir-contracts" - working_directory: noir-contracts - command: | - deploy_ecr noir-contracts - deploy_npm noir-contracts - - run: - name: "cli" - working_directory: cli - command: | - deploy_ecr cli - deploy_npm cli - # Aztec Sandbox and dependencies - - run: - name: "aztec-rpc" - working_directory: aztec-rpc - command: | - deploy_ecr aztec-rpc - deploy_npm aztec-rpc - - run: - name: "acir-simulator" - working_directory: acir-simulator - command: | - deploy_ecr acir-simulator - deploy_npm acir-simulator - - run: - name: "archiver" - working_directory: archiver - command: | - deploy_ecr archiver - deploy_npm archiver - - run: - name: "merkle-tree" - working_directory: merkle-tree - command: | - deploy_ecr merkle-tree - deploy_npm merkle-tree - - run: - name: "p2p" - working_directory: p2p - command: | - deploy_ecr p2p - deploy_npm p2p - - run: - name: "sequencer-client" - working_directory: sequencer-client - command: | - deploy_ecr sequencer-client - deploy_npm sequencer-client - - run: - name: "world-state" - working_directory: world-state - command: | - deploy_ecr world-state - deploy_npm world-state - - run: - name: "key-store" - working_directory: key-store - command: | - deploy_ecr key-store - deploy_npm key-store - - run: - name: "aztec-node" - working_directory: aztec-node - command: | - deploy_ecr aztec-node - deploy_npm aztec-node - - run: - name: "aztec-sandbox" - working_directory: aztec-sandbox - command: | - deploy_ecr aztec-sandbox - deploy_npm aztec-sandbox + name: "yarn-project" + command: yarn-project/deploy_npm.sh deploy-dockerhub: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: medium steps: - *checkout @@ -1212,15 +916,13 @@ jobs: name: "deploy-sandbox" working_directory: aztec-sandbox command: | - deploy_ecr aztec-sandbox x86_64 - deploy_ecr aztec-sandbox arm64 deploy_dockerhub aztec-sandbox x86_64 deploy_dockerhub aztec-sandbox arm64 create_dockerhub_manifest aztec-sandbox x86_64,arm64 deploy-end: docker: - - image: cimg/base:current + - image: cimg/base:2023.09 resource_class: small steps: - run: @@ -1229,7 +931,7 @@ jobs: build-deployment-canary: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -1240,7 +942,7 @@ jobs: run-deployment-canary-uniswap: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -1251,7 +953,7 @@ jobs: run-deployment-canary-browser: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -1262,7 +964,7 @@ jobs: run-deployment-canary-cli: machine: - image: ubuntu-2004:202010-01 + image: ubuntu-2204:2023.07.2 resource_class: large steps: - *checkout @@ -1299,7 +1001,7 @@ deploy_defaults: &deploy_defaults branch_pattern: "master" yarn_project: &yarn_project requires: - - yarn-project-base + - yarn-project <<: *defaults e2e_test: &e2e_test requires: @@ -1315,8 +1017,6 @@ workflows: when: equal: [system, << pipeline.parameters.workflow >>] jobs: - - build-docs: *defaults - # Barretenberg - barretenberg-x86_64-linux-gcc: *defaults - barretenberg-x86_64-linux-clang: *defaults @@ -1328,14 +1028,12 @@ workflows: - barretenberg-dsl-tests: *bb_test - barretenberg-tests: *bb_test - barretenberg-stdlib-tests: *bb_test - - barretenberg-stdlib-recursion-turbo-tests: *bb_test - barretenberg-stdlib-recursion-ultra-tests: *bb_test - barretenberg-join-split-tests: *bb_test # - barretenberg-benchmark-aggregator: # requires: # - barretenberg-tests # - barretenberg-stdlib-tests - # - barretenberg-stdlib-recursion-turbo-tests # - barretenberg-stdlib-recursion-ultra-tests # - barretenberg-join-split-tests # filters: @@ -1390,15 +1088,6 @@ workflows: - circuits-x86_64-linux-clang-assert <<: *defaults - # - circuits-end: - # requires: - # - circuits-wasm-linux-clang - # - circuits-x86_64-linux-clang-tidy - # - circuits-x86_64-linux-clang - # - circuits-wasm-tests - # - circuits-x86_64-tests - # <<: *defaults - - l1-contracts: *defaults - noir-contracts-build: *defaults @@ -1407,32 +1096,25 @@ workflows: requires: - circuits-wasm-linux-clang - l1-contracts + <<: *defaults + - yarn-project-format: + requires: + - yarn-project + <<: *defaults + - yarn-project-test: + requires: + - yarn-project + <<: *defaults + - yarn-project: + requires: + - yarn-project-base - noir-contracts-build <<: *defaults - - aztec-js: *yarn_project - end-to-end: *yarn_project - - ethereum: *yarn_project - - foundation: *yarn_project - - world-state: *yarn_project - - acir-simulator: *yarn_project - - archiver: *yarn_project - - aztec-rpc: *yarn_project - - aztec-node: *yarn_project - - cli: *yarn_project - - key-store: *yarn_project - - merkle-tree: *yarn_project - - p2p: *yarn_project - - p2p-bootstrap: *yarn_project - - l1-artifacts: *yarn_project - - noir-compiler: *yarn_project - - noir-contracts: *yarn_project - - sequencer-client: *yarn_project - - types: *yarn_project - - circuits-js: *yarn_project - - rollup-provider: *yarn_project - aztec-sandbox-base: *yarn_project - canary: *yarn_project + - build-docs: *yarn_project - aztec-sandbox-x86_64: requires: @@ -1451,27 +1133,7 @@ workflows: - e2e-join: requires: - - aztec-js - end-to-end - - ethereum - - foundation - - world-state - - acir-simulator - - archiver - - aztec-rpc - - aztec-node - - cli - - key-store - - merkle-tree - - p2p - - p2p-bootstrap - - l1-artifacts - - noir-compiler - - noir-contracts - - sequencer-client - - types - - circuits-js - - rollup-provider - aztec-sandbox-ecr-manifest - canary <<: *defaults diff --git a/.github/workflows/mirror_repos.yml b/.github/workflows/mirror_repos.yml index 7712b17ec3c3..ea5e694ca2a5 100644 --- a/.github/workflows/mirror_repos.yml +++ b/.github/workflows/mirror_repos.yml @@ -6,9 +6,6 @@ # action failing due to upstream changes, a manual resolution # PR with ./scripts/git_subrepo.sh pull will be needed. name: Mirror Repositories - -concurrency: - group: mirror-repositories on: schedule: # Run the workflow every night at 2:00 AM UTC. @@ -38,6 +35,8 @@ jobs: mirror-to-build-system-repo: runs-on: ubuntu-latest + # Force sequential. + needs: mirror-to-docs-repo steps: - name: Checkout uses: actions/checkout@v3 @@ -59,6 +58,8 @@ jobs: mirror-to-barretenberg-repo: runs-on: ubuntu-latest + # Force sequential. + needs: mirror-to-build-system-repo steps: - name: Checkout uses: actions/checkout@v3 @@ -80,6 +81,8 @@ jobs: mirror-to-aztec-nr-repo: runs-on: ubuntu-latest + # Force sequential. + needs: mirror-to-barretenberg-repo steps: - name: Checkout uses: actions/checkout@v3 @@ -97,4 +100,4 @@ jobs: git rebase origin/master git commit --amend -m "$(git log -1 --pretty=%B) [skip ci]" git push - fi \ No newline at end of file + fi diff --git a/.github/workflows/publish-bb.yml b/.github/workflows/publish-bb.yml index 5895d5ab9ca4..28ddb777e5b6 100644 --- a/.github/workflows/publish-bb.yml +++ b/.github/workflows/publish-bb.yml @@ -150,13 +150,6 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ inputs.tag || env.GITHUB_REF }} - # We need clang 14.0.3 or higher, as lower versions do not seem - # to be spec conformant. In particular std::span does not seem - # to follow the specifications. - # We need clang 15 because barretenberg uses concepts. - # clang 15 is the similar to Apple clang 14. - - name: Select Xcode version - run: sudo xcode-select -switch /Applications/Xcode_14.3.1.app - name: Create Mac Build Environment run: brew install cmake ninja diff --git a/.gitmodules b/.gitmodules index e355139eb3dc..f643e34f4ca5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "legacy-barretenberg-build-system"] - path = barretenberg/build-system - url = https://github.com/AztecProtocol/build-system [submodule "l1-contracts/lib/openzeppelin-contracts"] path = l1-contracts/lib/openzeppelin-contracts url = https://github.com/openzeppelin/openzeppelin-contracts diff --git a/README.md b/README.md index 6dfabaa19641..0dd23af28246 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,15 @@ This repository uses CircleCI for continuous integration. Build steps are manage All packages need to be included in the [build manifest](`build_manifest.json`), which declares what paths belong to each package, as well as dependencies between packages. When the CI runs, if none of the rebuild patterns or dependencies were changed, then the build step is skipped and the last successful image is re-tagged with the current commit. Read more on the [`build-system`](https://github.com/AztecProtocol/build-system) repository README. +It is faster to debug CI failures within a persistent ssh session compared to pushing and waiting. You can create a session with "Rerun step with SSH" on CircleCI which will generate an ssh command for debugging on a worker. Run that command locally and then do +```bash +cd project +./build-system/scripts/setup_env "$(git rev-parse HEAD)" "" "" "" +source /tmp/.bash_env* +{start testing your CI commands here} +``` +This provide an interactive environment for debugging the CI test. + ## Debugging Logging goes through the [`info` and `debug`](barretenberg/cpp/src/barretenberg/common/log.hpp) functions in C++, and through the [DebugLogger](yarn-project/foundation/src/log/debug.ts) module in Typescript. To see the log output, set a `DEBUG` environment variable to the name of the module you want to debug, to `aztec:*`, or to `*` to see all logs. diff --git a/barretenberg/.circleci/config.yml b/barretenberg/.circleci/config.yml deleted file mode 100644 index 0436b49b804f..000000000000 --- a/barretenberg/.circleci/config.yml +++ /dev/null @@ -1,438 +0,0 @@ -# This file uses YAML anchors and aliases to prevent repetition of blocks of config: -# https://support.atlassian.com/bitbucket-cloud/docs/yaml-anchors/ -# -# Two primary anchors are checkout and setup_env, called as the first step of almost all jobs: -# - checkout: A custom checkout step to reduce the amount of data downloaded to improve speed. -# - setup_env: Sets up the common environment used by all build steps. -# -# Two CCI executors are used: -# - docker (small): Used only to launch external EC2 instances for big workloads. It's the cheapest option. -# - machine (large): Used for building in CCI itself. 4cpus, 15GB has the optimal power/cost ratio. -# -# The docker executor uses a custom image build in `build_image`. It's specifically streamlined for fast download -# with just enough tools to execute the build system, and launch EC2 instances etc. - -version: 2.1 - -orbs: - slack: circleci/slack@4.12.1 - -parameters: - workflow: - type: string - default: "system" - -# This build step checks out the code from the repository. It has a hardcoded readonly key to allow the checkout. -# Initially it just fetches the repo metadata for the current commit hash to a depth of 50 commits. -# We need historical commit hashes to calculate diffs between previous and current commits. -# It then checks out the fetched head to actually download the data. -checkout: &checkout - run: - name: "Checkout code" - command: | - cd $HOME - mkdir -p .ssh - chmod 0700 .ssh - ssh-keyscan -t rsa github.com >> .ssh/known_hosts - - # IF YOU'RE CHANGING THIS, YOU ALSO WANT TO CHANGE: build-system/remote_build/remote_build - # Shallow checkout this commit. - mkdir -p project - cd project - git init - git remote add origin $CIRCLE_REPOSITORY_URL - # Only download metadata when fetching. - git fetch --depth 50 --filter=blob:none origin $CIRCLE_SHA1 - git checkout FETCH_HEAD - # Initialize submodules recursively - git submodule update --init --recursive - -# Called setup_env to setup a bunch of global variables used throughout the rest of the build process. -# It takes the required CCI environment variables as inputs, and gives them normalised names for the rest of -# the build process. This enables easy running of the build system external to CCI, as used for powerful EC2 builds. -setup_env: &setup_env - run: - name: "Setup environment" - command: ./build-system/scripts/setup_env "$CIRCLE_SHA1" "$CIRCLE_TAG" "$CIRCLE_JOB" "$CIRCLE_REPOSITORY_URL" "$CIRCLE_BRANCH" - -# setup_aztec_commit: &setup_aztec_commit -# run: -# name: "Setup environment for Aztec Integration Testing" -# command: | -# # Load the aztec commit into env for use in integration tests -# # Aztec commit will be chosen according to the following priorities: -# # 1. if present, grab commit from cpp/.aztec-packages-commit file -# # 2. if this is a branch with an identically named branch in aztec-pacakages, run against that branch -# # 3. default to aztec-packages 'master' - -# # default to master -# AZTEC_COMMIT=master -# echo "Checking if a branch/commit is specified in .aztec-packages-commit" -# echo "or if this is a branch with a sibling branch in aztec-packages." -# echo "Otherwise defaulting to test against circuits in aztec-packages 'master'." - -# COMMIT_FROM_FILE=$(cat cpp/.aztec-packages-commit 2>/dev/null || true) -# if [ -n "$COMMIT_FROM_FILE" ] && [[ "$COMMIT_FROM_FILE" = *[![:space:]]* ]]; then -# # if a commit is present in .aztec-packages-commit, use that -# # check that there is text in the commit file that is not just whitespace -# echo "Using aztec-packages commit ($COMMIT_FROM_FILE) from .aztec-packages-commit file" -# AZTEC_COMMIT=$COMMIT_FROM_FILE -# elif [ -n "$CIRCLE_BRANCH" ] && [ "$CIRCLE_BRANCH" != master ]; then -# echo "Checking if a sibling branch ($CIRCLE_BRANCH) exists in aztec-packages" -# if git ls-remote --heads git@github.com:AztecProtocol/aztec-packages.git 2>/dev/null | grep "refs/heads/$CIRCLE_BRANCH" &>/dev/null; then -# echo "Sibling branch ($CIRCLE_BRANCH) exists in aztec-packages! Circuits tests will run against that branch." -# AZTEC_COMMIT=$CIRCLE_BRANCH -# else -# echo "No sibling branch exists in aztec-packages. Defaulting to 'master'." -# fi -# else -# echo "Defaulting to 'master'." -# fi - -# echo "export AZTEC_COMMIT=$AZTEC_COMMIT" >> "$BASH_ENV" -# source "$BASH_ENV" - -# # This step is used to save logs from various barretenberg test to the workspace so that they can be used later to parse benchmark values out of them -# # NOTE(AD): This is now obsolete as benchmarking has been moved to aztec-packages repo. Another pass may simplify this. -# save_logs: &save_logs -# persist_to_workspace: -# root: /tmp/test-logs -# paths: -# - ./* - -jobs: - # wasm-linux-clang: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Build" - # command: cond_spot_run_build barretenberg-wasm-linux-clang 64 - - # x86_64-linux-gcc: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Build" - # command: cond_spot_run_build barretenberg-x86_64-linux-gcc 64 - - x86_64-linux-clang: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Build" - command: cond_spot_run_build barretenberg-x86_64-linux-clang 64 - - # x86_64-linux-clang-assert: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Build" - # command: cond_spot_run_build barretenberg-x86_64-linux-clang-assert 64 - - x86_64-linux-clang-fuzzing: - docker: - - image: aztecprotocol/alpine-build-image - resource_class: small - steps: - - *checkout - - *setup_env - - run: - name: "Build" - command: cond_spot_run_build barretenberg-x86_64-linux-clang-fuzzing 64 - - # stdlib-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Test" - # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 stdlib-tests - # - *save_logs - - # dsl-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Test" - # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 dsl_tests - # - *save_logs - - # barretenberg-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Test" - # command: cond_spot_run_test_script ./scripts/bb-tests.sh barretenberg-x86_64-linux-clang-assert - # - *save_logs - - # honk-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Test" - # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 honk_tests - # - *save_logs - - # proof-system-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Test" - # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 proof_system_tests - # - *save_logs - - # stdlib-recursion-turbo-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Test" - # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 1 stdlib_recursion_tests --gtest_filter=*turbo* - # - *save_logs - - # stdlib-recursion-ultra-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Test" - # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 3 stdlib_recursion_tests --gtest_filter=-*turbo* - # - *save_logs - - # join-split-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Test" - # command: cond_spot_run_tests barretenberg-x86_64-linux-clang-assert 3 join_split_example_proofs_join_split_tests --gtest_filter=-*full_proof* - # - *save_logs - - # # bb-bin-tests: - # # docker: - # # - image: aztecprotocol/alpine-build-image - # # resource_class: small - # # steps: - # # - *checkout - # # - *setup_env - # # - run: - # # name: "Test" - # # command: cond_spot_run_test_script ./scripts/bin-test.sh barretenberg-x86_64-linux-clang-assert - - # bb-js: - # machine: - # image: ubuntu-2004:202010-01 - # resource_class: large - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Build" - # command: build bb.js - - # bb-js-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Test" - # command: cond_spot_run_tests bb.js - - # acir-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Build and test" - # command: cond_spot_run_build acir-tests 32 - - # # These machines cost a fortune (10x other machines). - # # There is a branch coming for github actions that will build mac stuff on releases. - # # I'll leave this here for now, just in case proves useful to be able to do CI mac builds on branches, - # # but let's not uncomment in master. - # # - # # aarch64-macos-clang: - # # macos: - # # xcode: "14.3.1" - # # resource_class: macos.m1.medium.gen1 - # # steps: - # # - *checkout - # # - run: - # # name: "Install toolchain" - # # command: brew install cmake ninja - # # - run: - # # name: "Build" - # # working_directory: ~/project/cpp - # # command: cmake --preset default && cmake --build --preset default --target bb - # # - run: - # # name: "Test" - # # working_directory: ~/project/cpp/bin-test - # # command: ./bin-test.sh - - # ################################### - # # Aztec integration tests - # #circuits-wasm-linux-clang-builder-runner: - # # docker: - # # - image: aztecprotocol/alpine-build-image - # # resource_class: small - # # steps: - # # - *checkout - # # - *setup_env - # # - run: - # # name: "Build" - # # command: cond_spot_run_build barretenberg-circuits-wasm-linux-clang-builder-runner 64 - - # circuits-x86_64-linux-clang-builder-runner: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - run: - # name: "Build" - # command: cond_spot_run_build barretenberg-circuits-x86_64-linux-clang-builder-runner 64 - - # #circuits-wasm-tests: - # # docker: - # # - image: aztecprotocol/alpine-build-image - # # resource_class: small - # # steps: - # # - *checkout - # # - *setup_env - # # - *setup_aztec_commit - # # - run: - # # name: "Build" - # # command: cond_spot_run_test_script ./scripts/run_aztec_circuits_tests barretenberg-circuits-wasm-linux-clang-builder-runner "$AZTEC_COMMIT" 1 wasm scripts/a3-tests -*.skip*:*.circuit* - - # circuits-x86_64-tests: - # docker: - # - image: aztecprotocol/alpine-build-image - # resource_class: small - # steps: - # - *checkout - # - *setup_env - # - *setup_aztec_commit - # - run: - # name: "Build" - # command: cond_spot_run_test_script ./scripts/run_aztec_circuits_tests barretenberg-circuits-x86_64-linux-clang-builder-runner "$AZTEC_COMMIT" 1 x86_64 scripts/a3-tests -*.skip* - # # End Aztec integration tests - # ################################### - -# Repeatable config for defining the workflow below. -tag_regex: &tag_regex /v[0-9]+(\.[0-9]+)*(-[a-zA-Z-]+\.[0-9]+)?/ -defaults: &defaults - filters: - tags: - only: *tag_regex - context: - - slack - post-steps: - - slack/notify: - channel: $SLACK_BARRETENBERG_CHANNEL - event: fail - branch_pattern: "master" - -# bb_test: &bb_test -# requires: -# - x86_64-linux-clang-assert -# <<: *defaults - -# notmaster: ¬master -# filters: -# branches: -# ignore: -# - master -# <<: *defaults - -workflows: - system: - jobs: - # - aarch64-macos-clang: *defaults - # - x86_64-linux-gcc: *defaults - - x86_64-linux-clang: *defaults - # - x86_64-linux-clang-assert: *defaults - - x86_64-linux-clang-fuzzing: *defaults - # - wasm-linux-clang: *defaults - # - proof-system-tests: *bb_test - # - honk-tests: *bb_test - # - dsl-tests: *bb_test - # - barretenberg-tests: *bb_test - # - stdlib-tests: *bb_test - # - stdlib-recursion-turbo-tests: *bb_test - # - stdlib-recursion-ultra-tests: *bb_test - # - join-split-tests: *bb_test - # - bb-bin-tests: *bb_test - # - bb-js: - # requires: - # - wasm-linux-clang - # <<: *defaults - # - bb-js-tests: - # requires: - # - bb-js - # <<: *defaults - # - acir-tests: - # requires: - # - x86_64-linux-clang-assert - # - bb-js - # <<: *defaults - #- circuits-wasm-linux-clang-builder-runner: *notmaster - # - circuits-x86_64-linux-clang-builder-runner: *notmaster - #- circuits-wasm-tests: - # requires: - # - circuits-wasm-linux-clang-builder-runner - # <<: *notmaster - # - circuits-x86_64-tests: - # requires: - # - circuits-x86_64-linux-clang-builder-runner - # <<: *notmaster diff --git a/barretenberg/.gitrepo b/barretenberg/.gitrepo index 875ba73837d4..76607ccb079f 100644 --- a/barretenberg/.gitrepo +++ b/barretenberg/.gitrepo @@ -5,8 +5,8 @@ ; [subrepo] remote = https://github.com/AztecProtocol/barretenberg - branch = main - commit = ae9f99c3caf0213882d843577374b03871cc7092 - parent = c8a5cfb375b498475503c12cc83fcdba39f2ec5f + branch = master + commit = 16c9bec3e171dd4704ba641735a28f0bf340d564 + parent = b62c4de76264a4fa214c4a61841ef7199f970fde method = merge cmdver = 0.4.6 diff --git a/barretenberg/PROJECT b/barretenberg/PROJECT deleted file mode 100644 index adcaa3c7f541..000000000000 --- a/barretenberg/PROJECT +++ /dev/null @@ -1 +0,0 @@ -barretenberg diff --git a/barretenberg/acir_tests/Dockerfile.bb.js b/barretenberg/acir_tests/Dockerfile.bb.js index 3a8b0522976d..3fc58e353cdd 100644 --- a/barretenberg/acir_tests/Dockerfile.bb.js +++ b/barretenberg/acir_tests/Dockerfile.bb.js @@ -21,4 +21,4 @@ RUN BROWSER=chrome THREAD_MODEL=mt ./run_acir_tests_browser.sh double_verify_pro RUN BROWSER=chrome THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul # Commenting for now as fails intermittently. Unreproducable on mainframe. # See https://github.com/AztecProtocol/aztec-packages/issues/2104 -#RUN BROWSER=webkit THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul \ No newline at end of file +#RUN BROWSER=webkit THREAD_MODEL=st ./run_acir_tests_browser.sh 1_mul diff --git a/barretenberg/barretenberg-wasm.nix b/barretenberg/barretenberg-wasm.nix deleted file mode 100644 index 7440f5bb6ac2..000000000000 --- a/barretenberg/barretenberg-wasm.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ stdenv, cmake, ninja, binaryen, callPackage }: -let - toolchain_file = ./cpp/cmake/toolchains/wasm32-wasi.cmake; - wasi-sdk = callPackage ./wasi-sdk.nix { }; -in -stdenv.mkDerivation -{ - pname = "barretenberg.wasm"; - version = "0.7.10"; # x-release-please-version - - src = ./cpp; - - nativeBuildInputs = [ cmake ninja wasi-sdk ]; - - buildInputs = [ ]; - - cmakeFlags = [ - "-GNinja" - "-DTESTING=OFF" - "-DBENCHMARKS=OFF" - "-DCMAKE_TOOLCHAIN_FILE=${toolchain_file}" - "-DCMAKE_C_COMPILER=${wasi-sdk}/bin/clang" - "-DCMAKE_CXX_COMPILER=${wasi-sdk}/bin/clang++" - "-DCMAKE_AR=${wasi-sdk}/bin/llvm-ar" - "-DCMAKE_RANLIB=${wasi-sdk}/bin/llvm-ranlib" - "-DCMAKE_SYSROOT=${wasi-sdk}/share/wasi-sysroot" - "-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER" - "-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY" - "-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY" - "-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY" - "-DCMAKE_C_COMPILER_WORKS=ON" - "-DCMAKE_CXX_COMPILER_WORKS=ON" - ]; - - buildPhase = '' - cmake --build . --target barretenberg.wasm --parallel - ''; -} diff --git a/barretenberg/barretenberg.nix b/barretenberg/barretenberg.nix deleted file mode 100644 index 04576b20335a..000000000000 --- a/barretenberg/barretenberg.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ overrideCC, stdenv, llvmPackages, cmake, ninja, lib, callPackage, gcc11 }: -let - targetPlatform = stdenv.targetPlatform; - buildEnv = - if (stdenv.targetPlatform.isGnu && stdenv.targetPlatform.isAarch64) then - # As per https://discourse.nixos.org/t/gcc11stdenv-and-clang/17734/7 since it seems that aarch64-linux uses - # gcc9 instead of gcc11 for the C++ stdlib, while all other targets we support provide the correct libstdc++ - overrideCC llvmPackages.stdenv (llvmPackages.clang.override { gccForLibs = gcc11.cc; }) - else - llvmPackages.stdenv; - optionals = lib.lists.optionals; - toolchain_file = ./cpp/cmake/toolchains/${targetPlatform.system}.cmake; -in -buildEnv.mkDerivation -{ - pname = "libbarretenberg"; - version = "0.7.10"; # x-release-please-version - - src = ./cpp; - - nativeBuildInputs = [ cmake ninja ]; - - buildInputs = [ llvmPackages.openmp ]; - - cmakeFlags = [ - "-DTESTING=OFF" - "-DBENCHMARKS=OFF" - "-DDISABLE_ASM=ON" - "-DDISABLE_ADX=ON" - "-DCMAKE_TOOLCHAIN_FILE=${toolchain_file}" - "-DCMAKE_BUILD_TYPE=RelWithAssert" - ]; - - NIX_CFLAGS_COMPILE = - optionals targetPlatform.isDarwin [ " -fno-aligned-allocation" ]; - - enableParallelBuilding = true; -} diff --git a/barretenberg/bootstrap_docker.sh b/barretenberg/bootstrap_docker.sh deleted file mode 100755 index e2f88e225253..000000000000 --- a/barretenberg/bootstrap_docker.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# This script builds the projects listed in build_mainifest.sh. - -set -eu - -COMMIT_HASH=$(git rev-parse HEAD) -source ./build-system/scripts/setup_env $COMMIT_HASH '' mainframe_$USER $(git rev-parse --show-toplevel) -build_local diff --git a/barretenberg/build-system b/barretenberg/build-system deleted file mode 160000 index a109f3aef28c..000000000000 --- a/barretenberg/build-system +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a109f3aef28cea4a50481cdf2d74fc3909212c0b diff --git a/barretenberg/build_manifest.json b/barretenberg/build_manifest.json deleted file mode 100644 index 564626daca9b..000000000000 --- a/barretenberg/build_manifest.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "barretenberg-x86_64-linux-clang": { - "buildDir": "cpp", - "dockerfile": "dockerfiles/Dockerfile.x86_64-linux-clang", - "rebuildPatterns": ["^cpp/"], - "dependencies": [] - }, - "barretenberg-x86_64-linux-clang-assert": { - "buildDir": "cpp", - "dockerfile": "dockerfiles/Dockerfile.x86_64-linux-clang-assert", - "rebuildPatterns": ["^cpp/"], - "dependencies": [] - }, - "barretenberg-x86_64-linux-clang-fuzzing": { - "buildDir": "cpp", - "dockerfile": "dockerfiles/Dockerfile.x86_64-linux-clang-fuzzing", - "rebuildPatterns": ["^cpp/"], - "dependencies": [] - }, - "barretenberg-x86_64-linux-gcc": { - "buildDir": "cpp", - "dockerfile": "dockerfiles/Dockerfile.x86_64-linux-gcc", - "rebuildPatterns": ["^cpp/"], - "dependencies": [] - }, - "barretenberg-wasm-linux-clang": { - "buildDir": "cpp", - "dockerfile": "dockerfiles/Dockerfile.wasm-linux-clang", - "rebuildPatterns": ["^cpp/"], - "dependencies": [] - }, - "barretenberg-circuits-x86_64-linux-clang-builder-runner": { - "buildDir": "cpp", - "dockerfile": "dockerfiles/Dockerfile.circuits-x86_64-linux-clang-builder-runner", - "rebuildPatterns": ["^cpp/"], - "dependencies": [] - }, - "barretenberg-circuits-wasm-linux-clang-builder-runner": { - "buildDir": "cpp", - "dockerfile": "dockerfiles/Dockerfile.circuits-wasm-linux-clang-builder-runner", - "rebuildPatterns": ["^cpp/"], - "dependencies": [] - }, - "bb.js": { - "buildDir": "ts", - "rebuildPatterns": ["^ts/"], - "dependencies": ["barretenberg-wasm-linux-clang"] - }, - "acir-tests": { - "buildDir": "acir_tests", - "rebuildPatterns": ["^acir_tests/"], - "dependencies": ["bb.js", "barretenberg-x86_64-linux-clang-assert"] - } -} diff --git a/barretenberg/build_manifest.sh b/barretenberg/build_manifest.sh deleted file mode 100755 index 5768303cf86b..000000000000 --- a/barretenberg/build_manifest.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# Source this file to define the PROJECTS variable, needed by build_local, used by bootstrap_docker.sh. -# -# PROJECT elements have structure PROJECT_DIR_NAME:WORKING_DIR:DOCKERFILE:REPO. -# PROJECT_DIR_NAME: Should reflect the projects directory name. -# WORKING_DIR: Everything within this directory is copied into the docker context (excluding paths in .dockerignore). -# DOCKERFILE: Defaults to Dockerfile. However some projects have multiple build Dockerfiles located in subdirs. -# REPO: Defaults to . The docker repository name, used to name the resulting docker image. -# -# This file tells bootstrap_docker.sh which and in which order to build projects for locally testing the docker builds. -# To check *most* of the build works as expected, we can just do the minimum to produce the e2e tests, and run them -# locally to check they work. Other projects can be *temporarily* uncommented to test their Dockerfiles, but don't -# commit them, so that the most important build path remains fast and simple. - -PROJECTS=( - cpp:cpp:./dockerfiles/Dockerfile.wasm-linux-clang:barretenberg-wasm-linux-clang - cpp:cpp:./dockerfiles/Dockerfile.x86_64-linux-clang-assert:barretenberg-x86_64-linux-clang-assert - ts:ts:./Dockerfile:bb.js - acir_tests:acir_tests:./Dockerfile:acir_tests -) diff --git a/barretenberg/cpp/.rebuild_patterns b/barretenberg/cpp/.rebuild_patterns index 0c13870647a0..24dc32bd6de9 100644 --- a/barretenberg/cpp/.rebuild_patterns +++ b/barretenberg/cpp/.rebuild_patterns @@ -1,3 +1,4 @@ ^barretenberg/.*\\.(cpp|cc|cxx|c\\+\\+|h|hpp|hxx|h\\+\\+|c|h|inl|inc|ipp|tpp|cmake)$ ^barretenberg/.*CMakeLists\\.txt$ -^barretenberg/.*Dockerfile.*$ \ No newline at end of file +^barretenberg/.*Dockerfile.*$ +^barretenberg/cpp/scripts/ diff --git a/barretenberg/cpp/CMakeLists.txt b/barretenberg/cpp/CMakeLists.txt index cca88d9a4427..057c6b325809 100644 --- a/barretenberg/cpp/CMakeLists.txt +++ b/barretenberg/cpp/CMakeLists.txt @@ -9,6 +9,13 @@ project( VERSION 0.7.10 # x-release-please-version LANGUAGES CXX C ) +# Insert version into `bb` config file +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/src/barretenberg/bb/config.hpp.in + ${CMAKE_CURRENT_SOURCE_DIR}/src/barretenberg/bb/config.hpp + @ONLY +) + option(DISABLE_ASM "Disable custom assembly" OFF) option(DISABLE_ADX "Disable ADX assembly variant" OFF) diff --git a/barretenberg/cpp/dockerfiles/Dockerfile.wasm-linux-clang b/barretenberg/cpp/dockerfiles/Dockerfile.wasm-linux-clang index c642b4a9a66c..bdcd6d3edc77 100644 --- a/barretenberg/cpp/dockerfiles/Dockerfile.wasm-linux-clang +++ b/barretenberg/cpp/dockerfiles/Dockerfile.wasm-linux-clang @@ -1,6 +1,5 @@ FROM ubuntu:lunar AS builder -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential wget git libssl-dev cmake ninja-build curl -RUN curl https://wasmtime.dev/install.sh -sSf | bash /dev/stdin --version v3.0.1 +RUN apt-get update && apt-get install -y build-essential git cmake ninja-build curl WORKDIR /usr/src/barretenberg/cpp COPY ./scripts/install-wasi-sdk.sh ./scripts/install-wasi-sdk.sh RUN ./scripts/install-wasi-sdk.sh @@ -18,4 +17,4 @@ COPY --from=builder /usr/src/barretenberg/cpp/build-wasm/lib/libbarretenberg.a / COPY --from=builder /usr/src/barretenberg/cpp/build-wasm/lib/libwasi.a /usr/src/barretenberg/cpp/build-wasm/lib/libwasi.a COPY --from=builder /usr/src/barretenberg/cpp/build-wasm/lib/libenv.a /usr/src/barretenberg/cpp/build-wasm/lib/libenv.a # Copy wasi-sdk so that consuming projects have the toolchain available. -COPY --from=builder /usr/src/barretenberg/cpp/src/wasi-sdk-20.0 /usr/src/barretenberg/cpp/src/wasi-sdk-20.0 \ No newline at end of file +COPY --from=builder /usr/src/barretenberg/cpp/src/wasi-sdk-20.0 /usr/src/barretenberg/cpp/src/wasi-sdk-20.0 diff --git a/barretenberg/cpp/docs/Fuzzing.md b/barretenberg/cpp/docs/Fuzzing.md index 7efc814e84cb..7dc3a6bde9f2 100644 --- a/barretenberg/cpp/docs/Fuzzing.md +++ b/barretenberg/cpp/docs/Fuzzing.md @@ -1,14 +1,18 @@ # Fuzzing barretenberg + ## Intro + We are gradually introducing fuzzing of various primitives into barretenberg, focusing first and foremost on in-cicruit types. If you are developing / patching a primitive and there is a fuzzer available for it, please take the time to update the fuzzer (if you've added new functionality) and run it for at least a few hours to increase security. ## Build To build with standard clang: + ```bash cmake --preset fuzzing cmake --build --preset fuzzing ``` + Fuzzing build turns off building tests and benchmarks, since they are incompatible with libfuzzer interface. To turn on address sanitizer add `-DADDRESS_SANITIZER=ON`. Note that address sanitizer can be used to explore crashes. @@ -27,35 +31,43 @@ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER= -DCMA ``` ## Currently supported -Currently we have fuzzers for bigfield, bit_array, bool, byte_array, field, safe_uint and uint. Each of them is available in 3 versions: StandardPlonk, TurboPlonk, ALL (differential fuzzing of 2 versions). + +Currently we have fuzzers for bigfield, bit_array, bool, byte_array, field, safe_uint and uint. Each of them is available in 2 versions: StandardPlonk, ALL (differential fuzzing of 2 versions). To compile all fuzzers just type `make`. + ## Running the fuzzer + TODO: add information about saved testcases You can simply run a fuzzer by executing the built executable, for example, + ```bash -./bin/stdlib_primitives_bigfield_turbo_fuzzer +./bin/stdlib_primitives_bigfield_standard_fuzzer ``` + This is useful if you added a feature/instruction or changed some logic and want to quickly test if there are any really bad bugs. To run the fuzzer seriously, I'd recommend: + ```bash mkdir ../../../_testcases; mkdir crashes; ./bin/ -timeout=1 -len_control=500 -workers=8 -jobs=8 -entropic=1 -shrink=1 -artifact_prefix=crashes/ -use_value_profile=1 ../../../_testcases ``` + You can watch the progress of the fuzzer in one of the generated logs fuzz-.log The purpose of each parameter: -+ -timeout=1 - If a testcase takes more than 1 second to execute, it will be treated as a crash -+ -len_control=500 - Slows down the increase of testcase size. Especially important for heavy classes like bigfield, keeps the number of executions per second at a decent rate -+ -worker=8 - The number of threads that can simultaneously execute testcases. Should be less or equal to the number of jobs -+ -jobs=8 - After how many crashes the fuzzer will stop fuzzing. If a crash is executed and the number of jobs is more than workers then the fuzzer will proceed to give the worker a new job. The 8/8 worker/job configuration ensures that the fuzzer will quit after 8 crashes and until the first crash all the workers are busy. -+ -entropic=1 - Entropic should be enabled by default, but in case it isn't, enable it. A better power schedule than the old one. -+ -shrink=1 - If a new testcase is encountered that has the same coverage as some previous one in the corpus and the testcase is smaller, replace the one in the corpus with the new one. Helps keep exec/s higher. -+ -artifact_prefix=crashes/ - Where to save crashes/timeouts/ooms. -+ -use_value_profile=1 - Leverage libfuzzer internal CMP analysis. Very useful, but blows the corpus up. -+ (../../../_testcases) - The path to the folder, where corpus testcases are going to be saved and loaded from (also loads testcases from there at the start of fuzzing). - -Log structure is described here https://llvm.org/docs/LibFuzzer.html + +- -timeout=1 - If a testcase takes more than 1 second to execute, it will be treated as a crash +- -len_control=500 - Slows down the increase of testcase size. Especially important for heavy classes like bigfield, keeps the number of executions per second at a decent rate +- -worker=8 - The number of threads that can simultaneously execute testcases. Should be less or equal to the number of jobs +- -jobs=8 - After how many crashes the fuzzer will stop fuzzing. If a crash is executed and the number of jobs is more than workers then the fuzzer will proceed to give the worker a new job. The 8/8 worker/job configuration ensures that the fuzzer will quit after 8 crashes and until the first crash all the workers are busy. +- -entropic=1 - Entropic should be enabled by default, but in case it isn't, enable it. A better power schedule than the old one. +- -shrink=1 - If a new testcase is encountered that has the same coverage as some previous one in the corpus and the testcase is smaller, replace the one in the corpus with the new one. Helps keep exec/s higher. +- -artifact_prefix=crashes/ - Where to save crashes/timeouts/ooms. +- -use_value_profile=1 - Leverage libfuzzer internal CMP analysis. Very useful, but blows the corpus up. +- (../../../\_testcases) - The path to the folder, where corpus testcases are going to be saved and loaded from (also loads testcases from there at the start of fuzzing). + +Log structure is described here https://llvm.org/docs/LibFuzzer.html If you've found an issue, stopped the fuzzer, you can minimize the corpus to get rid of repetitions and then start from a minimized corpus @@ -67,10 +79,12 @@ cp ../../../_testcases_minimized/* ../../../_testcases ``` If you've found a crash, you can minimize the crash to make the root cause more obvious: + ```bash mkdir minimized_crashes ./bin/ -minimize_crash=1 -artifact_prefix=minimized_crashes ``` + Also, both bigfield and safeuint fuzzer containt the SHOW_INFORMATION preprocessor cases, which enable the printing of instructions and values to make debugging the crash easier. # Coverage reports diff --git a/barretenberg/cpp/scripts/run_tests b/barretenberg/cpp/scripts/run_tests index 8c4ed35047ef..28d9f8cc4f8c 100755 --- a/barretenberg/cpp/scripts/run_tests +++ b/barretenberg/cpp/scripts/run_tests @@ -20,7 +20,8 @@ IMAGE_URI=$(calculate_image_uri $REPOSITORY) retry docker pull $IMAGE_URI # If there is a file in the scripts directory named $TESTS, those are the tests to run. -if [ -f "$(query_manifest projectDir $REPOSITORY)/scripts/$TESTS" ]; then +cd $(query_manifest projectDir $REPOSITORY)/scripts +if [ -f "$TESTS" ]; then TESTS=$(cat $TESTS | tr '\n' ' ') fi diff --git a/barretenberg/cpp/src/barretenberg/barretenberg.hpp b/barretenberg/cpp/src/barretenberg/barretenberg.hpp index 329f31bb1ca4..9ee9413e151a 100644 --- a/barretenberg/cpp/src/barretenberg/barretenberg.hpp +++ b/barretenberg/cpp/src/barretenberg/barretenberg.hpp @@ -24,7 +24,6 @@ #include "numeric/uint256/uint256.hpp" #include "plonk/proof_system/types/proof.hpp" #include "plonk/proof_system/verification_key/verification_key.hpp" -#include "proof_system/circuit_builder/turbo_circuit_builder.hpp" #include "proof_system/circuit_builder/ultra_circuit_builder.hpp" #include "proof_system/types/circuit_type.hpp" // TODO(https://github.com/AztecProtocol/barretenberg/issues/491): diff --git a/barretenberg/cpp/src/barretenberg/bb/.gitignore b/barretenberg/cpp/src/barretenberg/bb/.gitignore new file mode 100644 index 000000000000..d1a04366d843 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/bb/.gitignore @@ -0,0 +1 @@ +config.hpp \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/bb/config.hpp.in b/barretenberg/cpp/src/barretenberg/bb/config.hpp.in new file mode 100644 index 000000000000..1345e27971d4 --- /dev/null +++ b/barretenberg/cpp/src/barretenberg/bb/config.hpp.in @@ -0,0 +1,6 @@ +#ifndef INCLUDE_GUARD +#define INCLUDE_GUARD + +#define BB_VERSION "@CMAKE_PROJECT_VERSION@" + +#endif // INCLUDE_GUARD diff --git a/barretenberg/cpp/src/barretenberg/bb/main.cpp b/barretenberg/cpp/src/barretenberg/bb/main.cpp index 2eae122b471f..81c4a2bfb49a 100644 --- a/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -1,3 +1,4 @@ +#include "config.hpp" #include "get_bytecode.hpp" #include "get_crs.hpp" #include "get_witness.hpp" @@ -332,6 +333,17 @@ int main(int argc, char* argv[]) std::string vk_path = getOption(args, "-k", "./target/vk"); CRS_PATH = getOption(args, "-c", "./crs"); bool recursive = flagPresent(args, "-r") || flagPresent(args, "--recursive"); + + // Skip CRS initialization for any command which doesn't require the CRS. + if (command == "--version") { + writeStringToStdout(BB_VERSION); + return 0; + } else if (command == "info") { + std::string output_path = getOption(args, "-o", "info.json"); + acvmInfo(output_path); + return 0; + } + init(); if (command == "prove_and_verify") { @@ -355,9 +367,6 @@ int main(int argc, char* argv[]) } else if (command == "vk_as_fields") { std::string output_path = getOption(args, "-o", vk_path + "_fields.json"); vkAsFields(vk_path, output_path); - } else if (command == "info") { - std::string output_path = getOption(args, "-o", "info.json"); - acvmInfo(output_path); } else { std::cerr << "Unknown command: " << command << "\n"; return 1; diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/CMakeLists.txt index d9a995e7cfb8..3234668be52c 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/CMakeLists.txt @@ -1,6 +1,5 @@ # Each source represents a separate benchmark suite set(BENCHMARK_SOURCES -standard_honk.bench.cpp standard_plonk.bench.cpp ultra_honk.bench.cpp ultra_plonk.bench.cpp @@ -14,7 +13,7 @@ set(LINKED_LIBRARIES benchmark::benchmark ) -# Add executable and custom target for each suite, e.g. standard_honk_bench +# Add executable and custom target for each suite, e.g. ultra_honk_bench foreach(BENCHMARK_SOURCE ${BENCHMARK_SOURCES}) get_filename_component(BENCHMARK_NAME ${BENCHMARK_SOURCE} NAME_WE) # extract name without extension add_executable(${BENCHMARK_NAME}_bench main.bench.cpp ${BENCHMARK_SOURCE} benchmark_utilities.hpp) diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/benchmark_utilities.hpp b/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/benchmark_utilities.hpp index e2727fb5f17f..21e3513fd84c 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/benchmark_utilities.hpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/benchmark_utilities.hpp @@ -1,6 +1,5 @@ #include -#include "barretenberg/honk/composer/standard_composer.hpp" #include "barretenberg/honk/composer/ultra_composer.hpp" #include "barretenberg/proof_system/types/circuit_type.hpp" #include "barretenberg/stdlib/encryption/ecdsa/ecdsa.hpp" @@ -195,20 +194,11 @@ void construct_proof_with_specified_num_gates(State& state, test_circuit_function(builder, num_gates); auto composer = Composer(); - if constexpr (proof_system::IsAnyOf) { - auto instance = composer.create_instance(builder); - auto ext_prover = composer.create_prover(instance); - state.ResumeTiming(); - - // Construct proof - auto proof = ext_prover.construct_proof(); - } else { - auto ext_prover = composer.create_prover(builder); - state.ResumeTiming(); + auto ext_prover = composer.create_prover(builder); + state.ResumeTiming(); - // Construct proof - auto proof = ext_prover.construct_proof(); - } + // Construct proof + auto proof = ext_prover.construct_proof(); } } diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_to_plonk_standard.sh b/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_to_plonk_standard.sh deleted file mode 100755 index ad7ecc1f22d0..000000000000 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/compare_honk_to_plonk_standard.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# This script is used to compare the results of honk_bench between baseline (master) and -# the branch from which the script is run. Simply check out the branch of interest, ensure -# it is up to date with local master, and run the script. - -echo -e '\nComparing Standard Plonk/Honk benchmarks.' -# Set some directories -BASE_DIR="$HOME/barretenberg/cpp" -BUILD_DIR="$BASE_DIR/build-bench" -BENCH_RESULTS_DIR="$BASE_DIR/tmp_bench_results" -BENCH_TOOLS_DIR="$BUILD_DIR/_deps/benchmark-src/tools" - -# Install requirements (numpy + scipy) for comparison script if necessary. -# Note: By default, installation will occur in $HOME/.local/bin. -pip3 install --user -r $BUILD_DIR/_deps/benchmark-src/requirements.txt - -# Create temporary directory for honk_bench results (json) -cd $BASE_DIR -mkdir $BENCH_RESULTS_DIR - -# -echo -e '\nBuilding and running Standard benchmarks..' -# rm -rf $BUILD_DIR -cmake --preset bench > /dev/null && cmake --build --preset bench --target standard_plonk_bench -cd build-bench -PLONK_BENCH_RESULTS="$BENCH_RESULTS_DIR/plonk_bench.json" -./bin/standard_plonk_bench --benchmark_format=json > $PLONK_BENCH_RESULTS - -cd .. -cmake --preset bench > /dev/null && cmake --build --preset bench --target standard_honk_bench -cd build-bench -HONK_BENCH_RESULTS="$BENCH_RESULTS_DIR/honk_bench.json" -./bin/standard_honk_bench --benchmark_format=json > $HONK_BENCH_RESULTS - -# Call compare.py on the results (json) to get high level statistics. -# See docs at https://github.com/google/benchmark/blob/main/docs/tools.md for more details. -$BENCH_TOOLS_DIR/compare.py benchmarks $PLONK_BENCH_RESULTS $HONK_BENCH_RESULTS - -# # Delete the temporary results directory and its contents -rm -r $BENCH_RESULTS_DIR \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/honk.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/honk.bench.cpp deleted file mode 100644 index 87b8c5a2845a..000000000000 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/honk.bench.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "barretenberg/honk/composer/standard_composer.hpp" -#include "barretenberg/stdlib/primitives/field/field.hpp" -#include "barretenberg/stdlib/primitives/witness/witness.hpp" -#include -#include - -using namespace benchmark; -using namespace proof_system::plonk::stdlib; - -namespace standard_honk_bench { - -using Builder = proof_system::StandardCircuitBuilder; -using Composer = proof_system::honk::StandardComposer; - -constexpr size_t MIN_LOG_NUM_GATES = 16; -constexpr size_t MAX_LOG_NUM_GATES = 16; -// To get good statistics, number of Repetitions must be sufficient. ~30 Repetitions gives good results. -constexpr size_t NUM_REPETITIONS = 5; - -void generate_test_circuit(auto& builder, size_t num_gates) -{ - barretenberg::srs::init_crs_factory("../srs_db/ignition"); - field_t a(witness_t(&builder, barretenberg::fr::random_element())); - field_t b(witness_t(&builder, barretenberg::fr::random_element())); - field_t c(&builder); - for (size_t i = 0; i < (num_gates / 4) - 4; ++i) { - c = a + b; - c = a * c; - a = b * b; - b = c * c; - } -} - -/** - * @brief Benchmark: Creation of a Standard Honk prover - */ -void create_prover_standard(State& state) noexcept -{ - for (auto _ : state) { - state.PauseTiming(); - auto num_gates = 1 << (size_t)state.range(0); - auto builder = Builder(static_cast(num_gates)); - generate_test_circuit(builder, static_cast(num_gates)); - state.ResumeTiming(); - - auto composer = Composer(); - composer.create_prover(builder); - } -} -BENCHMARK(create_prover_standard)->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, 1)->Repetitions(NUM_REPETITIONS); - -/** - * @brief Benchmark: Construction of a Standard Honk proof - */ -void construct_proof_standard(State& state) noexcept -{ - auto num_gates = 1 << (size_t)state.range(0); - for (auto _ : state) { - state.PauseTiming(); - auto builder = Builder(static_cast(num_gates)); - generate_test_circuit(builder, static_cast(num_gates)); - - auto composer = Composer(); - auto ext_prover = composer.create_prover(builder); - state.ResumeTiming(); - - auto proof = ext_prover.construct_proof(); - } - state.SetComplexityN(num_gates); // Set up for computation of constant C where prover ~ C*N -} -BENCHMARK(construct_proof_standard) - ->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, 1) - ->Repetitions(NUM_REPETITIONS) - ->Complexity(oN); - -/** - * @brief Benchmark: Creation of a Standard Honk verifier - */ -void create_verifier_standard(State& state) noexcept -{ - for (auto _ : state) { - state.PauseTiming(); - auto num_gates = 1 << (size_t)state.range(0); - auto builder = Builder(static_cast(num_gates)); - generate_test_circuit(builder, static_cast(num_gates)); - state.ResumeTiming(); - - auto composer = Composer(); - composer.create_verifier(builder); - } -} -// BENCHMARK(create_verifier_standard)->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, -// 1)->Repetitions(NUM_REPETITIONS); - -/** - * @brief Benchmark: Verification of a Standard Honk proof - */ -void verify_proof_standard(State& state) noexcept -{ - for (auto _ : state) { - state.PauseTiming(); - auto num_gates = (size_t)state.range(0); - auto builder = Builder(static_cast(num_gates)); - generate_test_circuit(builder, static_cast(num_gates)); - - auto composer = Composer(); - auto prover = composer.create_prover(builder); - auto proof = prover.construct_proof(); - auto verifier = composer.create_verifier(builder); - state.ResumeTiming(); - - verifier.verify_proof(proof); - } -} -// BENCHMARK(verify_proof_standard)->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES, 1)->Iterations(1); -} // namespace standard_honk_bench \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/standard_honk.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/standard_honk.bench.cpp deleted file mode 100644 index 42fed512ffc7..000000000000 --- a/barretenberg/cpp/src/barretenberg/benchmark/honk_bench/standard_honk.bench.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "barretenberg/benchmark/honk_bench/benchmark_utilities.hpp" -#include "barretenberg/honk/composer/standard_composer.hpp" -#include "barretenberg/proof_system/circuit_builder/standard_circuit_builder.hpp" - -using namespace benchmark; - -namespace standard_honk_bench { - -using StandardBuilder = proof_system::StandardCircuitBuilder; -using StandardHonk = proof_system::honk::StandardComposer; - -// Log number of gates for test circuit -constexpr size_t MIN_LOG_NUM_GATES = bench_utils::BenchParams::MIN_LOG_NUM_GATES; -constexpr size_t MAX_LOG_NUM_GATES = bench_utils::BenchParams::MAX_LOG_NUM_GATES; -// Number of times to repeat each benchmark -constexpr size_t NUM_REPETITIONS = bench_utils::BenchParams::NUM_REPETITIONS; - -/** - * @brief Benchmark: Construction of a Standard proof for a circuit determined by the provided circuit function - */ -void construct_proof_standard(State& state, void (*test_circuit_function)(StandardBuilder&, size_t)) noexcept -{ - bench_utils::construct_proof_with_specified_num_gates(state, test_circuit_function); -} - -BENCHMARK_CAPTURE(construct_proof_standard, - arithmetic, - &bench_utils::generate_basic_arithmetic_circuit) - ->DenseRange(MIN_LOG_NUM_GATES, MAX_LOG_NUM_GATES) - ->Repetitions(NUM_REPETITIONS) - ->Unit(::benchmark::kSecond); - -} // namespace standard_honk_bench \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/CMakeLists.txt b/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/CMakeLists.txt index 7fd8082895c0..57f0eea70ee1 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/CMakeLists.txt +++ b/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/CMakeLists.txt @@ -10,7 +10,7 @@ set(LINKED_LIBRARIES benchmark::benchmark ) -# Add executable and custom target for each suite, e.g. standard_honk_bench +# Add executable and custom target for each suite, e.g. ultra_honk_bench foreach(BENCHMARK_SOURCE ${BENCHMARK_SOURCES}) get_filename_component(BENCHMARK_NAME ${BENCHMARK_SOURCE} NAME_WE) # extract name without extension add_executable(${BENCHMARK_NAME}_bench main.bench.cpp ${BENCHMARK_SOURCE}) diff --git a/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/relations.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/relations.bench.cpp index 362d5b15b6ca..df0be6fe25a2 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/relations.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/relations_bench/relations.bench.cpp @@ -1,7 +1,5 @@ #include "barretenberg/honk/flavor/goblin_ultra.hpp" -#include "barretenberg/honk/flavor/standard.hpp" #include "barretenberg/honk/flavor/ultra.hpp" -#include "barretenberg/proof_system/relations/arithmetic_relation.hpp" #include "barretenberg/proof_system/relations/auxiliary_relation.hpp" #include "barretenberg/proof_system/relations/ecc_op_queue_relation.hpp" #include "barretenberg/proof_system/relations/elliptic_relation.hpp" @@ -47,12 +45,6 @@ template void execute_relation(::benchmark: } } -void arithmetic_relation(::benchmark::State& state) noexcept -{ - execute_relation>(state); -} -BENCHMARK(arithmetic_relation); - void auxiliary_relation(::benchmark::State& state) noexcept { execute_relation>(state); @@ -83,11 +75,11 @@ void lookup_relation(::benchmark::State& state) noexcept } BENCHMARK(lookup_relation); -void permutation_relation(::benchmark::State& state) noexcept +void ultra_permutation_relation(::benchmark::State& state) noexcept { - execute_relation>(state); + execute_relation>(state); } -BENCHMARK(permutation_relation); +BENCHMARK(ultra_permutation_relation); void ultra_arithmetic_relation(::benchmark::State& state) noexcept { diff --git a/barretenberg/cpp/src/barretenberg/common/fuzzer.hpp b/barretenberg/cpp/src/barretenberg/common/fuzzer.hpp index 2aa56914080b..2e56c71afa98 100644 --- a/barretenberg/cpp/src/barretenberg/common/fuzzer.hpp +++ b/barretenberg/cpp/src/barretenberg/common/fuzzer.hpp @@ -1,7 +1,6 @@ #pragma once #include "barretenberg/numeric/uint256/uint256.hpp" #include "barretenberg/proof_system/circuit_builder/standard_circuit_builder.hpp" -#include "barretenberg/proof_system/circuit_builder/turbo_circuit_builder.hpp" #include // NOLINTBEGIN(cppcoreguidelines-macro-usage, google-runtime-int) @@ -680,7 +679,7 @@ class ArithmeticFuzzHelper { }; template