Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(acir)!: Program and witness stack structure #5149

Merged
merged 160 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
71998b8
call opcode and serialization
vezenovm Feb 26, 2024
d081ecc
uncomment serde in test:
vezenovm Feb 26, 2024
a70156e
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 4, 2024
dcb6d9e
pass noir fmt and clippy
vezenovm Mar 4, 2024
d822483
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 4, 2024
2376e16
fixup call comments
vezenovm Mar 4, 2024
10195f3
resovle merge conflcits w/ master'
vezenovm Mar 4, 2024
0792a08
cargo fmt
vezenovm Mar 4, 2024
9be6881
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 4, 2024
4c7f82e
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 6, 2024
96a719c
program and witness stack structure and respective serialization
vezenovm Mar 6, 2024
288a7ec
a little cleanup
vezenovm Mar 6, 2024
1f65f18
cargo fmt
vezenovm Mar 6, 2024
0dc8b38
fmt and clippy
vezenovm Mar 6, 2024
e602ecd
update avm-transpiler to handle new program structure
vezenovm Mar 6, 2024
c3d825d
import correct witness hpp file
vezenovm Mar 6, 2024
cd27e74
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 6, 2024
695d85e
Merge branch 'mv/acir-call-opcode' into mv/program-wit-stack-serialize
vezenovm Mar 6, 2024
e1757fd
serialize Program in acvm_js
vezenovm Mar 6, 2024
ba1369e
Merge remote-tracking branch 'origin/mv/program-wit-stack-serialize' …
vezenovm Mar 6, 2024
4c357ac
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 6, 2024
ad8129b
update public witness methods in acvm_js
vezenovm Mar 7, 2024
1dac703
add necessary clone
vezenovm Mar 7, 2024
14cea93
remove unused import
vezenovm Mar 7, 2024
fc7c8b7
updated serialization
vezenovm Mar 7, 2024
e45f50d
Merge branch 'mv/acir-call-opcode' into mv/program-wit-stack-serialize
TomAFrench Mar 7, 2024
3ac2c53
Merge branch 'master' into mv/acir-call-opcode
TomAFrench Mar 7, 2024
299d0dd
Merge branch 'mv/acir-call-opcode' into mv/program-wit-stack-serialize
TomAFrench Mar 7, 2024
9ceee33
compress wit correctly in noir js
vezenovm Mar 7, 2024
6d08e8a
change back to pinned bb.js
vezenovm Mar 7, 2024
d3b5032
update witness compression test
vezenovm Mar 8, 2024
94b4739
update Dockerfiles
vezenovm Mar 8, 2024
c01aa62
switch order of noir tests
vezenovm Mar 8, 2024
2023556
bb js before noir in the config file
vezenovm Mar 8, 2024
3a31504
specify bb.js dep
vezenovm Mar 8, 2024
0b5ab14
remove unnecessary prints
vezenovm Mar 8, 2024
babb483
uncomment one e2e test
vezenovm Mar 11, 2024
127e03f
remove old comment and try bootstrap_packages
vezenovm Mar 11, 2024
111089e
yarn inside bb ts
vezenovm Mar 11, 2024
4e361fe
appropriately serialize program for smart contract
vezenovm Mar 11, 2024
6905b96
disable simple_verifier_codegen in aztec_packages native CI
vezenovm Mar 11, 2024
6ddfd30
bring back install playwright for CI
vezenovm Mar 11, 2024
2b1639a
fix simple_verifier_codegen nextest expr
vezenovm Mar 11, 2024
a755f8a
and not or
vezenovm Mar 11, 2024
3b2a7e4
passing hardcoded contracts
vezenovm Mar 12, 2024
24749d9
skip recursion in acir tests
vezenovm Mar 12, 2024
5ce2b3e
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 12, 2024
c6cc631
merge conflicts w/ master
vezenovm Mar 12, 2024
d6707ca
Revert "merge conflicts w/ master"
vezenovm Mar 12, 2024
7748098
Reapply "merge conflicts w/ master"
vezenovm Mar 12, 2024
a2c7297
rearrange config
vezenovm Mar 12, 2024
de216d6
clippy
vezenovm Mar 12, 2024
fdae079
remove old import in transpiler
vezenovm Mar 12, 2024
0d6ed9d
add packages dep
vezenovm Mar 12, 2024
45040e4
bootstrap packages in packages-test
vezenovm Mar 12, 2024
441942e
upate circuits.js and protocol-contracts artifacts
vezenovm Mar 12, 2024
20d58ac
increase timeout
vezenovm Mar 12, 2024
a5b7d09
more timeout increase
vezenovm Mar 12, 2024
6ec4afd
dont bootstrap in packages tests
vezenovm Mar 12, 2024
a8ccd5c
remove noir-packages dep
vezenovm Mar 12, 2024
0c78c33
need packages dep in packages.test
vezenovm Mar 12, 2024
27359e8
test inrease counter timeout
vezenovm Mar 12, 2024
1d04bdb
switch order of config
vezenovm Mar 12, 2024
8ac7d2c
move acir tests after bberg in config
vezenovm Mar 12, 2024
a7ce531
bring back test
vezenovm Mar 12, 2024
576f092
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 12, 2024
ac72a93
fix native acvm cli interface
vezenovm Mar 12, 2024
9217b4a
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 12, 2024
1407de4
empty
vezenovm Mar 13, 2024
671cb93
yarn formatting
vezenovm Mar 13, 2024
b7f6609
acvm cli error update
vezenovm Mar 13, 2024
352c335
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 13, 2024
9624796
merge conflcits w/ parent
vezenovm Mar 13, 2024
9350526
yarn lock
vezenovm Mar 13, 2024
52b3773
update yarn lock
vezenovm Mar 13, 2024
88ad6cd
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 13, 2024
6177b62
update noir-pacakges to be dependent
vezenovm Mar 13, 2024
0ffc638
merge conflcits
vezenovm Mar 13, 2024
4bb76b6
update snapshots
vezenovm Mar 13, 2024
1200597
try pinned bb.js-dev
vezenovm Mar 13, 2024
42485d5
try linked bb.js
vezenovm Mar 13, 2024
25b3f4f
update bb.js path
vezenovm Mar 13, 2024
e02a4bc
move nargo backend path env set
vezenovm Mar 13, 2024
9180274
echo path
vezenovm Mar 13, 2024
914af07
use main.js and some of DSL readme
vezenovm Mar 13, 2024
c351300
update gitignore
vezenovm Mar 13, 2024
a418cb4
updated readme
vezenovm Mar 13, 2024
b665ff7
remove commitment to contracts
vezenovm Mar 13, 2024
a094e24
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 13, 2024
90cd0cf
cleanup
vezenovm Mar 13, 2024
a4d7ace
clippy
vezenovm Mar 13, 2024
210569f
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 13, 2024
dbfdb07
merge conflicts new snaps
vezenovm Mar 13, 2024
accc62a
empty
vezenovm Mar 13, 2024
db9eac3
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 13, 2024
15d7622
Merge branch 'mv/acir-call-opcode' into mv/program-wit-stack
vezenovm Mar 13, 2024
c9d5fa6
empty
vezenovm Mar 13, 2024
c786c7d
build all bb in config before noir-packages
vezenovm Mar 13, 2024
bc13ebe
fix yml indent
vezenovm Mar 13, 2024
1e59a4c
update snapshots in yarn project
vezenovm Mar 13, 2024
204ec20
change back to original timeouts
vezenovm Mar 13, 2024
0be14a1
more readme updates
vezenovm Mar 13, 2024
4ee6462
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 14, 2024
cf7cb11
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 14, 2024
99bee54
Update noir/noir-repo/acvm-repo/acvm_js/src/compression.rs
vezenovm Mar 14, 2024
9a57443
Update noir/noir-repo/acvm-repo/acvm_js/src/execute.rs
vezenovm Mar 14, 2024
f5327b7
Update noir/noir-repo/acvm-repo/acvm_js/src/public_witness.rs
vezenovm Mar 14, 2024
8612d41
Update noir/noir-repo/acvm-repo/acvm_js/src/public_witness.rs
vezenovm Mar 14, 2024
246adb2
rename remaining vars to
vezenovm Mar 14, 2024
61387df
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 14, 2024
5bc6d2f
add comment to witness_compression
vezenovm Mar 14, 2024
fc84eb6
merge conflcits w/ snapshots
vezenovm Mar 14, 2024
8c4fcde
update snapshots'
vezenovm Mar 14, 2024
9818d7e
fixup readme
vezenovm Mar 14, 2024
b515cf5
Merge branch 'master' into mv/acir-call-opcode
vezenovm Mar 14, 2024
cf91d52
Merge branch 'mv/acir-call-opcode' into mv/program-wit-stack
vezenovm Mar 14, 2024
fc4a158
re-run serde for acir after bad merge
vezenovm Mar 14, 2024
722b7dc
Merge remote-tracking branch 'origin/mv/program-wit-stack' into mv/pr…
vezenovm Mar 14, 2024
9ebf404
chore: add dependency on bb.js job to noir-packages jobs
TomAFrench Mar 14, 2024
aa6c430
chore: fix job name
TomAFrench Mar 14, 2024
d1c4bee
chore: `noir-packages-tests` depends on `noir-packages`
TomAFrench Mar 14, 2024
301f4b8
chore: modified wrong job
TomAFrench Mar 14, 2024
2df6fbd
merge conflcits after call opcode put in master
vezenovm Mar 18, 2024
c41b403
updated snapshots
vezenovm Mar 18, 2024
9f566ca
Merge branch 'master' into mv/program-wit-stack
vezenovm Mar 18, 2024
49523c0
fix bad acir.cpp
vezenovm Mar 18, 2024
c94e520
merge conflilcts w/ master
vezenovm Mar 18, 2024
cdae556
update snaps
vezenovm Mar 18, 2024
231a500
noir-compile-acir-tests to bb tests sol
vezenovm Mar 18, 2024
2803b20
copy bb.js in earthfile
vezenovm Mar 18, 2024
f767793
missing a FROM
vezenovm Mar 18, 2024
159b895
switch where copy is done in Earthfile
vezenovm Mar 18, 2024
6d4436f
copy what yarn project does
vezenovm Mar 18, 2024
8fbac37
update link
vezenovm Mar 18, 2024
a55ed45
breaking changes from master again
vezenovm Mar 18, 2024
aacbd24
updated acir serde
vezenovm Mar 18, 2024
bb3027d
update snaps
vezenovm Mar 18, 2024
853d005
link in earthly
vezenovm Mar 18, 2024
d9c71f7
go back to what yarn-project does
vezenovm Mar 18, 2024
7821f84
Merge branch 'master' into mv/program-wit-stack
vezenovm Mar 18, 2024
1fa4732
get earthly noir packages working
vezenovm Mar 18, 2024
8bee903
Merge remote-tracking branch 'origin/mv/program-wit-stack' into mv/pr…
vezenovm Mar 18, 2024
20f7b88
specify using /build
vezenovm Mar 18, 2024
6830ae8
Merge branch 'master' into mv/program-wit-stack
vezenovm Mar 18, 2024
1e8693d
Merge branch 'master' into mv/program-wit-stack
vezenovm Mar 18, 2024
7bb56c2
Merge branch 'master' into mv/program-wit-stack
vezenovm Mar 19, 2024
4c37b4b
Update noir/noir-repo/acvm-repo/acvm_js/src/execute.rs
vezenovm Mar 19, 2024
72157ca
handle edge cases for program to circuit in acvm_js
vezenovm Mar 19, 2024
3230eef
use mem take
vezenovm Mar 19, 2024
fdcabd9
Merge branch 'master' into mv/program-wit-stack
vezenovm Mar 19, 2024
fb75544
cargo fmt
vezenovm Mar 19, 2024
223b3c8
misnamed field
vezenovm Mar 19, 2024
4cdefa7
remove old comment
vezenovm Mar 19, 2024
33c90fd
use into on err
vezenovm Mar 19, 2024
b085914
use JsString for public_witness in acvm_js
vezenovm Mar 19, 2024
45ca74c
Update noir/noir-repo/tooling/nargo/src/ops/optimize.rs
TomAFrench Mar 19, 2024
004fe2c
Update noir/noir-repo/tooling/nargo/src/ops/optimize.rs
TomAFrench Mar 19, 2024
3ea3cc1
Update noir/noir-repo/tooling/nargo/src/ops/optimize.rs
TomAFrench Mar 19, 2024
2a07951
remove extra expression_width param passed to optimize
vezenovm Mar 19, 2024
ef33716
merge conflicts
vezenovm Mar 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
229 changes: 117 additions & 112 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,103 +92,6 @@ jobs:
- continuation/continue:
configuration_path: .circleci/generated_config.yml

