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

api: Add stable marshaling #597

Merged
merged 7 commits into from
Jul 16, 2024
Merged

api: Add stable marshaling #597

merged 7 commits into from
Jul 16, 2024

Commits on Jul 16, 2024

  1. internal/proto: Exclude NaN floating point numbers from testing

    They are not comparable. Previously, unit tests could fail.
    
    Signed-off-by: Leonard Lyubich <[email protected]>
    cthulhu-rider committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    01b4607 View commit details
    Browse the repository at this point in the history
  2. internal/proto: Test that all marshaling functions panic on short buffer

    As they state in the docs.
    
    Signed-off-by: Leonard Lyubich <[email protected]>
    cthulhu-rider committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    79f9438 View commit details
    Browse the repository at this point in the history
  3. internal/proto: Prevent potentially incorrect encoding of byte arrays

    Previously, `MarshalToBytes` and `MarshalToRepeatedBytes` may have
    encoded data incorrectly. If there was nothing left in the buffer to
    accommodate the entire array, only the part that could fit was written.
    
    Now the functions check that the buffer will actually hold the required
    bytes, and only then calls built-in `copy`. Corresponding unit tests now
    pass.
    
    Signed-off-by: Leonard Lyubich <[email protected]>
    cthulhu-rider committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    d7cb390 View commit details
    Browse the repository at this point in the history
  4. proto/status: Declare constants for status codes

    Protocol Buffers V3 has no constants, and they are missing in the
    generated code as well. To make them easier to access, they are exported
    manually.
    
    Signed-off-by: Leonard Lyubich <[email protected]>
    cthulhu-rider committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    49db262 View commit details
    Browse the repository at this point in the history
  5. proto: Support stable marshaling for NeoFS messages

    Specific encoding of NeoFS messages is required to implement protocol
    checksums and signatures.
    
    Continues 51fa18f.
    
    Signed-off-by: Leonard Lyubich <[email protected]>
    cthulhu-rider committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    99e8303 View commit details
    Browse the repository at this point in the history
  6. lint: Refresh deprecated config

    This fixes
    ```
    $ golangci-lint --version
    golangci-lint has version 1.59.1 built with go1.22.3 from 1a55854a on 2024-06-09T18:08:33Z
    $ golangci-lint run ./...
    WARN [config_reader] The configuration option `output.format` is deprecated, please use `output.formats`
    ```
    
    The configuration file is updated according to
    https://golangci-lint.run/usage/configuration/.
    
    Signed-off-by: Leonard Lyubich <[email protected]>
    cthulhu-rider committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    88b92b2 View commit details
    Browse the repository at this point in the history
  7. lint: Drop no-op govet config

    According to https://golangci-lint.run/usage/linters/#govet,
    `check-shadowing` no longer exists. Now it should be
    ```yaml
    govet:
      disable: [shadow]
    ```
    but `shadow` is disabled by default. Thus, whole `govet` section is not
    needed anymore.
    
    ```
    $ golangci-lint --version
    golangci-lint has version 1.59.1 built with go1.22.3 from 1a55854a on 2024-06-09T18:08:33Z
    ```
    
    Signed-off-by: Leonard Lyubich <[email protected]>
    cthulhu-rider committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    d1a668c View commit details
    Browse the repository at this point in the history