-
Notifications
You must be signed in to change notification settings - Fork 355
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
storage-plus: Implement u128 key #694
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since u128 is not implemented for PrimaryKey I was not able to.
Not sure if u128 is intentionally not implemented here
Yes it was. #547 (comment)
The real question is - do you really need 128 bit key?
@maurolacy ?
I building an optimized version of Claim and a sorted index that will save a sorted list of a defined number of claims.
To achieve the sorted claim list, I am indexing the total claim amount with the address as appended key, bool is just a placeholder. |
Looks like doubling the size of every key will be very costly for this feature... |
Yes. We can add this, but better to avoid it. My question would be, why you can't use Converting the key to a string would work too. Or using a tuple of two |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I think this wouldn't hurt, as those bytes are in memory / stack in the first place, and do not hit storage.
Approving. Will create a follow-up issue to benchmark Key
performance with and without u128 support, so we confirm this.
Update: See #695.
I needed to implement a
(Uint128, &Addr)
composite keymap, since u128 is not implemented forPrimaryKey
I was not able to.Not sure if u128 is intentionally not implemented here, just pushing it here in case it is left over