Skip to content

Commit 17c6444

Browse files
authored
Merge branch 'master' into update-localnet-README-to-add-makefile-directory-to-bootstrap-instructions
2 parents 133d3ab + a8a3db6 commit 17c6444

1,280 files changed

Lines changed: 171548 additions & 41829 deletions

File tree

Some content is hidden

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

.custom-gcl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# The version of golangci-lint used to build the custom binary
2-
version: v1.63.4
2+
version: v2.7.1
33

44
# The name of the custom binary
55
name: custom-gcl

.github/workflows/ci.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,12 @@ jobs:
5555
path: tools/custom-gcl # path defined in .custom-gcl.yml
5656
lookup-only: 'true' # if already cached, don't download here
5757
# We install the non-custom golangci-lint binary using the golangci-lint action.
58-
# The action is set up to always install and run the linter - there isn't a way to only install.
59-
# We provide args to disable all linters which results in the step immediately failing.
6058
- name: Install golangci-lint
6159
if: steps.cache-linter.outputs.cache-hit != 'true'
62-
uses: golangci/golangci-lint-action@v6
63-
continue-on-error: true # after installation (what we care about), this step will fail - this line allows workflow to continue
60+
uses: golangci/golangci-lint-action@v9
6461
with:
65-
args: "--no-config --disable-all" # set args so that no linters are actually run
66-
- name: Build custom linter binary
67-
if: steps.cache-linter.outputs.cache-hit != 'true'
68-
run: |
69-
golangci-lint custom
62+
install-only: true
63+
version: v2.7.1
7064

7165
golangci:
7266
strategy:
@@ -112,7 +106,7 @@ jobs:
112106
- name: Add custom linter binary to path
113107
run: echo "$(pwd)/tools" >> $GITHUB_PATH
114108
- name: Run golangci-lint
115-
uses: golangci/golangci-lint-action@v6
109+
uses: golangci/golangci-lint-action@v9
116110
with:
117111
install-mode: 'none' # looks for binary in path rather than downloading
118112
args: "-v"
@@ -334,6 +328,7 @@ jobs:
334328
gcr.io/flow-container-registry/collection:latest \
335329
gcr.io/flow-container-registry/consensus:latest \
336330
gcr.io/flow-container-registry/execution:latest \
331+
gcr.io/flow-container-registry/execution-ledger:latest \
337332
gcr.io/flow-container-registry/ghost:latest \
338333
gcr.io/flow-container-registry/observer:latest \
339334
gcr.io/flow-container-registry/verification:latest \

.github/workflows/image_builds.yml

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build & Promote Docker Images to Public Registry
1+
name: Build & Promote Docker Images to Public Registry
22
on:
33
workflow_dispatch:
44
inputs:
@@ -25,53 +25,59 @@ jobs:
2525
# The environment is set to 'container builds' that provides the necessary secrets for pushing to the pirvate registry.
2626
public-build:
2727
if: ${{ github.event.inputs.secure-build == 'false' }}
28-
name: Execute public repo build & push to private artifact registry
28+
name: Execute public repo build & push to private artifact registry
2929
runs-on: ubuntu-latest
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
# We specify all of the potential build commands for each role.
33+
# We specify all of the potential build commands for each role.
3434
# This allows us to build and push all images in parallel, reducing the overall build time.
3535
# The matrix is defined to include all roles & image types that we want to build and push.
3636
# These commands are targets defined in the Makefile of the repository.
3737
build_command:
3838
# access Build Commands
39-
- docker-build-access-with-adx docker-push-access-with-adx
40-
- docker-build-access-without-adx docker-push-access-without-adx
41-
- docker-build-access-without-netgo-without-adx docker-push-access-without-netgo-without-adx
42-
- docker-cross-build-access-arm docker-push-access-arm
39+
- docker-build-access-with-adx docker-push-access-with-adx
40+
- docker-build-access-without-adx docker-push-access-without-adx
41+
- docker-build-access-without-netgo-without-adx docker-push-access-without-netgo-without-adx
42+
- docker-cross-build-access-arm docker-push-access-arm
4343

4444
# collection Build Commands
45-
- docker-build-collection-with-adx docker-push-collection-with-adx
46-
- docker-build-collection-without-adx docker-push-collection-without-adx
47-
- docker-build-collection-without-netgo-without-adx docker-push-collection-without-netgo-without-adx
48-
- docker-cross-build-collection-arm docker-push-collection-arm
45+
- docker-build-collection-with-adx docker-push-collection-with-adx
46+
- docker-build-collection-without-adx docker-push-collection-without-adx
47+
- docker-build-collection-without-netgo-without-adx docker-push-collection-without-netgo-without-adx
48+
- docker-cross-build-collection-arm docker-push-collection-arm
4949

5050
# consensus Build Commands
51-
- docker-build-consensus-with-adx docker-push-consensus-with-adx
52-
- docker-build-consensus-without-adx docker-push-consensus-without-adx
53-
- docker-build-consensus-without-netgo-without-adx docker-push-consensus-without-netgo-without-adx
54-
- docker-cross-build-consensus-arm docker-push-consensus-arm
51+
- docker-build-consensus-with-adx docker-push-consensus-with-adx
52+
- docker-build-consensus-without-adx docker-push-consensus-without-adx
53+
- docker-build-consensus-without-netgo-without-adx docker-push-consensus-without-netgo-without-adx
54+
- docker-cross-build-consensus-arm docker-push-consensus-arm
5555

5656
# execution Build Commands
57-
- docker-build-execution-with-adx docker-push-execution-with-adx
58-
- docker-build-execution-without-adx docker-push-execution-without-adx
59-
- docker-build-execution-without-netgo-without-adx docker-push-execution-without-netgo-without-adx
60-
- docker-cross-build-execution-arm docker-push-execution-arm
57+
- docker-build-execution-with-adx docker-push-execution-with-adx
58+
- docker-build-execution-without-adx docker-push-execution-without-adx
59+
- docker-build-execution-without-netgo-without-adx docker-push-execution-without-netgo-without-adx
60+
- docker-cross-build-execution-arm docker-push-execution-arm
61+
62+
# execution Ledger Service Build Commands
63+
- docker-build-execution-ledger-with-adx docker-push-execution-ledger-with-adx
64+
- docker-build-execution-ledger-without-adx docker-push-execution-ledger-without-adx
65+
- docker-build-execution-ledger-without-netgo-without-adx docker-push-execution-ledger-without-netgo-without-adx
66+
- docker-cross-build-execution-ledger-arm docker-push-execution-ledger-arm
6167

6268
# observer Build Commands
63-
- docker-build-observer-with-adx docker-push-observer-with-adx
64-
- docker-build-observer-without-adx docker-push-observer-without-adx
65-
- docker-build-observer-without-netgo-without-adx docker-push-observer-without-netgo-without-adx
66-
- docker-cross-build-observer-arm docker-push-observer-arm
69+
- docker-build-observer-with-adx docker-push-observer-with-adx
70+
- docker-build-observer-without-adx docker-push-observer-without-adx
71+
- docker-build-observer-without-netgo-without-adx docker-push-observer-without-netgo-without-adx
72+
- docker-cross-build-observer-arm docker-push-observer-arm
6773

6874
# verification Build Commands
69-
- docker-build-verification-with-adx docker-push-verification-with-adx
70-
- docker-build-verification-without-adx docker-push-verification-without-adx
71-
- docker-build-verification-without-netgo-without-adx docker-push-verification-without-netgo-without-adx
72-
- docker-cross-build-verification-arm docker-push-verification-arm
75+
- docker-build-verification-with-adx docker-push-verification-with-adx
76+
- docker-build-verification-without-adx docker-push-verification-without-adx
77+
- docker-build-verification-without-netgo-without-adx docker-push-verification-without-netgo-without-adx
78+
- docker-cross-build-verification-arm docker-push-verification-arm
7379

74-
environment: container builds
80+
environment: container builds
7581
steps:
7682
- name: Setup Go
7783
uses: actions/setup-go@v4
@@ -119,7 +125,7 @@ jobs:
119125
fail-fast: false
120126
matrix:
121127
role: [access, collection, consensus, execution, observer, verification]
122-
environment: secure builds
128+
environment: secure builds
123129
steps:
124130
- uses: actions/create-github-app-token@v2
125131
id: app-token
@@ -128,13 +134,13 @@ jobs:
128134
private-key: ${{ secrets.DEPLOYMENT_APP_PRIVATE_KEY }}
129135
owner: ${{ github.repository_owner }}
130136

131-
- uses: convictional/trigger-workflow-and-wait@v1.6.1
137+
- uses: convictional/trigger-workflow-and-wait@v1.6.5
132138
with:
133139
client_payload: '{"role": "${{ matrix.role }}", "tag": "${{ inputs.tag }}"}'
134140
github_token: ${{ steps.app-token.outputs.token }}
135141
owner: 'onflow'
136-
repo: ${{ secrets.SECURE_BUILDS_REPO }}
137-
ref: master-private
142+
repo: ${{ secrets.SECURE_BUILDS_REPO }}
143+
ref: master-private
138144
workflow_file_name: 'secure_build.yml'
139145

140146
promote-to-partner-registry:
@@ -155,19 +161,19 @@ jobs:
155161
fail-fast: false
156162
matrix:
157163
role: [access]
158-
environment: ${{ matrix.role }} image promotion to partner registry
164+
environment: ${{ matrix.role }} image promotion to partner registry
159165
steps:
160166
- name: Checkout repo
161167
uses: actions/checkout@v3
162168

163-
- name: Promote ${{ matrix.role }}
169+
- name: Promote ${{ matrix.role }}
164170
uses: ./actions/promote-images
165171
with:
166172
gcp_credentials: ${{ secrets.PARTNER_REGISTRY_PROMOTION_SECRET }}
167173
private_registry: ${{ vars.PRIVATE_REGISTRY }}
168174
private_registry_host: ${{ env.PRIVATE_REGISTRY_HOST }}
169175
promotion_registry: ${{ vars.PARTNER_REGISTRY }}
170-
role: ${{ matrix.role }}
176+
role: ${{ matrix.role }}
171177
tags: "${{ inputs.tag }},${{ inputs.tag }}-without-adx,${{ inputs.tag }}-without-netgo-without-adx,${{ inputs.tag }}-arm"
172178

173179
promote-to-public-registry:
@@ -187,18 +193,18 @@ jobs:
187193
fail-fast: false
188194
matrix:
189195
role: [access, collection, consensus, execution, observer, verification]
190-
environment: ${{ matrix.role }} image promotion to public registry
196+
environment: ${{ matrix.role }} image promotion to public registry
191197
steps:
192198
- name: Checkout repo
193199
uses: actions/checkout@v3
194200

195-
- name: Promote ${{ matrix.role }}
201+
- name: Promote ${{ matrix.role }}
196202
uses: ./actions/promote-images
197203
with:
198204
gcp_credentials: ${{ secrets.PUBLIC_REGISTRY_PROMOTION_SECRET }}
199205
private_registry: ${{ vars.PRIVATE_REGISTRY }}
200206
private_registry_host: ${{ env.PRIVATE_REGISTRY_HOST }}
201207
promotion_registry: ${{ vars.PUBLIC_REGISTRY }}
202-
role: ${{ matrix.role }}
208+
role: ${{ matrix.role }}
203209
tags: "${{ inputs.tag }},${{ inputs.tag }}-without-adx,${{ inputs.tag }}-without-netgo-without-adx,${{ inputs.tag }}-arm"
204210

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ flowdb
4343
.idea
4444
.vscode
4545
*.code-workspace
46+
*.worktrees
47+
.claude/
48+
.local/
4649
# ignore all files in the .cursor directory, except for the rules directory
4750
.cursor/*
4851
!.cursor/rules/

.golangci.yml

Lines changed: 84 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,89 @@
1-
run:
2-
timeout: 10m
3-
4-
linters-settings:
5-
goimports:
6-
# enforced by linter
7-
# put imports beginning with prefix after 3rd-party packages;
8-
# it's a comma-separated list of prefixes
9-
local-prefixes: github.com/onflow/flow-go/
10-
11-
# used to generate canonical import ordering
12-
# not enforced by linter
13-
gci:
14-
sections:
15-
- standard # 1. standard library
16-
- default # 2. external packages
17-
- prefix(github.com/onflow/) # 3. org packages
18-
- prefix(github.com/onflow/flow-go/) # 4. project packages
19-
skip-generated: true
20-
custom-order: true
21-
22-
gosec:
23-
# To select a subset of rules to run.
24-
# Available rules: https://github.com/securego/gosec#available-rules
25-
includes:
26-
- G401
27-
- G402
28-
- G501
29-
- G502
30-
- G503
31-
- G505
32-
33-
staticcheck:
34-
# Disable SA1019 to allow use of deprecated label
35-
checks: ["all", "-SA1019"]
36-
37-
custom:
38-
structwrite:
39-
type: module
40-
description: "disallow struct field writes outside constructor"
41-
original-url: "github.com/onflow/flow-go/tools/structwrite"
42-
1+
version: "2"
432
linters:
443
enable:
45-
- goimports
464
- gosec
475
- structwrite
6+
settings:
7+
gosec:
8+
includes:
9+
- G401
10+
- G402
11+
- G501
12+
- G502
13+
- G503
14+
- G505
15+
staticcheck:
16+
checks:
17+
- all
18+
- -SA1019
4819

49-
issues:
50-
exclude-rules:
51-
- path: _test\.go # disable some linters on test files
52-
linters:
53-
- unused
54-
- structwrite
55-
- path: 'consensus/hotstuff/helper/*' # disable some linters on test helper files
56-
linters:
57-
- structwrite
58-
- path: 'utils/unittest/*' # disable some linters on test files
59-
linters:
60-
- structwrite
61-
- path: 'consensus/hotstuff/helper/*' # disable some linters on test files
62-
linters:
63-
- structwrite
64-
- path: 'engine/execution/testutil/*' # disable some linters on test files
65-
linters:
66-
- structwrite
67-
# typecheck currently not handling the way we do function inheritance well
68-
# disabling for now
69-
- path: 'cmd/access/node_build/*'
70-
linters:
71-
- typecheck
72-
- path: 'cmd/observer/node_builder/*'
73-
linters:
74-
- typecheck
75-
- path: 'follower/*'
76-
linters:
77-
- typecheck
20+
# TODO: these were added to allow updating to the latest version of the linter.
21+
# Update the code to remove these issues instead of suppressing them.
22+
- -QF1001 # could apply De Morgan's law" were hidden
23+
- -QF1003 # could use tagged switch on chainID (staticcheck)
24+
- -QF1006 # could lift into loop condition (staticcheck)
25+
- -QF1008 # could remove embedded field \"BaseConfig\" from selector" were hidden
26+
- -QF1011 # could omit type flow.IdentifierList from declaration; it will be inferred from the right-hand side" were hidden
27+
- -QF1012 # Use fmt.Fprintf(...) instead of Write([]byte(fmt.Sprintf(...))) (staticcheck)
28+
- -S1021 # should merge variable declaration with assignment on next line (staticcheck)
29+
- -ST1003 # should not use underscores in package names" were hidden
30+
- -ST1005 # error strings should not be capitalized" were hidden
31+
- -ST1006 # receiver name should not be an underscore, omit the name if it is unused (staticcheck)
32+
- -ST1008 # error should be returned as the last argument" were hidden
33+
- -ST1012 # error var factoryError should have name of the form errFoo" were hidden
34+
- -ST1016 # methods on the same type should have the same receiver name (seen 45x "db", 4x "s") (staticcheck)
35+
- -ST1017 # don't use Yoda conditions" were hidden
36+
- -ST1023 # should omit type flow.IdentifierList from declaration; it will be inferred from the right-hand side" were hidden
37+
custom:
38+
structwrite:
39+
type: module
40+
description: disallow struct field writes outside constructor
41+
original-url: github.com/onflow/flow-go/tools/structwrite
42+
exclusions:
43+
generated: lax
44+
presets:
45+
- comments
46+
- common-false-positives
47+
- legacy
48+
- std-error-handling
49+
rules:
50+
- linters:
51+
- structwrite
52+
- unused
53+
path: _test\.go
54+
- linters:
55+
- structwrite
56+
path: consensus/hotstuff/helper/*
57+
- linters:
58+
- structwrite
59+
path: utils/unittest/*
60+
- linters:
61+
- structwrite
62+
path: consensus/hotstuff/helper/*
63+
- linters:
64+
- structwrite
65+
path: engine/execution/testutil/*
66+
paths:
67+
- third_party$
68+
- builtin$
69+
- examples$
70+
formatters:
71+
enable:
72+
- goimports
73+
settings:
74+
gci:
75+
sections:
76+
- standard
77+
- default
78+
- prefix(github.com/onflow/)
79+
- prefix(github.com/onflow/flow-go/)
80+
custom-order: true
81+
goimports:
82+
local-prefixes:
83+
- github.com/onflow/flow-go/
84+
exclusions:
85+
generated: lax
86+
paths:
87+
- third_party$
88+
- builtin$
89+
- examples$

0 commit comments

Comments
 (0)