Commit graph

1277 commits

Author SHA1 Message Date
Evgenii Stratonikov
0cab407378 [#376] reputation: Remove pointers from slices
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-15 12:19:49 +03:00
Evgenii Stratonikov
30c530e83d [#376] container: Remove pointers from slices
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-15 12:19:49 +03:00
Evgenii Stratonikov
aa1e092ca5 [#376] object: Remove pointer from slices
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-15 12:19:49 +03:00
Evgenii Stratonikov
e21a7823c5 [#376] session: Make XHeader slice non-pointer
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-15 12:19:49 +03:00
Evgenii Stratonikov
6f4908edc2 [#376] netmap: Make attributes a non-pointer slice
The speed of copying (which is done regulary for e.g. subnet changes)
is less, however it isn't on the hot path and the absolute time
difference is insignificant.
```
name              old time/op    new time/op    delta
NodeAttributes-8    96.2ns ± 1%   158.3ns ± 1%  +64.61%  (p=0.000 n=10+10)

name              old alloc/op   new alloc/op   delta
NodeAttributes-8     32.0B ± 0%     32.0B ± 0%     ~     (all equal)

name              old allocs/op  new allocs/op  delta
NodeAttributes-8      2.00 ± 0%      2.00 ± 0%     ~     (all equal)
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-15 12:19:49 +03:00
Evgenii Stratonikov
2f0eee96fc [#376] netmap: Replace slices of pointers with structs
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-15 12:19:49 +03:00
Evgenii Stratonikov
ec484f2fd2 [#376] acl: Replace slices of pointers with raw structs
```
name                                     old time/op    new time/op    delta
Table_ToGRPCMessage/to_grpc_message-8      2.82µs ± 5%    2.86µs ± 5%     ~     (p=0.395 n=10+8)
Table_ToGRPCMessage/from_grpc_message-8    2.47µs ± 5%    1.08µs ± 6%  -56.16%  (p=0.000 n=9+9)

name                                     old alloc/op   new alloc/op   delta
Table_ToGRPCMessage/to_grpc_message-8      3.31kB ± 0%    3.31kB ± 0%     ~     (all equal)
Table_ToGRPCMessage/from_grpc_message-8    1.82kB ± 0%    1.38kB ± 0%  -24.56%  (p=0.000 n=10+10)

name                                     old allocs/op  new allocs/op  delta
Table_ToGRPCMessage/to_grpc_message-8        46.0 ± 0%      46.0 ± 0%     ~     (all equal)
Table_ToGRPCMessage/from_grpc_message-8      45.0 ± 0%       9.0 ± 0%  -80.00%  (p=0.000 n=10+10)
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-15 12:19:49 +03:00
Evgenii Stratonikov
4a70c42104 [#376] acl: Add benchmarks for Table conversions
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-15 12:19:49 +03:00
Evgenii Stratonikov
84daaf59ef [#376] refs: Replace []*ObjectID with []ObjectID
```
ObjectIDSlice/0_elements/to_grpc_message-8       5.64ns ± 2%    5.89ns ± 4%   +4.56%  (p=0.000 n=10+10)
ObjectIDSlice/0_elements/from_grpc_message-8     6.68ns ± 3%    6.81ns ± 8%     ~     (p=0.143 n=10+10)
ObjectIDSlice/0_elements/marshal-8               7.41ns ± 3%    7.91ns ± 4%   +6.63%  (p=0.000 n=10+10)
ObjectIDSlice/1_elements/to_grpc_message-8       69.8ns ± 3%    80.5ns ± 7%  +15.39%  (p=0.000 n=10+10)
ObjectIDSlice/1_elements/from_grpc_message-8     56.4ns ± 6%    34.7ns ± 5%  -38.55%  (p=0.000 n=10+9)
ObjectIDSlice/1_elements/marshal-8               68.4ns ± 4%    67.6ns ± 4%     ~     (p=0.404 n=10+10)
ObjectIDSlice/50_elements/to_grpc_message-8      2.52µs ± 7%    2.56µs ± 4%     ~     (p=0.315 n=10+9)
ObjectIDSlice/50_elements/from_grpc_message-8    1.83µs ± 8%    0.44µs ± 1%  -75.73%  (p=0.000 n=10+8)
ObjectIDSlice/50_elements/marshal-8              2.32µs ±17%    2.22µs ± 3%     ~     (p=0.247 n=10+10)

name                                           old alloc/op   new alloc/op   delta
ObjectIDSlice/0_elements/to_grpc_message-8        0.00B          0.00B          ~     (all equal)
ObjectIDSlice/0_elements/from_grpc_message-8      0.00B          0.00B          ~     (all equal)
ObjectIDSlice/0_elements/marshal-8                0.00B          0.00B          ~     (all equal)
ObjectIDSlice/1_elements/to_grpc_message-8        72.0B ± 0%     72.0B ± 0%     ~     (all equal)
ObjectIDSlice/1_elements/from_grpc_message-8      32.0B ± 0%     24.0B ± 0%  -25.00%  (p=0.000 n=10+10)
ObjectIDSlice/1_elements/marshal-8                48.0B ± 0%     48.0B ± 0%     ~     (all equal)
ObjectIDSlice/50_elements/to_grpc_message-8      3.62kB ± 0%    3.62kB ± 0%     ~     (all equal)
ObjectIDSlice/50_elements/from_grpc_message-8    1.62kB ± 0%    1.28kB ± 0%  -20.79%  (p=0.000 n=10+10)
ObjectIDSlice/50_elements/marshal-8              2.05kB ± 0%    2.05kB ± 0%     ~     (all equal)

name                                           old allocs/op  new allocs/op  delta
ObjectIDSlice/0_elements/to_grpc_message-8         0.00           0.00          ~     (all equal)
ObjectIDSlice/0_elements/from_grpc_message-8       0.00           0.00          ~     (all equal)
ObjectIDSlice/0_elements/marshal-8                 0.00           0.00          ~     (all equal)
ObjectIDSlice/1_elements/to_grpc_message-8         2.00 ± 0%      2.00 ± 0%     ~     (all equal)
ObjectIDSlice/1_elements/from_grpc_message-8       2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)
ObjectIDSlice/1_elements/marshal-8                 1.00 ± 0%      1.00 ± 0%     ~     (all equal)
ObjectIDSlice/50_elements/to_grpc_message-8        51.0 ± 0%      51.0 ± 0%     ~     (all equal)
ObjectIDSlice/50_elements/from_grpc_message-8      51.0 ± 0%       1.0 ± 0%  -98.04%  (p=0.000 n=10+10)
ObjectIDSlice/50_elements/marshal-8                1.00 ± 0%      1.00 ± 0%     ~     (all equal)
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-15 12:19:49 +03:00
Evgenii Stratonikov
529d636ede [#376] refs: Add benchmarks for ObjectID slice conversions
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-15 12:19:49 +03:00
Evgenii Stratonikov
50382114f4 [#383] rpc/client: Export URI-parsing function
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-10 19:16:42 +03:00
Evgenii Stratonikov
fadd47f4fb [#376] object: remove pointer from Attribute slice
```
name                           old time/op    new time/op    delta
AttributesMarshal/marshal-8      4.44µs ± 9%    2.72µs ± 0%  -38.79%  (p=0.000 n=10+9)
AttributesMarshal/unmarshal-8    3.16µs ±13%    0.55µs ± 4%  -82.60%  (p=0.000 n=10+10)

name                           old alloc/op   new alloc/op   delta
AttributesMarshal/marshal-8      4.42kB ± 0%    4.42kB ± 0%     ~     (all equal)
AttributesMarshal/unmarshal-8    2.02kB ± 0%    1.79kB ± 0%  -11.11%  (p=0.000 n=10+10)

name                           old allocs/op  new allocs/op  delta
AttributesMarshal/marshal-8        51.0 ± 0%      51.0 ± 0%     ~     (all equal)
AttributesMarshal/unmarshal-8      51.0 ± 0%       1.0 ± 0%  -98.04%  (p=0.000 n=10+10)
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-09 15:23:13 +03:00
Evgenii Stratonikov
204126893e [#376] object: add benchmarks for attributes marshal/unmarshal
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-03-09 15:23:13 +03:00
Leonard Lyubich
d065453bd0 [#380] Support changes in signature schemes
Support new `SignatureRFC6979` message. Make `refs.ECDSA_SHA512` to be
default scheme.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-03-02 16:49:50 +03:00
Leonard Lyubich
f4fd28e39b Release v2.12.0 - Heuksando (흑산도, 黑山島)
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-02-25 11:12:57 +03:00
Leonard Lyubich
e872572ba3 Update release instruction
Remove no longer needed version section.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-02-25 11:12:57 +03:00
Leonard Lyubich
fd3bf4a56b Fix linter remarks
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-02-25 11:12:57 +03:00
Leonard Lyubich
99370889d1 [#371] Support recent changes in NeoFS API protocol
Support:
  * new status codes (object, container, session);
  * object `Lock` message;
  * different signature schemes.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-02-25 10:24:07 +03:00
Evgenii Stratonikov
a4349f6692 [#55] refs: Add Scheme field to Signature
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-25 10:15:28 +03:00
Evgenii Stratonikov
66e1fb8c53 [#55] refs: Fix linter warnings
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-25 10:15:28 +03:00
Pavel Karpy
1384523f62 [#372] object: Add object notification unit tests
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-02-22 18:19:18 +03:00
Pavel Karpy
4007aa86f4 [#372] object: Add object notification attributes
Also, add functions for parsing and setting object notifications.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-02-22 18:19:18 +03:00
Pavel Karpy
aabc2dd927 [#372] object: Fix filter comment
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-02-22 18:19:18 +03:00
Evgenii Stratonikov
60473c44b9 [#368] README.md: change desctiption and link to SDK
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-08 11:03:28 +03:00
Leonard Lyubich
32dd0bb3f9 [#369] status: Support WRONG_MAGIC_NUMBER code and detail
Define constant for `WrongMagicNumber` local code. Define constant
`DetailIDCorrect` for correct magic detail. Add `ResetDetails`
and `AppendDetails` method pair. Replace `SetDetails` method with new
`SetStatusDetails` function which can be implemented using new methods.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-01-27 16:53:16 +03:00
Leonard Lyubich
959d1c8c38 [#369] status: Compile sources with detailed magic number
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-01-27 16:53:16 +03:00
Leonard Lyubich
227a871a04 [#367] session: Support magic_number field of RequestMetaHeader
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-01-14 13:17:21 +03:00
Leonard Lyubich
e9a8451fb7 [#367] *: Re-compile proto files of NeoFS API protocol
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-01-14 13:17:21 +03:00
Alex Vanin
f04051c96c Release v2.11.1
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-28 13:00:49 +03:00
Alex Vanin
c64a5c08c8 Update credits
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-28 13:00:49 +03:00
Alex Vanin
49db0cfa03 [#366] rpc/client: Inherit read-write gRPC timeout from client
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-28 12:49:31 +03:00
Alex Vanin
aa53fb7131 [#366] rpc/grpc: Perform read-write message operations with timeout
Remote gRPC server may not return or accept data for a while. gRPC
solves this issue with timeout in context. However, the context is
used for entire gRPC method invocation. Unfortunately the duration
of requests with streams can't be estimated easily.

To solve this issue we can specify timeouts for every message read
and write. Single message has size limit so timeout can be related
to that.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-28 12:49:31 +03:00
Alex Vanin
8b17921f03 Release v2.11.0 - Sinjido (신지도, 薪智島)
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-02 18:15:52 +03:00
Alex Vanin
4b67b56c4b [#361] Do not remove stable marshal test file after API recompile
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-02 16:42:47 +03:00
Alex Vanin
c35dff758d [#361] Return proto file for stable marshal tests
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-02 16:42:47 +03:00
Angira Kekteeva
fb33a6e08a [#364] Makefile: Remove deprecated -i flag
Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
2021-12-02 16:27:25 +03:00
Pavel Karpy
3604d96f3f [#362] netmap: Add marshaling of the subnetID field of container policy
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-12-01 16:45:23 +03:00
Leonard Lyubich
d93828f465 [#356] netmap: Fix post-loop handling of zero subnet in IterateSubnets
Return any error other than `ErrRemoveSubnet` from `IterateSubnets`
during post-loop processing of zero subnet.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
5ce4b22e40 [#356] refs: Implement Unmarshal method on SubnetID
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
50ab22c19c [#356] netmap: Improve docs and slightly optimize the code
API changes:
  * Rename `Enters` method of the `NodeSubnetInfo` to `Enabled`.
  * Declare undefined behavior of `WriteSubnetInfo` with non-unique
  attributes.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
abc494b2bc [#356] netmap: Simplify zero subnet processing in IterateSubnets
For now we don't need to distinguish cases of missing zero subnet's
attribute and the one with `True` value.

Remove local enum `zeroStatus` of `IterateSubnets` since we need to
distinguish between two statuses and use `bool` variable for this.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
896cee4bb0 [#356] netmap: Increase test coverage of IterateSubnets
Add both `False` and `True` subnet attributes.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
dfb780a2b6 [#356] netmap: Document IterateSubnets behavior with duplicate keys
Node attributes must be key-unique. In current implementation
`IterateSubnets` doesn't monitor the uniqueness of keys.

Declare undefined behavior of `IterateSubnets` for non-unique attribute
keys.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
5d99e697aa [#356] refs: Test text marshaling of nil SubnetID
Add `(*refs.SubnetID)(nil).MarshalText()` unit test.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
dc292864aa [#356] refs: Handle uint32 overflow in SubnetID text format
Clarify the bit size limit in `SubnetID.UnmarshalText` method. Cover
overflow case in unit test.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
4560e447e1 [#356] netmap: Fix potential double-processing of zero subnet
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
051b103df3 [#356] netmap: Return missing subnets error from IterateSubnets
Each NeoFS storage node should be present in at least one subnet.

Make `netmap.IterateSubnets` function to return an error if the node by the
end of the loop does not belong to any subnet.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
348f9498bd [#356] netmap: Implement the functionality of working with subnets
NeoFS storage node can participate in a subnet group (at least one).
According to NeoFS API V2 protocol, subnets are entered and exited through
the attributes of the node. We should provide functionality for conveniently
setting and reading attributes based on the needs of the network.

Define `NodeSubnetInfo` type which groups information about the subnet
reflected in `NodeInfo`. Implement `WriteSubnetInfo` function which writes
`SubnetInfo` data to `NodeInfo`. It will be used to prepare a request for
registration on the NeoFS network. Implement `IterateSubnets` function which
allows to iterate over all subnets of the node. Moreover, it allows you to
remove a subnet from the `NodeInfo` right during iterative traversal.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
0e6e0e4678 [#356] refs: Implement text encoding of SubnetID
Implement `encoding.TextMarshaler` / `encoding.TextUnmarshaler` interfaces
on `SubnetID` according to NeoFS API V2 protocol.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00
Leonard Lyubich
f0af5ce759 [#356] refs: Add functions to work with zero subnet
Add helper functions which provide ease of use with subnet zero IDs.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-24 17:13:18 +03:00