# Noir
noir-x86_64:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir 32
aztec_manifest_key: noir

noir-arm64:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir 32 arm64
aztec_manifest_key: noir

noir-ecr-manifest:
machine:
image: default
resource_class: medium
steps:
- *checkout
- *setup_env
- run:
name: "Create ECR manifest"
command: create_ecr_manifest noir x86_64,arm64
aztec_manifest_key: noir

noir-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir-tests 32
aztec_manifest_key: noir-tests

noir-packages:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir-packages 32
aztec_manifest_key: noir-packages

noir-packages-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir-packages-tests 32
aztec_manifest_key: noir-packages-tests

noir-compile-acir-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir-compile-acir-tests 32
aztec_manifest_key: noir-compile-acir-tests

avm-transpiler:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build avm-transpiler 32
aztec_manifest_key: avm-transpiler

# Barretenberg
barretenberg-wasm-linux-clang:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This order was changed as we now portal bb.js in noir_js_backend_barretenberg in order to get CI fully passing on aztec-packages. We just will not be able to sync to Noir until we do a bb.js release

docker:
Expand Down Expand Up @@ -356,7 +259,19 @@ jobs:
command: cond_spot_run_test barretenberg-x86_64-linux-clang-assert 32 ./scripts/run_tests 3 stdlib_plonk_recursion_tests --gtest_filter=-*turbo*
aztec_manifest_key: barretenberg-x86_64-linux-clang-assert

