neofs: adapt helper to SDK ObjectHash removal#4255
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4255 +/- ##
=======================================
Coverage 83.57% 83.58%
=======================================
Files 359 359
Lines 44177 44182 +5
=======================================
+ Hits 36922 36928 +6
- Misses 5440 5444 +4
+ Partials 1815 1810 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
AnnaShaleva
left a comment
There was a problem hiding this comment.
Why draft? The code itself looks good, is something missing?
| return nil, err | ||
| } | ||
| if len(hashes) == 0 { | ||
| return nil, fmt.Errorf("%w: empty response", ErrInvalidRange) |
There was a problem hiding this comment.
We need to preserve behaviour compatibility. Does c.ObjectRangeInit return an error in the similar case when c.ObjectHash returned an empty list of hashes?
There was a problem hiding this comment.
Good point. ObjectRangeInit does not provide the same signal by itself, so I added an explicit compatibility check. This restores the old behaviour for non-empty ranges. Full equivalence for the 0|0 case would still require consulting ObjectHead, because an empty stream can also be valid for an empty payload.
Do we need that extra ObjectHead check as well, or is restoring compatibility for non-empty ranges enough here?
There was a problem hiding this comment.
It affects Oracle behaviour, so I'd say we need a full compatibility in this case. Let me check the C# node.
There was a problem hiding this comment.
Update neofs-sdk-go to `v1.0.0-rc.18.0.20260508161611-2131d01b3469`. Remove `ObjectHash` from the local NeoFS client interface and handle range hash requests via `ObjectRangeInit` with local SHA-256 calculation, preserving the existing JSON output format. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
I've created a draft for now, because the changes to the SDK haven't been merged into the master branch yet. |
roman-khimov
left a comment
There was a problem hiding this comment.
OK as a quick stub to make things going.
|
Affects Oracles, will be merged after Gorgon. (or even may be removed at all, need to check other usages) |
Refs nspcc-dev/neofs-sdk-go#812.