Skip to content

Commit 2d51672

Browse files
committed
Merge remote-tracking branch 'origin/master' into network-state-provider
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # shared/services/ec-manager.go # shared/services/requirements.go
2 parents badc2b3 + c81c4e8 commit 2d51672

529 files changed

Lines changed: 3710 additions & 3401 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.

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: actions/setup-go@v5
1919
with:
20-
go-version: 1.25.1
20+
go-version: 1.26.2
2121
- run: make NO_DOCKER=true release
2222
docker-build:
2323
runs-on: ubuntu-latest

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
- uses: actions/checkout@v4
2020
- uses: actions/setup-go@v5
2121
with:
22-
go-version: 1.25.1
22+
go-version: 1.26.2
2323
- name: golangci-lint
2424
uses: golangci/golangci-lint-action@v8
2525
with:
2626
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
27-
version: v2.4
27+
version: v2.11
2828

2929
# Optional: working directory, useful for monorepos
3030
# working-directory: ${{ matrix.modules }}

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v4
2020
- uses: actions/setup-go@v5
2121
with:
22-
go-version: 1.25.1
22+
go-version: 1.26.2
2323
- run: go test -test.timeout 20m $(go list ./... | grep -v bindings) -coverprofile=./cover.out -coverpkg=./...
2424
# upload the plaintext coverage report
2525
- name: Upload txt coverage report

.golangci.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,46 @@
11
version: "2"
22
linters:
3-
default: none
3+
enable:
4+
- revive
5+
settings:
6+
revive:
7+
enable-default-rules: true
8+
rules:
9+
- name: exported
10+
disabled: true
11+
- name: var-naming
12+
disabled: true
13+
- name: package-comments
14+
disabled: true
15+
- name: unused-parameter
16+
disabled: true
17+
- name: error-strings
18+
disabled: true
19+
staticcheck:
20+
checks:
21+
- all
22+
# A `-` preceding a linter name disables it.
23+
# Disable ST1000 to allow packages without comments
24+
- -ST1000
25+
# Disable ST1005 to allow error strings to start with uppercase letters
26+
- -ST1005
27+
# Disable ST1003 to allow underscores in variable names
28+
- -ST1003
29+
# Disable these 3 to allow comments on exported things to have the improper form
30+
- -ST1020
31+
- -ST1021
32+
- -ST1022
33+
errcheck:
34+
exclude-functions:
35+
- (*os.File).Close
36+
37+
438
formatters:
539
enable:
640
- goimports
741
run:
842
relative-path-mode: cfg
9-
go: '1.25.1'
43+
go: '1.26.2'
1044
output:
1145
formats:
1246
text:

Makefile

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ define rocketpool-cli-template
2525
${BIN_DIR}/rocketpool-cli-$1-$2: ${bin_deps}
2626
@echo "Building rocketpool-cli-$1-$2"
2727
ifndef NO_DOCKER
28-
docker run --rm -v ./:/src --user $(shell id -u):$(shell id -g) -e CGO_ENABLED=0 \
29-
-e GOARCH=$2 -e GOOS=$1 --workdir /src -v ~/.cache:/.cache rocketpool/smartnode-builder:${VERSION} \
30-
go build -o $$@ ./rocketpool-cli/
28+
docker run --rm -v ./:/src --user $(shell id -u):$(shell id -g) \
29+
-e CGO_ENABLED=0 -e XDG_CACHE_HOME=/go/.cache \
30+
-e GOMODCACHE=/go/.cache/pkg/mod \
31+
-e GOCACHE=/go/.cache/go-build \
32+
-e GOARCH=$2 -e GOOS=$1 \
33+
--workdir /src -v ~/.cache:/go/.cache \
34+
rocketpool/smartnode-builder:${VERSION} go build -o $$@ ./rocketpool-cli/
3135
else
3236
CGO_ENABLED=0 GOOS=$1 GOARCH=$2 go build -o $$@ ./rocketpool-cli/
3337
endif
@@ -66,18 +70,28 @@ ifndef NO_DOCKER
6670
bin_deps += docker-builder
6771
endif
6872

69-
docker_build_cmd_amd64 = docker run --rm -v ./:/src --user $(shell id -u):$(shell id -g) -e CGO_ENABLED=1 -e CGO_CFLAGS="-O -D__BLST_PORTABLE__" \
70-
-e GOARCH=amd64 -e GOOS=linux --workdir /src -v ~/.cache:/.cache rocketpool/smartnode-builder:${VERSION} \
71-
go build
73+
docker_build_cmd_amd64 = docker run --rm -v ./:/src --user $(shell id -u):$(shell id -g) \
74+
-e CGO_ENABLED=1 -e CGO_CFLAGS="-O -D__BLST_PORTABLE__" \
75+
-e GOARCH=amd64 -e GOOS=linux \
76+
-e XDG_CACHE_HOME=/go/.cache \
77+
-e GOMODCACHE=/go/.cache/pkg/mod \
78+
-e GOCACHE=/go/.cache/go-build \
79+
--workdir /src -v ~/.cache:/go/.cache \
80+
rocketpool/smartnode-builder:${VERSION} go build
7281
local_build_cmd_amd64 = CGO_ENABLED=1 CGO_CFLAGS="-O -D__BLST_PORTABLE__" GOARCH=amd64 GOOS=linux go build
73-
docker_build_cmd_arm64 = docker run --rm -v ./:/src --user $(shell id -u):$(shell id -g) -e CGO_ENABLED=1 -e CGO_CFLAGS="-O -D__BLST_PORTABLE__" \
74-
-e CC=aarch64-linux-gnu-gcc -e CXX=aarch64-linux-gnu-cpp -e CGO_CFLAGS="-O -D__BLST_PORTABLE__" -e GOARCH=arm64 -e GOOS=linux \
75-
--workdir /src -v ~/.cache:/.cache rocketpool/smartnode-builder:${VERSION} \
76-
go build
82+
docker_build_cmd_arm64 = docker run --rm -v ./:/src --user $(shell id -u):$(shell id -g) \
83+
-e CGO_ENABLED=1 -e CC=aarch64-linux-gnu-gcc -e CXX=aarch64-linux-gnu-cpp \
84+
-e CGO_CFLAGS="-O -D__BLST_PORTABLE__" -e GOARCH=arm64 -e GOOS=linux \
85+
-e XDG_CACHE_HOME=/go/.cache \
86+
-e GOMODCACHE=/go/.cache/pkg/mod \
87+
-e GOCACHE=/go/.cache/go-build \
88+
--workdir /src -v ~/.cache:/go/.cache \
89+
rocketpool/smartnode-builder:${VERSION} go build
7790
local_build_cmd_arm64 = CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-cpp CGO_CFLAGS="-O -D__BLST_PORTABLE__" GOARCH=arm64 GOOS=linux go build
7891
# amd64 daemon build
7992
.PHONY: ${BIN_DIR}/rocketpool-daemon-linux-amd64
8093
${BIN_DIR}/rocketpool-daemon-linux-amd64: ${bin_deps}
94+
@echo "Building rocketpool-daemon-linux-amd64"
8195
ifndef NO_DOCKER
8296
${docker_build_cmd_amd64} -o $@ rocketpool/rocketpool.go
8397
else
@@ -87,6 +101,7 @@ endif
87101
# arm64 daemon build
88102
.PHONY: ${BIN_DIR}/rocketpool-daemon-linux-arm64
89103
${BIN_DIR}/rocketpool-daemon-linux-arm64: ${bin_deps}
104+
@echo "Building rocketpool-daemon-linux-arm64"
90105
ifndef NO_DOCKER
91106
${docker_build_cmd_arm64} -o $@ rocketpool/rocketpool.go
92107
else
@@ -105,6 +120,7 @@ $(foreach oos,$(CLI_TARGET_OOS),$(foreach arch,$(ARCHS),$(eval $(call rocketpool
105120
# amd64 treegen build
106121
.PHONY: ${BIN_DIR}/treegen-linux-amd64
107122
${BIN_DIR}/treegen-linux-amd64: ${bin_deps}
123+
@echo "Building treegen-linux-amd64"
108124
ifndef NO_DOCKER
109125
${docker_build_cmd_amd64} -o $@ ./treegen/.
110126
else
@@ -114,6 +130,7 @@ endif
114130
# arm64 treegen build
115131
.PHONY: ${BIN_DIR}/treegen-linux-arm64
116132
${BIN_DIR}/treegen-linux-arm64: ${bin_deps}
133+
@echo "Building treegen-linux-arm64"
117134
ifndef NO_DOCKER
118135
${docker_build_cmd_arm64} -o $@ ./treegen/.
119136
else
@@ -123,6 +140,7 @@ endif
123140
# amd64 state-cli build
124141
.PHONY: ${TOOLS_DIR}/state-cli-linux-amd64
125142
${TOOLS_DIR}/state-cli-linux-amd64: ${bin_deps}
143+
@echo "Building state-cli-linux-amd64"
126144
ifndef NO_DOCKER
127145
${docker_build_cmd_amd64} -o $@ ./shared/services/state/cli/.
128146
else
@@ -132,6 +150,7 @@ endif
132150
# arm64 state-cli build
133151
.PHONY: ${TOOLS_DIR}/state-cli-linux-arm64
134152
${TOOLS_DIR}/state-cli-linux-arm64: ${bin_deps}
153+
@echo "Building state-cli-linux-arm64"
135154
ifndef NO_DOCKER
136155
${docker_build_cmd_arm64} -o $@ ./shared/services/state/cli/.
137156
else
@@ -151,14 +170,14 @@ docker: ${BUILD_DIR}/docker-buildx-builder
151170

152171
.PHONY: docker-push
153172
docker-push: ${BUILD_DIR}/docker-buildx-builder
154-
echo -n "Building ${VERSION} and publishing containers. Continue? [yN]: " && read ans && if [ $${ans:-'N'} != 'y' ]; then exit 1; fi
173+
@echo -n "Building ${VERSION} and publishing containers. Continue? [yN]: " && read ans && if [ $${ans:-'N'} != 'y' ]; then exit 1; fi
155174
# override the output type to push to dockerhub
156175
VERSION=${VERSION} ${SOURCE} docker bake --builder smartnode-builder -f docker/daemon-bake.hcl smartnode --set "smartnode.output=type=registry"
157-
echo "Done!"
176+
@echo "Done!"
158177

159178
.PHONY: docker-latest
160179
docker-latest: ${BUILD_DIR}/docker-buildx-builder
161-
echo -n "Building ${VERSION}, tagging as latest, and publishing. Continue? [yN]: " && read ans && if [ $${ans:-'N'} != 'y' ]; then exit 1; fi
180+
@echo -n "Building ${VERSION}, tagging as latest, and publishing. Continue? [yN]: " && read ans && if [ $${ans:-'N'} != 'y' ]; then exit 1; fi
162181
# override the output type to push to dockerhub, and the tags array to tag latest
163182
VERSION=${VERSION} ${SOURCE} docker bake --builder smartnode-builder -f docker/daemon-bake.hcl smartnode --set "smartnode.output=type=registry" --set "smartnode.tags=rocketpool/smartnode:latest"
164183

@@ -169,10 +188,18 @@ docker-prune:
169188
docker buildx rm smartnode-builder
170189
rm ${BUILD_DIR}/docker-buildx-builder
171190

191+
golangci_lint_version = v2.11
192+
docker_lint_cmd = docker run -e XDG_CACHE_HOME=/go/.cache -e GOMODCACHE=/go/.cache/pkg/mod -e GOCACHE=/go/.cache/go-build -e GOLANGCI_LINT_CACHE=/go/.cache/golangci-lint \
193+
--user $(shell id -u):$(shell id -g) --rm -v ~/.cache:/go/.cache -v .:/smartnode --workdir /smartnode/ golangci/golangci-lint:${golangci_lint_version}-alpine golangci-lint
194+
local_lint_cmd = GOTOOLCHAIN=go1.26.2 go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${golangci_lint_version}
172195
.PHONY: lint
173196
lint:
174-
ifndef NO_DOCKER
175-
docker run -e GOMODCACHE=/go/.cache/pkg/mod -e GOCACHE=/go/.cache/go-build -e GOLANGCI_LINT_CACHE=/go/.cache/golangci-lint --user $(shell id -u):$(shell id -g) --rm -v ~/.cache:/go/.cache -v .:/smartnode --workdir /smartnode/ golangci/golangci-lint:v2.4-alpine golangci-lint fmt --diff
197+
ifdef NO_DOCKER
198+
$(local_lint_cmd) run
199+
$(local_lint_cmd) fmt --diff
200+
else
201+
$(docker_lint_cmd) run
202+
$(docker_lint_cmd) fmt --diff
176203
endif
177204

178205
.PHONY: test
@@ -183,3 +210,7 @@ test:
183210
clean:
184211
rm -rf ${BUILD_DIR}
185212
docker buildx rm smartnode-builder
213+
214+
.PHONY: fmt
215+
fmt:
216+
go run golang.org/x/tools/cmd/goimports@v0.44.0 -local github.com/rocket-pool/smartnode -w .

addons/rescue_node/addon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type credentialDetails struct {
2727

2828
func (c *credentialDetails) GetTimeLeft() time.Duration {
2929

30-
if c.solo == true {
30+
if c.solo {
3131
return time.Until(c.issued.Add(soloAuthValidity))
3232
}
3333

bindings/dao/claim.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"sync"
66

77
"github.com/ethereum/go-ethereum/accounts/abi/bind"
8+
89
"github.com/rocket-pool/smartnode/bindings/rocketpool"
910
)
1011

bindings/dao/protocol/dao.go

Lines changed: 0 additions & 18 deletions
This file was deleted.

bindings/dao/protocol/proposal.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ import (
1313
"github.com/ethereum/go-ethereum/accounts/abi"
1414
"github.com/ethereum/go-ethereum/accounts/abi/bind"
1515
"github.com/ethereum/go-ethereum/common"
16+
"golang.org/x/sync/errgroup"
17+
1618
"github.com/rocket-pool/smartnode/bindings/dao"
1719
"github.com/rocket-pool/smartnode/bindings/rocketpool"
1820
"github.com/rocket-pool/smartnode/bindings/types"
1921
strutils "github.com/rocket-pool/smartnode/bindings/utils/strings"
20-
"golang.org/x/sync/errgroup"
2122
)
2223

2324
// Settings

bindings/dao/protocol/proposals.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/ethereum/go-ethereum/accounts/abi/bind"
1010
"github.com/ethereum/go-ethereum/common"
1111
"github.com/ethereum/go-ethereum/common/math"
12+
1213
"github.com/rocket-pool/smartnode/bindings/rocketpool"
1314
"github.com/rocket-pool/smartnode/bindings/types"
1415
)

0 commit comments

Comments
 (0)