-
Notifications
You must be signed in to change notification settings - Fork 592
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
osmomath: mutative and efficient BigDec truncations with arbitrary decimals #6261
Conversation
Important Notice This PR modifies an in-repo Go module. It is one of:
The dependent Go modules, especially the root one, will have to be Please follow the instructions below:
Please let us know if you need any help. |
756288c
to
0b8dac1
Compare
713c9fc
to
0b8dac1
Compare
devbot add changelog misc osmomath: mutative and efficient BigDec truncations with arbitrary decimals. |
1a0589e
to
0b8dac1
Compare
@pysel please see the last A/C on the issue:
Could you try addressing it, please? |
3124f18
to
8e267f2
Compare
6b5a23a
to
22d2176
Compare
7f20c37
to
b052536
Compare
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.
Nice work! Overall LGTM
This PR is LGTM after the remaining comments are addressed. Note to self: try running tests before approving |
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.
Nice work!
In the future, please add changelog and create issues for unaddressed threads
…cimals (#6261) * merge main * Auto: update go.mod after push to pysel/bigdec-sdkdec that modified dependencies locally * better doc * mutative/non-mutative custom precision truncators * selfrev: better variable name * use better type * selfrev: better docs * selfrev: better error in case of failed test * use new truncators in CalculatePriceToTick * use osmomath.PrecisionDec * supposedly fix e2e * sdk.Precision -> osmomath.PrecisionDec * pre-compute precision factors * add edge case * fix go mod after merge * panic if converting to Dec with precsiion bigger than PrecisionDec * bring back old case, expect panic * add example to DecWithPrecision * updates * godoc updates * changelog * uint * updates --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: roman <roman@osmosis.team> (cherry picked from commit d5c8abc) # Conflicts: # CHANGELOG.md # go.mod # go.sum # x/epochs/go.mod # x/epochs/go.sum
Closes: #6257
What is the purpose of the change
This PR:
SDKDec()
(now justDec()
) conversion function to be less resource-consumingPerformance
The new version of
SDKDec
is approximately 1.84 times better than the old version in terms of time, and 1.75 times better in terms of the number of allocations:Testing and Verifying
Tests added
Documentation and Release Note
changelog misc section