Skip to content

Commit

Permalink
chore(ci): skip vk generation on protocol-circuits-gates-report and…
Browse files Browse the repository at this point in the history
… `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.
  • Loading branch information
TomAFrench authored Sep 5, 2024
1 parent 1c1d35a commit 824aa8a
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions noir-projects/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 824aa8a

Please sign in to comment.