barretenberg-acir-tests-bb:
bb-js:
machine:
image: default
resource_class: large
steps:
- *checkout
- *setup_env
- run:
name: "Build and test"
command: build bb.js
aztec_manifest_key: bb.js

bb-js-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
Expand All @@ -365,34 +280,119 @@ jobs:
- *setup_env
- run:
name: "Build and test"
command: cond_spot_run_build barretenberg-acir-tests-bb 32
aztec_manifest_key: barretenberg-acir-tests-bb
command: cond_spot_run_test bb.js 32 ./scripts/run_tests
aztec_manifest_key: bb.js

# Noir
noir-x86_64:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir 32
aztec_manifest_key: noir

barretenberg-acir-tests-bb-sol:
noir-arm64:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build and test"
command: cond_spot_run_build barretenberg-acir-tests-bb-sol 32
aztec_manifest_key: barretenberg-acir-tests-bb-sol
name: "Build"
command: cond_spot_run_build noir 32 arm64
aztec_manifest_key: noir

bb-js:
noir-ecr-manifest:
machine:
image: default
resource_class: large
resource_class: medium
steps:
- *checkout
- *setup_env
- run:
name: "Create ECR manifest"
command: create_ecr_manifest noir x86_64,arm64
aztec_manifest_key: noir

