Skip to content

Commit

Permalink
feat: Sync from noir (#7170)
Browse files Browse the repository at this point in the history
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: add back Pedersen blackbox functions (revert PR 5221)
(noir-lang/noir#5318)
fix: skip emission of brillig calls which will never be executed
(noir-lang/noir#5314)
feat: Make macros operate on token streams instead of AST nodes
(noir-lang/noir#5301)
chore: Bundle SSA Evaluator Options
(noir-lang/noir#5317)
fix: Replace panic in monomorphization with an error
(noir-lang/noir#5305)
fix(nargo_fmt): Account for spaces before the generic list of a function
(noir-lang/noir#5303)
fix: update `in_contract` flag before handling function metadata in
elaborator (noir-lang/noir#5292)
fix: fix incorrect return type being applied to stdlib functions
`modulus_be_bytes()`, `modulus_be_bits()`, etc.
(noir-lang/noir#5278)
chore: refactor test case generation in build.rs
(noir-lang/noir#5280)
fix: handle struct with nested arrays in oracle return values
(noir-lang/noir#5244)
feat: build simple dictionary from inspecting ACIR program
(noir-lang/noir#5264)
fix: Add more thorough check for whether a type is valid when passing it
from constrained code to unconstrained code
(noir-lang/noir#5009)
chore: Pedersen commitment in Noir
(noir-lang/noir#5221)
chore: pedersen hash in Noir
(noir-lang/noir#5217)
fix: Don't lazily elaborate functions
(noir-lang/noir#5282)
fix: avoid unnecessarily splitting expressions with multiplication terms
with a shared term (noir-lang/noir#5291)
fix: avoid duplicating constant arrays
(noir-lang/noir#5287)
feat: add fuzzer for Noir programs
(noir-lang/noir#5251)
feat: Run `comptime` code from annotations on a type definition
(noir-lang/noir#5256)
feat: implement comptime support for `as_slice` builtin
(noir-lang/noir#5276)
chore: create separate crate just for noir artifacts
(noir-lang/noir#5162)
feat: add support for wildcard types
(noir-lang/noir#5275)
chore: replace logical operators with bitwise in `DebugToString`
(noir-lang/noir#5236)
fix: use proper serialization in `AbiValue`
(noir-lang/noir#5270)
chore: simplify compilation flow to write to file immediately
(noir-lang/noir#5265)
feat: implement comptime support for `array_len` builtin
(noir-lang/noir#5272)
chore: Use the elaborator by default
(noir-lang/noir#5246)
chore: Release Noir(0.31.0)
(noir-lang/noir#5166)
feat!: remove `dep::` prefix
(noir-lang/noir#4946)
feat: Sync from aztec-packages
(noir-lang/noir#5242)
chore: replace `is_bn254` implementation to not rely on truncation of
literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations
(noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values
(noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2
(noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec`
(noir-lang/noir#5241)
fix: Disable `if` optimization
(noir-lang/noir#5240)
chore: redo typo PR by dropbigfish
(noir-lang/noir#5234)
chore: add property tests for ABI encoding
(noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen
(noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages
(noir-lang/noir#5235)
chore(docs): fixing trailing slash issue
(noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles
(noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator
(noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes
(noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error
(noir-lang/noir#5225)
chore: fixing all relative paths
(noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver`
(noir-lang/noir#5218)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <[email protected]>
Co-authored-by: TomAFrench <[email protected]>
  • Loading branch information
3 people authored Jun 27, 2024
1 parent eb00830 commit ed815a3
Show file tree
Hide file tree
Showing 452 changed files with 13,589 additions and 1,518 deletions.
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2e543b40eb83ef2080e4d8f870f525fadd631099
f2f8ecc833d4725d0829f9c339389c90d1a4fbcd
20 changes: 10 additions & 10 deletions avm-transpiler/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion avm-transpiler/scripts/compile_then_transpile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi
shift # remove the compile arg so we can inject --show-artifact-paths

# Forward all arguments to nargo, tee output to console
artifacts_to_transpile=$($NARGO compile --show-artifact-paths $@ | tee /dev/tty | grep -oP 'Saved contract artifact to: \K.*')
artifacts_to_transpile=$($NARGO compile --use-legacy --show-artifact-paths $@ | tee /dev/tty | grep -oP 'Saved contract artifact to: \K.*')

# NOTE: the output that is teed to /dev/tty will normally not be redirectable by the caller.
# If the script is run via docker, however, the user will see this output on stdout and will be able to redirect.
Expand Down
2 changes: 1 addition & 1 deletion boxes/boxes/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"main": "./dist/index.js",
"scripts": {
"compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile --silence-warnings",
"compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile --use-legacy --silence-warnings",
"codegen": "${AZTEC_BUILDER:-aztec-builder} codegen src/contracts/target -o artifacts",
"clean": "rm -rf ./dist .tsbuildinfo ./artifacts ./src/contracts/target",
"prep": "yarn clean && yarn compile && yarn codegen",
Expand Down
2 changes: 1 addition & 1 deletion boxes/boxes/vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "0.1.0",
"type": "module",
"scripts": {
"compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile --silence-warnings",
"compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile --use-legacy --silence-warnings",
"codegen": "${AZTEC_BUILDER:-aztec-builder} codegen src/contracts/target -o artifacts",
"clean": "rm -rf ./dest .tsbuildinfo ./artifacts ./src/contracts/target",
"prep": "yarn clean && yarn compile && yarn codegen && tsc -b",
Expand Down
2 changes: 1 addition & 1 deletion noir-projects/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN ./bootstrap.sh
WORKDIR /usr/src/noir-projects/noir-protocol-circuits
RUN ./bootstrap.sh
WORKDIR /usr/src/noir-projects/aztec-nr
RUN nargo compile --silence-warnings
RUN nargo compile --use-legacy --silence-warnings

FROM scratch
COPY --from=builder /usr/src/noir-projects /usr/src/noir-projects
6 changes: 3 additions & 3 deletions noir-projects/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ WORKDIR /usr/src/noir-projects
COPY . .

# Build & test
RUN cd ./noir-protocol-circuits && ./bootstrap.sh && nargo test --silence-warnings
RUN cd ./noir-protocol-circuits && ./bootstrap.sh && nargo test --use-legacy --silence-warnings

RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \
# Wait for TXE to initialize
sleep 5 && \
cd ./noir-contracts && \
# We need to increase the timeout since all tests running in parallel hammer TXE at the same time, and processing slows down leading to timeouts
# The only way we currently have to batch tests is via RAYON_NUM_THREADS, which is not ideal
./bootstrap.sh && NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \
./bootstrap.sh && NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --use-legacy --silence-warnings --oracle-resolver http://localhost:8080 ; \
kill $(cat /tmp/txe.pid)

RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \
# Wait for TXE to initialize
sleep 5 && \
cd ./aztec-nr && \
nargo test --silence-warnings --oracle-resolver http://localhost:8080
nargo test --use-legacy --silence-warnings --oracle-resolver http://localhost:8080
4 changes: 2 additions & 2 deletions noir-projects/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test:
RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \
# Wait for TXE to initialize
sleep 5 && \
cd /usr/src/noir-projects/aztec-nr && nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \
cd /usr/src/noir-projects/aztec-nr && nargo test --use-legacy --silence-warnings --oracle-resolver http://localhost:8080 ; \
kill $(cat /tmp/txe.pid)

RUN cd /usr/src/yarn-project/txe && yarn start & echo $! > /tmp/txe.pid && \
Expand All @@ -61,7 +61,7 @@ test:
cd /usr/src/noir-projects/noir-contracts && \
# We need to increase the timeout since all tests running in parallel hammer TXE at the same time and processing slows down, leading to timeouts
# The only way we currently have to batch tests is via RAYON_NUM_THREADS, which is not ideal
NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --silence-warnings --oracle-resolver http://localhost:8080 ; \
NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --use-legacy --silence-warnings --oracle-resolver http://localhost:8080 ; \
kill $(cat /tmp/txe.pid)

format:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct UnconstrainedContext {
}

impl UnconstrainedContext {
fn new() -> Self {
unconstrained fn new() -> Self {
// We could call these oracles on the getters instead of at creation, which makes sense given that they might
// not even be accessed. However any performance gains are minimal, and we'd rather fail early if a user
// incorrectly attempts to create an UnconstrainedContext in an environment in which these oracles are not
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ unconstrained fn get_contract_instance_internal(address: AztecAddress) -> [Field
get_contract_instance_oracle(address)
}

unconstrained fn get_contract_instance_internal_avm(address: AztecAddress) -> [Field; CONTRACT_INSTANCE_LENGTH + 1] {
unconstrained pub fn get_contract_instance_internal_avm(address: AztecAddress) -> [Field; CONTRACT_INSTANCE_LENGTH + 1] {
get_contract_instance_oracle_avm(address)
}

Expand Down
2 changes: 1 addition & 1 deletion noir-projects/noir-contracts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fi

echo "Compiling contracts..."
NARGO=${NARGO:-../../noir/noir-repo/target/release/nargo}
$NARGO compile --silence-warnings
$NARGO compile --silence-warnings --use-legacy

echo "Transpiling contracts..."
scripts/transpile.sh
2 changes: 1 addition & 1 deletion noir-projects/noir-protocol-circuits/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ node ./index.js

echo "Compiling protocol circuits..."
NARGO=${NARGO:-../../noir/noir-repo/target/release/nargo}
$NARGO compile --silence-warnings
$NARGO compile --silence-warnings --use-legacy
4 changes: 2 additions & 2 deletions noir/noir-repo/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
".": "0.30.0",
"acvm-repo": "0.46.0"
".": "0.31.0",
"acvm-repo": "0.47.0"
}
Loading

0 comments on commit ed815a3

Please sign in to comment.