Skip to content
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

fix for storing uint64 values as int64 in db #219

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

pk910
Copy link
Member

@pk910 pk910 commented Jan 20, 2025

Dora fails and gets stuck when trying to store uint64 values with the highest bit set into db.
This was previously not a problem, but with withdrawal requests there is now a way to put arbitrary numbers into requests, so dora needs to be prepared to handle those high values.

The background of this limitation is, that values are stored as signed 64 bit number in db, so it can only handle the lower half of the uint64 range.
To get around that limitation, the uint64 values are now converted to the int64 range for storing in db,
That means:
uint64(0) -> int64.MinValue
uint64.MaxValue -> int64.MaxValue

With this value translation, we can store big uint64 to the db and still filter based on min/max values, as the order of values within the range keeps stable.

@pk910 pk910 merged commit d523bf7 into master Jan 21, 2025
1 check passed
@pk910 pk910 deleted the pk910/fix-max-amount-withdrawals branch January 21, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants