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

feat: monotonic sqrt big dec #6053

Merged
merged 2 commits into from
Aug 28, 2023
Merged

feat: monotonic sqrt big dec #6053

merged 2 commits into from
Aug 28, 2023

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Aug 15, 2023

Closes: #6045

What is the purpose of the change

To raise the minimum spot price in CL, we need to implement a MonotonicSqrt function on osmomath.BigDec to support higher precision.

See design document: https://app.clickup.com/37420681/v/dc/13nzm9-22453/13nzm9-45853

Testing and Verifying

Copied tests from regular MonotonicSqrt.

Benchmark

goos: linux
goarch: amd64
pkg: github.com/osmosis-labs/osmosis/osmomath
cpu: 12th Gen Intel(R) Core(TM) i7-1260P
                        │  reg.bench   │     big.bench      │
                        │    sec/op    │   sec/op     vs base   │
MonotonicSqrt-16          386.8µ ± 19%
MonotonicSqrt_BigDec-16                  470.0µ ± 2%
geomean                   386.8µ         470.0µ       ? ¹ ²
¹ benchmark set differs from baseline; geomeans may not be comparable
² ratios must be >0 to compute geomean

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

  • Specification (x/{module}/README.md)
  • Osmosis documentation site
  • Code comments?
  • N/A

@p0mvn p0mvn added V:state/compatible/backport State machine compatible PR, should be backported A:backport/v17.x backport patches to v17.x branch labels Aug 15, 2023
@p0mvn p0mvn requested a review from AlpinYukseloglu August 16, 2023 09:57
@p0mvn p0mvn marked this pull request as ready for review August 16, 2023 09:57
@p0mvn p0mvn force-pushed the roman/big-dec-monotonic-sqrt branch from 32897f9 to 30a8336 Compare August 20, 2023 08:48
Copy link
Contributor

@AlpinYukseloglu AlpinYukseloglu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@p0mvn p0mvn merged commit 2b703e6 into main Aug 28, 2023
@p0mvn p0mvn deleted the roman/big-dec-monotonic-sqrt branch August 28, 2023 03:14
@p0mvn p0mvn added the A:backport/v19.x backport patches to v19.x branch label Aug 28, 2023
mergify bot pushed a commit that referenced this pull request Aug 28, 2023
* feat: monotonic sqrt big dec

* changelog

(cherry picked from commit 2b703e6)

# Conflicts:
#	CHANGELOG.md
mergify bot pushed a commit that referenced this pull request Aug 28, 2023
* feat: monotonic sqrt big dec

* changelog

(cherry picked from commit 2b703e6)

# Conflicts:
#	CHANGELOG.md
p0mvn added a commit that referenced this pull request Aug 28, 2023
czarcas7ic pushed a commit that referenced this pull request Aug 28, 2023
Co-authored-by: Roman <roman@osmosis.team>
nicolaslara pushed a commit that referenced this pull request Aug 31, 2023
* feat: monotonic sqrt big dec

* changelog
@github-actions github-actions bot mentioned this pull request May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v17.x backport patches to v17.x branch A:backport/v19.x backport patches to v19.x branch V:state/compatible/backport State machine compatible PR, should be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat/test: MonotonicSqrt function defined on osmomath.BigDec and benchmark against sdk.Dec
2 participants