Skip to content

Commit c57f027

Browse files
authored
chore(ci): Mirror Aztec-nr (#2270)
solution for: - #2265 - handles renaming noir-libs -> aztec-nr - renames what was aztec-nr to just aztec aztec-nr lives here (with full history): - https://github.com/AztecProtocol/aztec-nr - once this is merged it can be made public and a nice readme put on it
1 parent a91db48 commit c57f027

File tree

111 files changed

+368
-67
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+368
-67
lines changed

.github/workflows/mirror_repos.yml

+22-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ concurrency:
1212
on:
1313
schedule:
1414
# Run the workflow every night at 2:00 AM UTC.
15-
cron: '0 2 * * *'
15+
- cron: '0 2 * * *'
1616

1717
jobs:
1818
mirror-to-docs-repo:
@@ -77,3 +77,24 @@ jobs:
7777
git commit --amend -m "$(git log -1 --pretty=%B) [skip ci]"
7878
git push
7979
fi
80+
81+
mirror-to-aztec-nr-repo:
82+
runs-on: ubuntu-latest
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@v3
86+
with:
87+
fetch-depth: 0
88+
token: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
89+
- name: Push to aztec-nr repo
90+
run: |
91+
SUBREPO_PATH=yarn-project/aztec-nr
92+
git config --global user.name AztecBot
93+
git config --global user.email tech@aztecprotocol.com
94+
95+
if ./scripts/git_subrepo.sh push $SUBREPO_PATH --branch=main; then
96+
git fetch # in case a commit came after this
97+
git rebase origin/master
98+
git commit --amend -m "$(git log -1 --pretty=%B) [skip ci]"
99+
git push
100+
fi

build_manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"^l1-contracts/",
103103
"^yarn-project/l1-artifacts/",
104104
"^yarn-project/noir-contracts/",
105-
"^yarn-project/noir-libs/",
105+
"^yarn-project/aztec-nr/",
106106
"^yarn-project/noir-compiler/",
107107
"^yarn-project/yarn-project-base/",
108108
"^yarn-project/yarn.lock"
@@ -199,7 +199,7 @@
199199
"dockerfile": "noir-contracts/Dockerfile.build",
200200
"rebuildPatterns": [
201201
"^yarn-project/noir-contracts/",
202-
"^yarn-project/noir-libs/"
202+
"^yarn-project/aztec-nr/"
203203
]
204204
},
205205
"noir-contracts": {
@@ -208,7 +208,7 @@
208208
"dockerfile": "noir-contracts/Dockerfile",
209209
"rebuildPatterns": [
210210
"^yarn-project/noir-contracts/",
211-
"^yarn-project/noir-libs/"
211+
"^yarn-project/aztec-nr/"
212212
]
213213
},
214214
"noir-compiler": {

docs/docs/concepts/foundation/accounts/keys.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ In a future version, encryption keys will be differentiated between incoming and
7171

7272
An application in Aztec.nr can access the encryption public key for a given address using the oracle call `get_public_key`, which you can then use for calls such as `emit_encrypted_log`:
7373

74-
#include_code encrypted /yarn-project/noir-libs/value-note/src/utils.nr rust
74+
#include_code encrypted /yarn-project/aztec-nr/value-note/src/utils.nr rust
7575

7676
:::info
7777
In order to be able to provide the public encryption key for a given address, that public key needs to have been registered in advance. At the moment, there is no broadcasting mechanism for public keys, which means that you will need to manually register all addresses you intend to send encrypted notes to. You can do this via the `registerRecipient` method of the Aztec RPC server, callable either via aztec.js or the CLI. Note that any accounts you own that have been added to the RPC server are automatically registered.
@@ -83,7 +83,7 @@ In addition to deriving encryption keys, the privacy master key is used for deri
8383

8484
An application in Aztec.nr can request a nullifier from the current user for computing the nullifier of a note via the `get_secret_key` oracle call:
8585

86-
#include_code nullifier /yarn-project/noir-libs/value-note/src/value_note.nr rust
86+
#include_code nullifier /yarn-project/aztec-nr/value-note/src/value_note.nr rust
8787

8888
### Scoped keys
8989

docs/docs/dev_docs/contracts/events.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ await aztecRpc.registerRecipient(completeAddress);
4444
4545
To emit encrypted logs first import the `emit_encrypted_log` utility function inside your contract:
4646

47-
#include_code encrypted_import /yarn-project/noir-libs/value-note/src/utils.nr rust
47+
#include_code encrypted_import /yarn-project/aztec-nr/value-note/src/utils.nr rust
4848

4949
Then you can call the function:
5050

51-
#include_code encrypted /yarn-project/noir-libs/value-note/src/utils.nr rust
51+
#include_code encrypted /yarn-project/aztec-nr/value-note/src/utils.nr rust
5252

5353

5454
### Unencrypted Events

docs/docs/dev_docs/contracts/portals/main.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ As time passes, a sequencer will see your tx, the juicy fee provided and include
3737
To consume the message, we can use the `consume_l1_to_l2_message` function within the `context` struct.
3838
The `msg_key` is the hash of the message produced from the `sendL2Message` call, the `content` is the content of the message, and the `secret` is the pre-image hashed to compute the `secretHash`.
3939

40-
#include_code context_consume_l1_to_l2_message /yarn-project/noir-libs/aztec-noir/src/context.nr rust
40+
#include_code context_consume_l1_to_l2_message /yarn-project/aztec-nr/aztec/src/context.nr rust
4141

4242
Computing the `content` might be a little clunky in its current form, as we are still adding a number of bytes utilities. A good example exists within the [Non-native token example](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/noir-contracts/src/contracts/non_native_token_contract/src/hash.nr).
4343

@@ -63,7 +63,7 @@ The portal must ensure that the sender is as expected. One way to do this, is to
6363

6464
To send a message to L1 from your Aztec contract, you must use the `message_portal` function on the `context`. When messaging to L1, only the `content` is required (as field).
6565

66-
#include_code context_message_portal /yarn-project/noir-libs/aztec-noir/src/context.nr rust
66+
#include_code context_message_portal /yarn-project/aztec-nr/aztec/src/context.nr rust
6767

6868
When sending a message from L2 to L1 we don't need to pass recipient, deadline, secret nor fees. Recipient is populated with the attached portal and the remaining values are not needed as the message is inserted into the outbox at the same time as it was included in a block (for the inbox it could be inserted and then only included in rollup block later).
6969

docs/docs/dev_docs/contracts/state_variables.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ The BoolSerialisationMethods is part of the Aztec stdlib:
2828

2929
It contains methods that instruct its PublicState wrapper how to serialise and deserialise a boolean to and from a Field, which is the data type being saved in the public state tree.
3030

31-
The Aztec stdlib provides serialization methods for various common types. Check [here](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/noir-libs/aztec-noir/src/types/type_serialisation) for the complete list.
31+
The Aztec stdlib provides serialization methods for various common types. Check [here](https://github.com/AztecProtocol/aztec-packages/blob/master/yarn-project/aztec-nr/aztec/src/types/type_serialisation) for the complete list.
3232

3333
### Custom types
3434

3535
It's possible to create a public state for any types. Simply define methods that guide the PublicState wrapper in serialising the custom type to field(s) to store in the public state tree, and deserialising the field(s) retrieved from the tree back to the custom type.
3636

3737
The methods should be implemented in a struct that conforms to the following interface:
3838

39-
#include_code TypeSerialisationInterface /yarn-project/noir-libs/aztec-noir/src/types/type_serialisation.nr rust
39+
#include_code TypeSerialisationInterface /yarn-project/aztec-nr/aztec/src/types/type_serialisation.nr rust
4040

4141
For example, to create a public state for the following type:
4242

@@ -118,7 +118,7 @@ Notes are the fundamental elements in the private world.
118118

119119
A note should conform to the following interface:
120120

121-
#include_code NoteInterface /yarn-project/noir-libs/aztec-noir/src/note/note_interface.nr rust
121+
#include_code NoteInterface /yarn-project/aztec-nr/aztec/src/note/note_interface.nr rust
122122

123123
The interplay between a private state variable and its notes can be confusing. Here's a summary to aid intuition:
124124

@@ -243,7 +243,7 @@ Because of this limit, we should always consider using the second argument `Note
243243

244244
`NoteGetterOptions` encapsulates a set of configurable options for filtering and retrieving a selection of notes from a database:
245245

246-
#include_code NoteGetterOptions /yarn-project/noir-libs/aztec-noir/src/note/note_getter_options.nr rust
246+
#include_code NoteGetterOptions /yarn-project/aztec-nr/aztec/src/note/note_getter_options.nr rust
247247

248248
Developers can design instances of `NoteGetterOptions`, to determine how notes should be filtered and returned to the functions of their smart contracts.
249249

docs/docs/dev_docs/contracts/syntax.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[Noir](https://noir-lang.org/) is a language which is agnostic to proof systems and use cases. Rather than baking Aztec-specific keywords and smart contract types directly into Noir (which would break this agnosticism), we have developed a library -- written in Noir -- whose types and methods provide rich smart contract semantics.
44

5-
On top of [Noir's stdlib](https://noir-lang.org/standard_library/array_methods), we provide [Aztec.nr](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/noir-libs) for writing contracts on Aztec.
5+
On top of [Noir's stdlib](https://noir-lang.org/standard_library/array_methods), we provide [Aztec.nr](https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/aztec-nr) for writing contracts on Aztec.
66

77
Aztec.nr contains abstractions which remove the need to understand the low-level Aztec protocol. Notably, it provides:
88

docs/docs/dev_docs/dapps/testing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ To query storage directly, you'll need to know the slot you want to access. This
133133

134134
Private state in the Aztec Network is represented via sets of [private notes](../../concepts/foundation/state_model.md#private-state). In our token contract example, the balance of a user is represented as a set of unspent value notes, each with their own corresponding numeric value.
135135

136-
#include_code value-note-def yarn-project/noir-libs/value-note/src/value_note.nr rust
136+
#include_code value-note-def yarn-project/aztec-nr/value-note/src/value_note.nr rust
137137

138138
We can query the RPC server for all notes encrypted for a given user in a contract slot. For this example, we'll get all notes encrypted for the `owner` user that are stored on the token contract address and on the slot we calculated earlier. To calculate the actual balance, we extract the `value` of each note, which is the first element, and sum them up.
139139

docs/docs/dev_docs/dapps/tutorials/contract_deployment.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Then, open the `contracts/private_token/Nargo.toml` configuration file, and add
1919

2020
```toml
2121
[dependencies]
22-
aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/noir-libs/noir-aztec" }
23-
value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/noir-libs/value-note" }
22+
aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/aztec-nr/noir-aztec" }
23+
value_note = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/aztec-nr/value-note" }
2424
```
2525

2626
Last, copy-paste the code from the `PrivateToken` contract into `contracts/private_token/main.nr`:

docs/docs/dev_docs/getting_started/noir_contracts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ compiler_version = "0.1"
6161
type = "contract"
6262
6363
[dependencies]
64-
aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/noir-libs/aztec-noir" }
64+
aztec = { git="https://github.com/AztecProtocol/aztec-packages", tag="master", directory="yarn-project/aztec-nr/aztec" }
6565
```
6666

6767
You are now ready to write your own contracts!

docs/docs/dev_docs/wallets/writing_an_account_contract.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Public Key: 0x0ede151adaef1cfcc1b3e152ea39f00c5cda3f3857cef00decb049d283672dc71
3232

3333
The important part of this contract is the `entrypoint` function, which will be the first function executed in any transaction originated from this account. This function has two main responsibilities: 1) authenticating the transaction and 2) executing calls. It receives a `payload` with the list of function calls to execute, as well as a signature over that payload.
3434

