From 6d0d9ee5e4be7ea08058c1ad787d1c2e59bb31de Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 11:09:55 +0000 Subject: [PATCH 01/18] fixing nightly test fails --- Nargo.toml | 2 +- src/getters.nr | 2 +- src/json.nr | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Nargo.toml b/Nargo.toml index 628b216..8f45b72 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -2,7 +2,7 @@ name = "json_parser" type = "lib" authors = [""] -compiler_version = ">=0.37.0" +compiler_version = "1.0.0" [dependencies] noir_sort = {tag = "v0.2.0", git = "https://github.com/noir-lang/noir_sort"} \ No newline at end of file diff --git a/src/getters.nr b/src/getters.nr index a7144bd..faa1661 100644 --- a/src/getters.nr +++ b/src/getters.nr @@ -12,7 +12,7 @@ use crate::transcript_entry::TranscriptEntry; /** * @brief records data used to reason about whether a key exists in a json blob **/ -struct KeySearchResult { +pub struct KeySearchResult { found: bool, // does the key exist? target_lt_smallest_entry: bool, // is the target keyhash smaller than the smallest keyhash in self.key_hashes? target_gt_largest_entry: bool, // is the target keyhash larger than the largest keyhash in self.key_hashes? diff --git a/src/json.nr b/src/json.nr index b07c96b..2c7c806 100644 --- a/src/json.nr +++ b/src/json.nr @@ -42,7 +42,7 @@ impl JSONValue { * @description The "root" of the JSON refers to the parent object or array (or a value if the json is just a single value e.g. text = "\"foo\": \"bar\"") * @note text that describes just a single JSON value is not yet fully supported. Only use this library for processing objects or arrays for now **/ -struct JSON { +pub struct JSON { json: [u8; NumBytes], // the raw json bytes json_packed: [Field; NumPackedFields], // raw bytes, but packed into 31-byte Field elements raw_transcript: [Field; MaxNumTokens], // transcript of json tokens after basic processing From e33c15a3e6d604e97b23b50ffddcefc3cca61f0d Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 11:11:53 +0000 Subject: [PATCH 02/18] changed stable version in workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d2030e..418f17a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - toolchain: [nightly, 0.37.0] + toolchain: [nightly, 1.0.0-beta.1] steps: - name: Checkout sources uses: actions/checkout@v4 From c81ab3f3db2cc7ff37272e912823cadb1f697197 Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 11:20:04 +0000 Subject: [PATCH 03/18] correct formatter version workflow fix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 418f17a..bdabc82 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: - name: Install Nargo uses: noir-lang/noirup@v0.1.3 with: - toolchain: 0.37.0 + toolchain: 1.0.0-beta.0 - name: Run formatter run: nargo fmt --check From 254a191d562c128af788ac81b573b71103dd8cca Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 11:20:57 +0000 Subject: [PATCH 04/18] stable version was wrong --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bdabc82..32ad733 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - toolchain: [nightly, 1.0.0-beta.1] + toolchain: [nightly, 1.0.0-beta.0] steps: - name: Checkout sources uses: actions/checkout@v4 From 44e56083eaf7b5792496dd1176c60a7e25550bab Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 11:48:31 +0000 Subject: [PATCH 05/18] changed noir sort version --- Nargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nargo.toml b/Nargo.toml index 8f45b72..68ef641 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -5,4 +5,4 @@ authors = [""] compiler_version = "1.0.0" [dependencies] -noir_sort = {tag = "v0.2.0", git = "https://github.com/noir-lang/noir_sort"} \ No newline at end of file +noir_sort = {tag = "v0.2.1", git = "https://github.com/noir-lang/noir_sort"} \ No newline at end of file From d7c54de2d65d86546e11a52af9ace87b6e7b7bdd Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 11:50:40 +0000 Subject: [PATCH 06/18] added the test workflow from library starter --- .github/workflows/test.yml | 29 +++++++++++++++++++++++++---- Nargo.toml | 2 +- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 32ad733..340a6f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,20 +3,41 @@ name: Noir tests on: push: branches: - - main + - master pull_request: env: CARGO_TERM_COLOR: always + MINIMUM_NOIR_VERSION: v0.34.0 jobs: + noir-version-list: + name: Query supported Noir versions + runs-on: ubuntu-latest + outputs: + noir_versions: ${{ steps.get_versions.outputs.versions }} + + steps: + - name: Checkout sources + id: get_versions + run: | + # gh returns the Noir releases in reverse chronological order so we keep all releases published after the minimum supported version. + VERSIONS=$(gh release list -R noir-lang/noir --exclude-pre-releases --json tagName -q 'map(.tagName) | index(env.MINIMUM_NOIR_VERSION) as $index | if $index then .[0:$index+1] else [env.MINIMUM_NOIR_VERSION] end') + echo "versions=$VERSIONS" + echo "versions=$VERSIONS" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ github.token }} + test: + needs: [noir-version-list] name: Test on Nargo ${{matrix.toolchain}} runs-on: ubuntu-latest strategy: fail-fast: false matrix: - toolchain: [nightly, 1.0.0-beta.0] + toolchain: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}} + include: + - toolchain: nightly steps: - name: Checkout sources uses: actions/checkout@v4 @@ -38,7 +59,7 @@ jobs: - name: Install Nargo uses: noir-lang/noirup@v0.1.3 with: - toolchain: 1.0.0-beta.0 + toolchain: ${{ env.MINIMUM_NOIR_VERSION }} - name: Run formatter run: nargo fmt --check @@ -64,4 +85,4 @@ jobs: fi env: # We treat any cancelled, skipped or failing jobs as a failure for the workflow as a whole. - FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} + FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} \ No newline at end of file diff --git a/Nargo.toml b/Nargo.toml index 68ef641..8fcb06d 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -2,7 +2,7 @@ name = "json_parser" type = "lib" authors = [""] -compiler_version = "1.0.0" +compiler_version = "0.37.0" [dependencies] noir_sort = {tag = "v0.2.1", git = "https://github.com/noir-lang/noir_sort"} \ No newline at end of file From c1638a80668c5a04616a30c2d4dd37f15b822d18 Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 11:52:13 +0000 Subject: [PATCH 07/18] dealing with compiler version --- Nargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nargo.toml b/Nargo.toml index 8fcb06d..3ec682e 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -2,7 +2,7 @@ name = "json_parser" type = "lib" authors = [""] -compiler_version = "0.37.0" +compiler_version >= "0.35.0" [dependencies] noir_sort = {tag = "v0.2.1", git = "https://github.com/noir-lang/noir_sort"} \ No newline at end of file From 6f6c7f48396ab764573404ec024dd6302883fe10 Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 11:53:52 +0000 Subject: [PATCH 08/18] dealing with compiler version --- Nargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nargo.toml b/Nargo.toml index 3ec682e..f612168 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -2,7 +2,7 @@ name = "json_parser" type = "lib" authors = [""] -compiler_version >= "0.35.0" +compiler_version = ">= 0.35.0" [dependencies] noir_sort = {tag = "v0.2.1", git = "https://github.com/noir-lang/noir_sort"} \ No newline at end of file From c2d36a0fc558ff92a8983c95888ddafa8bcc8407 Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 13:04:30 +0000 Subject: [PATCH 09/18] formatter and bumping the minimum compiler version in the workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 340a6f5..d5cf0dc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: env: CARGO_TERM_COLOR: always - MINIMUM_NOIR_VERSION: v0.34.0 + MINIMUM_NOIR_VERSION: v0.36.0 jobs: noir-version-list: From 65c22a864b798698f213f7ced8b6ed8597a076bc Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 13:23:07 +0000 Subject: [PATCH 10/18] changed workflow to use the latest formatter version --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d5cf0dc..2695285 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,6 +51,7 @@ jobs: run: nargo test format: + needs: [noir-version-list] runs-on: ubuntu-latest steps: - name: Checkout sources @@ -59,8 +60,7 @@ jobs: - name: Install Nargo uses: noir-lang/noirup@v0.1.3 with: - toolchain: ${{ env.MINIMUM_NOIR_VERSION }} - + toolchain: ${{needs.noir-version-list.outputs.noir_versions[0] }} - name: Run formatter run: nargo fmt --check From 157f6f62dbb47268b9ec02e5fc1fe3d1d6fb6ede Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 13:26:10 +0000 Subject: [PATCH 11/18] will keep the standard toml compiler version in libs to be 0.36.0 --- Nargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nargo.toml b/Nargo.toml index f612168..a628f55 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -2,7 +2,7 @@ name = "json_parser" type = "lib" authors = [""] -compiler_version = ">= 0.35.0" +compiler_version = ">= 0.36.0" [dependencies] noir_sort = {tag = "v0.2.1", git = "https://github.com/noir-lang/noir_sort"} \ No newline at end of file From f0af7924e9e663fa909ad1724409f93f9b38116d Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Wed, 8 Jan 2025 13:29:31 +0000 Subject: [PATCH 12/18] master -> main --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2695285..7cdb180 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: Noir tests on: push: branches: - - master + - main pull_request: env: From 3c331c69481da8d5f2a09f74c094041a48b78b15 Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Thu, 9 Jan 2025 10:13:26 +0000 Subject: [PATCH 13/18] changed the workflow formatter version --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7cdb180..5d35009 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,7 +51,6 @@ jobs: run: nargo test format: - needs: [noir-version-list] runs-on: ubuntu-latest steps: - name: Checkout sources @@ -60,7 +59,7 @@ jobs: - name: Install Nargo uses: noir-lang/noirup@v0.1.3 with: - toolchain: ${{needs.noir-version-list.outputs.noir_versions[0] }} + toolchain: ${{ env.MINIMUM_NOIR_VERSION }} - name: Run formatter run: nargo fmt --check From 4440f0bed631a643aa10af971e38350dd18ce4f5 Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Thu, 9 Jan 2025 10:26:04 +0000 Subject: [PATCH 14/18] formatter version set manually --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5d35009..f81b864 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: env: CARGO_TERM_COLOR: always - MINIMUM_NOIR_VERSION: v0.36.0 + MINIMUM_NOIR_VERSION: v0.37.0 jobs: noir-version-list: @@ -59,7 +59,7 @@ jobs: - name: Install Nargo uses: noir-lang/noirup@v0.1.3 with: - toolchain: ${{ env.MINIMUM_NOIR_VERSION }} + toolchain: v1.0.0-beta.0 - name: Run formatter run: nargo fmt --check From 283be6df4f45d290e6eca87dab5115b9f65f6afe Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Thu, 9 Jan 2025 10:27:01 +0000 Subject: [PATCH 15/18] typo fixed --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f81b864..28f5684 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: env: CARGO_TERM_COLOR: always - MINIMUM_NOIR_VERSION: v0.37.0 + MINIMUM_NOIR_VERSION: v0.36.0 jobs: noir-version-list: From cb4ce4da8676cd21be6df762e981ac6be02eb05e Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Thu, 9 Jan 2025 10:32:17 +0000 Subject: [PATCH 16/18] some visibility changes due to merging main into the branch fixed --- src/get_literal.nr | 2 +- src/json.nr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/get_literal.nr b/src/get_literal.nr index 6e2d0d3..f3693ab 100644 --- a/src/get_literal.nr +++ b/src/get_literal.nr @@ -13,7 +13,7 @@ global LITERAL_OFFSET_SHIFT: [Field; 6] = * @brief a JSON "literal" type has 3 states: "true", "false", "null". * As such we can't directly convert to a bool and cover all possible cases **/ -struct JSONLiteral { +pub struct JSONLiteral { value: Field, } diff --git a/src/json.nr b/src/json.nr index 2c7c806..d412ede 100644 --- a/src/json.nr +++ b/src/json.nr @@ -20,7 +20,7 @@ use crate::transcript_entry::{ /** * @brief records a value in a json blob **/ -struct JSONValue { +pub struct JSONValue { value: BoundedVec, // raw bytes that constitute the json value entry value_type: Field, // either STRING_TOKEN, NUMERIC_TOKEN or LITERAL_TOKEN } From fd5037a2e3a7d2bffd7d85121463442fce3173a0 Mon Sep 17 00:00:00 2001 From: Khashayar Barooti Date: Thu, 9 Jan 2025 10:47:22 +0000 Subject: [PATCH 17/18] version changes again --- .github/workflows/test.yml | 4 ++-- Nargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28f5684..68c9c7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: env: CARGO_TERM_COLOR: always - MINIMUM_NOIR_VERSION: v0.36.0 + MINIMUM_NOIR_VERSION: v0.37.0 jobs: noir-version-list: @@ -59,7 +59,7 @@ jobs: - name: Install Nargo uses: noir-lang/noirup@v0.1.3 with: - toolchain: v1.0.0-beta.0 + toolchain: ${{ env.MINIMUM_NOIR_VERSION }} - name: Run formatter run: nargo fmt --check diff --git a/Nargo.toml b/Nargo.toml index a628f55..25da517 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -2,7 +2,7 @@ name = "json_parser" type = "lib" authors = [""] -compiler_version = ">= 0.36.0" +compiler_version = ">= 0.37.0" [dependencies] noir_sort = {tag = "v0.2.1", git = "https://github.com/noir-lang/noir_sort"} \ No newline at end of file From 22a12104690082f97eb1dd0e720065454fd9b2f7 Mon Sep 17 00:00:00 2001 From: Tom French <15848336+TomAFrench@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:07:38 +0000 Subject: [PATCH 18/18] Update Nargo.toml --- Nargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nargo.toml b/Nargo.toml index 25da517..91e7ae5 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -2,7 +2,7 @@ name = "json_parser" type = "lib" authors = [""] -compiler_version = ">= 0.37.0" +compiler_version = ">=0.37.0" [dependencies] noir_sort = {tag = "v0.2.1", git = "https://github.com/noir-lang/noir_sort"} \ No newline at end of file