From 824aa8ab9d5c5f6b1b69c35a40eb7e0735ab1f23 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Thu, 5 Sep 2024 21:57:00 +0100 Subject: [PATCH] chore(ci): skip vk generation on `protocol-circuits-gates-report` and `noir-format` (#8398) We're currently generating the verification keys for the protocol circuits in order to run the formatter on them and count the number of gates in the circuit. This is then much slower than it needs to be when we change the noir compiler/barretenberg such that the vk changes. This PR moves these targets to pull from the `+source` rather than `+build-protocol-circuits` target so we can avoid this. --- noir-projects/Earthfile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/noir-projects/Earthfile b/noir-projects/Earthfile index f3e05320ff2..7a3b55ef995 100644 --- a/noir-projects/Earthfile +++ b/noir-projects/Earthfile @@ -5,8 +5,6 @@ source: # Install nargo COPY ../noir/+nargo/nargo /usr/bin/nargo - # Install bb - COPY ../barretenberg/cpp/+preset-release/bin/bb /usr/src/barretenberg/cpp/build/bin/bb WORKDIR /usr/src/noir-projects @@ -33,6 +31,9 @@ build-protocol-circuits: FROM +source RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY mkdir -p ~/.aws && \ bash -c 'echo -e "[default]\naws_access_key_id=$AWS_ACCESS_KEY_ID\naws_secret_access_key=$AWS_SECRET_ACCESS_KEY" > ~/.aws/credentials' + + # Install bb + COPY ../barretenberg/cpp/+preset-release/bin/bb /usr/src/barretenberg/cpp/build/bin/bb RUN yarn RUN cd noir-protocol-circuits && BB_HASH=$bb_source_hash NARGO=nargo ./bootstrap.sh SAVE ARTIFACT noir-protocol-circuits @@ -43,6 +44,9 @@ build-mock-protocol-circuits: FROM +source RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY mkdir -p ~/.aws && \ bash -c 'echo -e "[default]\naws_access_key_id=$AWS_ACCESS_KEY_ID\naws_secret_access_key=$AWS_SECRET_ACCESS_KEY" > ~/.aws/credentials' + + # Install bb + COPY ../barretenberg/cpp/+preset-release/bin/bb /usr/src/barretenberg/cpp/build/bin/bb RUN yarn RUN cd mock-protocol-circuits && BB_HASH=$bb_source_hash NARGO=nargo ./bootstrap.sh SAVE ARTIFACT mock-protocol-circuits @@ -87,9 +91,10 @@ test: NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --silence-warnings --oracle-resolver http://localhost:8080 format: - FROM +build + FROM +source WORKDIR /usr/src/noir-projects/noir-protocol-circuits + RUN yarn && node ./generate_variants.js RUN nargo fmt --check WORKDIR /usr/src/noir-projects/mock-protocol-circuits @@ -102,13 +107,16 @@ format: RUN nargo fmt --check gates-report: - FROM +build-protocol-circuits + FROM +source WORKDIR /usr/src/noir-projects - COPY ./gates_report.sh ./gates_report.sh - COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb - + # Install bb + COPY ../barretenberg/cpp/+preset-release/bin/bb /usr/src/barretenberg/cpp/build/bin/bb ENV BB_BIN /usr/src/barretenberg/cpp/build/bin/bb + + RUN cd noir-protocol-circuits && yarn && node ./generate_variants.js && nargo compile --silence-warnings + + COPY ./gates_report.sh ./gates_report.sh RUN ./gates_report.sh SAVE ARTIFACT ./noir-protocol-circuits/gates_report.json gates_report.json