Skip to content

Commit

Permalink
Merge branch 'master' into lde/honk_acir_composer
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 committed Jan 22, 2024
2 parents 57af750 + 38d262e commit f8efa12
Show file tree
Hide file tree
Showing 108 changed files with 1,437 additions and 2,221 deletions.
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,17 @@ jobs:
name: "Test"
command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_sandbox_example.test.ts

e2e-singleton:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Test"
command: cond_spot_run_compose end-to-end 4 ./scripts/docker-compose.yml TEST=e2e_singleton.test.ts

e2e-block-building:
docker:
- image: aztecprotocol/alpine-build-image
Expand Down Expand Up @@ -1228,6 +1239,7 @@ workflows:
# TODO(3458): Investigate intermittent failure
# - e2e-slow-tree: *e2e_test
- e2e-sandbox-example: *e2e_test
- e2e-singleton: *e2e_test
- e2e-block-building: *e2e_test
- e2e-nested-contract: *e2e_test
- e2e-non-contract-account: *e2e_test
Expand Down Expand Up @@ -1265,6 +1277,7 @@ workflows:
- e2e-token-contract
- e2e-blacklist-token-contract
- e2e-sandbox-example
- e2e-singleton
- e2e-block-building
- e2e-nested-contract
- e2e-non-contract-account
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/dev_docs/contracts/syntax/storage/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,15 @@ To update the value of a `Singleton`, we can use the `replace` method. The metho

An example of this is seen in a example card game, where we create a new note (a `CardNote`) containing some new data, and replace the current note with it:

#include_code state_vars-SingletonReplace /yarn-project/noir-contracts/contracts/docs_example_contract/src/actions.nr rust
#include_code state_vars-SingletonReplace /yarn-project/noir-contracts/contracts/docs_example_contract/src/main.nr rust

If two people are trying to modify the Singleton at the same time, only one will succeed as we don't allow duplicate nullifiers! Developers should put in place appropriate access controls to avoid race conditions (unless a race is intended!).

### `get_note`

This function allows us to get the note of a Singleton, essentially reading the value.

#include_code state_vars-SingletonGet /yarn-project/noir-contracts/contracts/docs_example_contract/src/actions.nr rust
#include_code state_vars-SingletonGet /yarn-project/noir-contracts/contracts/docs_example_contract/src/main.nr rust

#### Nullifying Note reads

Expand Down
2 changes: 1 addition & 1 deletion noir/.github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Installs the workspace's yarn dependencies and caches them
runs:
using: composite
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
id: node
with:
node-version: 18.17.1
Expand Down
2 changes: 1 addition & 1 deletion noir/.github/workflows/docs-dead-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_NAME: ${{ github.workflow }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ github.job }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/DEAD_LINKS_IN_DOCS.md
52 changes: 34 additions & 18 deletions noir/.github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- name: Check if label is present
id: check-labels
uses: actions/github-script@v3
uses: actions/github-script@v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand All @@ -21,10 +21,11 @@ jobs:
}
// Fetch the list of files changed in the PR
const { data: files } = await github.pulls.listFiles({
const { data: files } = await github.rest.pulls.listFiles({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
pull_number: context.issue.number,
per_page: 100
});
// Check if any file is within the 'docs' folder
Expand All @@ -33,34 +34,28 @@ jobs:
- name: Add label if not present
if: steps.check-labels.outputs.result == 'true'
uses: actions/github-script@v3
uses: actions/github-script@v7.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = context.payload.pull_request.labels.map(label => label.name);
if (!labels.includes('documentation')) {
github.issues.addLabels({
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['documentation']
})
}
build_and_deploy_preview:
build_preview:
runs-on: ubuntu-latest
permissions:
pull-requests: write
needs: add_label
if: needs.add_label.outputs.has_label == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install Yarn dependencies
uses: ./.github/actions/setup

- name: Install wasm-bindgen-cli
uses: taiki-e/install-action@v2
Expand All @@ -71,13 +66,34 @@ jobs:
run: |
npm i wasm-opt -g
- name: Install Yarn dependencies
uses: ./.github/actions/setup

- name: Build docs
run:
yarn workspaces foreach -Rt run build
yarn workspaces foreach -Rpt --from docs run build

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: docs
path: ./docs/build/
retention-days: 3


deploy_preview:
needs: [build_preview, add_label]
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: needs.add_label.outputs.has_label == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download built docs
uses: actions/download-artifact@v3
with:
name: docs
path: ./docs/build

- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
Expand Down
9 changes: 2 additions & 7 deletions noir/.github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ jobs:
- name: Checkout release branch
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install Yarn dependencies
uses: ./.github/actions/setup

- name: Install wasm-bindgen-cli
uses: taiki-e/install-action@v2
Expand All @@ -29,9 +27,6 @@ jobs:
run: |
npm i wasm-opt -g
- name: Install Yarn dependencies
uses: ./.github/actions/setup

- name: Build docs for deploying
working-directory: docs
run:
Expand Down
14 changes: 9 additions & 5 deletions noir/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ jobs:
run: |
cargo update --workspace
- uses: actions/setup-node@v3
with:
node-version: 18.17.1
cache: 'yarn'
cache-dependency-path: 'yarn.lock'

- name: Update yarn.lock
run: yarn

- name: Configure git
run: |
git config user.name kevaundray
Expand All @@ -68,11 +77,6 @@ jobs:
ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}
token: ${{ secrets.NOIR_RELEASES_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install Yarn dependencies
uses: ./.github/actions/setup

Expand Down
4 changes: 2 additions & 2 deletions noir/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/noir-lang/noir
branch = aztec-packages
commit = 13f93d523342daf478e08e8ccc0f00962c7fbe05
parent = 41ae75cdee6285729551965972e8cb039ff3045a
commit = 602f23f4fb698cf6e37071936a2a46593a998d08
parent = f0fb5942386e2e091cb6d1b23108ac74c1c6b75d
method = merge
cmdver = 0.4.6
4 changes: 2 additions & 2 deletions noir/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
".": "0.22.0",
"acvm-repo": "0.38.0"
".": "0.23.0",
"acvm-repo": "0.39.0"
}
Loading

0 comments on commit f8efa12

Please sign in to comment.