-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Switch coins.Amount
to uint, consider using a deterministic map instead of a list
#1273
Comments
Depends on #553. |
Unclear how we want to move forward with this. My impressions are:
In conclusion, I think we can punt on actually dealing with this for now. Anyone disagree ? |
I agree that we can move deterministic map to post launch (especially since that will involve us creating our own datastructure), but I think coins.Amount should be made into a Uint prelaunch. |
Is this still an issue? I'm guessing yes. |
Definitely think this should be tackled pre-launch. Any opposition to this? I like @ValarDragon's idea of using arithmetic coins (signed ints which users never really interact with) and "safe" or "regular" coins (unsigned ints that users do interact with and that is kept in state). |
Oh sorry I forgot to write up the various things into this issue! To recap the arithmetic coins idea, I think the result of any arithmetic should be of type "arithmetic coins". Arithmetic coins can have negative denoms, so you can easily have things like Whenever you parse a coin value, or write a coin value, it would be the regular coins. So state would only have these regular coins, and fees would also only be read as regular coins. I like this because it enables fast addition laws, while also giving us the safety we'd want. I also think the coin denominations should be sorted, not a deterministic map. The reason I am in favor of this is because it makes the addition law much quicker. |
I agree in general but I'm not sure this is worth the complexity right now, given that we don't actually perform
This is now true. Maybe this is good enough, although I still don't like that we're storing all the denomination strings repeatedly in state. |
Agreed, I was actually writing another issue for exactly that last night, and just didn't get a chance to finish it then lol. |
This has been done. |
Ref https://github.com/cosmos/cosmos-sdk/pull/1218/files#r195270328
The text was updated successfully, but these errors were encountered: