Skip to content

Commit 410c450

Browse files
authored
Merge pull request #54 from status-im/feat/import-rln-prover
Add rln-prover code (from VAC repository)
2 parents 3221b5d + eef4aaa commit 410c450

Some content is hidden

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

70 files changed

+16040
-140
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ prover/prover-assets/**/**/**/*.bin binary
2424
prover/prover-assets/**/**/**/**/*.bin binary
2525
prover/prover-assets/kzgsrs/* binary
2626

27+
rln-prover/rln_proof/resources/*.bin binary
28+
2729
*.woff2 binary
2830

.github/actions/setup-nodejs/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
node-version:
66
description: 'The version of node to use'
77
required: true
8-
default: '20.17.0'
8+
default: '22.x'
99
pnpm-version:
1010
description: 'The version of pnpm to use'
1111
required: true

.github/workflows/coordinator-testing.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ on:
88
workflow_call:
99
inputs:
1010
commit_tag:
11-
required: true
11+
required: false
1212
type: string
13+
default: 'local'
1314
secrets:
1415
DOCKERHUB_USERNAME:
1516
required: false

.github/workflows/main.yml

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,13 @@ jobs:
3131
name: Filter commit changes
3232
outputs:
3333
changed-file-count: ${{ steps.filter.outputs.all_count }}
34-
coordinator: ${{ steps.filter.outputs.coordinator }}
35-
staterecovery: ${{ steps.filter.outputs.staterecovery }}
3634
postman: ${{ steps.filter.outputs.postman }}
37-
prover: ${{ steps.filter.outputs.prover }}
3835
transaction-exclusion-api: ${{ steps.filter.outputs.transaction-exclusion-api }}
3936
has-changes-requiring-build: ${{ steps.exclusion-filter.outputs.has-changes-requiring-build }}
4037
contracts-excluding-local-deployment-artifacts: ${{ steps.exclusion-filter.outputs.contracts-excluding-local-deployment-artifacts }}
4138
contracts-excluding-local-deployment-artifacts-count: ${{ steps.exclusion-filter.outputs.contracts-excluding-local-deployment-artifacts_count }}
42-
smart-contracts: ${{ steps.filter.outputs.smart-contracts }}
4339
linea-sequencer-plugin: ${{ steps.filter.outputs.linea-sequencer-plugin }}
40+
rln-prover: ${{ steps.filter.outputs.rln-prover }}
4441
steps:
4542
- name: Checkout
4643
uses: actions/checkout@v4
@@ -53,42 +50,12 @@ jobs:
5350
filters: |
5451
all:
5552
- '**/**'
56-
coordinator:
57-
- 'coordinator/**'
58-
- 'testdata/**'
59-
- 'buildSrc/**'
60-
- 'jvm-libs/**'
61-
- 'gradle/**'
62-
- 'build.gradle'
63-
- 'gradle.properties'
64-
- 'settings.gradle'
65-
- '.github/workflows/coordinator-*.yml'
66-
- '.github/workflows/main.yml'
67-
- 'config/common/traces-limits-v2.toml'
68-
- 'config/coordinator/**'
69-
- 'e2e/**'
70-
- 'docker/compose-*.yml'
71-
staterecovery:
72-
- 'state-recovery/**'
73-
- 'buildSrc/**'
74-
- 'jvm-libs/**'
75-
- 'gradle/**'
76-
- 'build.gradle'
77-
- 'gradle.properties'
78-
- 'settings.gradle'
79-
- '.github/workflows/staterecovery-*.yml'
80-
- '.github/workflows/main.yml'
8153
postman:
8254
- 'postman/**'
8355
- 'sdk/**'
8456
- 'ts-libs/linea-native-libs/**'
8557
- '.github/workflows/postman-*.yml'
8658
- '.github/workflows/main.yml'
87-
prover:
88-
- 'prover/**'
89-
- '.github/workflows/prover-*.yml'
90-
- '.github/workflows/main.yml'
91-
- 'constraints'
9259
transaction-exclusion-api:
9360
- 'transaction-exclusion-api/**'
9461
- 'jvm-libs/generic/extensions/futures/**'
@@ -106,15 +73,13 @@ jobs:
10673
- 'build.gradle'
10774
- 'gradle.properties'
10875
- 'settings.gradle'
109-
smart-contracts:
110-
- 'contracts/**'
111-
- 'testdata/**'
112-
- 'prover/**'
113-
- '.github/workflows/main.yml'
114-
- '.github/workflows/run-smc-tests.yml'
11576
linea-sequencer-plugin:
11677
- 'besu-plugins/linea-sequencer/**'
11778
- '.github/workflows/linea-sequencer-plugin-testing.yml'
79+
rln-prover:
80+
- 'rln-prover/**'
81+
- '.github/workflows/main.yml'
82+
- '.githb/workflows/rln-prover-tests.yml'
11883
11984
- name: Filter out commit changes
12085
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3.0.2
@@ -140,13 +105,10 @@ jobs:
140105
if: ${{ needs.filter-commit-changes.outputs.has-changes-requiring-build == 'true' }}
141106
uses: ./.github/workflows/testing.yml
142107
with:
143-
coordinator_changed: ${{ needs.filter-commit-changes.outputs.coordinator || 'false' }}
144108
linea_sequencer_changed: ${{ needs.filter-commit-changes.outputs.linea-sequencer-plugin || 'false' }}
145109
postman_changed: ${{ needs.filter-commit-changes.outputs.postman || 'false' }}
146-
prover_changed: ${{ needs.filter-commit-changes.outputs.prover || 'false' }}
147-
smart_contracts_changed: ${{ needs.filter-commit-changes.outputs.smart-contracts || 'false' }}
148-
staterecovery_changed: ${{ needs.filter-commit-changes.outputs.staterecovery || 'false' }}
149110
transaction_exclusion_api_changed: ${{ needs.filter-commit-changes.outputs.transaction-exclusion-api || 'false' }}
111+
rln_prover_changed: ${{ needs.filter-commit-changes.outputs.rln-prover || 'false' }}
150112
secrets: inherit
151113

