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

Use type aliasing or embedded types for handling protobuf and ed25519 operations #7382

Closed
4 tasks
robert-zaremba opened this issue Sep 24, 2020 · 1 comment
Closed
4 tasks
Assignees

Comments

@robert-zaremba
Copy link
Collaborator

robert-zaremba commented Sep 24, 2020

Summary

Signatures are heavily used blockchain workload, so if possible it's good to avoid unnecessary conversion operations

Problem Definition

In #7268 we introduce back ed25519 in SDK. The first implementation makes conversion to x/crypto/ed25519 each time we call any signature related function. This is suboptimal.

Ref: https://github.com/cosmos/cosmos-sdk/pull/7268/files#r493581731

Proposal

We can experiment with type alias or embed stdlib crypto/ed25519 PubKey and PrivateKey. This approach will remove type conversions and unnecessary memory allocations, but we will still need to keep method wrappers.

gogoproto.casttype can be used to instrument protobuf compiler.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@robert-zaremba
Copy link
Collaborator Author

Solved in: #7672

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant