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

Sometimes unknown enum values are lost #606

Closed
cthulhu-rider opened this issue Jul 22, 2024 · 2 comments
Closed

Sometimes unknown enum values are lost #606

cthulhu-rider opened this issue Jul 22, 2024 · 2 comments
Labels
bug Something isn't working I4 No visible changes S4 Routine U3 Regular

Comments

@cthulhu-rider
Copy link
Contributor

cthulhu-rider commented Jul 22, 2024

currently, Unmarshal / UnmarshalJSON of eACL and constituent types loses unknown enum value and shrinks them to 0. This should not be done: callers shouls be able to access real value and decide what to do on their own

@cthulhu-rider cthulhu-rider added the bug Something isn't working label Jul 22, 2024
@roman-khimov roman-khimov added U3 Regular S4 Routine I4 No visible changes labels Jul 22, 2024
cthulhu-rider added a commit that referenced this issue Jul 23, 2024
Caused by #606 which should make them PASS.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Jul 23, 2024
Caused by #606 which should make them PASS.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Jul 24, 2024
Caused by #606 which should make them PASS.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Jul 25, 2024
Caused by #606 which should make them PASS.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Jul 30, 2024
Caused by #606 which should make them PASS.

Signed-off-by: Leonard Lyubich <[email protected]>
@cthulhu-rider cthulhu-rider changed the title eacl: Unknown enum values are lost Sometimes unknown enum values are lost Aug 2, 2024
@cthulhu-rider
Copy link
Contributor Author

plus session verbs

cthulhu-rider added a commit that referenced this issue Aug 7, 2024
Caused by #606 which should make them PASS.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Aug 9, 2024
Caused by #606 which should make them PASS.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Aug 9, 2024
Caused by #606 which should make them PASS.

Signed-off-by: Leonard Lyubich <[email protected]>
@cthulhu-rider
Copy link
Contributor Author

negative values must be denied with proper message. Now they are either zeroed or errors says that value overflows int32 (cast problem)

cthulhu-rider added a commit that referenced this issue Dec 16, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
 1. All exported elements that depended on neofs-api-go types are
 permanently removed. They could not be excluded via a temporary
 deprecation mark as this would cause a conflict with importing ''*.pb.go'
 files. Such elements were not recommended for use in advance, so most
 of the updated software will not suffer from breakages.

 2. Request/response signing and verification functions have been added
 to `crypto` package A. They are used by the API client and will also be
 used by https://github.com/nspcc-dev/neofs-node.

 3. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
 while protobuf lib decodes them into `~int32`. In addition, during
 encoding/decoding, all unknown enum values were set to zero, which
 could lead to data loss. This commit fixes both issues. Separating the
 fix from the refactoring would have required adding artificial buggy
 code, it was decided not to generate it.

 4. Test binaries/JSONs/signatures that followed the erroneous
 behavior of p.3 are fixed.

 5. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
 `ProtoMessage` method replacing `WriteToV2`, taking into account the
 proposal from #532 and existing use cases, now dynamically allocates
 the message structure.

Closes #214. Refs #226. Refs #270. Closes #452. Closes #532. Closes #551
(it's almost impossible to do now). Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Dec 16, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
 1. All exported elements that depended on neofs-api-go types are
 permanently removed. They could not be excluded via a temporary
 deprecation mark as this would cause a conflict with importing ''*.pb.go'
 files. Such elements were not recommended for use in advance, so most
 of the updated software will not suffer from breakages.

 2. Request/response signing and verification functions have been added
 to `crypto` package A. They are used by the API client and will also be
 used by https://github.com/nspcc-dev/neofs-node.

 3. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
 while protobuf lib decodes them into `~int32`. In addition, during
 encoding/decoding, all unknown enum values were set to zero, which
 could lead to data loss. This commit fixes both issues. Separating the
 fix from the refactoring would have required adding artificial buggy
 code, it was decided not to generate it.

 4. Test binaries/JSONs/signatures that followed the erroneous
 behavior of p.3 are fixed.

 5. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
 `ProtoMessage` method replacing `WriteToV2`, taking into account the
 proposal from #532 and existing use cases, now dynamically allocates
 the message structure.

Closes #214. Refs #226. Refs #270. Closes #452. Closes #532. Closes #551
(it's almost impossible to do now). Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Dec 16, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
 1. All exported elements that depended on neofs-api-go types are
 permanently removed. They could not be excluded via a temporary
 deprecation mark as this would cause a conflict with importing ''*.pb.go'
 files. Such elements were not recommended for use in advance, so most
 of the updated software will not suffer from breakages.

 2. Request/response signing and verification functions have been added
 to `crypto` package A. They are used by the API client and will also be
 used by https://github.com/nspcc-dev/neofs-node.

 3. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
 while protobuf lib decodes them into `~int32`. In addition, during
 encoding/decoding, all unknown enum values were set to zero, which
 could lead to data loss. This commit fixes both issues. Separating the
 fix from the refactoring would have required adding artificial buggy
 code, it was decided not to generate it.

 4. Test binaries/JSONs/signatures that followed the erroneous
 behavior of p.3 are fixed.

 5. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
 `ProtoMessage` method replacing `WriteToV2`, taking into account the
 proposal from #532 and existing use cases, now dynamically allocates
 the message structure.

Closes #214. Refs #226. Refs #270. Closes #452. Closes #532. Closes #551
(it's almost impossible to do now). Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Dec 16, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
 1. All exported elements that depended on neofs-api-go types are
 permanently removed. They could not be excluded via a temporary
 deprecation mark as this would cause a conflict with importing ''*.pb.go'
 files. Such elements were not recommended for use in advance, so most
 of the updated software will not suffer from breakages.

 2. Request/response signing and verification functions have been added
 to `crypto` package A. They are used by the API client and will also be
 used by https://github.com/nspcc-dev/neofs-node.

 3. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
 while protobuf lib decodes them into `~int32`. In addition, during
 encoding/decoding, all unknown enum values were set to zero, which
 could lead to data loss. This commit fixes both issues. Separating the
 fix from the refactoring would have required adding artificial buggy
 code, it was decided not to generate it.

 4. Test binaries/JSONs/signatures that followed the erroneous
 behavior of p.3 are fixed.

 5. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
 `ProtoMessage` method replacing `WriteToV2`, taking into account the
 proposal from #532 and existing use cases, now dynamically allocates
 the message structure.

Closes #214. Refs #226. Refs #270. Closes #452. Closes #532. Closes #551
(it's almost impossible to do now). Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Dec 17, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
 1. All exported elements that depended on neofs-api-go types are
 permanently removed. They could not be excluded via a temporary
 deprecation mark as this would cause a conflict with importing ''*.pb.go'
 files. Such elements were not recommended for use in advance, so most
 of the updated software will not suffer from breakages.

 2. Request/response signing and verification functions have been added
 to `crypto` package A. They are used by the API client and will also be
 used by https://github.com/nspcc-dev/neofs-node.

 3. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
 while protobuf lib decodes them into `~int32`. In addition, during
 encoding/decoding, all unknown enum values were set to zero, which
 could lead to data loss. This commit fixes both issues. Separating the
 fix from the refactoring would have required adding artificial buggy
 code, it was decided not to generate it.

 4. Test binaries/JSONs/signatures that followed the erroneous
 behavior of p.3 are fixed.

 5. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
 `ProtoMessage` method replacing `WriteToV2`, taking into account the
 proposal from #532 and existing use cases, now dynamically allocates
 the message structure.

API client unit tests and AIO integration ones PASS, therefore, there is
no more way to track more regressions for now. If problems arise in
apps when updating the lib, fixes will be added later before the major
release.

Closes #214. Refs #226. Refs #270. Closes #452. Closes #532. Closes #551
(it's almost impossible to do now). Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Dec 17, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
 1. All exported elements that depended on neofs-api-go types are
 permanently removed. They could not be excluded via a temporary
 deprecation mark as this would cause a conflict with importing ''*.pb.go'
 files. Such elements were not recommended for use in advance, so most
 of the updated software will not suffer from breakages.

 2. Request/response signing and verification functions have been added
 to `crypto` package A. They are used by the API client and will also be
 used by https://github.com/nspcc-dev/neofs-node.

 3. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
 while protobuf lib decodes them into `~int32`. In addition, during
 encoding/decoding, all unknown enum values were set to zero, which
 could lead to data loss. This commit fixes both issues. Separating the
 fix from the refactoring would have required adding artificial buggy
 code, it was decided not to generate it.

 4. Test binaries/JSONs/signatures that followed the erroneous
 behavior of p.3 are fixed.

 5. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
 `ProtoMessage` method replacing `WriteToV2`, taking into account the
 proposal from #532 and existing use cases, now dynamically allocates
 the message structure.

API client unit tests and AIO integration ones PASS, therefore, there is
no more way to track more regressions for now. If problems arise in
apps when updating the lib, fixes will be added later before the major
release.

Closes #214. Refs #226. Refs #270. Closes #452. Closes #532. Closes #551
(it's almost impossible to do now). Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Dec 17, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
 1. All exported elements that depended on neofs-api-go types are
 permanently removed. They could not be excluded via a temporary
 deprecation mark as this would cause a conflict with importing ''*.pb.go'
 files. Such elements were not recommended for use in advance, so most
 of the updated software will not suffer from breakages.

 2. Request/response signing and verification functions have been added
 to `crypto` package A. They are used by the API client and will also be
 used by https://github.com/nspcc-dev/neofs-node.

 3. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
 while protobuf lib decodes them into `~int32`. In addition, during
 encoding/decoding, all unknown enum values were set to zero, which
 could lead to data loss. This commit fixes both issues. Separating the
 fix from the refactoring would have required adding artificial buggy
 code, it was decided not to generate it.

 4. Test binaries/JSONs/signatures that followed the erroneous
 behavior of p.3 are fixed.

 5. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
 `ProtoMessage` method replacing `WriteToV2`, taking into account the
 proposal from #532 and existing use cases, now dynamically allocates
 the message structure.

API client unit tests and AIO integration ones PASS, therefore, there is
no more way to track more regressions for now. If problems arise in
apps when updating the lib, fixes will be added later before the major
release.

Closes #214. Refs #226. Refs #270. Closes #452. Closes #532. Closes #551
(it's almost impossible to do now). Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Dec 17, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
 1. All exported elements that depended on neofs-api-go types are
 permanently removed. They could not be excluded via a temporary
 deprecation mark as this would cause a conflict with importing ''*.pb.go'
 files. Such elements were not recommended for use in advance, so most
 of the updated software will not suffer from breakages.

 2. Request/response signing and verification functions have been added
 to `crypto` package A. They are used by the API client and will also be
 used by https://github.com/nspcc-dev/neofs-node.

 3. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
 while protobuf lib decodes them into `~int32`. In addition, during
 encoding/decoding, all unknown enum values were set to zero, which
 could lead to data loss. This commit fixes both issues. Separating the
 fix from the refactoring would have required adding artificial buggy
 code, it was decided not to generate it.

 4. Test binaries/JSONs/signatures that followed the erroneous
 behavior of p.3 are fixed.

 5. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
 `ProtoMessage` method replacing `WriteToV2`, taking into account the
 proposal from #532 and existing use cases, now dynamically allocates
 the message structure.

API client unit tests and AIO integration ones PASS, therefore, there is
no more way to track more regressions for now. If problems arise in
apps when updating the lib, fixes will be added later before the major
release.

Closes #214. Refs #226. Refs #270. Closes #452. Closes #532. Closes #551
(it's almost impossible to do now). Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Dec 17, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
 1. All exported elements that depended on neofs-api-go types are
 permanently removed. They could not be excluded via a temporary
 deprecation mark as this would cause a conflict with importing ''*.pb.go'
 files. Such elements were not recommended for use in advance, so most
 of the updated software will not suffer from breakages.

 2. Request/response signing and verification functions have been added
 to `crypto` package A. They are used by the API client and will also be
 used by https://github.com/nspcc-dev/neofs-node.

 3. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
 while protobuf lib decodes them into `~int32`. In addition, during
 encoding/decoding, all unknown enum values were set to zero, which
 could lead to data loss. This commit fixes both issues. Separating the
 fix from the refactoring would have required adding artificial buggy
 code, it was decided not to generate it.

 4. Test binaries/JSONs/signatures that followed the erroneous
 behavior of p.3 are fixed.

 5. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
 `ProtoMessage` method replacing `WriteToV2`, taking into account the
 proposal from #532 and existing use cases, now dynamically allocates
 the message structure.

API client unit tests and AIO integration ones PASS, therefore, there is
no more way to track more regressions for now. If problems arise in
apps when updating the lib, fixes will be added later before the major
release.

Closes #214. Refs #226. Refs #270. Closes #452. Closes #532. Closes #551
(it's almost impossible to do now). Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Dec 18, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
 1. All exported elements that depended on neofs-api-go types are
 permanently removed. They could not be excluded via a temporary
 deprecation mark as this would cause a conflict with importing ''*.pb.go'
 files. Such elements were not recommended for use in advance, so most
 of the updated software will not suffer from breakages.

 2. Request/response signing and verification functions have been added
 to `crypto` package A. They are used by the API client and will also be
 used by https://github.com/nspcc-dev/neofs-node.

 3. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
 while protobuf lib decodes them into `~int32`. In addition, during
 encoding/decoding, all unknown enum values were set to zero, which
 could lead to data loss. This commit fixes both issues. Separating the
 fix from the refactoring would have required adding artificial buggy
 code, it was decided not to generate it.

 4. Test binaries/JSONs/signatures that followed the erroneous
 behavior of p.3 are fixed.

 5. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
 `ProtoMessage` method replacing `WriteToV2`, taking into account the
 proposal from #532 and existing use cases, now dynamically allocates
 the message structure.

API client unit tests and AIO integration ones PASS, therefore, there is
no more way to track more regressions for now. If problems arise in
apps when updating the lib, fixes will be added later before the major
release.

Closes #214. Refs #226. Refs #270. Closes #452. Closes #532. Closes #551
(it's almost impossible to do now). Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Dec 25, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
 1. All exported elements that depended on neofs-api-go types are
 permanently removed. They could not be excluded via a temporary
 deprecation mark as this would cause a conflict with importing ''*.pb.go'
 files. Such elements were not recommended for use in advance, so most
 of the updated software will not suffer from breakages.

 2. Request/response signing and verification functions have been added
 to `crypto` package A. They are used by the API client and will also be
 used by https://github.com/nspcc-dev/neofs-node.

 3. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
 while protobuf lib decodes them into `~int32`. In addition, during
 encoding/decoding, all unknown enum values were set to zero, which
 could lead to data loss. This commit fixes both issues. Separating the
 fix from the refactoring would have required adding artificial buggy
 code, it was decided not to generate it.

 4. Test binaries/JSONs/signatures that followed the erroneous
 behavior of p.3 are fixed.

 5. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
 `ProtoMessage` method replacing `WriteToV2`, taking into account the
 proposal from #532 and existing use cases, now dynamically allocates
 the message structure.

API client unit tests and AIO integration ones PASS, therefore, there is
no more way to track more regressions for now. If problems arise in
apps when updating the lib, fixes will be added later before the major
release.

Closes #214. Refs #226. Refs #270. Closes #452. Refs #532. Closes #551
(it's almost impossible to do now). Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider added a commit that referenced this issue Dec 25, 2024
Since 527c964, proto-generated code is
located in the current code library. Previously, the neofs-api-go
module's code was used for protocol interactions. In essence, it is a
super-layer on top of the `google.golang.org/protobuf` module with only
one feature: stable marshalling (Protocol Buffers with ascending field
order). Since it is now provided by local `proto/*` packages, there is
no longer a need for a separate module.

In addition to trimming the code base and refactoring, a bonus is the
allocation of fewer intermediate Go objects, which will have a
beneficial effect on runtime.

Although most of the changes are refactorings, the following changes
have been applied:
1. All exported elements that depended on neofs-api-go types are
permanently removed. They could not be excluded via a temporary
deprecation mark as this would cause a conflict with importing ''*.pb.go'
files. Such elements were not recommended for use in advance, so most
of the updated software will not suffer from breakages.

2. `neofs-api-go` a bug with interpreting enums as unsigned numbers,
while protobuf lib decodes them into `~int32`. In addition, during
encoding/decoding, all unknown enum values were set to zero, which
could lead to data loss. This commit fixes both issues. Separating the
fix from the refactoring would have required adding artificial buggy
code, it was decided not to generate it.

3. Test binaries/JSONs/signatures that followed the erroneous
behavior of p.2 are fixed.

4. While replacement of `ReadFromV2` methods called `FromProtoMessage`,
`ProtoMessage` method replacing `WriteToV2`, taking into account the
proposal from #532 and existing use cases, now dynamically allocates
the message structure.

NOTE: `client` package is going to be changed the same way in the
following commits.

NOTE 2: some tests panic due to protobuf namespace conflict, which will
be fixed automatically after the move is complete.

Closes #214. Refs #226. Refs #532. Fixes #606. Refs #652.

Signed-off-by: Leonard Lyubich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working I4 No visible changes S4 Routine U3 Regular
Projects
None yet
Development

No branches or pull requests

2 participants