Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5d95bb4
Commands to copy and format generated files
aakoshh Mar 17, 2025
c1bdb0d
Set noir to the feature branch
aakoshh Mar 18, 2025
f99c869
Change C++ codegen for serde/msgpack
aakoshh Mar 18, 2025
aeefaf3
Add Witness lt
aakoshh Mar 18, 2025
07566e7
AVM transpiler Cargo.lock
aakoshh Mar 18, 2025
ab9b7ff
Merge branch 'master' into af/msgpack-codegen
aakoshh Mar 18, 2025
d356f69
Remove comments about massaging the C++ code
aakoshh Mar 19, 2025
0d9dc22
Try to deserialize as msgpack instead of binpack
aakoshh Mar 19, 2025
16124ce
Patch no longer needed with this branch
aakoshh Mar 19, 2025
0ecd8d4
Use obj.via.map
aakoshh Mar 19, 2025
ebf72f5
Check if the data can be parsed as msgpack
aakoshh Mar 19, 2025
f764a86
Disable msgpack in bb
aakoshh Mar 20, 2025
c8f6157
Fixed codegen
aakoshh Mar 21, 2025
ffdeb65
Parse program with fallback
aakoshh Mar 21, 2025
d05544d
Parse Program ignoring Brillig
aakoshh Mar 21, 2025
74880c2
Update msgpack git commit to include fix
aakoshh Mar 21, 2025
15c1c71
Deserialize WitnessStack with msgpack
aakoshh Mar 21, 2025
27349bc
Merge remote-tracking branch 'origin/master' into af/msgpack-codegen
aakoshh Mar 21, 2025
24756ff
Fix catch
aakoshh Mar 21, 2025
dfd4ee8
Remove rmp-serde from avm-transpiler dependencies
aakoshh Mar 21, 2025
c82f1b1
Fix packing newtype is_unit
aakoshh Mar 21, 2025
919ab7a
Don't use visit for unit variants
aakoshh Mar 21, 2025
a6ec247
Return optional msgpack::object to avoid double parsing
aakoshh Mar 21, 2025
8c01b30
Merge branch 'master' into af/msgpack-codegen
aakoshh Mar 21, 2025
8387aff
Revert "Return optional msgpack::object to avoid double parsing"
aakoshh Mar 21, 2025
02e3d64
Check the value of the format byte
aakoshh Mar 22, 2025
63254d3
Use lambdas to avoid double parsing
aakoshh Mar 22, 2025
4123f84
Rename to deserialize_program and deserialize_witness_stack
aakoshh Mar 22, 2025
859b4c3
Move docs into the header
aakoshh Mar 22, 2025
4c57694
Typo
aakoshh Mar 22, 2025
a095acc
Try without using MSGPACK_FIELDS
aakoshh Mar 25, 2025
0759002
Try copying into a buffer
aakoshh Mar 25, 2025
f8f0473
Revert "Try copying into a buffer"
aakoshh Mar 25, 2025
aba2338
Print field that can't be decoded
aakoshh Mar 25, 2025
5810e3b
Fix dangling obj pointer
aakoshh Mar 25, 2025
073a9d5
Revert to original msgpack-c commit version
aakoshh Mar 25, 2025
d26f4ff
Merge remote-tracking branch 'origin/master' into af/msgpack-codegen
aakoshh Mar 25, 2025
4df2bf7
Merge branch 'master' into af/msgpack-codegen
aakoshh Mar 26, 2025
d39ebcf
Add docs to warn about keeping a reference to the object_handle
aakoshh Mar 26, 2025
e62c56b
Merge branch 'master' into af/msgpack-codegen
aakoshh Mar 26, 2025
3561f81
Move deserializers into the cpp
aakoshh Mar 27, 2025
44d05fd
Use MSGPACK_FIELDS. Remove Helpers.
aakoshh Mar 27, 2025
7edaf24
Merge branch 'af/msgpack-codegen' of github.com:AztecProtocol/aztec-p…
aakoshh Mar 27, 2025
e3df1d1
Merge remote-tracking branch 'origin/master' into af/msgpack-codegen
aakoshh Mar 27, 2025
18efc8b
Merge branch 'master' into af/msgpack-codegen
aakoshh Mar 27, 2025
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
2 changes: 1 addition & 1 deletion barretenberg/cpp/cmake/msgpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ ExternalProject_Add(
BUILD_COMMAND "" # No build step
INSTALL_COMMAND "" # No install step
UPDATE_COMMAND "" # No update step
)
)
21 changes: 13 additions & 8 deletions barretenberg/cpp/src/barretenberg/dsl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ There are two types of breaking serialization changes. One that alters the inter

1. Internal Structure Change

Go to the ACVM `acir` crate and re-run the [serde reflection test](https://github.com/noir-lang/noir/blob/master/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`.
The C++ bindings are generated by the ACVM `acir` crate and while running the [serde reflection test](https://github.com/noir-lang/noir/blob/master/acvm-repo/acir/src/lib.rs#L51).
By default it just ascertains that the format has not changed, but it can be told to
write the updated mappings to `acir.cpp` and `witness_stack.cpp`,
which become `acir.hpp` and `witness_stack.hpp` in `aztec-packages`.

The code can be regenerated and copied over with the following commands:

```shell
cd noir/noir-repo && NOIR_CODEGEN_OVERWRITE=1 cargo test -p acir cpp_codegen && cd -
cp noir/noir-repo/acvm-repo/acir/codegen/acir.cpp barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp
cp noir/noir-repo/acvm-repo/acir/codegen/witness.cpp barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/witness_stack.hpp
cd barretenberg/cpp && ./format.sh changed && cd -
```

2. Full Breaking Change

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@

namespace acir_format {

AcirFormat circuit_buf_to_acir_format(std::vector<uint8_t> const& buf, uint32_t honk_recursion);

/**
* @brief Converts from the ACIR-native `WitnessMap` format to Barretenberg's internal `WitnessVector` format.
* @brief Converts from the ACIR-native `WitnessStack` format to Barretenberg's internal `WitnessVector` format.
*
* @param buf Serialized representation of a `WitnessMap`.
* @return A `WitnessVector` equivalent to the passed `WitnessMap`.
* @param buf Serialized representation of a `WitnessStack`.
* @return A `WitnessVector` equivalent to the last `WitnessMap` in the stack.
* @note This transformation results in all unassigned witnesses within the `WitnessMap` being assigned the value 0.
* Converting the `WitnessVector` back to a `WitnessMap` is unlikely to return the exact same `WitnessMap`.
*/
WitnessVector witness_buf_to_witness_data(std::vector<uint8_t> const& buf);

AcirFormat circuit_buf_to_acir_format(std::vector<uint8_t> const& buf, uint32_t honk_recursion);

std::vector<AcirFormat> program_buf_to_acir_format(std::vector<uint8_t> const& buf, uint32_t honk_recursion);

WitnessVectorStack witness_buf_to_witness_stack(std::vector<uint8_t> const& buf);
Expand All @@ -25,4 +25,4 @@ AcirProgramStack get_acir_program_stack(std::string const& bytecode_path,
std::string const& witness_path,
uint32_t honk_recursion);
#endif
} // namespace acir_format
} // namespace acir_format
Loading