152114
# Always complete successfully even if no tests run
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: RLN prover tests
2+
3+
permissions:
4+
contents: read
5+
actions: read
6+
7+
on:
8+
workflow_call:
9+
10+
env:
11+
PROTOC_VERSION: "3.25.3"
12+
RUST_LOG: "debug"
13+
RUST_BACKTRACE: "full"
14+
15+
jobs:
16+
lint:
17+
runs-on: ubuntu-latest
18+
name: Run RLN prover tests
19+
steps:
20+
- name: Checkout sources
21+
uses: actions/checkout@v4
22+
- name: Install stable toolchain
23+
uses: dtolnay/rust-toolchain@stable
24+
with:
25+
components: rustfmt, clippy
26+
- name: Install protoc
27+
uses: taiki-e/install-action@v2
28+
with:
29+
tool: protoc@${{ env.PROTOC_VERSION }}
30+
- uses: Swatinem/rust-cache@v2
31+
with:
32+
shared-key: "stable"
33+
workspaces: "rln-prover"
34+
- name: Check formatting
35+
if: success() || failure()
36+
working-directory: rln-prover
37+
run: cargo fmt --all -- --check
38+
- name: Check clippy
39+
if: success() || failure()
40+
working-directory: rln-prover
41+
run: cargo clippy --all-targets --release -- -D warnings
42+
43+
test:
44+
runs-on: ubuntu-latest
45+
timeout-minutes: 60
46+
name: Test
47+
steps:
48+
- name: Checkout sources
49+
uses: actions/checkout@v4
50+
- name: Install stable toolchain
51+
uses: dtolnay/rust-toolchain@stable
52+
- name: Install protoc
53+
uses: taiki-e/install-action@v2
54+
with:
55+
tool: protoc@${{ env.PROTOC_VERSION }}
56+
- uses: Swatinem/rust-cache@v2
57+
with:
58+
shared-key: "stable"
59+
workspaces: "rln-prover"
60+
- name: Install foundry
61+
uses: foundry-rs/foundry-toolchain@v1
62+
- name: Test
63+
working-directory: rln-prover
64+
run: cargo test -v --release -- --nocapture
65+
66+
unused-deps:
67+
needs: [lint, test]
68+
runs-on: ubuntu-latest
69+
timeout-minutes: 60
70+
name: Unused Dependencies
71+
steps:
72+
- name: Checkout sources
73+
uses: actions/checkout@v4
74+
- name: Install nightly toolchain
75+
uses: dtolnay/rust-toolchain@nightly
76+
- name: Install protoc
77+
uses: taiki-e/install-action@v2
78+
with:
79+
tool: protoc@${{ env.PROTOC_VERSION }}
80+
- uses: Swatinem/rust-cache@v2
81+
with:
82+
shared-key: "nightly"
83+
workspaces: "rln-prover"
84+
- name: Install cargo-udeps
85+
uses: taiki-e/install-action@v2
86+
with:
87+
tool: cargo-udeps
88+
- name: Check unused dependencies
89+
working-directory: rln-prover
90+
run: cargo +nightly udeps --all-targets --all-features
91+

