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

client: Optimize message encoding for signing #665

Open
cthulhu-rider opened this issue Dec 11, 2024 · 0 comments
Open

client: Optimize message encoding for signing #665

cthulhu-rider opened this issue Dec 11, 2024 · 0 comments
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

Comments

@cthulhu-rider
Copy link
Contributor

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 transport

with 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

@cthulhu-rider cthulhu-rider added enhancement Improving existing functionality blocked Can't be done because of something client Issue related to the client discussion Open discussion of some problem labels Dec 11, 2024
@roman-khimov roman-khimov added U4 Nothing urgent S3 Minimally significant I4 No visible changes performance More of something per second and removed discussion Open discussion of some problem labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants