Skip to content

Commit 74199d8

Browse files
authored
chore(docs): github actions, reorg, other nits (#16299)
Some bundled changes here, as discussed with @critesjosh - Docs deployment and previews are now done via Netlify. These versions are cut by release-please so that doesn't change. - Removed typedoc and the aztec-nr autogenerated docs. This means reference won't show anymore until we find a better solution using the upcoming aztec-nr documentation. As for typedoc, it's not very useful and was wrong. Removing these deps makes the website smaller, faster, and makes it not depend on any other builds, which allows it to be deployed by Netlify. - Moving and merging some pages to make navigation easier (please thank Claude for de-duplicating TONS of info!) - Some other little nits
1 parent c37649e commit 74199d8

52 files changed

Lines changed: 802 additions & 2430 deletions

Some content is hidden

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

.github/workflows/docs-preview.yml

Lines changed: 0 additions & 152 deletions
This file was deleted.

.github/workflows/release-please.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ jobs:
5050
git config --global user.name AztecBot
5151
git config --global user.email tech@aztecprotocol.com
5252
53-
- name: Build dependencies
54-
run: |
55-
for project in noir barretenberg l1-contracts yarn-project; do
56-
CI=1 $project/bootstrap.sh
57-
done
58-
5953
- name: Query new version
6054
id: version
6155
run: |
@@ -88,7 +82,6 @@ jobs:
8882
git commit -m "chore(docs): cut new aztec docs version for tag ${{ steps.version.outputs.semver }}"
8983
git push
9084
91-
9285
- name: Cut Barretenberg Docs version
9386
working-directory: ./barretenberg/docs
9487
run: |

barretenberg/docs/bootstrap.sh

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if semver check $REF_NAME; then
2020
export COMMIT_TAG=$REF_NAME
2121
fi
2222

23-
function build_and_deploy {
23+
function build {
2424
if [ "${CI:-0}" -eq 1 ] && [ $(arch) == arm64 ]; then
2525
echo "Not building bb docs for arm64 in CI."
2626
return
@@ -31,19 +31,6 @@ function build_and_deploy {
3131
return
3232
fi
3333
denoise "yarn install && yarn build"
34-
35-
if [ "${CI:-0}" -eq 1 ] && [ "$(arch)" == "amd64" ]; then
36-
if [ "$REF_NAME" == "next" ]; then
37-
echo_header "deploying to production"
38-
do_or_dryrun yarn netlify deploy --site barretenberg --prod
39-
else
40-
echo_header "deploying preview for branch: $REF_NAME"
41-
do_or_dryrun yarn netlify deploy --site barretenberg
42-
fi
43-
else
44-
echo "Skipping deployment - only deploy in CI on amd64."
45-
fi
46-
4734
cache_upload bb-docs-$hash.tar.gz build
4835
}
4936

@@ -63,7 +50,7 @@ case "$cmd" in
6350
git clean -fdx
6451
;;
6552
""|"full"|"fast"|"ci")
66-
build_and_deploy
53+
build
6754
;;
6855
"hash")
6956
echo "$hash"

bootstrap.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ case "$cmd" in
437437
release-image/bootstrap.sh push
438438
test
439439
release
440-
docs/bootstrap.sh release-docs
441440
;;
442441
"ci-release")
443442
export CI=1

docs/bootstrap.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ function build_docs {
3232
cache_upload docs-$hash.tar.gz build
3333
}
3434

35-
function release_docs {
36-
echo "deploying docs to prod"
37-
yarn install
38-
yarn build
39-
40-
yarn netlify deploy --site aztec-docs-dev --prod 2>&1
41-
}
42-
4335
function test_cmds {
4436
if [ "${CI:-0}" -eq 1 ] && [ $(arch) == arm64 ]; then
4537
# Not running docs tests for arm64 in CI.
@@ -69,9 +61,6 @@ case "$cmd" in
6961
"hash")
7062
echo "$hash"
7163
;;
72-
"release-docs")
73-
release_docs
74-
;;
7564
test|test_cmds)
7665
$cmd
7766
;;

docs/docs/aztec/concepts/advanced/storage/indexed_merkle_tree.mdx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ In routine nullifier insertions, a non membership check for a value is performed
6363
As it turns out, we can do better. [This paper](https://eprint.iacr.org/2021/1263.pdf) (page 6) introduces the idea of an indexed merkle tree. A Merkle Tree that allows us to perform efficient non-membership proofs. It achieves this by extending each node to include a specialized data structure. Each node not only stores some value $v \in \mathbb{F}_p$ but also some pointers to the leaf with the next higher value. The data structure is as follows:
6464

6565
$$
66-
\textsf{leaf} = \{v, i_{\textsf{next}}, v_{\textsf{next}}\}.
66+
\textsf{leaf} = \{v, i_\textsf{next}, v_\textsf{next}\}.
6767
$$
6868

69-
Based on the tree's insertion rules, we can assume that there are no leaves in the tree that exist between the range $(v, v_{\textsf{next}})$.
69+
Based on the tree's insertion rules, we can assume that there are no leaves in the tree that exist between the range $(v, v_\textsf{next})$.
7070

7171
More simply put, the merkle tree pretty much becomes a linked list of increasing size, where once inserted the pointers at a leaf can change, but the nullifier value cannot.
7272

@@ -79,45 +79,45 @@ The insertion protocol is described below:
7979
1. Look for a nullifier's corresponding low_nullifier where:
8080

8181
$$
82-
low\_nullifier_{\textsf{next\_value}} > new\_nullifier
82+
low\_nullifier_\textsf{next\_value} > new\_nullifier
8383
$$
8484

8585
> if $new\_nullifier$ is the largest use the leaf:
8686
8787
$$
88-
low\_nullifier_{\textsf{next\_value}} == 0
88+
low\_nullifier_\textsf{next\_value} == 0
8989
$$
9090

9191
2. Perform membership check of the low nullifier.
9292
3. Perform a range check on the low nullifier's value and next_value fields:
9393

9494
$$
95-
new\_nullifier > low\_nullifier_{\textsf{value}} \: \&\& \: ( new\_nullifier < low\_nullifier_{\textsf{next\_value}} \: || \: low\_nullifier_{\textsf{next\_value}} == 0 )
95+
new\_nullifier > low\_nullifier_\textsf{value}} \: \&\& \: ( new\_nullifier < low\_nullifier_\textsf{next\_value}} \: || \: low\_nullifier_\textsf{next\_value}} == 0 )
9696
$$
9797

9898
4. Update the low nullifier pointers
9999

100100
$$
101-
low\_nullifier_{\textsf{next\_index}} = new\_insertion\_index
101+
low\_nullifier_\textsf{next\_index}} = new\_insertion\_index
102102
$$
103103

104104
$$
105-
low\_nullifier_{\textsf{next\_value}} = new\_nullifier
105+
low\_nullifier_\textsf{next\_value}} = new\_nullifier
106106
$$
107107

108108
5. Perform insertion of new updated low nullifier (yields new root)
109109
6. Update pointers on new leaf. Note: low_nullifier is from before update in step 4
110110

111111
$$
112-
new\_nullifier\_leaf_{\textsf{value}} = new\_nullifier
112+
new\_nullifier\_leaf_\textsf{value}} = new\_nullifier
113113
$$
114114

115115
$$
116-
new\_nullifier\_leaf_{\textsf{next\_value}} = low\_nullifier_{\textsf{next\_value}}
116+
new\_nullifier\_leaf_\textsf{next\_value}} = low\_nullifier_\textsf{next\_value}}
117117
$$
118118

119119
$$
120-
new\_nullifier\_leaf_{\textsf{next\_index}} = low\_nullifier_{\textsf{next\_index}}
120+
new\_nullifier\_leaf_\textsf{next\_index}} = low\_nullifier_\textsf{next\_index}}
121121
$$
122122

123123
7. Perform insertion of new leaf (yields new root)
@@ -130,7 +130,7 @@ $$
130130
- A handful of equality constraints.
131131

132132
**Special cases**
133-
You'll notice at step 3 the $low\_nullifier_{\textsf{next\_value}}$ can be 0. This is a special case as if a value is the max, it will not point to anything larger (as it does not exist). Instead it points to zero. By doing so we close the loop, so we are always inserting into a ring, if we could insert outside the ring we could cause a split.
133+
You'll notice at step 3 the $low\_nullifier_\textsf{next\_value}}$ can be 0. This is a special case as if a value is the max, it will not point to anything larger (as it does not exist). Instead it points to zero. By doing so we close the loop, so we are always inserting into a ring, if we could insert outside the ring we could cause a split.
134134

135135
A visual aid for insertion is presented below:
136136

@@ -175,12 +175,12 @@ Suppose we want to show that the value `20` doesn't exist in the tree. We just r
175175
- hash the low nullifier: $low\_nullifier = h(10, 1, 30)$.
176176
- Prove the low leaf exists in the tree: `n` hashes.
177177
- Check the new value 'would have' belonged in the range given by the low leaf: `2` range checks.
178-
- If ($low\_nullifier_{\textsf{next\_index}} == 0$):
178+
- If ($low\_nullifier_\textsf{next\_index}} == 0$):
179179
- Special case, the low leaf is at the very end, so the new_value must be higher than all values in the tree:
180-
- $assert(low\_nullifier_{\textsf{value}} < new\_value_{\textsf{value}})$
180+
- $assert(low\_nullifier_\textsf{value}} < new\_value_\textsf{value}})$
181181
- Else:
182-
- $assert(low\_nullifier_{\textsf{value}} < new\_value_{\textsf{value}})$
183-
- $assert(low\_nullifier_{\textsf{next\_value}} > new\_value_{\textsf{value}})$
182+
- $assert(low\_nullifier_\textsf{value}} < new\_value_\textsf{value}})$
183+
- $assert(low\_nullifier_\textsf{next\_value}} > new\_value_\textsf{value}})$
184184

185185
This is already a massive performance improvement, however we can go further, as this tree is not sparse. We can perform batch insertions.
186186

docs/docs/aztec/concepts/advanced/storage/partial_notes.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ And we can't use the normal flow to create a transaction fee refund note for Ali
9797
So we define a new type of note with its `compute_partial_commitment` defined as:
9898

9999
$$
100-
\text{amount}*G_{amount} + \text{address}*G_{address} + \text{randomness}*G_{randomness} + \text{slot}*G_{slot}
100+
\text{amount} \cdot G_\text{amount} + \text{address} \cdot G_\text{address} + \text{randomness} \cdot G_\text{randomness} + \text{slot} \cdot G_\text{slot}
101101
$$
102102

103103
Suppose Alice is willing to pay up to a set amount in stablecoins for her transaction. (Note, this amount gets passed into public so that when `transaction_fee` is known the FPC can verify that it isn't losing money. Wallets are expected to choose common values here, e.g. powers of 10).
104104

105105
Then we can subtract the set amount from Alice's balance of private stablecoins, and create a point in private like:
106106

107107
$$
108-
P_a' := \text{alice address}*G_{address} + \text{rand}_a*G_{randomness} + \text{Alice note slot}*G_{slot}
108+
P_a' := \text{alice address} \cdot G_\text{address} + \text{rand}_a \cdot G_\text{randomness} + \text{Alice note slot} \cdot G_\text{slot}
109109
$$
110110

111111
We also need to create a point for the owner of the FPC (whom we call Bob) to receive the transaction fee, which will also need randomness.
@@ -117,7 +117,7 @@ We need to use different randomness for Bob's note here to avoid potential priva
117117
:::
118118

119119
$$
120-
P_b' := \text{bob address}*G_{address} + \text{rand}_b*G_{randomness} + \text{Bob note slot}*G_{slot}
120+
P_b' := \text{bob address} \cdot G_\text{address} + \text{rand}_b \cdot G_\text{randomness} + \text{Bob note slot} \cdot G_\text{slot}
121121
$$
122122

123123
Here, the $P'$s "partially encode" the notes that we are _going to create_ for Alice and Bob. So we can use points as "Partial Notes".
@@ -127,11 +127,11 @@ We pass these points and the funded amount to public, and at the end of public e
127127
Then, we arrive at the point that corresponds to the complete note by
128128

129129
$$
130-
P_a := P_a'+P_{refund} = (\text{funded amount} - \text{transaction fee})*G_{amount} + \text{alice address}*G_{address} +\text{rand}_a*G_{randomness} + \text{Alice note slot}*G_{slot}
130+
P_a := P_a'+P_\text{refund} = (\text{funded amount} - \text{transaction fee}) \cdot G_\text{amount} + \text{alice address} \cdot G_\text{address} + \text{rand}_a \cdot G_\text{randomness} + \text{Alice note slot} \cdot G_\text{slot}
131131
$$
132132

133133
$$
134-
P_b := P_b'+P_{fee} = (\text{transaction fee})*G_{amount} + \text{bob address}*G_{address} +\text{rand}_b*G_{randomness} + \text{Bob note slot}*G_{slot}
134+
P_b := P_b'+P_\text{fee} = (\text{transaction fee}) \cdot G_\text{amount} + \text{bob address} \cdot G_\text{address} + \text{rand}_b \cdot G_\text{randomness} + \text{Bob note slot} \cdot G_\text{slot}
135135
$$
136136

137137
Then we just emit `P_a.x` and `P_b.x` as a note hashes, and we're done!

docs/docs/aztec/concepts/pxe/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,5 @@ Oracles are pieces of data that are injected into a smart contract function from
104104

105105
To learn how to develop on top of the PXE, refer to these guides:
106106

107-
- [Run more than one PXE on your local machine](../../../developers/guides/local_env/run_more_than_one_pxe_sandbox.md)
107+
- [Run more than one PXE on your local machine](../../../developers/guides/local_env/sandbox.md#running-multiple-pxes-in-the-sandbox)
108108
- [Use in-built oracles including oracles for arbitrary data](../../../developers/guides/smart_contracts/writing_contracts/how_to_use_capsules.md)

docs/docs/aztec/smart_contracts/oracles/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Oracles introduce **non-determinism** into a circuit, and thus are `unconstraine
2424

2525
## Inbuilt oracles
2626

27-
- [`debug_log`](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/aztec-nr/aztec/src/oracle/debug_log.nr) - Provides a couple of debug functions that can be used to log information to the console. Read more about debugging [here](../../../developers/reference/debugging/index.md).
27+
- [`debug_log`](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/aztec-nr/aztec/src/oracle/debug_log.nr) - Provides a couple of debug functions that can be used to log information to the console. Read more about debugging [here](../../../developers/guides/local_env/how_to_debug.md).
2828
- [`auth_witness`](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/aztec-nr/authwit/src/auth_witness.nr) - Provides a way to fetch the authentication witness for a given address. This is useful when building account contracts to support approve-like functionality.
2929
- [`get_l1_to_l2_message`](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/aztec-nr/aztec/src/oracle/get_l1_to_l2_message.nr) - Useful for application that receive messages from L1 to be consumed on L2, such as token bridges or other cross-chain applications.
3030
- [`notes`](https://github.com/AztecProtocol/aztec-packages/blob/master/noir-projects/aztec-nr/aztec/src/oracle/notes.nr) - Provides a lot of functions related to notes, such as fetches notes from storage etc, used behind the scenes for value notes and other pre-build note implementations.

0 commit comments

Comments
 (0)