NeoFS SDK Go RC25 adopts API 2.29 with anti-replay signatures
Neo SPCC released NeoFS SDK Go v1.0.0-rc.25 on Dec. 3, moving its Go library for NeoFS to API v2.29 and the protocol’s new protection against replayed requests.
Under API v2.29, a signed request can’t be reused on a different NeoFS network or for a different operation, and each chunk of an upload is numbered and tied to that upload. The SDK applies both automatically with nodes that support v2.29, and NeoFS Node v0.59.0, released later on Dec. 3, adds that support.
The release also gives container creators new storage options for erasure-coded data and node limits, and removes X-headers, the free-form key-value fields requests could carry, which RC24 deprecated on Oct. 27. RC25 raises the default API version from v2.28 to v2.29, continuing the one-version-per-release pattern seen since RC17, and brings 20 merged pull requests.
API v2.29, the protocol definitions that NeoFS libraries are built from, was published on Dec. 1. NeoFS Node v0.59.0 also fixes a flaw that let upload chunks be replayed, and the SDK keeps the previous signing scheme for nodes on older API versions.
Requests tied to one network and operation
From API v2.29, a request signature covers a new RequestSignData message rather than the request alone (PR #919). The message combines a SHA-256 hash of the request with the name of the operation being called and the network’s magic number, which identifies the NeoFS network the request is meant for.
According to the API definitions, this stops a signature from being reused on another NeoFS network or for another operation. The SDK fetches the magic number from the node when it connects.
Uploads tied to a single stream
NeoFS uploads are sent as a stream of chunks. From API v2.29, each chunk must carry a sequence number, starting at zero and rising by exactly one, and the stream ID announced when the upload began (PRs #909 and #849).
Nodes must reject a chunk that arrives out of order or carries the wrong stream ID, which the API definitions describe as protection against replay attacks.
New storage policy options
RC25 adds three options to placement policies, the rules a container’s creator chooses to decide which nodes store its objects:
- Minimum erasure-coded parts: erasure coding splits an object into data and parity parts, and the object stays available as long as enough parts survive. A new
MINPARTSsetting sets how many parts must be stored on different nodes for an upload to succeed. Without it, all parts must be stored (PR #903). - Node limits: a policy can now set the maximum number of nodes a rule may use. Previously the limit could only be a multiple of the number of nodes the rule selects, and one setting applied to every rule (PR #907).
- Select all:
SELECT *picks every matching node and is allowed only with the new node-limit setting (PR #920).
PR #920 also rejects policies with REP 0 rules, which ask for zero copies.
Changes to check before upgrading
Besides the REP 0 change, developers moving to RC25 should check three other changes. X-headers have been removed from the client, including its WithXHeaders option, so applications still setting them must drop those calls (PR #928).
Developers who feed their own headers into the SDK’s EACL checks, which apply a container’s access rules, must replace HeadersOfType with HeaderValue. The new method returns one value per header type and key and supports lazy fetching (PR #913).
The client also treats empty data chunks in a download as an error. Previously, a node sending them kept the client working until a context deadline stopped it (PR #904).
Other changes and fixes
The client gains a v2 API for setting and removing container attributes (PR #905).
Delegated session tokens, which let another party act on a user’s behalf, now carry a signed SHA-256 hash of the token they came from. Delegation chains using the older token version are still accepted (PR #914).
The release also fixes connection leaks when dialing fails or the connection pool recovers a node (PR #924), and makes cancellation errors match Go’s standard context.Canceled and context.DeadlineExceeded (PR #902).
The full release notes can be found at the link below:
https://github.com/nspcc-dev/neofs-sdk-go/releases/tag/v1.0.0-rc.25