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: aztec nr lib constraining nullifier key is fresh #5939

Merged
merged 38 commits into from
May 1, 2024

Conversation

sklppy88
Copy link
Contributor

@sklppy88 sklppy88 commented Apr 22, 2024

resolves #5688

@AztecBot
Copy link
Collaborator

AztecBot commented Apr 23, 2024

Benchmark results

No metrics with a significant change found.

Detailed results

All benchmarks are run on txs on the Benchmarking contract on the repository. Each tx consists of a batch call to create_note and increment_balance, which guarantees that each tx has a private call, a nested private call, a public call, and a nested public call, as well as an emitted private note, an unencrypted log, and public storage read and write.

This benchmark source data is available in JSON format on S3 here.

L2 block published to L1

Each column represents the number of txs on an L2 block published to L1.

Metric 8 txs 32 txs 64 txs
l1_rollup_calldata_size_in_bytes 740 740 740
l1_rollup_calldata_gas 6,692 6,680 6,692
l1_rollup_execution_gas 586,824 586,812 586,824
l2_block_processing_time_in_ms 1,613 (+7%) 5,397 (-2%) 10,471
l2_block_building_time_in_ms 22,658 88,818 177,081 (-1%)
l2_block_rollup_simulation_time_in_ms 22,455 88,054 175,602 (-1%)
l2_block_public_tx_process_time_in_ms 9,026 34,845 69,440 (-1%)

L2 chain processing

Each column represents the number of blocks on the L2 chain where each block has 16 txs.

Metric 5 blocks 10 blocks
node_history_sync_time_in_ms 17,102 (-5%) 30,979 (-4%)
node_database_size_in_bytes 20,774,992 37,482,576
pxe_database_size_in_bytes 29,868 59,425

Circuits stats

Stats on running time and I/O sizes collected for every circuit run across all benchmarks.

Circuit circuit_simulation_time_in_ms circuit_input_size_in_bytes circuit_output_size_in_bytes
private-kernel-init 175 46,819 28,822
private-kernel-inner 206 76,734 28,822
private-kernel-ordering 230 53,040 42,751
base-parity 67.7 (+2%) 128 64.0
base-rollup 16,386 (-1%) 111,062 925
root-parity 1,611 27,064 64.0
root-rollup 64.4 (-1%) 11,454 789
public-kernel-app-logic 1,982 54,321 22,677
public-kernel-tail 4,863 (-1%) 159,770 3,898
merge-rollup 6,459 2,696 925
public-kernel-teardown 161 (-1%) 54,321 30,042
public-kernel-setup 221 (-1%) 54,321 30,042

Tree insertion stats

The duration to insert a fixed batch of leaves into each tree type.

Metric 1 leaves 16 leaves 64 leaves 128 leaves 512 leaves 1024 leaves 2048 leaves 4096 leaves 32 leaves
batch_insert_into_append_only_tree_16_depth_ms 11.0 17.7 (-1%) N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_count 16.7 31.8 N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_16_depth_hash_ms 0.640 0.546 (-1%) N/A N/A N/A N/A N/A N/A N/A
batch_insert_into_append_only_tree_32_depth_ms N/A N/A 51.8 (-1%) 79.9 260 500 (-1%) 981 1,946 N/A
batch_insert_into_append_only_tree_32_depth_hash_count N/A N/A 95.9 159 543 1,055 2,079 4,127 N/A
batch_insert_into_append_only_tree_32_depth_hash_ms N/A N/A 0.528 (-1%) 0.494 0.474 0.467 0.466 0.465 N/A
batch_insert_into_indexed_tree_20_depth_ms N/A N/A 60.7 (-2%) 120 376 737 (-1%) 1,464 2,911 N/A
batch_insert_into_indexed_tree_20_depth_hash_count N/A N/A 105 208 692 1,363 2,707 5,395 N/A
batch_insert_into_indexed_tree_20_depth_hash_ms N/A N/A 0.535 (-1%) 0.539 0.511 0.507 0.508 0.508 N/A
batch_insert_into_indexed_tree_40_depth_ms N/A N/A N/A N/A N/A N/A N/A N/A 66.7 (-1%)
batch_insert_into_indexed_tree_40_depth_hash_count N/A N/A N/A N/A N/A N/A N/A N/A 108
batch_insert_into_indexed_tree_40_depth_hash_ms N/A N/A N/A N/A N/A N/A N/A N/A 0.587 (-1%)

Miscellaneous

Transaction sizes based on how many contract classes are registered in the tx.

Metric 0 registered classes 1 registered classes
tx_size_in_bytes 44,613 535,433

Transaction size based on fee payment method

Metric native fee payment method fpc_public fee payment method fpc_private fee payment method
tx_with_fee_size_in_bytes 897 1,145 1,345

Transaction processing duration by data writes.

Metric 0 new note hashes 1 new note hashes 2 new note hashes
tx_pxe_processing_time_ms 1,396 (-1%) 1,007 3,669 (-1%)
Metric 1 public data writes 2 public data writes 3 public data writes 4 public data writes 5 public data writes 8 public data writes
tx_sequencer_processing_time_ms 884 790 (-2%) 1,426 (-1%) 936 (-1%) 2,198 (-1%) 1,116 (-1%)

@sklppy88 sklppy88 marked this pull request as ready for review April 26, 2024 16:47
@sklppy88 sklppy88 changed the title feat: constrain nullifier key is fresh feat: aztec nr lib constraining nullifier key is fresh Apr 27, 2024
@sklppy88 sklppy88 added the C-aztec.nr Component: Aztec smart contract framework label Apr 27, 2024
let derived_slot = pedersen_hash(
[storage_slot_of_nullifier_public_key, address.to_field()],
0
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Having hardcoded the inner logic of a Map here would result in hard to debug bug if something got changed there. I would introduce a derive_map_storage_slot function and use it from both Map and here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍. Addressed in 0ca8578

nullifier_public_key_to_test: GrumpkinPoint,
) {
// This is the storage slot of the nullifier_public_key inside the key registry contract
let storage_slot_of_nullifier_public_key = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment to canonical registry that we have the slot hardcoded here?

Copy link
Contributor

Choose a reason for hiding this comment

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

On this, could we not expose "global" values on the struct directly? Seems like it could be super sleek it we could do something like

registry::SOME_STORAGE_SLOT_CONSTANT

@Thunkar do you have any thoughts here? I have actually not checked if this is already possible with the code you made 👀

Copy link
Contributor Author

@sklppy88 sklppy88 May 1, 2024

Choose a reason for hiding this comment

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

Addressed the original comment in 0ca8578


// It's a bit wonky because we need to know the delay for get_current_value_in_private to work correctly
// We read from the canonical Key Registry
let registry_private_getter: SharedMutablePrivateGetter<Field, 5> = SharedMutablePrivateGetter::new(*context, AztecAddress::from_field(CANONICAL_KEY_REGISTRY_ADDRESS), derived_slot);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would also add comment to registry that we use the value here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 0ca8578

assert(keys[key_type].eq(key));
}

fn get_public_keys_internal(address: AztecAddress) -> [GrumpkinPoint; 4] {
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like having this function just makes it harder to read then if you just had line 64 on line 58 but maybe it's just a matter of taste

Copy link
Contributor

Choose a reason for hiding this comment

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

Think it is mostly taste, but I agree, if not using more than once would just insert it directly in there

Copy link
Contributor Author

@sklppy88 sklppy88 May 1, 2024

Choose a reason for hiding this comment

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

I also gree with your matter of taste, I thought it was convention to do it this way but I guess I was wrong. Addressed in 0ca8578

get_public_keys_and_partial_address_oracle(address)
}

pub fn get_public_keys_and_partial_address(address: AztecAddress) -> (PartialAddress, [GrumpkinPoint; 4]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you aware of us needing the partial address somewhere?

As far as I know the whole purpose of it is to be able to check the preimage of aztec address which we only do internally in the function so I don't think it makes sense to return here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 0ca8578

yarn-project/simulator/src/client/db_oracle.ts Outdated Show resolved Hide resolved
yarn-project/simulator/src/client/view_data_oracle.ts Outdated Show resolved Hide resolved
yarn-project/simulator/src/client/view_data_oracle.ts Outdated Show resolved Hide resolved
describe('key rotation flows', () => {
const firstNewMasterNullifierPublicKey = Point.random();

describe('normal key rotation flow', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that all the 3 cases in this describe block are interdependent I think it would make sense to just have them as one test case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, addressed this and the other obvious cases in 0ca8578

});

it('checks our registry contract from test contract and finds the new nullifier public key that has been rotated', async () => {
it('in the case where the key exists both in the pxe and our registry, we know nothing weird will happen', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

"nothing weird will happen" is not descriptive enough. Also I feel all the test names are not concise enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair point, I've tried to make a pass on the test names, please let me know if unsatisfactory

Copy link
Contributor

@LHerskind LHerskind left a comment

Choose a reason for hiding this comment

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

Had a few comments beyond and as extension to the ones Jan added.

NULLIFIER: 0,
};

pub fn assert_nullifier_public_key_is_fresh(
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed yesterday, think it would be better if we just have the getter here that is doing the assertions. In my mental model, you want to retrieve it for a user when you are populating the note, so having just one function do it instead of doing a retrieval and then a check that is doing the same internally seems nicer in my mind.

A similar change was made with the public storage some time back as an application can then easily add an explicit check if it want to see if it is a specific value etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, addressed as part of a stack, but popped into this pr for ease of review.

Addressed in 0ca8578

@@ -0,0 +1,67 @@
use dep::protocol_types::{
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there different number of spaces per tab between users?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will stick to four from now on 🙃

nullifier_public_key_to_test: GrumpkinPoint,
) {
// This is the storage slot of the nullifier_public_key inside the key registry contract
let storage_slot_of_nullifier_public_key = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

On this, could we not expose "global" values on the struct directly? Seems like it could be super sleek it we could do something like

registry::SOME_STORAGE_SLOT_CONSTANT

@Thunkar do you have any thoughts here? I have actually not checked if this is already possible with the code you made 👀

assert(keys[key_type].eq(key));
}

fn get_public_keys_internal(address: AztecAddress) -> [GrumpkinPoint; 4] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Think it is mostly taste, but I agree, if not using more than once would just insert it directly in there

}
}

fn check_public_key_validity(address: AztecAddress, key_type: u8, key: GrumpkinPoint) {
Copy link
Contributor

Choose a reason for hiding this comment

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

As the comment below, think this could be done inline, seems a bit unnecessary to have these two separate functions when it is as small as they are. Seems like it would just be two lines instead of two functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in 0ca8578

(partial_address, [nullifier_pub_key, incoming_pub_key, outgoing_pub_key, tagging_pub_key])
}

fn _check_public_key_validity_constrain_oracle(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would likely be easier to follow, if you have that the function is returning the address instead, and then constrain it in the caller. Would then have function that is essentially take the preimage and compue, which should be similar to what we have other places (as jan mentioned)

Copy link
Contributor Author

@sklppy88 sklppy88 May 1, 2024

Choose a reason for hiding this comment

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

Fair, addresssed in 0ca8578

@@ -6,7 +6,7 @@
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
},
"reporters": [["default", {"summaryThreshold": 9999}]],
"reporters": [["default", { "summaryThreshold": 9999 }]],
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like just a good ol formatting

@@ -171,6 +172,27 @@ export class Oracle {
return capsule.map(toACVMField);
}

async getPublicKeysAndPartialAddress([address]: ACVMField[]): Promise<ACVMField[]> {
Copy link
Contributor

Choose a reason for hiding this comment

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

The function name and the ordering of the return values messes with my brain. If we have the the key first in the name I would also assume it is also first in the return values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Addressed in 0ca8578

@sklppy88 sklppy88 requested a review from LHerskind May 1, 2024 12:27
Copy link
Contributor

@LHerskind LHerskind left a comment

Choose a reason for hiding this comment

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

A few comments

@sklppy88 sklppy88 requested a review from LHerskind May 1, 2024 20:06
@sklppy88 sklppy88 merged commit f95de6b into master May 1, 2024
65 checks passed
@sklppy88 sklppy88 deleted the ek/feat/constrain-keys-are-fresh-lib branch May 1, 2024 23:22
AztecBot added a commit to noir-lang/noir that referenced this pull request May 1, 2024
TomAFrench pushed a commit to noir-lang/noir that referenced this pull request May 1, 2024
TomAFrench pushed a commit to noir-lang/noir that referenced this pull request May 1, 2024
AztecBot added a commit to noir-lang/noir that referenced this pull request May 1, 2024
rahul-kothari pushed a commit that referenced this pull request May 2, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.37.0</summary>

##
[0.37.0](aztec-package-v0.36.0...aztec-package-v0.37.0)
(2024-05-02)


### Miscellaneous

* **aztec-package:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg.js: 0.37.0</summary>

##
[0.37.0](barretenberg.js-v0.36.0...barretenberg.js-v0.37.0)
(2024-05-02)


### Features

* Devbox
([#5772](#5772))
([72321f9](72321f9))
</details>

<details><summary>aztec-packages: 0.37.0</summary>

##
[0.37.0](aztec-packages-v0.36.0...aztec-packages-v0.37.0)
(2024-05-02)


### ⚠ BREAKING CHANGES

* use `distinct` return value witnesses by default
(noir-lang/noir#4951)
* Bit shift is restricted to u8 right operand
(noir-lang/noir#4907)

### Features

* Abort ongoing proving jobs
([#6049](#6049))
([0aa352d](0aa352d))
* Add aztecprotocol/aztec-builder
([#6116](#6116))
([30899d0](30899d0))
* Add de-sugaring for `impl Trait` in function parameters
(noir-lang/noir#4919)
([f060fa6](f060fa6))
* Aztec nr lib constraining nullifier key is fresh
([#5939](#5939))
([f95de6b](f95de6b))
* Bit shift is restricted to u8 right operand
(noir-lang/noir#4907)
([f060fa6](f060fa6))
* Count Bb lines weighted by complexity
([#6090](#6090))
([705177f](705177f))
* Devbox
([#5772](#5772))
([72321f9](72321f9))
* Enforce gas limits from private kernels
([#6105](#6105))
([4395855](4395855))
* **experimental:** `comptime` globals
(noir-lang/noir#4918)
([f060fa6](f060fa6))
* Handle `no_predicates` attribute
(noir-lang/noir#4942)
([4dc5efb](4dc5efb))
* Migrate boxes to GA and Earthly
([#6076](#6076))
([4a49f9d](4a49f9d))
* Pippenger benchmarks compatible with wasmtime
([#6095](#6095))
([5297b5b](5297b5b))
* Private da gas metering
([#6103](#6103))
([1a8f372](1a8f372))
* Prover metrics
([#6050](#6050))
([5b133f2](5b133f2))
* Use `distinct` return value witnesses by default
(noir-lang/noir#4951)
([4dc5efb](4dc5efb))


### Bug Fixes

* Ban self-referential structs
(noir-lang/noir#4883)
([f060fa6](f060fa6))
* **ci:** Build-key hotfix
([#6123](#6123))
([5791004](5791004))
* **ci:** Ssh'ing into instances
([#6136](#6136))
([af3192d](af3192d))
* Discard ref counts during unrolling
(noir-lang/noir#4923)
([f060fa6](f060fa6))
* **docs:** Add codegen to `aztec-builder` command
([#6098](#6098))
([4839ed9](4839ed9))
* Ensure where clauses propagated to trait default definitions
(noir-lang/noir#4894)
([4dc5efb](4dc5efb))
* Require for all foldable functions to use distinct return
(noir-lang/noir#4949)
([4dc5efb](4dc5efb))


### Miscellaneous

* Add regression test for
[#3051](#3051)
(noir-lang/noir#4815)
([f060fa6](f060fa6))
* Add test for recursing a foldable function
(noir-lang/noir#4948)
([4dc5efb](4dc5efb))
* Adding devcontainer with create aztec app
([#5960](#5960))
([ae5cb21](ae5cb21))
* Build docs in earthly
([#6038](#6038))
([784d542](784d542))
* Bump bench-tx-size timeout
([#6109](#6109))
([aa3eefa](aa3eefa))
* **ci:** Fix spot runner build key
([#6119](#6119))
([f332bc9](f332bc9))
* **ci:** Hotfix
([#6124](#6124))
([f60dfcd](f60dfcd))
* **ci:** Run benchmarks on Earthly
([#6089](#6089))
([c985c73](c985c73))
* **ci:** Turn off ARM build for now
([#6135](#6135))
([853913f](853913f))
* Disable bench-summary for now
([67485f1](67485f1))
* Disable doc builds
([#6107](#6107))
([7933f0f](7933f0f))
* **docs:** Adding matomo tracking
(noir-lang/noir#4898)
([4dc5efb](4dc5efb))
* Ebs attach robustness
([#6108](#6108))
([c702688](c702688))
* Fix typo in `ResolverError::AbiAttributeOutsideContract`
(noir-lang/noir#4933)
([4dc5efb](4dc5efb))
* Migrate the prover client test to earthly
([#6118](#6118))
([a59a6c0](a59a6c0))
* Redo typo PR by stayweek
([#6080](#6080))
([0869452](0869452))
* Redo typo PR by vitalmotif
([#6081](#6081))
([1a89d1a](1a89d1a))
* Refactor nested contract test for speed
([#6117](#6117))
([b346a2f](b346a2f))
* Remove unnecessary `pub(super)` in interpreter
(noir-lang/noir#4939)
([4dc5efb](4dc5efb))
* Replace relative paths to noir-protocol-circuits
([47592a2](47592a2))
* Replace relative paths to noir-protocol-circuits
([f0d95f5](f0d95f5))
* Update error conversion traits to act on references
(noir-lang/noir#4936)
([f060fa6](f060fa6))


### Documentation

* Tweaks for release
([#6129](#6129))
([77b45b9](77b45b9))
* Update @aztec/builder readme
([#6115](#6115))
([248761e](248761e))
* Yellow paper updates for the parity circuits
([#6048](#6048))
([cfe1b05](cfe1b05))
</details>

<details><summary>barretenberg: 0.37.0</summary>

##
[0.37.0](barretenberg-v0.36.0...barretenberg-v0.37.0)
(2024-05-02)


### ⚠ BREAKING CHANGES

* use `distinct` return value witnesses by default
(noir-lang/noir#4951)

### Features

* Count Bb lines weighted by complexity
([#6090](#6090))
([705177f](705177f))
* Devbox
([#5772](#5772))
([72321f9](72321f9))
* Handle `no_predicates` attribute
(noir-lang/noir#4942)
([4dc5efb](4dc5efb))
* Pippenger benchmarks compatible with wasmtime
([#6095](#6095))
([5297b5b](5297b5b))
* Use `distinct` return value witnesses by default
(noir-lang/noir#4951)
([4dc5efb](4dc5efb))


### Bug Fixes

* Ensure where clauses propagated to trait default definitions
(noir-lang/noir#4894)
([4dc5efb](4dc5efb))
* Require for all foldable functions to use distinct return
(noir-lang/noir#4949)
([4dc5efb](4dc5efb))


### Miscellaneous

* Add test for recursing a foldable function
(noir-lang/noir#4948)
([4dc5efb](4dc5efb))
* **docs:** Adding matomo tracking
(noir-lang/noir#4898)
([4dc5efb](4dc5efb))
* Fix typo in `ResolverError::AbiAttributeOutsideContract`
(noir-lang/noir#4933)
([4dc5efb](4dc5efb))
* Redo typo PR by stayweek
([#6080](#6080))
([0869452](0869452))
* Remove unnecessary `pub(super)` in interpreter
(noir-lang/noir#4939)
([4dc5efb](4dc5efb))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
AztecBot added a commit to AztecProtocol/barretenberg that referenced this pull request May 3, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>aztec-package: 0.37.0</summary>

##
[0.37.0](AztecProtocol/aztec-packages@aztec-package-v0.36.0...aztec-package-v0.37.0)
(2024-05-02)


### Miscellaneous

* **aztec-package:** Synchronize aztec-packages versions
</details>

<details><summary>barretenberg.js: 0.37.0</summary>

##
[0.37.0](AztecProtocol/aztec-packages@barretenberg.js-v0.36.0...barretenberg.js-v0.37.0)
(2024-05-02)


### Features

* Devbox
([#5772](AztecProtocol/aztec-packages#5772))
([72321f9](AztecProtocol/aztec-packages@72321f9))
</details>

<details><summary>aztec-packages: 0.37.0</summary>

##
[0.37.0](AztecProtocol/aztec-packages@aztec-packages-v0.36.0...aztec-packages-v0.37.0)
(2024-05-02)


### ⚠ BREAKING CHANGES

* use `distinct` return value witnesses by default
(noir-lang/noir#4951)
* Bit shift is restricted to u8 right operand
(noir-lang/noir#4907)

### Features

* Abort ongoing proving jobs
([#6049](AztecProtocol/aztec-packages#6049))
([0aa352d](AztecProtocol/aztec-packages@0aa352d))
* Add aztecprotocol/aztec-builder
([#6116](AztecProtocol/aztec-packages#6116))
([30899d0](AztecProtocol/aztec-packages@30899d0))
* Add de-sugaring for `impl Trait` in function parameters
(noir-lang/noir#4919)
([f060fa6](AztecProtocol/aztec-packages@f060fa6))
* Aztec nr lib constraining nullifier key is fresh
([#5939](AztecProtocol/aztec-packages#5939))
([f95de6b](AztecProtocol/aztec-packages@f95de6b))
* Bit shift is restricted to u8 right operand
(noir-lang/noir#4907)
([f060fa6](AztecProtocol/aztec-packages@f060fa6))
* Count Bb lines weighted by complexity
([#6090](AztecProtocol/aztec-packages#6090))
([705177f](AztecProtocol/aztec-packages@705177f))
* Devbox
([#5772](AztecProtocol/aztec-packages#5772))
([72321f9](AztecProtocol/aztec-packages@72321f9))
* Enforce gas limits from private kernels
([#6105](AztecProtocol/aztec-packages#6105))
([4395855](AztecProtocol/aztec-packages@4395855))
* **experimental:** `comptime` globals
(noir-lang/noir#4918)
([f060fa6](AztecProtocol/aztec-packages@f060fa6))
* Handle `no_predicates` attribute
(noir-lang/noir#4942)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
* Migrate boxes to GA and Earthly
([#6076](AztecProtocol/aztec-packages#6076))
([4a49f9d](AztecProtocol/aztec-packages@4a49f9d))
* Pippenger benchmarks compatible with wasmtime
([#6095](AztecProtocol/aztec-packages#6095))
([5297b5b](AztecProtocol/aztec-packages@5297b5b))
* Private da gas metering
([#6103](AztecProtocol/aztec-packages#6103))
([1a8f372](AztecProtocol/aztec-packages@1a8f372))
* Prover metrics
([#6050](AztecProtocol/aztec-packages#6050))
([5b133f2](AztecProtocol/aztec-packages@5b133f2))
* Use `distinct` return value witnesses by default
(noir-lang/noir#4951)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))


### Bug Fixes

* Ban self-referential structs
(noir-lang/noir#4883)
([f060fa6](AztecProtocol/aztec-packages@f060fa6))
* **ci:** Build-key hotfix
([#6123](AztecProtocol/aztec-packages#6123))
([5791004](AztecProtocol/aztec-packages@5791004))
* **ci:** Ssh'ing into instances
([#6136](AztecProtocol/aztec-packages#6136))
([af3192d](AztecProtocol/aztec-packages@af3192d))
* Discard ref counts during unrolling
(noir-lang/noir#4923)
([f060fa6](AztecProtocol/aztec-packages@f060fa6))
* **docs:** Add codegen to `aztec-builder` command
([#6098](AztecProtocol/aztec-packages#6098))
([4839ed9](AztecProtocol/aztec-packages@4839ed9))
* Ensure where clauses propagated to trait default definitions
(noir-lang/noir#4894)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
* Require for all foldable functions to use distinct return
(noir-lang/noir#4949)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))


### Miscellaneous

* Add regression test for
[#3051](AztecProtocol/aztec-packages#3051)
(noir-lang/noir#4815)
([f060fa6](AztecProtocol/aztec-packages@f060fa6))
* Add test for recursing a foldable function
(noir-lang/noir#4948)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
* Adding devcontainer with create aztec app
([#5960](AztecProtocol/aztec-packages#5960))
([ae5cb21](AztecProtocol/aztec-packages@ae5cb21))
* Build docs in earthly
([#6038](AztecProtocol/aztec-packages#6038))
([784d542](AztecProtocol/aztec-packages@784d542))
* Bump bench-tx-size timeout
([#6109](AztecProtocol/aztec-packages#6109))
([aa3eefa](AztecProtocol/aztec-packages@aa3eefa))
* **ci:** Fix spot runner build key
([#6119](AztecProtocol/aztec-packages#6119))
([f332bc9](AztecProtocol/aztec-packages@f332bc9))
* **ci:** Hotfix
([#6124](AztecProtocol/aztec-packages#6124))
([f60dfcd](AztecProtocol/aztec-packages@f60dfcd))
* **ci:** Run benchmarks on Earthly
([#6089](AztecProtocol/aztec-packages#6089))
([c985c73](AztecProtocol/aztec-packages@c985c73))
* **ci:** Turn off ARM build for now
([#6135](AztecProtocol/aztec-packages#6135))
([853913f](AztecProtocol/aztec-packages@853913f))
* Disable bench-summary for now
([67485f1](AztecProtocol/aztec-packages@67485f1))
* Disable doc builds
([#6107](AztecProtocol/aztec-packages#6107))
([7933f0f](AztecProtocol/aztec-packages@7933f0f))
* **docs:** Adding matomo tracking
(noir-lang/noir#4898)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
* Ebs attach robustness
([#6108](AztecProtocol/aztec-packages#6108))
([c702688](AztecProtocol/aztec-packages@c702688))
* Fix typo in `ResolverError::AbiAttributeOutsideContract`
(noir-lang/noir#4933)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
* Migrate the prover client test to earthly
([#6118](AztecProtocol/aztec-packages#6118))
([a59a6c0](AztecProtocol/aztec-packages@a59a6c0))
* Redo typo PR by stayweek
([#6080](AztecProtocol/aztec-packages#6080))
([0869452](AztecProtocol/aztec-packages@0869452))
* Redo typo PR by vitalmotif
([#6081](AztecProtocol/aztec-packages#6081))
([1a89d1a](AztecProtocol/aztec-packages@1a89d1a))
* Refactor nested contract test for speed
([#6117](AztecProtocol/aztec-packages#6117))
([b346a2f](AztecProtocol/aztec-packages@b346a2f))
* Remove unnecessary `pub(super)` in interpreter
(noir-lang/noir#4939)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
* Replace relative paths to noir-protocol-circuits
([47592a2](AztecProtocol/aztec-packages@47592a2))
* Replace relative paths to noir-protocol-circuits
([f0d95f5](AztecProtocol/aztec-packages@f0d95f5))
* Update error conversion traits to act on references
(noir-lang/noir#4936)
([f060fa6](AztecProtocol/aztec-packages@f060fa6))


### Documentation

* Tweaks for release
([#6129](AztecProtocol/aztec-packages#6129))
([77b45b9](AztecProtocol/aztec-packages@77b45b9))
* Update @aztec/builder readme
([#6115](AztecProtocol/aztec-packages#6115))
([248761e](AztecProtocol/aztec-packages@248761e))
* Yellow paper updates for the parity circuits
([#6048](AztecProtocol/aztec-packages#6048))
([cfe1b05](AztecProtocol/aztec-packages@cfe1b05))
</details>

<details><summary>barretenberg: 0.37.0</summary>

##
[0.37.0](AztecProtocol/aztec-packages@barretenberg-v0.36.0...barretenberg-v0.37.0)
(2024-05-02)


### ⚠ BREAKING CHANGES

* use `distinct` return value witnesses by default
(noir-lang/noir#4951)

### Features

* Count Bb lines weighted by complexity
([#6090](AztecProtocol/aztec-packages#6090))
([705177f](AztecProtocol/aztec-packages@705177f))
* Devbox
([#5772](AztecProtocol/aztec-packages#5772))
([72321f9](AztecProtocol/aztec-packages@72321f9))
* Handle `no_predicates` attribute
(noir-lang/noir#4942)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
* Pippenger benchmarks compatible with wasmtime
([#6095](AztecProtocol/aztec-packages#6095))
([5297b5b](AztecProtocol/aztec-packages@5297b5b))
* Use `distinct` return value witnesses by default
(noir-lang/noir#4951)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))


### Bug Fixes

* Ensure where clauses propagated to trait default definitions
(noir-lang/noir#4894)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
* Require for all foldable functions to use distinct return
(noir-lang/noir#4949)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))


### Miscellaneous

* Add test for recursing a foldable function
(noir-lang/noir#4948)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
* **docs:** Adding matomo tracking
(noir-lang/noir#4898)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
* Fix typo in `ResolverError::AbiAttributeOutsideContract`
(noir-lang/noir#4933)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
* Redo typo PR by stayweek
([#6080](AztecProtocol/aztec-packages#6080))
([0869452](AztecProtocol/aztec-packages@0869452))
* Remove unnecessary `pub(super)` in interpreter
(noir-lang/noir#4939)
([4dc5efb](AztecProtocol/aztec-packages@4dc5efb))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
try {
publicKeys = await this.typedOracle.getPublicKeysForAddress(AztecAddress.fromField(fromACVMField(address)));
} catch (err) {
publicKeys = Array(4).fill(Point.ZERO);
Copy link
Contributor

@benesjan benesjan May 9, 2024

Choose a reason for hiding this comment

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

Why did you caught here the error and populated the keys with invalid values here ^? This just makes the code hard to debug. Had to refactor this in my PR after debugging a failed constraint.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha, my bad, thanks for the heads up. I think initially there was a case of wanting to support grabbing either pub keys or partial address from this but yeah, it was stupid and I had changed stuff back while forgetting to change this back as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-aztec.nr Component: Aztec smart contract framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implementing aztec-nr library that constrains a use of fresh keys
5 participants