35-
#include_code entrypoint-struct yarn-project/noir-libs/aztec-noir/src/entrypoint.nr rust
35+
#include_code entrypoint-struct yarn-project/aztec-nr/aztec/src/entrypoint.nr rust
3636

3737
:::info
3838
Using the `EntrypointPayload` struct is not mandatory. You can package the instructions to be carried out by your account contract however you want. However, the entrypoint payload already provides a set of helper functions, both in Noir and Typescript, that can save you a lot of time when writing a new account contract.
@@ -48,7 +48,7 @@ We authenticate the transaction. To do this, we serialise and Pedersen-hash the
4848

4949
Last, we execute the calls in the payload struct. The `execute_calls` helper function runs through the private and public calls included in the entrypoint payload and executes them:
5050

51-
#include_code entrypoint-execute-calls yarn-project/noir-libs/aztec-noir/src/entrypoint.nr rust
51+
#include_code entrypoint-execute-calls yarn-project/aztec-nr/aztec/src/entrypoint.nr rust
5252

5353
Note the usage of the `_with_packed_args` variant of [`call_public_function` and `call_private_function`](../contracts/functions.md#calling-functions). Due to Noir limitations, we cannot include more than a small number of arguments in a function call. However, we can bypass this restriction by using a hash of the arguments in a function call, which gets automatically expanded to the full set of arguments when the nested call is executed. We call this _argument packing_.
5454

yarn-project/aztec-nr/.gitrepo

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
; DO NOT EDIT (unless you know what you are doing)
2+
;
3+
; This subdirectory is a git "subrepo", and this file is maintained by the
4+
; git-subrepo command. See https://github.com/ingydotnet/git-subrepo#readme
5+
;
6+
[subrepo]
7+
remote = git@github.com:AztecProtocol/aztec-nr.git
8+
branch = master
9+
commit = f662901567fa19e205062d84180763f06cddd641
10+
method = merge
11+
cmdver = 0.4.6
12+
parent = 8df8fa7351ca79c022e2eb7dddfd7cf0145876df

0 commit comments

Comments
 (0)