Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go.mod: Upgrade github.com/nspcc-dev/neofs-sdk-go #3199

Merged
merged 8 commits into from
Mar 10, 2025
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
2 changes: 1 addition & 1 deletion .docker/Dockerfile.adm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23 AS builder
FROM golang:1.24 AS builder
ARG BUILD=now
ARG VERSION=dev
ARG REPO=repository
Expand Down
2 changes: 1 addition & 1 deletion .docker/Dockerfile.cli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23 AS builder
FROM golang:1.24 AS builder
ARG BUILD=now
ARG VERSION=dev
ARG REPO=repository
Expand Down
2 changes: 1 addition & 1 deletion .docker/Dockerfile.ir
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23 AS builder
FROM golang:1.24 AS builder
ARG BUILD=now
ARG VERSION=dev
ARG REPO=repository
Expand Down
2 changes: 1 addition & 1 deletion .docker/Dockerfile.storage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23 AS builder
FROM golang:1.24 AS builder
ARG BUILD=now
ARG VERSION=dev
ARG REPO=repository
Expand Down
2 changes: 1 addition & 1 deletion .docker/Dockerfile.storage-testnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23 AS builder
FROM golang:1.24 AS builder
ARG BUILD=now
ARG VERSION=dev
ARG REPO=repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.24'
cache: true

- name: Build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/setup-go@v5
with:
cache: true
go-version: '1.23'
go-version: '1.24'

- name: Check out code
uses: actions/checkout@v4
Expand All @@ -46,14 +46,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, macos-14]
go: [ '1.22', '1.23' ]
go: [ '1.23', '1.24' ]
exclude:
# Only the latest Go version MacOS.
- os: macos-14
go: '1.22'
go: '1.23'
# Exclude the latest Go version for Ubuntu as Coverage uses it.
- os: ubuntu-22.04
go: '1.23'
go: '1.24'

steps:
- name: Setup go
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ Changelog for NeoFS Node
### Removed

