Skip to content

Commit cd5bd77

Browse files
Merge branch 'master' into Execution/Consensus-interface-over-RPC
2 parents 4501faf + 179bd98 commit cd5bd77

File tree

164 files changed

+4094
-2076
lines changed

Some content is hidden

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

164 files changed

+4094
-2076
lines changed

.github/actions/lint-go/action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: 'Lint Go Code'
3+
description: 'Runs both golangci-lint and custom linters on the Go codebase.'
4+
5+
runs:
6+
using: composite
7+
8+
steps:
9+
- name: GolangCI Lint
10+
uses: golangci/golangci-lint-action@v9
11+
with:
12+
version: v2.5
13+
14+
- name: Custom Lint
15+
shell: bash
16+
run: go run ./linters ./...

.github/workflows/_arbitrator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v5
16+
uses: actions/checkout@v6
1717
with:
1818
submodules: recursive
1919

.github/workflows/_bold-legacy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ jobs:
99
runs-on: arbitrator-ci
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v5
12+
uses: actions/checkout@v6
1313
with:
1414
submodules: recursive
1515

1616

1717
- name: Setup CI
1818
uses: ./.github/actions/ci-setup
1919

20+
- name: Build
21+
run: make -j8 build test-go-deps
22+
2023
- name: run challenge tests
2124
run: >-
2225
${{ github.workspace }}/.github/workflows/gotestsum.sh --tags legacychallengetest

.github/workflows/_codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout repository
33-
uses: actions/checkout@v5
33+
uses: actions/checkout@v6
3434

3535
- name: Download JUnit reports
3636
uses: actions/download-artifact@v6

.github/workflows/_detect-changes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v5
24+
uses: actions/checkout@v6
2525
with:
2626
submodules: recursive
2727
fetch-depth: 10 # Will cover most PRs

.github/workflows/_fast.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: arbitrator-ci
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v5
12+
uses: actions/checkout@v6
1313
with:
1414
submodules: recursive
1515

@@ -22,11 +22,5 @@ jobs:
2222
- name: Build all lint dependencies
2323
run: make -j8 build-node-deps
2424

25-
- name: GolangCI Lint
26-
uses: golangci/golangci-lint-action@v9
27-
with:
28-
version: v2.5
29-
30-
- name: Custom Lint
31-
run: |
32-
go run ./linters ./...
25+
- name: Setup CI
26+
uses: ./.github/actions/lint-go

.github/workflows/_go-tests.yml

Lines changed: 100 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,52 @@
22
name: nitro-go-tests
33
on:
44
workflow_call:
5+
inputs:
6+
run-name:
7+
required: true
8+
type: string
9+
description: "The name of the test run. It will be used for labeling artifacts."
10+
run-defaults-a:
11+
required: false
12+
type: boolean
13+
run-defaults-b:
14+
required: false
15+
type: boolean
16+
run-flaky:
17+
required: false
18+
type: boolean
19+
run-pathdb:
20+
required: false
21+
type: boolean
22+
run-stylus:
23+
required: false
24+
type: boolean
25+
run-challenge:
26+
required: false
27+
type: boolean
28+
run-l3challenge:
29+
required: false
30+
type: boolean
31+
run-legacy-challenge:
32+
required: false
33+
type: boolean
34+
run-race:
35+
required: false
36+
type: boolean
37+
run-long:
38+
required: false
39+
type: boolean
40+
run-execution-spec-tests:
41+
required: false
42+
type: boolean
43+
run-pebble:
44+
required: false
45+
type: boolean
546

647
jobs:
748
go-tests:
8-
name: Full Go tests (matrix)
49+
name: Go tests
950
runs-on: arbitrator-ci
10-
strategy:
11-
fail-fast: false
12-
matrix:
13-
test-mode: [defaults-A, defaults-B, flaky, pathdb, challenge, stylus, l3challenge]
1451
services:
1552
redis:
1653
image: redis
@@ -19,7 +56,7 @@ jobs:
1956

2057
steps:
2158
- name: Checkout
22-
uses: actions/checkout@v5
59+
uses: actions/checkout@v6
2360
with:
2461
submodules: recursive
2562

@@ -37,21 +74,21 @@ jobs:
3774
- name: Build
3875
run: make -j8 build test-go-deps
3976

40-
- name: Build all lint dependencies
77+
- name: Build node dependencies
4178
run: make -j8 build-node-deps
4279

4380
# --------------------- PATHDB MODE ---------------------
4481

4582
- name: run tests without race detection and path state scheme
46-
if: matrix.test-mode == 'pathdb'
83+
if: inputs.run-pathdb
4784
run: >-
4885
${{ github.workspace }}/.github/workflows/gotestsum.sh
4986
--tags cionly --timeout 90m --cover --test_state_scheme path
5087
5188
# --------------------- DEFAULTS MODE ---------------------
5289

5390
- name: run tests without race detection and hash state scheme (A-batch)
54-
if: matrix.test-mode == 'defaults-A'
91+
if: inputs.run-defaults-a
5592
id: run-tests-defaults-a
5693
continue-on-error: true
5794
run: >-
@@ -60,7 +97,7 @@ jobs:
6097
--junitfile test-results/junit-a.xml --run '^Test[A-L]'
6198
6299
- name: run tests without race detection and hash state scheme (B-batch)
63-
if: matrix.test-mode == 'defaults-B'
100+
if: inputs.run-defaults-b
64101
id: run-tests-defaults-b
65102
continue-on-error: true
66103
run: >-
@@ -69,18 +106,18 @@ jobs:
69106
--junitfile test-results/junit-b.xml --skip '^Test[A-L]'
70107
71108
- name: Process JUnit XML logs
72-
if: startsWith(matrix.test-mode, 'defaults') && always()
109+
if: (inputs.run-defaults-a || inputs.run-defaults-b) && always()
73110
run: python3 ${{ github.workspace }}/.github/workflows/process_junit.py test-results/
74111

75112
- name: Upload Go test Artifacts
76-
if: startsWith(matrix.test-mode, 'defaults') && always()
113+
if: (inputs.run-defaults-a || inputs.run-defaults-b) && always()
77114
uses: actions/upload-artifact@v5
78115
with:
79-
name: junit-reports-go-${{ matrix.test-mode }}
116+
name: junit-reports-go-${{ inputs.run-defaults-a && 'defaults-a' || 'defaults-b' }}
80117
path: test-results/junit*.xml
81118

82119
- name: Fail if tests failed
83-
if: (matrix.test-mode == 'defaults-A' && steps.run-tests-defaults-a.outcome == 'failure') || (matrix.test-mode == 'defaults-B' && steps.run-tests-defaults-b.outcome == 'failure')
120+
if: (inputs.run-defaults-a && steps.run-tests-defaults-a.outcome == 'failure') || (inputs.run-defaults-b && steps.run-tests-defaults-b.outcome == 'failure')
84121
run: |
85122
echo "One or more tests failed."
86123
exit 1
@@ -92,13 +129,13 @@ jobs:
92129
--tags cionly --timeout 60m --test_state_scheme hash --consensus_execution_in_same_process_use_rpc
93130
94131
- name: run redis tests
95-
if: matrix.test-mode == 'defaults-A'
132+
if: inputs.run-defaults-a
96133
run: >-
97134
gotestsum --format short-verbose -- -p 1 -run TestRedis ./arbnode/... ./system_tests/...
98135
-coverprofile=coverage-redis.txt -covermode=atomic -coverpkg=./... -- --test_redis=redis://localhost:6379/0
99136
100137
- name: Upload coverage to Codecov
101-
if: startsWith(matrix.test-mode, 'defaults')
138+
if: inputs.run-defaults-a || inputs.run-defaults-b
102139
uses: codecov/codecov-action@v5
103140
with:
104141
fail_ci_if_error: false
@@ -107,21 +144,21 @@ jobs:
107144
token: ${{ secrets.CODECOV_TOKEN }}
108145