noir-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir-tests 32
aztec_manifest_key: noir-tests

noir-packages:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir-packages 32
aztec_manifest_key: noir-packages

noir-packages-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir-packages-tests 32
aztec_manifest_key: noir-packages-tests

noir-compile-acir-tests:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build noir-compile-acir-tests 32
aztec_manifest_key: noir-compile-acir-tests

avm-transpiler:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build"
command: cond_spot_run_build avm-transpiler 32
aztec_manifest_key: avm-transpiler

barretenberg-acir-tests-bb:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Build and test"
command: build bb.js
aztec_manifest_key: bb.js
command: cond_spot_run_build barretenberg-acir-tests-bb 32
aztec_manifest_key: barretenberg-acir-tests-bb

bb-js-tests:
barretenberg-acir-tests-bb-sol:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
Expand All @@ -401,8 +401,8 @@ jobs:
- *setup_env
- run:
name: "Build and test"
command: cond_spot_run_test bb.js 32 ./scripts/run_tests
aztec_manifest_key: bb.js
command: cond_spot_run_build barretenberg-acir-tests-bb-sol 32
aztec_manifest_key: barretenberg-acir-tests-bb-sol

bb-js-acir-tests:
docker:
Expand Down Expand Up @@ -1272,10 +1272,14 @@ workflows:
- noir-arm64
<<: *defaults
- noir-tests: *defaults
- noir-packages: *defaults
- noir-packages:
requires:
- bb-js
<<: *defaults
- noir-packages-tests:
requires:
- noir-ecr-manifest
- noir-packages
<<: *defaults
- noir-compile-acir-tests:
requires:
Expand Down Expand Up @@ -1305,6 +1309,7 @@ workflows:
- barretenberg-acir-tests-bb-sol:
requires:
- barretenberg-x86_64-linux-clang-sol
- noir-compile-acir-tests
<<: *bb_acir_tests
- barretenberg-docs: *defaults
- bb-js:
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
"C_Cpp.default.includePath": ["barretenberg/cpp/src"],
"rust-analyzer.linkedProjects": [
"noir/noir-repo/Cargo.toml",
"noir/noir-repo/acvm-repo/acvm_js/Cargo.toml",
"avm-transpiler/Cargo.toml"
]
}
12 changes: 6 additions & 6 deletions avm-transpiler/src/transpile_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use log::info;
use regex::Regex;
use serde::{Deserialize, Serialize};

use acvm::acir::circuit::Circuit;
use acvm::acir::circuit::Program;

