Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/beekeeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ jobs:
msg: ${{ steps.commit.outputs.msg }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
if: github.event.action != 'beekeeper'
with:
fetch-depth: 0
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
if: github.event.action == 'beekeeper'
with:
fetch-depth: 0
ref: ${{ github.event.client_payload.ref }}
- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
cache: false
go-version-file: go.mod
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: '0'
- name: Check whether docs have changed
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
cache: true
go-version-file: go.mod
Expand All @@ -41,9 +41,9 @@ jobs:
continue-on-error: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
cache: true
go-version-file: go.mod
Expand All @@ -55,22 +55,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
cache: false
go-version-file: go.mod
- name: Commit linting
if: github.ref != 'refs/heads/master'
uses: wagoid/commitlint-github-action@v5
- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v8
with:
skip-cache: false
version: v1.64.5
version: v2.5.0
- name: Whitespace check
run: make check-whitespace
- name: go mod tidy check
Expand All @@ -81,9 +81,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
cache: false
go-version-file: go.mod
Expand All @@ -109,11 +109,11 @@ jobs:
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
cache: false
go-version-file: go.mod
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Docker Hub and Quay Login
Expand Down
108 changes: 57 additions & 51 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,81 @@
run:
timeout: 10m
version: "2"
linters:
enable:
- asciicheck
- bidichk
- copyloopvar
- dogsled
- durationcheck
- errcheck
- errname
- errorlint
- forbidigo
- gochecknoinits
- goconst
- gofmt
- goheader
- goprintffuncname
- gosimple
- govet
- importas
- ineffassign
- misspell
- nilerr
- noctx
- paralleltest
- prealloc
- predeclared
- promlinter
- staticcheck
- thelper
- typecheck
- unconvert
- unused
# - depguard disable temporary until this issue is resolved: https://github.com/golangci/golangci-lint/issues/3906

linters-settings:
govet:
enable-all: true
disable:
- fieldalignment ## temporally disabled
- shadow ## temporally disabled
goheader:
values:
regexp:
date: "20[1-2][0-9]"
template: |-
Copyright {{date}} The Swarm Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
paralleltest:
# Ignore missing calls to `t.Parallel()` and only report incorrect uses of `t.Parallel()`.
ignore-missing: true
issues:
exclude-rules:
- linters:
- goheader
text: "go-ethereum Authors" ## disable check for other authors
- path: _test\.go
linters:
- goconst ## temporally disable goconst in test
- linters:
- forbidigo
path: cmd/bee/cmd
text: "use of `fmt.Print" ## allow fmt.Print in cmd directory
- linters:
- dogsled
path: pkg/api/(.+)_test\.go # temporally disable dogsled in api test files
- linters:
- dogsled
path: pkg/pushsync/(.+)_test\.go # temporally disable dogsled in pushsync test files
# temporally disable paralleltest in following packages
- linters:
- paralleltest
path: pkg/log
settings:
goheader:
values:
regexp:
date: 20[1-2][0-9]
template: |-
Copyright {{date}} The Swarm Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
govet:
disable:
- fieldalignment
- shadow
enable-all: true
paralleltest:
ignore-missing: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- goheader
text: go-ethereum Authors
- linters:
- goconst
path: _test\.go
- linters:
- forbidigo
path: cmd/bee/cmd
text: use of `fmt.Print
- linters:
- dogsled
path: pkg/api/(.+)_test\.go
- linters:
- dogsled
path: pkg/pushsync/(.+)_test\.go
- linters:
- paralleltest
path: pkg/log
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.24 AS build
FROM golang:1.25 AS build

WORKDIR /src
# enable modules caching in separate layer
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.24 AS build
FROM golang:1.25 AS build

ARG REACHABILITY_OVERRIDE_PUBLIC=false
ARG BATCHFACTOR_OVERRIDE_PUBLIC=5
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.goreleaser
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:12.10-slim
FROM debian:12.12-slim

ENV DEBIAN_FRONTEND=noninteractive

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.scratch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:12.10-slim
FROM debian:12.12-slim

ENV DEBIAN_FRONTEND=noninteractive

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GO ?= go
GOBIN ?= $$($(GO) env GOPATH)/bin
GOLANGCI_LINT ?= $(GOBIN)/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.64.5
GOLANGCI_LINT_VERSION ?= v2.5.0
GOGOPROTOBUF ?= protoc-gen-gogofaster
GOGOPROTOBUF_VERSION ?= v1.3.1
BEEKEEPER_INSTALL_DIR ?= $(GOBIN)
Expand Down
4 changes: 2 additions & 2 deletions cmd/bee/cmd/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ func splitRefs(cmd *cobra.Command) {
}

logger.Debug("write root", "hash", rootRef)
_, err = writer.WriteString(fmt.Sprintf("%s\n", rootRef))
_, err = fmt.Fprintf(writer, "%s\n", rootRef)
if err != nil {
return fmt.Errorf("write root hash: %w", err)
}
for _, ref := range refs {
logger.Debug("write chunk", "hash", ref)
_, err = writer.WriteString(fmt.Sprintf("%s\n", ref))
_, err = fmt.Fprintf(writer, "%s\n", ref)
if err != nil {
return fmt.Errorf("write chunk address: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/ethersphere/bee/v2

go 1.24.0
go 1.25

toolchain go1.24.2
toolchain go1.25.1

require (
contrib.go.opencensus.io/exporter/prometheus v0.4.2
Expand Down Expand Up @@ -46,7 +46,6 @@ require (
go.uber.org/atomic v1.11.0
go.uber.org/goleak v1.3.0
golang.org/x/crypto v0.36.0
golang.org/x/net v0.38.0
golang.org/x/sync v0.12.0
golang.org/x/sys v0.31.0
golang.org/x/term v0.30.0
Expand Down Expand Up @@ -170,6 +169,7 @@ require (
go.uber.org/zap v1.27.0 // indirect
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/tools v0.29.0 // indirect
google.golang.org/protobuf v1.36.1 // indirect
Expand Down
2 changes: 1 addition & 1 deletion pkg/accesscontrol/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (al *ActLogic) getAccessKey(ctx context.Context, storage kvs.KeyValueStore,
// Generate lookup key and access key decryption key for a given public key.
func (al *ActLogic) getKeys(publicKey *ecdsa.PublicKey) ([]byte, []byte, error) {
nonces := [][]byte{zeroByteArray, oneByteArray}
keys, err := al.Session.Key(publicKey, nonces)
keys, err := al.Key(publicKey, nonces)
if len(keys) != len(nonces) {
return nil, nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/accesscontrol/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (c *ControllerStruct) getGranteeList(ctx context.Context, ls file.LoadSaver
}

func (c *ControllerStruct) encryptRefForPublisher(publisherPubKey *ecdsa.PublicKey, ref swarm.Address) (swarm.Address, error) {
keys, err := c.access.Session.Key(publisherPubKey, [][]byte{oneByteArray})
keys, err := c.access.Key(publisherPubKey, [][]byte{oneByteArray})
if err != nil {
return swarm.ZeroAddress, err
}
Expand All @@ -275,7 +275,7 @@ func (c *ControllerStruct) encryptRefForPublisher(publisherPubKey *ecdsa.PublicK
}

func (c *ControllerStruct) decryptRefForPublisher(publisherPubKey *ecdsa.PublicKey, encryptedRef swarm.Address) (swarm.Address, error) {
keys, err := c.access.Session.Key(publisherPubKey, [][]byte{oneByteArray})
keys, err := c.access.Key(publisherPubKey, [][]byte{oneByteArray})
if err != nil {
return swarm.ZeroAddress, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/accesscontrol/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestController_UpdateHandler(t *testing.T) {
publisher := getPrivKey(1)
diffieHellman := accesscontrol.NewDefaultSession(publisher)
al := accesscontrol.NewLogic(diffieHellman)
keys, err := al.Session.Key(&publisher.PublicKey, [][]byte{{1}})
keys, err := al.Key(&publisher.PublicKey, [][]byte{{1}})
assertNoError(t, "Session key", err)
refCipher := encryption.New(keys[0], 0, 0, sha3.NewLegacyKeccak256)
ls := createLs()
Expand Down
2 changes: 1 addition & 1 deletion pkg/accesscontrol/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (s *SessionStruct) Key(publicKey *ecdsa.PublicKey, nonces [][]byte) ([][]by
if publicKey == nil {
return nil, ErrInvalidPublicKey
}
x, y := publicKey.Curve.ScalarMult(publicKey.X, publicKey.Y, s.key.D.Bytes())
x, y := publicKey.ScalarMult(publicKey.X, publicKey.Y, s.key.D.Bytes())
if x == nil || y == nil {
return nil, ErrSecretKeyInfinity
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func newTestServer(t *testing.T, o testServerOptions) (*http.Client, *websocket.
transport = transport.Clone()
// always dial to the server address, regardless of the url host and port
transport.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
return net.Dial(network, ts.Listener.Addr().String())
return (&net.Dialer{}).DialContext(ctx, network, ts.Listener.Addr().String())
}
return transport.RoundTrip(r)
}),
Expand Down
Loading
Loading