109146
- name: create block input json file
110-
if: matrix.test-mode == 'defaults-A'
147+
if: inputs.run-defaults-a
111148
run: >-
112149
gotestsum --format short-verbose -- -run TestProgramStorage$ ./system_tests/... --count 1 --
113150
--recordBlockInputs.enable=true --recordBlockInputs.WithBaseDir="${{ github.workspace }}/target"
114151
--recordBlockInputs.WithTimestampDirEnabled=false --recordBlockInputs.WithBlockIdInFileNameEnabled=false
115152
116153
- name: run arbitrator prover on block input json
117-
if: matrix.test-mode == 'defaults-A'
154+
if: inputs.run-defaults-a
118155
run: |
119156
make build-prover-bin
120157
target/bin/prover target/machines/latest/machine.wavm.br -b \
121158
--json-inputs="${{ github.workspace }}/target/TestProgramStorage/block_inputs.json"
122159
123160
- name: run jit prover on block input json
124-
if: matrix.test-mode == 'defaults-A'
161+
if: inputs.run-defaults-a
125162
run: |
126163
make build-jit
127164
if [ -n "$(target/bin/jit \
@@ -135,7 +172,7 @@ jobs:
135172
# --------------------- FLAKY MODE --------------------------
136173

137174
- name: run flaky tests
138-
if: matrix.test-mode == 'flaky'
175+
if: inputs.run-flaky
139176
continue-on-error: true
140177
run: >-
141178
${{ github.workspace }}/.github/workflows/gotestsum.sh
@@ -144,27 +181,64 @@ jobs:
144181
# --------------------- CHALLENGE MODES ---------------------
145182

146183
- name: build challenge tests
147-
if: matrix.test-mode == 'challenge'
148-
run: go test -tags challengetest ./... -run=^$ -v
184+
if: inputs.run-challenge
185+
run: >-
186+
${{ github.workspace }}/.github/workflows/gotestsum.sh --tags challengetest
187+
--run TestChallenge --timeout 120m --cover
149188
150189
- name: run L3 challenge tests
151-
if: matrix.test-mode == 'l3challenge'
190+
if: inputs.run-l3challenge
152191
run: >-
153192
${{ github.workspace }}/.github/workflows/gotestsum.sh
154193
--tags challengetest --run TestL3Challenge --timeout 120m --cover
155194
156-
# --------------------- CHALLENGE MODES ---------------------
195+
- name: run legacy challenge tests
196+
if: inputs.run-legacy-challenge
197+
run: >-
198+
${{ github.workspace }}/.github/workflows/gotestsum.sh --tags legacychallengetest
199+
--run TestChallenge --timeout 60m --cover
200+
201+
# --------------------- STYLUS MODE ---------------------
157202

158203
- name: run stylus tests
159-
if: matrix.test-mode == 'stylus'
204+
if: inputs.run-stylus
160205
run: >-
161206
${{ github.workspace }}/.github/workflows/gotestsum.sh
162207
--tags stylustest --run TestProgramArbitrator --timeout 60m --cover
163208
209+
# --------------------- RACE MODE ---------------------
210+
211+
- name: run race tests
212+
if: inputs.run-race
213+
run: >-
214+
${{ github.workspace }}/.github/workflows/gotestsum.sh
215+
--race --timeout 90m --test_state_scheme hash
216+
217+
218+
# --------------------- LONG MODE ---------------------
219+
220+
- name: run long tests
221+
if: inputs.run-long
222+
run: >-
223+
${{ github.workspace }}/.github/workflows/gotestsum.sh --tags stylustest
224+
--run TestProgramLong --timeout 60m --cover
225+
226+
# --------------------- EXECUTION SPEC MODE ---------------------
227+
228+
- name: run execution spec tests
229+
if: inputs.run-execution-spec-tests
230+
run: ${{ github.workspace }}/.github/workflows/runExecutionSpecTests.sh
231+
232+
# --------------------- PEBBLE MODE ---------------------
233+
234+
- name: run pebble tests
235+
if: inputs.run-pebble
236+
run: ${{ github.workspace }}/.github/workflows/gotestsum.sh --timeout 90m --test_database_engine pebble
237+
164238
# --------------------- ARCHIVE LOGS FOR ALL MODES ---------------------
165239

166240
- name: Archive detailed run log
167241
uses: actions/upload-artifact@v5
168242
with:
169-
name: ${{ matrix.test-mode }}-full.log
243+
name: ${{ inputs.run-name }}-full.log
170244
path: full.log
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: standard-go-test-suite
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
main:
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
test-mode: [defaults-A, defaults-B, flaky, pathdb, challenge, stylus, l3challenge]
12+
uses: ./.github/workflows/_go-tests.yml
13+
secrets: inherit
14+
with:
15+
run-name: ${{ matrix.test-mode }}
16+
run-defaults-a: ${{ matrix.test-mode == 'defaults-A' }}
17+
run-defaults-b: ${{ matrix.test-mode == 'defaults-B' }}
18+
run-flaky: ${{ matrix.test-mode == 'flaky' }}
19+
run-pathdb: ${{ matrix.test-mode == 'pathdb' }}
20+
run-challenge: ${{ matrix.test-mode == 'challenge' }}
21+
run-stylus: ${{ matrix.test-mode == 'stylus' }}
22+
run-l3challenge: ${{ matrix.test-mode == 'l3challenge' }}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
# --- Full GO tests (not required by can_proceed) ---
3939
go-tests:
40-
uses: ./.github/workflows/_go-tests.yml
40+
uses: ./.github/workflows/_standard-go-test-suite.yml
4141
secrets: inherit
4242

4343
# --- Summarize test results (not required by can_proceed) ---

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v5
28+
uses: actions/checkout@v6
2929
with:
3030
submodules: recursive
3131

0 commit comments

Comments
 (0)