-
Notifications
You must be signed in to change notification settings - Fork 14
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
balance uses uint64 #7
Comments
Only if the top bit of the uint64 is set, then it becomes a problem |
it's something we need to address in the long run. i think the likelihood of it occurring during the intended operating window of pegnetd is, for most assets, very low, but not for all. what's your assessment? without a top bit we can only go up to 92,233,720,368.54775807. using KRW at ~0.00083 usd per, that's 76k USD. our current fct marketcap is already over 100k |
Oh jeeze, that is much lower than I had thought it would be. Is there another sql type we can use? |
Unfortunately none that SQLite supports. SQLite's Since I assume requiring a dedicated sql database server is not an option, one of our options is to just store a marshaled Another option is to have varying definitions of tokens instead of a simple 8-decimal systems. Something like KRW will never need 8 decimals so we're wasting a lot of room. This would complicate all other code and it would also make running queries that involve values from multiple tokens hard if not impossible. Since this is a problem that also exists in FATd, we should really come up with something useful. |
@WhoSoup I think you were off in the math. I am seeing the limit being 76 million USD into KRW. Which buys us more time to address this. |
But I agree we should come up with something. |
yeah, thanks for double checking |
The functions in pegnet/addresses.go all use uint64 for balances but sqlite doesn't support uint64. they need to be changed to int64 or a workaround found
The text was updated successfully, but these errors were encountered: