client: Optimize message encoding for signing #665
Labels
blocked
Can't be done because of something
client
Issue related to the client
enhancement
Improving existing functionality
I4
No visible changes
performance
More of something per second
S3
Minimally significant
U4
Nothing urgent
Is your feature request related to a problem? Please describe.
currently, to sign any request,
Client
encodes its parts and passes to the signing func. Any encoding result is a protobuf message. There are 3 supported crypto schemes at the moment, and each of them hashes the signed payload. After signatures are calculated, Client attaches it to the request, encodes it into protobuf and passes into gRPC transportwith this, client takes up a lot of memory. More lightweight approach is desired
Describe the solution you'd like
calculate the signed checksum immediately w/o an intermediate buffer. The message can provide corresponding interface for this. https://pkg.go.dev/io#WriterTo is the closes std one (but there is no need for
(int64, error)
return)Describe alternatives you've considered
continue current encoding, but use resulting protobuf messages not just for signing but for gRPC transport too
this is harder to implement, but will go more efficiently
Additional context
i block this for now. nspcc-dev/neofs-api#305 is about to come, and may make all these irrelevant
The text was updated successfully, but these errors were encountered: