mirror of
https://github.com/nspcc-dev/neofs-sdk-go.git
synced 2026-03-01 04:29:18 +00:00
client: Optimize message encoding for signing #260
Labels
No labels
I2
I3
I4
S1
S2
S3
S4
U0
U1
U2
U2
U2
U3
U4
blocked
bug
client
config
discussion
documentation
enhancement
epic
feature
go
good first issue
help wanted
performance
pool
question
security
task
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nspcc-dev/neofs-sdk-go#260
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cthulhu-rider on GitHub (Dec 11, 2024).
Is your feature request related to a problem? Please describe.
currently, to sign any request,
Clientencodes 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. https://github.com/nspcc-dev/neofs-api/issues/305 is about to come, and may make all these irrelevant