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

Replace public keys with those compressed #5280

Open
s8sato opened this issue Jan 9, 2025 · 1 comment
Open

Replace public keys with those compressed #5280

s8sato opened this issue Jan 9, 2025 · 1 comment
Labels
Optimization Something isn't working as well as it should

Comments

@s8sato
Copy link
Contributor

s8sato commented Jan 9, 2025

I don’t ask for crypto. M◉⃤|<𓊖༒𓊖 Takemiya 武宮誠 (Sora.org & SORAMITSU), [2025/01/08 19:58]
How many bytes used per account stored in memory in wsv?

S. Sato, [2025/01/09 0:20]
Approximately 2.2GiB resident memory difference is observed for 2^20 (1Mi) account-asset pairs, which means 2200~2300B for a pair. Code (s8sato@17bfacd)

Assumptions:

  • No difference except in the world state: compared in the initial state of 0 blocks
  • Every account accompanies one asset

I might investigate further to be more precise

S. Sato, [2025/01/09 0:47]
We might have to store multihash instead of PublicKey as well as to dedup ids

I don’t ask for crypto. M◉⃤|<𓊖༒𓊖 Takemiya 武宮誠 (Sora.org & SORAMITSU), [2025/01/09 1:12]
Do we store compressed public keys?

S. Sato, [2025/01/09 1:28]
I guess no, it consumes 8+296 bytes while e.g. ed25519 multihash is essentially 32 bytes

I don’t ask for crypto. M◉⃤|<𓊖༒𓊖 Takemiya 武宮誠 (Sora.org & SORAMITSU), [2025/01/09 14:18]
We can compress the public key I guess as we just need a bit showing if y is even or odd and not the whole y coord

@s8sato s8sato added the Optimization Something isn't working as well as it should label Jan 9, 2025
@s8sato
Copy link
Contributor Author

s8sato commented Jan 10, 2025

In addition to PublicKey size and duplicate IDs between keys and values, it would be a major factor in memory usage that mv::storage::Storage.revert holds a snapshot to handle soft forks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Optimization Something isn't working as well as it should
Projects
None yet
Development

No branches or pull requests

1 participant