-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Refactor store keys to allow variable-length addresses #8345
Comments
Just noting that ADR 028 doesn't currently support variable length addresses, but the plan is to update it with both 20 and 32 byte addresses based on recent discussions. |
I'm re-reading this, and just want to make sure we're on the same page for 3/ . We don't need to length-prefix all components, just the variable-length component(s), correct? e.g. a balance store key for a particular denom is:
and NOT:
I don't think we need to length-prefix fixed-length components. See e.g. the draft PR here |
Just this:
And we probably shouldn't even use |
cool, we're on the same page 👍 |
ahh this was a misunderstanding on my part as well. Thanks for clarifying @amaurymartiny |
@AmauryM We should add a followup to add a store migration for Sunny's weighted votes PR. |
Summary
Problem Definition
ADR-028 proposes to have addresses of length > 20 bytes for security reasons. However, some modules (bank, distribution, gov, slashing, staking) depend on fixed-length addresses (
AddrLen
, set to 20 bytes now).This issue is to discuss refactoring the store keys of these modules to be able to handle variable-length addresses.
Proposal
Aaron outlined some ideas in this comment for replacing addresses inside store keys:
AddrLen
to something bigger (e.g. 41), addresses are length-prefixed (1 byte) and padded with 0s untilAddrLen
From Aaron, about 3/:
It seems to me that 3/ is more space-efficient than 2/, and doesn't require additional
acc_num<->addr
lookups like in 1/. So 3/ would be my preferred way to go.cc @alessio @alexanderbez
For Admin Use
The text was updated successfully, but these errors were encountered: