Skip to content

Commit ef966b1

Browse files
chore: set beelocal branch to update-k3s-1.30.3 and go 1.23 upgrade (#4878)
1 parent fb6c2e8 commit ef966b1

File tree

100 files changed

+213
-344
lines changed

Some content is hidden

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

100 files changed

+213
-344
lines changed

.github/workflows/beekeeper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- "**"
99

1010
env:
11-
K3S_VERSION: "v1.22.17+k3s1"
11+
K3S_VERSION: "v1.30.3+k3s1"
1212
REPLICA: 3
1313
RUN_TYPE: "PR RUN"
1414
SETUP_CONTRACT_IMAGE: "ethersphere/bee-localchain"

.github/workflows/go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ jobs:
6767
if: github.ref != 'refs/heads/master'
6868
uses: wagoid/commitlint-github-action@v5
6969
- name: GolangCI-Lint
70-
uses: golangci/golangci-lint-action@v4
70+
uses: golangci/golangci-lint-action@v6
7171
with:
7272
skip-cache: false
73-
version: v1.54.1
73+
version: v1.61.0
7474
- name: Whitespace check
7575
run: make check-whitespace
7676
- name: go mod tidy check

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ linters:
44
enable:
55
- asciicheck
66
- bidichk
7-
# - depguard disable temporary until this issue is resolved: https://github.com/golangci/golangci-lint/issues/3906
7+
- copyloopvar
88
- dogsled
99
- durationcheck
1010
- errcheck
1111
- errname
1212
- errorlint
13-
- exportloopref
1413
- forbidigo
1514
- gochecknoinits
1615
- goconst
@@ -33,6 +32,7 @@ linters:
3332
- typecheck
3433
- unconvert
3534
- unused
35+
# - depguard disable temporary until this issue is resolved: https://github.com/golangci/golangci-lint/issues/3906
3636

3737
linters-settings:
3838
govet:

CODINGSTYLE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,10 @@ Use the Golang [testing package](https://pkg.go.dev/testing) from the standard l
161161

162162
### Parallel Test Execution
163163

164-
Run tests in parallel where possible but don't forget about variable scope gotchas.
164+
Run tests in parallel where possible.
165165

166166
```go
167167
for tc := range tt {
168-
tc := tc // must not forget this
169168
t.Run(tc.name, func(t *testing.T) {
170169
t.Parallel()
171170
//execute

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22 AS build
1+
FROM golang:1.23 AS build
22

33
WORKDIR /src
44
# enable modules caching in separate layer
@@ -8,7 +8,7 @@ COPY . ./
88

99
RUN make binary
1010

11-
FROM debian:12.4-slim
11+
FROM debian:12.7-slim
1212

1313
ENV DEBIAN_FRONTEND noninteractive
1414

Dockerfile.goreleaser

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:12.4-slim
1+
FROM debian:12.7-slim
22

33
ENV DEBIAN_FRONTEND noninteractive
44

Dockerfile.scratch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:12.4-slim
1+
FROM debian:12.7-slim
22

33
ENV DEBIAN_FRONTEND noninteractive
44

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GO ?= go
22
GOBIN ?= $$($(GO) env GOPATH)/bin
33
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
4-
GOLANGCI_LINT_VERSION ?= v1.55.0
4+
GOLANGCI_LINT_VERSION ?= v1.61.0
55
GOGOPROTOBUF ?= protoc-gen-gogofaster
66
GOGOPROTOBUF_VERSION ?= v1.3.1
77
BEEKEEPER_INSTALL_DIR ?= $(GOBIN)

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/ethersphere/bee/v2
22

3-
go 1.22
3+
go 1.23
44

5-
toolchain go1.22.0
5+
toolchain go1.23.0
66

77
require (
88
contrib.go.opencensus.io/exporter/prometheus v0.4.2

pkg/accesscontrol/grantee.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ package accesscontrol
77
import (
88
"context"
99
"crypto/ecdsa"
10-
"crypto/elliptic"
1110
"errors"
1211
"fmt"
1312

1413
"github.com/btcsuite/btcd/btcec/v2"
14+
"github.com/ethereum/go-ethereum/crypto"
1515
"github.com/ethersphere/bee/v2/pkg/file"
1616
"github.com/ethersphere/bee/v2/pkg/swarm"
1717
)
@@ -85,7 +85,10 @@ func (g *GranteeListStruct) Add(addList []*ecdsa.PublicKey) error {
8585

8686
// Save saves the grantee list to the underlying storage and returns the reference.
8787
func (g *GranteeListStruct) Save(ctx context.Context) (swarm.Address, error) {
88-
data := serialize(g.grantees)
88+
data, err := serialize(g.grantees)
89+
if err != nil {
90+
return swarm.ZeroAddress, fmt.Errorf("grantee serialize error: %w", err)
91+
}
8992
refBytes, err := g.loadSave.Save(ctx, data)
9093
if err != nil {
9194
return swarm.ZeroAddress, fmt.Errorf("grantee save error: %w", err)
@@ -140,16 +143,16 @@ func NewGranteeListReference(ctx context.Context, ls file.LoadSaver, reference s
140143
}, nil
141144
}
142145

143-
func serialize(publicKeys []*ecdsa.PublicKey) []byte {
146+
func serialize(publicKeys []*ecdsa.PublicKey) ([]byte, error) {
144147
b := make([]byte, 0, len(publicKeys)*publicKeyLen)
145148
for _, key := range publicKeys {
146-
b = append(b, serializePublicKey(key)...)
149+
// TODO: check if this is the correct way to serialize the public key
150+
// Is this the only curve we support?
151+
// Should we have switch case for different curves?
152+
pubBytes := crypto.S256().Marshal(key.X, key.Y)
153+
b = append(b, pubBytes...)
147154
}
148-
return b
149-
}
150-
151-
func serializePublicKey(pub *ecdsa.PublicKey) []byte {
152-
return elliptic.Marshal(pub.Curve, pub.X, pub.Y)
155+
return b, nil
153156
}
154157

155158
func deserialize(data []byte) []*ecdsa.PublicKey {

0 commit comments

Comments
 (0)