### Updated
- Minimum required version of Go to 1.23 (#2918)
- `github.com/nspcc-dev/neofs-sdk-go` dependency to `v1.0.0-rc.13` (#3199)
- `github.com/nspcc-dev/neo-go` dependency to `v0.108.1` (#3199)
- `github.com/nspcc-dev/hrw/v2` dependency to `v2.0.3` (#3199)
- `github.com/stretchr/testify` dependency to `v1.10.0` (#3199)
- `golang.org/x/exp` dependency to `v0.0.0-20250210185358-939b2ce775ac` (#3199)
- `golang.org/x/net` dependency to `v0.32.0` (#3199)
- `golang.org/x/sync` dependency to `v0.11.0` (#3199)
- `google.golang.org/grpc` dependency to `v1.70.0` (#3199)
- `google.golang.org/protobuf` dependency to `v1.36.5` (#3199)

### Updating from v0.45.1

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ VERSION ?= $(shell set -o pipefail; git describe --tags --dirty --match "v*" --a
HUB_IMAGE ?= nspccdev/neofs
HUB_TAG ?= $(VERSION)

GO_VERSION ?= 1.22
GO_VERSION ?= 1.23
LINT_VERSION ?= 1.55.0
ARCH = amd64

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The latest version of neofs-node works with neofs-contract

# Building

To make all binaries you need Go 1.22+ and `make`:
To make all binaries you need Go 1.23+ and `make`:
```
make all
```
Expand Down
4 changes: 2 additions & 2 deletions cmd/internal/cmdprinter/netmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

cmd.Printf("%sNode %d: %s %s ", indent, index+1, hex.EncodeToString(node.PublicKey()), strState)

netmap.IterateNetworkEndpoints(node, func(endpoint string) {
for endpoint := range func(f func(string) bool) { node.IterateNetworkEndpoints(func(s string) bool { return !f(s) }) } {

Check warning on line 29 in cmd/internal/cmdprinter/netmap.go

View check run for this annotation

Codecov / codecov/patch

cmd/internal/cmdprinter/netmap.go#L29

Added line #L29 was not covered by tests
cmd.Printf("%s ", endpoint)
})
}

Check warning on line 31 in cmd/internal/cmdprinter/netmap.go

View check run for this annotation

Codecov / codecov/patch

cmd/internal/cmdprinter/netmap.go#L31

Added line #L31 was not covered by tests
cmd.Println()

if !short {
Expand Down
1 change: 0 additions & 1 deletion cmd/neofs-adm/internal/modules/fschain/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ func awaitTx(cmd *cobra.Command, c Client, txs []hashVUBPair) error {
const pollInterval = time.Second

tick := time.NewTicker(pollInterval)
defer tick.Stop()

at := trigger.Application

Expand Down
2 changes: 0 additions & 2 deletions cmd/neofs-adm/internal/modules/storagecfg/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,8 @@ func depositGas(cmd *cobra.Command, acc *wallet.Account, network string) error {

cmd.Print("Waiting for transactions to persist.")
tick := time.NewTicker(time.Second / 2)
defer tick.Stop()

timer := time.NewTimer(time.Second * 20)
defer timer.Stop()

at := trigger.Application

Expand Down
1 change: 0 additions & 1 deletion cmd/neofs-cli/modules/container/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ It will be stored in FS chain when inner ring will accepts it.`,
const waitInterval = time.Second

t := time.NewTimer(waitInterval)
defer t.Stop()

for ; ; t.Reset(waitInterval) {
select {
Expand Down
1 change: 0 additions & 1 deletion cmd/neofs-cli/modules/container/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ Only owner of the container has a permission to remove container.`,
const waitInterval = time.Second

t := time.NewTimer(waitInterval)
defer t.Stop()

for ; ; t.Reset(waitInterval) {
select {
Expand Down
1 change: 0 additions & 1 deletion cmd/neofs-cli/modules/container/set_eacl.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ Container ID in EACL table will be substituted with ID from the CLI.`,
const waitInterval = time.Second

t := time.NewTimer(waitInterval)
defer t.Stop()

for ; ; t.Reset(waitInterval) {
select {
Expand Down
4 changes: 2 additions & 2 deletions cmd/neofs-cli/modules/netmap/nodeinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@

cmd.Println("state:", stateWord)

netmap.IterateNetworkEndpoints(i, func(s string) {
for s := range func(f func(string) bool) { i.IterateNetworkEndpoints(func(s string) bool { return !f(s) }) } {

Check warning on line 72 in cmd/neofs-cli/modules/netmap/nodeinfo.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/netmap/nodeinfo.go#L72

Added line #L72 was not covered by tests
cmd.Println("address:", s)
})
}

Check warning on line 74 in cmd/neofs-cli/modules/netmap/nodeinfo.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/netmap/nodeinfo.go#L74

Added line #L74 was not covered by tests

i.IterateAttributes(func(key, value string) {
cmd.Printf("attribute: %s=%s\n", key, value)
Expand Down
2 changes: 1 addition & 1 deletion cmd/neofs-cli/modules/object/head.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
func printHeader(cmd *cobra.Command, obj *object.Object) error {
printObjectID(cmd, obj.GetID)
printContainerID(cmd, obj.GetContainerID)
cmd.Printf("Owner: %s\n", obj.OwnerID())
cmd.Printf("Owner: %s\n", obj.Owner())

Check warning on line 167 in cmd/neofs-cli/modules/object/head.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/object/head.go#L167

Added line #L167 was not covered by tests
cmd.Printf("CreatedAt: %d\n", obj.CreationEpoch())
cmd.Printf("Size: %d\n", obj.PayloadSize())
common.PrintChecksum(cmd, "HomoHash", obj.PayloadHomomorphicHash)
Expand Down
5 changes: 1 addition & 4 deletions cmd/neofs-cli/modules/object/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"github.com/spf13/cobra"
)

// object lock command.
var objectLockCmd = &cobra.Command{
Use: "lock",
Short: "Lock object in container",
Expand Down Expand Up @@ -51,8 +50,6 @@
return err
}

idOwner := user.NewFromECDSAPublicKey(key.PublicKey)

var lock objectSDK.Lock
lock.WriteMembers(lockList)

Expand Down Expand Up @@ -81,7 +78,7 @@

obj := objectSDK.New()
obj.SetContainerID(cnr)
obj.SetOwnerID(&idOwner)
obj.SetOwner(user.NewFromECDSAPublicKey(key.PublicKey))

Check warning on line 81 in cmd/neofs-cli/modules/object/lock.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/object/lock.go#L81

Added line #L81 was not covered by tests
obj.SetType(objectSDK.TypeLock)
obj.SetAttributes(expirationAttr)
obj.SetPayload(lock.Marshal())
Expand Down
4 changes: 2 additions & 2 deletions cmd/neofs-cli/modules/object/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
}
payloadReader = bytes.NewReader(objTemp.Payload())
cnr = objTemp.GetContainerID()
ownerID = *objTemp.OwnerID()
ownerID = objTemp.Owner()

Check warning on line 100 in cmd/neofs-cli/modules/object/put.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/object/put.go#L100

Added line #L100 was not covered by tests
} else {
fi, err := f.Stat()
if err != nil {
Expand All @@ -119,7 +119,7 @@
}

obj.SetContainerID(cnr)
obj.SetOwnerID(&ownerID)
obj.SetOwner(ownerID)

Check warning on line 122 in cmd/neofs-cli/modules/object/put.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/object/put.go#L122

Added line #L122 was not covered by tests
obj.SetAttributes(attrs...)

var prm internalclient.PutObjectPrm
Expand Down
2 changes: 1 addition & 1 deletion cmd/neofs-cli/modules/storagegroup/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@

obj := object.New()
obj.SetContainerID(cnr)
obj.SetOwnerID(&ownerID)
obj.SetOwner(ownerID)

Check warning on line 155 in cmd/neofs-cli/modules/storagegroup/put.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/storagegroup/put.go#L155

Added line #L155 was not covered by tests

storagegroupSDK.WriteToObject(*sg, obj)

Expand Down
2 changes: 1 addition & 1 deletion cmd/neofs-lens/internal/printers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
cmd.Println("Type:", h.Type())
printContainerID(cmd, h.GetContainerID)
printObjectID(cmd, h.GetID)
cmd.Println("Owner:", h.OwnerID())
cmd.Println("Owner:", h.Owner())

Check warning on line 22 in cmd/neofs-lens/internal/printers.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-lens/internal/printers.go#L22

Added line #L22 was not covered by tests
cmd.Println("CreatedAt:", h.CreationEpoch())
cmd.Println("PayloadSize:", h.PayloadSize())
cmd.Println("Attributes:")
Expand Down
2 changes: 1 addition & 1 deletion cmd/neofs-node/config/node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type stringAddressGroup []string

func (x stringAddressGroup) IterateAddresses(f func(string) bool) {
for i := range x {
if f(x[i]) {
if !f(x[i]) {
break
}
}
Expand Down
8 changes: 3 additions & 5 deletions cmd/neofs-node/config/node/config_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package nodeconfig

import (
"slices"
"testing"

"github.com/nspcc-dev/neo-go/pkg/encoding/address"
"github.com/nspcc-dev/neofs-node/cmd/neofs-node/config"
configtest "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/test"
"github.com/nspcc-dev/neofs-node/pkg/network"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -68,14 +68,12 @@ func TestNodeSection(t *testing.T) {

ind := 0

addrs.IterateAddresses(func(addr network.Address) bool {
for addr := range slices.Values(addrs) {
require.Equal(t, expectedAddr[ind].str, addr.String())
require.Equal(t, expectedAddr[ind].host, addr.URIAddr())

ind++

return false
})
}

require.Equal(t, true, relay)

Expand Down
2 changes: 1 addition & 1 deletion cmd/neofs-node/netmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

func (c *cfg) iterateNetworkAddresses(f func(string) bool) {
ni := c.cfgNodeInfo.localInfo
ni.IterateNetworkEndpoints(f)
ni.IterateNetworkEndpoints(func(s string) bool { return !f(s) })

Check warning on line 147 in cmd/neofs-node/netmap.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-node/netmap.go#L147

Added line #L147 was not covered by tests
}

func (c *cfg) addressNum() int {
Expand Down
11 changes: 6 additions & 5 deletions cmd/neofs-node/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"google.golang.org/grpc"
"google.golang.org/grpc/encoding"
"google.golang.org/grpc/encoding/proto"
"google.golang.org/grpc/mem"
)

type transport struct {
Expand Down Expand Up @@ -41,7 +42,7 @@
}

// [encoding.Codec] making Marshal to accept and forward []byte messages only.
var binaryMessageOnly = grpc.ForceCodec(protoCodecBinaryRequestOnly{})
var binaryMessageOnly = grpc.ForceCodecV2(protoCodecBinaryRequestOnly{})

type protoCodecBinaryRequestOnly struct{}

Expand All @@ -50,17 +51,17 @@
return "neofs_binary_sender"
}

func (protoCodecBinaryRequestOnly) Marshal(msg any) ([]byte, error) {
func (protoCodecBinaryRequestOnly) Marshal(msg any) (mem.BufferSlice, error) {

Check warning on line 54 in cmd/neofs-node/transport.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-node/transport.go#L54

Added line #L54 was not covered by tests
bMsg, ok := msg.([]byte)
if ok {
return bMsg, nil
return mem.BufferSlice{mem.NewBuffer(&bMsg, mem.DefaultBufferPool())}, nil

Check warning on line 57 in cmd/neofs-node/transport.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-node/transport.go#L57

Added line #L57 was not covered by tests
}

return nil, fmt.Errorf("message is not of type %T", bMsg)
}

func (protoCodecBinaryRequestOnly) Unmarshal(raw []byte, msg any) error {
return encoding.GetCodec(proto.Name).Unmarshal(raw, msg)
func (protoCodecBinaryRequestOnly) Unmarshal(data mem.BufferSlice, msg any) error {
return encoding.GetCodecV2(proto.Name).Unmarshal(data, msg)

Check warning on line 64 in cmd/neofs-node/transport.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-node/transport.go#L63-L64

Added lines #L63 - L64 were not covered by tests
}

func replicationResultFromResponse(m *protoobject.ReplicateResponse) ([]byte, error) {
Expand Down
1 change: 0 additions & 1 deletion cmd/neofs-node/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func initTreeService(c *cfg) {
} else {
go func() {
tick := time.NewTicker(d)
defer tick.Stop()

for range tick.C {
err := c.treeService.SynchronizeAll()
Expand Down
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/nspcc-dev/neofs-node

go 1.22
go 1.23

require (
github.com/cenkalti/backoff/v4 v4.2.1
Expand All @@ -14,12 +14,12 @@ require (
github.com/mitchellh/go-homedir v1.1.0
github.com/mr-tron/base58 v1.2.0
github.com/multiformats/go-multiaddr v0.12.2
github.com/nspcc-dev/hrw/v2 v2.0.2
github.com/nspcc-dev/hrw/v2 v2.0.3
github.com/nspcc-dev/locode-db v0.6.0
github.com/nspcc-dev/neo-go v0.108.0
github.com/nspcc-dev/neo-go v0.108.1
github.com/nspcc-dev/neofs-api-go/v2 v2.14.1-0.20240827150555-5ce597aa14ea
github.com/nspcc-dev/neofs-contract v0.21.0
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.12.0.20250225190549-3ca765653f49
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.13
github.com/nspcc-dev/tzhash v1.8.2
github.com/olekukonko/tablewriter v0.0.5
github.com/panjf2000/ants/v2 v2.9.0
Expand All @@ -28,16 +28,16 @@ require (
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.10.0
go.etcd.io/bbolt v1.3.11
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
golang.org/x/net v0.28.0
golang.org/x/sync v0.10.0
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac
golang.org/x/net v0.32.0
golang.org/x/sync v0.11.0
golang.org/x/sys v0.28.0
golang.org/x/term v0.27.0
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
google.golang.org/grpc v1.70.0
google.golang.org/protobuf v1.36.5
gopkg.in/yaml.v3 v3.0.1
)

Expand Down Expand Up @@ -96,7 +96,7 @@ require (
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
Expand Down
Loading
Loading