use crate::transpile::brillig_to_avm;
use crate::utils::extract_brillig_from_acir;
Expand Down Expand Up @@ -55,10 +55,10 @@ pub struct AcirContractFunction {
pub custom_attributes: Vec<String>,
pub abi: serde_json::Value,
#[serde(
serialize_with = "Circuit::serialize_circuit_base64",
deserialize_with = "Circuit::deserialize_circuit_base64"
serialize_with = "Program::serialize_program_base64",
deserialize_with = "Program::deserialize_program_base64"
)]
pub bytecode: Circuit,
pub bytecode: Program,
pub debug_symbols: serde_json::Value,
}

Expand Down Expand Up @@ -88,8 +88,8 @@ impl From<CompiledAcirContract> for TranspiledContract {
function.name, contract.name
);
// Extract Brillig Opcodes from acir
let acir_circuit = function.bytecode.clone();
let brillig = extract_brillig_from_acir(&acir_circuit.opcodes);
let acir_program = function.bytecode;
let brillig = extract_brillig_from_acir(&acir_program.functions[0].opcodes);

// Transpile to AVM
let avm_bytecode = brillig_to_avm(brillig);
Expand Down
7 changes: 7 additions & 0 deletions barretenberg/acir_tests/flows/write_contract.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had wrote this flow to easily write contracts against the acir_artifacts, however, it is not needed anymore after some CI changes I made. However, it is not unnecessarily useful so I feel we could leave this in?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove it if we're not using it.

set -eu

export TEST_NAME=$(basename $(pwd))

$BIN write_vk -o vk
$BIN contract -k vk -c $CRS_PATH -b ./target/acir.gz -o $TEST_NAME.sol
34 changes: 34 additions & 0 deletions barretenberg/cpp/src/barretenberg/dsl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Domain Specific Language

This package adds support to use [ACIR](https://github.com/noir-lang/noir/tree/master/acvm-repo/acir) with barretenberg.

## Serialization Changes

There are two types of breaking serialization changes. One that alters that alters the internal ACIR structure passed to barretenberg, and one that changes how we serialize the buffer passed to barretenberg.

1. Internal Structure Change

Go to the ACVM `acir` crate and re-run the [serde reflection test](../../../../../noir/noir-repo/acvm-repo/acir/src/lib.rs#L51). Remember to comment out the hash check to write the updated C++ serde file. Copy that file into the `dsl` package's [serde folder](./acir_format/serde/) where you will see an `acir.hpp` file.

You will have to update a couple things in the new `acir.hpp`:
- Replace all `throw serde::deserialization_error` with `throw_or_abort`
- The top-level struct (such as `Program`) will still use its own namespace for its internal fields. This extra `Program::` can be removed from the top-level `struct Program { .. }` object.

The same can then be done for any breaking changes introduced to `witness_stack.hpp`.

2. Full Breaking Change

This type of breaking change is rarely expected to happen, however, due to its nature there are multiple consumers of the pre-existing serialization you should be aware of if you ever need to make this change.

A full change is when you attempt to change the object whose buffer we are actually deserializing in barretenberg. To give more detail, when [deserializing the constraint buffer](./acir_format/acir_to_constraint_buf.hpp#366) if the object for which we call `bincodeDeserialize` on changes, anything that has pre-existing ACIR using the previous object's `bincodeDeserialize` method will now fail. The serialization is once again determined by the top-level object in the [acir crate](../../../../../noir/noir-repo/acvm-repo/acir/src/circuit/mod.rs). After performing the steps outlined for an internal structure breaking change as listed in (1) above, we need to update all consumers of barretenberg.

Even if you correctly update all serialization in [acvm_js](../../../../../noir/noir-repo/acvm-repo/acvm_js/README.md) such as during [execution](../../../../../noir/noir-repo/acvm-repo/acvm_js/src/execute.rs#57), there is multiple places the `yarn-project` uses the ACIR top-level serialization. The `yarn-project` sequencer also uses the native `acvm_cli tool` that has an execute method that [expects raw byte code](../../../../../noir/noir-repo/tooling/acvm_cli/src/cli/execute_cmd.rs#63).

In the context of Aztec we need to regenerate all the artifacts in [noir-projects](../../../../../noir-projects/bootstrap.sh). This regeneration assumes that we have rebuilt the compilers (Noir compiler and AVM transpiler) to use the new serialization. After regenerating these artifacts we can bootstrap the yarn-project. There are multiple packages in the yarn-project that rely on pre-computed artifacts such as `yarn-project/circuits.js` and `yarn-project/protocol-contracts`.

The Aztec artifacts can be individually regenerated as well using `yarn test -u`.
You can also run the command on the relevant workspaces, which at the time are the following:
```
yarn workspace @aztec/circuits.js test -u
yarn workspace @aztec/protocol-contracts test -u
```
Loading
Loading