-
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
ADR-028 extensible address format: breaking changes investigation #8041
Comments
[EDIT] This things should work because we don't change addresses for existing keys.
|
So just to be clear, I am not aware of any proposal to change current addresses. What I have proposed is that new addresses be a different length so that 20 byte addresses are grandfathered as legacy and all non-20 byte addresses are new. What will break then is the assumption that addresses are always 20 bytes. First and foremost there is a lot of SDK code relying on this assumption - just do a find usages on the address length constant. For clients, again let's be clear on what will actually break and as far as I know it is simply that new addresses will not be 20 bytes. What you're outlining @robert-zaremba are not things that will break AFAIK (except things affected by ADR 034 but that's a separate concern). Nobody has proposed rewriting secp256k1 addresses to some other format. |
How about |
BTW - I have reformulated my initial list above |
Ed25519 has never been officially enabled so as far as the SDK is concerned that address format is still up discussion |
Maybe other SDK users have a custom accounts and would be good to hear their concerns. The goal of this issue is to investigate all problems we may face both with existing software and potential adoption path. |
Maybe, but I think that's mostly outside of our scope of concern. The whole time we've had this discussion, everyone has emphasized that the only things we need to treat as legacy are secp256k1 and amino multisigs. If people have forked the SDK and added other keys, they should have known what they were getting into because it's really not that easy. |
So currently within the SDK, the
I see 3 ways to refactor this code to accommodate a new address format: (1) The mostly painless wayAllow variable length addresses but set a So if we had 40 byte addresses, store key functions would encode existing 20 byte addresses in a 41 byte array with the first byte being the byte (2) The more efficient wayWe could allow variable length addresses with no (3) The probably bad waySet a larger fixed |
Thanks @aaronc, that's helpful. Some immediate questions: a. When you say b. x/auth's state is a map c. It seems that variable-length addresses (without MaxAddrLen and padding) is not considered. Is that because it requires the introduction of some sort ORM to handle indexing, and that would be too big a refactor? Also, I'm a bit confused why there are two issues #5694 and this one. |
Right
Right
I'm confused. That's (2). Am I missing something?
🤷 |
I was referring to variable-length addresses inside the store key. Same as |
Oh, well you need some sort of way of splitting components in store keys. It's hard to do that with binary data without fixed length keys. We could serialize addresses as strings and use the null terminator to separate but that's even more storage space. I guess we can give that as a fourth alternative. |
Maybe I'm missing something, but afaiu you would just need a length prefix: |
Overall I'm more in favor in |
Re:
|
|
Hmm, not quite - you may encounter problems with prefix stores with that approach. Try to think a bit about how prefix stores get constructed. Without fixed length parts, you generally need some lexical separator |
I'm pretty sure that can be optimized away with a memory cache. |
Hmmm yeah (2) doesn't affect address format at all. We're talking about store keys. Maybe @amaurymartiny can explain or we can discuss later. |
I don't see why we would make that compromise to save 1 byte of storage. Also the format of adr 028 is somewhat orthogonal to how the SDK deals with variable length addresses. That problem needs to be solved to enable adr 028 to move in a different direction. |
Actually this could maybe work @amaurymartiny as long as components before is also length prefixed or fixed length. I think it needs to be thought through case by case depending on the other components. But yeah maybe we can avoid the padding in which case max len = 255 and that should be plenty. Let's think about it a bit. |
So, I think length prefixing will work for multi-part keys without padding as long as all parts except the last one are prefixed, (i.e. The case where length prefixing is problematic is if you care about keys being lexically sorted in index scans. In those cases, fixed length bytes or strings with lexical separators are needed. I tried using length suffixing in the orm to deal with this, but I think that also has its pitfalls. But anyway, we don't need lexical sorting for addresses at all. |
Notes from the today meeting: https://hackmd.io/@robert-zaremba/S1hsgDq2w |
@aaronc , @amaurymartiny , @clevinson - I think we can close this task. What do you think? We were discussing in the past days about all things, and we added the last followup task: #8516, which I believe is the last one. |
That's fine @robert-zaremba |
Summary
ADR-028 is very important because current address format is not future safe if we want to expand to more different account and pubkey schemes .
Discussion about moving ADR-028 is in #5694
Problem Definition
Changing address format is a breaking change for many apps.
Proposal
List and document the dev and client issues with changing the address format.
The text was updated successfully, but these errors were encountered: