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: Sync from noir #9099

Merged
merged 63 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
acb958c
[1 changes] fix: homogeneous input points for EC ADD (https://github.…
AztecBot Oct 9, 2024
8ebe3c2
chore: apply sync fixes
AztecBot Oct 9, 2024
9afc69d
[1 changes] fix: visibility for impl methods (https://github.com/noir…
AztecBot Oct 10, 2024
7c635e6
chore: apply sync fixes
AztecBot Oct 10, 2024
caab224
fix: visibility for impl methods (https://github.com/noir-lang/noir/p…
AztecBot Oct 10, 2024
485da30
[1 changes] feat(test): Fuzz poseidon hases against an external libra…
AztecBot Oct 10, 2024
0abe72d
chore: apply sync fixes
AztecBot Oct 10, 2024
3a60573
feat(test): Fuzz poseidon hases against an external library (https://…
AztecBot Oct 10, 2024
04e12a9
Merge branch 'master' into sync-noir
TomAFrench Oct 10, 2024
9170c60
.
TomAFrench Oct 10, 2024
055a3d2
.
TomAFrench Oct 10, 2024
a649a86
.
TomAFrench Oct 10, 2024
b2c97e8
.
TomAFrench Oct 10, 2024
bb54ecd
.
TomAFrench Oct 11, 2024
0cfe965
.
TomAFrench Oct 11, 2024
9c99120
.
TomAFrench Oct 11, 2024
a97fb97
.
TomAFrench Oct 11, 2024
c5a2b28
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
267f7c0
[1 changes] feat: slightly improve "unexpected token" error message (…
AztecBot Oct 11, 2024
f451abd
chore: apply sync fixes
AztecBot Oct 11, 2024
043e812
feat: slightly improve "unexpected token" error message (https://gith…
AztecBot Oct 11, 2024
24d9d6f
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
ae46950
.
TomAFrench Oct 11, 2024
87f7137
.
TomAFrench Oct 11, 2024
2980169
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
c5e9d64
.
TomAFrench Oct 11, 2024
630ec07
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
acc4438
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
2ecf7ff
Merge branch 'master' into sync-noir
TomAFrench Oct 11, 2024
444777b
Update tail_output_composer.nr
TomAFrench Oct 11, 2024
a27c5d4
[1 changes] chore: regression test for #5462 (https://github.com/noir…
AztecBot Oct 12, 2024
23b90bb
chore: apply sync fixes
AztecBot Oct 12, 2024
1199fb0
chore: regression test for #5462 (https://github.com/noir-lang/noir/p…
AztecBot Oct 12, 2024
2179898
[1 changes] chore: regression test for #5462 (https://github.com/noir…
AztecBot Oct 13, 2024
ff5a45f
chore: apply sync fixes
AztecBot Oct 13, 2024
fdedf32
chore: regression test for #5462 (https://github.com/noir-lang/noir/p…
AztecBot Oct 13, 2024
a5083ec
[1 changes] chore: regression test for #5462 (https://github.com/noir…
AztecBot Oct 14, 2024
44dad1f
chore: apply sync fixes
AztecBot Oct 14, 2024
0f84874
chore: regression test for #5462 (https://github.com/noir-lang/noir/p…
AztecBot Oct 14, 2024
023c21a
Merge branch 'master' into sync-noir
TomAFrench Oct 14, 2024
e385aa9
.
TomAFrench Oct 14, 2024
0e70c14
.
TomAFrench Oct 14, 2024
4eee91e
.
TomAFrench Oct 14, 2024
ffe0858
Merge branch 'master' into sync-noir
TomAFrench Oct 14, 2024
4088359
.
TomAFrench Oct 14, 2024
4075dcf
.
TomAFrench Oct 14, 2024
8cd1c1e
.
TomAFrench Oct 14, 2024
8f8e97a
.
TomAFrench Oct 14, 2024
a994182
.
TomAFrench Oct 14, 2024
fcf9541
chore: fix tags
TomAFrench Oct 14, 2024
28fbecd
.
TomAFrench Oct 14, 2024
1c6f06d
.
TomAFrench Oct 14, 2024
ffe00a6
.
TomAFrench Oct 14, 2024
58c05bb
.
TomAFrench Oct 14, 2024
87d5182
.
TomAFrench Oct 14, 2024
8ae9e95
.
TomAFrench Oct 14, 2024
3e68942
.
TomAFrench Oct 14, 2024
928d7a9
.
TomAFrench Oct 14, 2024
609cc3b
.
TomAFrench Oct 14, 2024
3c0e9f1
.
TomAFrench Oct 14, 2024
2ab81c6
.
TomAFrench Oct 14, 2024
830a200
Merge branch 'master' into sync-noir
TomAFrench Oct 14, 2024
d23ca53
.
TomAFrench Oct 14, 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
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c4273a0c8f8b751a3dbe097e070e4e7b2c8ec438
ae87d287ab1fae0f999dfd0d1166fbddb927ba97
4 changes: 3 additions & 1 deletion boxes/boxes/react/src/contracts/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ contract BoxReact {
}

#[private]
#[initializer]
#['private]
#['initializer]
fn constructor(
number: Field,
owner: AztecAddress,
Expand All @@ -30,6 +31,7 @@ contract BoxReact {
}

#[private]
#['private]
fn setNumber(
number: Field,
owner: AztecAddress,
Expand Down
4 changes: 3 additions & 1 deletion boxes/boxes/vanilla/src/contracts/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ contract Vanilla {
}

#[private]
#[initializer]
#['private]
#['initializer]
fn constructor(
number: Field,
owner: AztecAddress,
Expand All @@ -30,6 +31,7 @@ contract Vanilla {
}

#[private]
#['private]
fn setNumber(
number: Field,
owner: AztecAddress,
Expand Down
3 changes: 2 additions & 1 deletion boxes/init/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use dep::aztec::macros::aztec;
#[aztec]
contract Main {
#[private]
#[initializer]
#['private]
#['initializer]
fn constructor() { }
}
1 change: 1 addition & 0 deletions noir-projects/aztec-nr/aztec/src/macros/dispatch/mod.nr
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ pub comptime fn generate_public_dispatch(m: Module) -> Quoted {
// functions having this attribute. However, the public MACRO will
// handle the public_dispatch function specially and do nothing.
#[public]
#['public]
pub unconstrained fn public_dispatch(selector: Field) {
$dispatch
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ contract AppSubscription {
global SUBSCRIPTION_TXS = 5;

#[private]
#['private]
fn entrypoint(payload: DAppPayload, user_address: AztecAddress) {
// Default msg_sender for entrypoints is now Fr.max_value rather than 0 addr (see #7190 & #7404)
assert(context.msg_sender().to_field() == MAX_FIELD_VALUE);
Expand Down Expand Up @@ -64,7 +65,8 @@ contract AppSubscription {
}

#[public]
#[initializer]
#['public]
#['initializer]
fn constructor(
target_address: AztecAddress,
subscription_recipient_address: AztecAddress,
Expand All @@ -80,6 +82,7 @@ contract AppSubscription {
}

#[private]
#['private]
fn subscribe(subscriber: AztecAddress, nonce: Field, expiry_block_number: Field, tx_count: Field) {
assert(tx_count as u64 <= SUBSCRIPTION_TXS as u64);

Expand Down
18 changes: 13 additions & 5 deletions noir-projects/noir-contracts/contracts/auth_contract/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ contract Auth {
}

#[public]
#[initializer]
#['public]
#['initializer]
fn constructor(admin: AztecAddress) {
assert(!admin.is_zero(), "invalid admin");
storage.admin.initialize(admin);
}

// docs:start:shared_mutable_schedule
#[public]
#['public]
fn set_authorized(authorized: AztecAddress) {
assert_eq(storage.admin.read(), context.msg_sender(), "caller is not admin");
storage.authorized.schedule_value_change(authorized);
Expand All @@ -40,7 +42,8 @@ contract Auth {

// docs:start:public_getter
#[public]
#[view]
#['public]
#['view]
fn get_authorized() -> AztecAddress {
// docs:start:shared_mutable_get_current_public
storage.authorized.get_current_value_in_public()
Expand All @@ -49,7 +52,8 @@ contract Auth {
// docs:end:public_getter

#[public]
#[view]
#['public]
#['view]
fn get_scheduled_authorized() -> AztecAddress {
// docs:start:shared_mutable_get_scheduled_public
let (scheduled_value, _block_of_change): (AztecAddress, u32) = storage.authorized.get_scheduled_value_in_public();
Expand All @@ -58,17 +62,20 @@ contract Auth {
}

#[public]
#[view]
#['public]
#['view]
fn get_authorized_delay() -> pub u32 {
storage.authorized.get_current_delay_in_public()
}

#[public]
#['public]
fn set_authorized_delay(new_delay: u32) {
storage.authorized.schedule_delay_change(new_delay);
}

#[private]
#['private]
fn do_private_authorized_thing() {
// Reading a value from authorized in private automatically adds an extra validity condition: the base rollup
// circuit will reject this tx if included in a block past the block horizon, which is as far as the circuit can
Expand All @@ -80,7 +87,8 @@ contract Auth {
}

#[private]
#[view]
#['private]
#['view]
fn get_authorized_in_private() -> AztecAddress {
storage.authorized.get_current_value_in_private()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ contract AuthRegistry {
* @param authorize True if the caller is authorized to perform the message hash, false otherwise
*/
#[public]
#['public]
fn set_authorized(message_hash: Field, authorize: bool) {
storage.approved_actions.at(context.msg_sender()).at(message_hash).write(authorize);
}
Expand All @@ -34,6 +35,7 @@ contract AuthRegistry {
* @param reject True if all actions should be rejected, false otherwise
*/
#[public]
#['public]
fn set_reject_all(reject: bool) {
storage.reject_all.at(context.msg_sender()).write(reject);
}
Expand All @@ -49,6 +51,7 @@ contract AuthRegistry {
* @return `IS_VALID_SELECTOR` if the action was consumed, revert otherwise
*/
#[public]
#['public]
fn consume(on_behalf_of: AztecAddress, inner_hash: Field) -> Field {
assert_eq(false, storage.reject_all.at(on_behalf_of).read(), "rejecting all");

Expand Down Expand Up @@ -79,6 +82,7 @@ contract AuthRegistry {
* @param authorize True if the message hash should be authorized, false otherwise
*/
#[private]
#['private]
fn set_authorized_private(approver: AztecAddress, message_hash: Field, authorize: bool) {
assert_current_call_valid_authwit(&mut context, approver);
AuthRegistry::at(context.this_address())._set_authorized(approver, message_hash, authorize).enqueue(&mut context);
Expand All @@ -93,7 +97,8 @@ contract AuthRegistry {
* @param authorize True if the caller is authorized to perform the message hash, false otherwise
*/
#[public]
#[internal]
#['public]
#['internal]
fn _set_authorized(approver: AztecAddress, message_hash: Field, authorize: bool) {
storage.approved_actions.at(approver).at(message_hash).write(authorize);
}
Expand All @@ -105,7 +110,8 @@ contract AuthRegistry {
* @return True if all actions are rejected, false otherwise
*/
#[public]
#[view]
#['public]
#['view]
fn is_reject_all(on_behalf_of: AztecAddress) -> bool {
storage.reject_all.at(on_behalf_of).read()
}
Expand All @@ -118,7 +124,8 @@ contract AuthRegistry {
* @return True if the caller is authorized to perform the action, false otherwise
*/
#[public]
#[view]
#['public]
#['view]
fn is_consumable(on_behalf_of: AztecAddress, message_hash: Field) -> bool {
storage.approved_actions.at(on_behalf_of).at(message_hash).read()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ contract AuthWitTest {
use dep::authwit::auth::{assert_inner_hash_valid_authwit, assert_inner_hash_valid_authwit_public};

#[private]
#['private]
fn consume(on_behalf_of: AztecAddress, inner_hash: Field) {
assert_inner_hash_valid_authwit(&mut context, on_behalf_of, inner_hash);
}

#[public]
#['public]
fn consume_public(on_behalf_of: AztecAddress, inner_hash: Field) {
assert_inner_hash_valid_authwit_public(&mut context, on_behalf_of, inner_hash);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ contract AvmInitializerTest {
* Storage
************************************************************************/
#[public]
#[initializer]
#['public]
#['initializer]
fn constructor() {
storage.immutable.initialize(42);
}

#[public]
#['public]
fn read_storage_immutable() -> pub Field {
storage.immutable.read()
}
Expand Down
Loading
Loading