.github/workflows/run-smc-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ on:
88
workflow_call:
99
inputs:
1010
commit_tag:
11-
required: true
11+
required: false
1212
type: string
13+
default: 'local'
1314

1415
env:
1516
GOPROXY: "https://proxy.golang.org"

.github/workflows/staterecovery-testing.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ on:
88
workflow_call:
99
inputs:
1010
commit_tag:
11-
required: true
11+
required: false
1212
type: string
13+
default: 'local'
1314
secrets:
1415
DOCKERHUB_USERNAME:
1516
required: false

.github/workflows/status-network-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
uses: "actions/setup-node@v3"
3939
with:
4040
cache: "pnpm"
41-
node-version: "lts/*"
41+
node-version: "22.x"
4242

4343
- name: "Install the Node.js dependencies"
4444
run: "pnpm install"
@@ -158,7 +158,7 @@ jobs:
158158
uses: "actions/setup-node@v3"
159159
with:
160160
cache: "pnpm"
161-
node-version: "lts/*"
161+
node-version: "22.x"
162162

163163
- name: "Install the Node.js dependencies"
164164
run: "pnpm install"

.github/workflows/testing.yml

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,22 @@ permissions:
77
on:
88
workflow_call:
99
inputs:
10-
coordinator_changed:
11-
required: true
12-
type: string
13-
staterecovery_changed:
14-
required: true
15-
type: string
1610
postman_changed:
1711
required: true
1812
type: string
19-
prover_changed:
20-
required: true
21-
type: string
2213
transaction_exclusion_api_changed:
2314
required: true
2415
type: string
25-
smart_contracts_changed:
16+
linea_sequencer_changed:
2617
required: true
2718
type: string
28-
linea_sequencer_changed:
19+
rln_prover_changed:
2920
required: true
3021
type: string
3122

3223
jobs:
3324
# Cache for pulling Docker images is disabled as we empirically found that this
3425
# (retrieving cache and loading Docker images) actually increased test time-to-completion
35-
coordinator:
36-
uses: ./.github/workflows/coordinator-testing.yml
37-
if: ${{ inputs.coordinator_changed == 'true' }}
38-
secrets: inherit
39-
40-
prover:
41-
uses: ./.github/workflows/prover-testing.yml
42-
if: ${{ inputs.prover_changed == 'true' }}
43-
secrets: inherit
44-
4526
postman:
4627
uses: ./.github/workflows/postman-testing.yml
4728
if: ${{ inputs.postman_changed == 'true' }}
@@ -52,25 +33,20 @@ jobs:
5233
if: ${{ inputs.transaction_exclusion_api_changed == 'true' }}
5334
secrets: inherit
5435

55-
staterecovery:
56-
uses: ./.github/workflows/staterecovery-testing.yml
57-
if: ${{ inputs.staterecovery_changed == 'true' }}
58-
secrets: inherit
59-
60-
smart-contracts:
61-
uses: ./.github/workflows/run-smc-tests.yml
62-
if: ${{ inputs.smart_contracts_changed == 'true' }}
63-
secrets: inherit
64-
6536
linea-sequencer:
6637
uses: ./.github/workflows/linea-sequencer-plugin-testing.yml
6738
if: ${{ inputs.linea_sequencer_changed == 'true' }}
6839
secrets: inherit
6940

41+
rln-prover:
42+
uses: ./.github/workflows/rln-prover-tests.yml
43+
if: ${{ inputs.rln_prover_changed == 'true' }}
44+
secrets: inherit
45+
7046
# If all jobs are skipped, the workflow will still succeed.
7147
always_succeed:
7248
runs-on: ubuntu-latest
73-
if: ${{ inputs.coordinator_changed == 'false' && inputs.prover_changed == 'false' && inputs.postman_changed == 'false' && inputs.transaction_exclusion_api_changed == 'false' }}
49+
if: ${{ inputs.postman_changed == 'false' && inputs.transaction_exclusion_api_changed == 'false' && inputs.linea_sequencer_changed == 'false' && inputs.rln_prover_changed == 'false' }}
7450
steps:
7551
- name: Ensure Workflow Success
7652
run: echo "All jobs were skipped, but workflow succeeds."

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,7 @@ __pycache__/
145145
!prover/**/verifying_key.bin
146146
!/sdk/src/lib/compressor/bin
147147

148-
custom-besu-package
148+
custom-besu-package
149+
lib/forge-std
150+
lib/openzeppelin-contracts
151+
lib/openzeppelin-contracts-upgradeable

0 commit comments

Comments
 (0)