Commit graph

78 commits

Author SHA1 Message Date
981dc785f3 [#107] proto/test: Add oneof test
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-26 14:36:19 +03:00
866db105ed [#107] protogen: Unify oneof getters with default protoc plugin
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-26 14:36:19 +03:00
937a53683a [#107] protogen: Fix oneof JSON marshaling
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-26 14:36:19 +03:00
4a00ef946f [#107] protogen: Fix oneof getter scalar default value
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-26 14:36:19 +03:00
61f6f0f4a2 [#107] proto/test: Regenerate *.pb.go
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-26 14:36:19 +03:00
c1b5f46f98 [#107] protogen: Remove unused parameter
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-26 14:36:19 +03:00
7be31eb847 [#77] protogen: Add tests for JSON format
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-19 10:47:00 +03:00
adb7c602d7 [#77] protogen: Initial implementation
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-19 10:47:00 +03:00
a28ceb251a [#77] util/proto: Optimize int32 marshaling
This is the approach used in easyproto
52d3ac4744/writer.go (L203)

It allows to occupy slightly less space for negative numbers.
The format is still protobuf, although, technically, this is a breaking
change for our stable marshaling format.
However, we don't use int32 at all and all enums have positive values,
so nothing is broken.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-16 17:11:13 +03:00
47a48969b0 [#103] proto: Test end-to-end scenario
All checks were successful
DCO action / DCO (pull_request) Successful in 1m27s
Tests and linters / Tests (1.19) (pull_request) Successful in 1m36s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m43s
Tests and linters / Lint (pull_request) Successful in 1m51s
Tests and linters / Tests with -race (pull_request) Successful in 2m6s
Test the generated code, do not write yet another marshaling routine in
tests.

Before:
```
ok      git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto      0.003s  coverage: 55.6% of statements
```

After:
```
ok      git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/util/proto      0.003s  coverage: 80.0% of statements
```

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-09 11:18:17 +03:00
19247e8941 [#103] protogen: Handle uint32 type
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-09 11:18:17 +03:00
ff4f31b6f3 [#103] protogen: Handle files in all packages
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-08-09 11:18:17 +03:00
b72aa14bab [#87] proto: Process files with protoc version 27.2
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
2024-08-06 17:20:29 +03:00
9b90d139c5 [#94] object: Generate protobufs for Patch method
* Generate protobufs for patch method;
* Create marshalers, unmarshalers, converters for gererated types;
* Add unit-tests.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2024-07-29 08:55:14 +00:00
f517e39491 [#91] protogen: Support unpacked repeated uint64 fields
All checks were successful
DCO action / DCO (pull_request) Successful in 1m18s
Tests and linters / Lint (pull_request) Successful in 1m31s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m39s
Tests and linters / Tests (1.19) (pull_request) Successful in 1m45s
Tests and linters / Tests with -race (pull_request) Successful in 2m21s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-07-16 14:39:20 +03:00
610c450a65 [#90] proto/test: Fix go vet warnings
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-07-15 16:40:21 +03:00
3f92d7bfb0 [#90] proto/test: Fix proto file formatting
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-07-15 16:40:21 +03:00
1772b92182 [#69] object: Initial EC implementation
All checks were successful
DCO action / DCO (pull_request) Successful in 1m7s
Tests and linters / Tests (1.19) (pull_request) Successful in 1m37s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m33s
Tests and linters / Lint (pull_request) Successful in 1m46s
Tests and linters / Tests with -race (pull_request) Successful in 1m45s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-03-19 15:23:01 +03:00
a85146250b [#68] Makefile: Use gofumpt for formatting
All checks were successful
DCO action / DCO (pull_request) Successful in 1m17s
Tests and linters / Tests (1.20) (pull_request) Successful in 2m22s
Tests and linters / Lint (pull_request) Successful in 2m51s
Tests and linters / Tests (1.19) (pull_request) Successful in 2m48s
Tests and linters / Tests with -race (pull_request) Successful in 2m40s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2024-03-14 10:31:58 +03:00
634e24aba7 [#65] object: Fix SetMarshalData for PutSingle request
All checks were successful
DCO action / DCO (pull_request) Successful in 1m11s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m25s
Tests and linters / Tests (1.19) (pull_request) Successful in 1m33s
Tests and linters / Tests with -race (pull_request) Successful in 1m56s
Tests and linters / Lint (pull_request) Successful in 1m14s
Allow to reset marshal data

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-02-15 15:44:01 +03:00
72885aae83 [#62] signature: Refactor BufferPool
All checks were successful
Tests and linters / Tests (1.19) (pull_request) Successful in 7m46s
DCO action / DCO (pull_request) Successful in 8m16s
Tests and linters / Tests (1.20) (pull_request) Successful in 9m24s
Tests and linters / Tests with -race (pull_request) Successful in 9m25s
Tests and linters / Lint (pull_request) Successful in 9m49s
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-01-12 18:09:28 +03:00
b46e8cfbda [#59] util: Rename stableMarshaler
All checks were successful
DCO action / DCO (pull_request) Successful in 1m23s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m46s
Tests and linters / Lint (pull_request) Successful in 1m59s
Tests and linters / Tests (1.19) (pull_request) Successful in 2m7s
Tests and linters / Tests with -race (pull_request) Successful in 2m22s
It should be with a single `l`, see `json.Marshaler`.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-11-21 15:28:03 +03:00
9cc2095446 [#59] util: Restore backwards compatibility in NestedStructureMarshal()
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-11-21 15:27:57 +03:00
f50872f1bc [#58] object: Allow to set marshal data
Now it is possible set marshaled data to reduce memory
allocations.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-10-31 13:47:48 +03:00
17bed735a1 [#20] Update api version
All checks were successful
DCO action / DCO (pull_request) Successful in 1m14s
Tests and linters / Tests (1.19) (pull_request) Successful in 1m39s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m42s
Tests and linters / Lint (pull_request) Successful in 1m57s
Tests and linters / Tests with -race (pull_request) Successful in 2m5s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-17 11:10:12 +03:00
9a7b47d769 [#50] util: Use protowire for util/proto helpers
* Use methods to calculate size

Signed-off-by: Airat Arifullin a.arifullin@yadro.com
2023-08-10 16:40:53 +00:00
3072090c77 [#51] protogen: Do not panic in StableSize()
All checks were successful
Tests and linters / Lint (pull_request) Successful in 1m56s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m7s
Tests and linters / Tests (1.19) (pull_request) Successful in 2m37s
Tests and linters / Tests with -race (pull_request) Successful in 1m44s
Refs TrueCloudLab/frostfs-node#554 .

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-02 10:47:14 +03:00
7a5ee927c8 [#49] util/proto: Do not allocate in StringSize()
All checks were successful
Tests and linters / Tests (1.19) (pull_request) Successful in 1m1s
Tests and linters / Lint (pull_request) Successful in 2m10s
Tests and linters / Tests with -race (pull_request) Successful in 2m18s
Tests and linters / Tests (1.20) (pull_request) Successful in 2m52s
It was not catched by the test because most of the time the function is
inlined. However, I've seen it allocating with pprof in one of the
earlier builds.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-26 18:52:59 +03:00
6e92d7d5de [#49] util/proto: Make NestedStructure* generic
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-26 18:31:23 +03:00
849de02bc3 [#49] util/proto: Calculate repeated field size without allocations
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-26 18:31:23 +03:00
59c8421597 [#49] util/proto: Use StableSize() to determine if the struct is empty
`reflect` is not necessary here, and checking `StableSize` is what we
_want_ anyway.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-26 18:31:00 +03:00
68021b910a [#38] signature: Increase pool max object size
According to the results of profiling, objects with a size of 72KB
are mainly allocated.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-06-02 17:27:16 +03:00
e9e7901f67 [#27] util/proto: Fix staticcheck warning
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-05-03 14:15:56 +03:00
2aa3ee46e7 [#27] util/signature: Fix staticcheck warning
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-05-03 14:15:56 +03:00
Pavel Karpy
d9347a05f0 [#21] *: Drop reputation system
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
2023-04-17 15:46:52 +03:00
ec0d0274fa [#3] signature: Add buffer pool
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-03-10 13:36:26 +03:00
73fde0e37c [#3] signature: Verify parts in parallel
Verify request/response parts in parallel

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-03-10 13:36:26 +03:00
d005bf0393 [#3] signature: Refactor sign and verify
Split methods to separate files, drop redundant intefaces

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-03-10 13:36:26 +03:00
f69d2ad83c Rename package name
Due to source code relocation from GitHub.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2023-03-07 13:42:36 +03:00
1351b6656d Move to frostfs-api
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2022-12-12 17:40:48 +03:00
Leonard Lyubich
cf868188ef [#418] netmap: Support NetmapService.NetmapSnapshot RPC
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-09-19 16:44:34 +04:00
Evgenii Stratonikov
ea7a3811bf [#415] *: Add maintenance status and node state
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-09-16 18:50:53 +04:00
Evgenii Stratonikov
9e17cdfc76 [#413] util/proto: Marshal repeated []byte fields correctly
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-08-27 11:06:58 +03:00
Evgenii Stratonikov
dd233c3fbc [#386] util/signature: Add WalletConnect API support
To avoid introducing new dependency (neo-go), crypto routines are used
as in other code.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-06-21 20:09:33 +03:00
Evgenii Stratonikov
454b5c0ed7 [#406] protogen: Uncomment control service line
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-06-20 14:45:58 +03:00
fyrchik
0b8e4e4753
[#400] Support latest API in protoc plugin (#400)
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-05-30 10:33:01 +03:00
Evgenii Stratonikov
77a3ba9197 [#393] util/signature: Remove bytes pool and provide buffer explicitly
Chained verification is done in a single thread there is no need to use
pool to do this. Also because newly allocated items are 5 MiB in size
we can run out of memory given that typical header it much less in size.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-04-21 15:11:57 +03:00
Evgenii Stratonikov
23702bc51a util/protogen: add StableMarshal generator command
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-04-21 15:07:57 +03:00
Evgenii Stratonikov
e348c933b7 util/proto: fix doc comment
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-04-21 15:07:57 +03:00
Evgenii Stratonikov
94f068e462 *: remove error from StableMarshal return values
We marshal only in-memory structures, no error is expected.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-04-21 15:07:57 +03:00