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

perf: remove repeated reallocations in swap step iterations #5211

Merged
merged 7 commits into from May 18, 2023

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented May 17, 2023

Closes: #XXX

What is the purpose of the change

This PR removes repeated reallocations of sdk.Int in swap iterations

  • reallocations are removed by converting to mutative math
  • precomputed sdk.SmallestDec()
  • removed some obsolete method calls as a drive by

Testing and Verifying

This change is already covered by existing tests

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/no_backport State machine compatible PR, depends on prior breaks A:no-changelog labels May 17, 2023
@p0mvn p0mvn marked this pull request as ready for review May 17, 2023 22:19
@p0mvn p0mvn requested a review from czarcas7ic as a code owner May 17, 2023 22:19
Copy link
Member

@czarcas7ic czarcas7ic left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@@ -309,8 +316,8 @@ func (k Keeper) computeOutAmtGivenIn(
// initialize swap state with the following parameters:
// as we iterate through the following for loop, this swap state will get updated after each required iteration
swapState := SwapState{
amountSpecifiedRemaining: tokenAmountInSpecified, // tokenIn
amountCalculated: sdk.ZeroDec(), // tokenOut
amountSpecifiedRemaining: tokenAmountInSpecified.Clone(), // tokenIn
Copy link
Member

Choose a reason for hiding this comment

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

I see you used clone here, but for computeIn in the same step you did not. Just pointing this out

Copy link
Member

Choose a reason for hiding this comment

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

IMO we do not need to use clone here

Copy link
Member

Choose a reason for hiding this comment

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

if its remotely concerning, we can definitely keep cloning

(An extra heap allocation is better for confidence in 0 chance of bugs)

I'm supportive of doing clone to be more future proof here. The other changes are pretty trivial / isolated to convince yourself about, this one not as much

Copy link
Member Author

Choose a reason for hiding this comment

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

Added comment:

// N.B. We clone tokenAmountInSpecified because swapState.amountSpecifiedRemaining will get
// mutated during the compute swap step loop. However, we still need the original
// value of tokenAmountInSpecified to calculate the amount of tokenOut to return.

This does not apply to in given out. That's why we don't clone there

if err != nil {
return sdk.Coin{}, sdk.Coin{}, 0, sdk.Dec{}, sdk.Dec{}, err
}
liquidityNet = swapStrategy.SetLiquidityDeltaSign(liquidityNet)
// Update the swapState's liquidity with the new tick's liquidity
newLiquidity := math.AddLiquidity(swapState.liquidity, liquidityNet)
newLiquidity := swapState.liquidity.AddMut(liquidityNet)
Copy link
Member

Choose a reason for hiding this comment

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

yeah coming to think about it, we did not need the AddLiquidity method

Copy link
Member

Choose a reason for hiding this comment

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

(note I am not checking this in PR review, trusting people with more context)

@@ -309,8 +316,8 @@ func (k Keeper) computeOutAmtGivenIn(
// initialize swap state with the following parameters:
// as we iterate through the following for loop, this swap state will get updated after each required iteration
swapState := SwapState{
amountSpecifiedRemaining: tokenAmountInSpecified, // tokenIn
amountCalculated: sdk.ZeroDec(), // tokenOut
amountSpecifiedRemaining: tokenAmountInSpecified.Clone(), // tokenIn
Copy link
Member

Choose a reason for hiding this comment

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

IMO we do not need to use clone here

@@ -538,29 +549,28 @@ func (k Keeper) computeInAmtGivenOut(

// update the swapState with the new sqrtPrice from the above swap
swapState.sqrtPrice = sqrtPrice
swapState.amountSpecifiedRemaining = swapState.amountSpecifiedRemaining.Sub(amountOut)
swapState.amountCalculated = swapState.amountCalculated.Add(amountIn.Add(feeChargeTotal))
swapState.amountSpecifiedRemaining = swapState.amountSpecifiedRemaining.SubMut(amountOut)
Copy link
Member

Choose a reason for hiding this comment

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

what is the reason using mut here improves performance?

Copy link
Member

Choose a reason for hiding this comment

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

Basically, every Int/Decimal operation in the SDK allocates a new big.Int

Every new big.Int requires a heap allocation, which takes more time. (And then has to get garbage collected later)

This page talks a bit about perf differences stack/heap: https://stackoverflow.com/questions/36512509/why-is-stack-memory-cheaper-than-heap-memory-in-c (and keep in mind that in C you manually free things. Garbage collection is far more expensive than a free call)

Lmk if your unfamiliar with stack/heap! (In which case the above post won't make any sense)

Copy link
Member

Choose a reason for hiding this comment

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

So this line is going from a = a - b to instead a -= b. Now in every single compiled language, these will have no performance differences for normal code.

However in golang, we don't have interfaces for basic arithmetic that can get compiler optimized. So it can't infer that a = a.Add(b) is equivalent to a += b, and the internal methods are slower.

Rust doesn't have this problem

Copy link
Member

Choose a reason for hiding this comment

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

Ah #5211 (comment) this change was the question that I had in mind, everythings clear now thanks!

}
// These are truncated at precision end to round in favor of the pool when:
// - calculating amount out during swap
// - withdrawing liquidity
// The denominator is rounded up to get a smaller final amount.
denom := sqrtPriceA.MulRoundUp(sqrtPriceB)
return liq.MulTruncate(diff).QuoTruncate(denom)
Copy link
Member

Choose a reason for hiding this comment

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

this is so sad that we have to manually do this

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah lol

Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

LGTM, aside from things I noted as left to other reviewers

p0mvn and others added 4 commits May 18, 2023 13:28
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
@p0mvn
Copy link
Member Author

p0mvn commented May 18, 2023

Thanks all, merging once CI passes

@p0mvn p0mvn merged commit 17fa8e9 into main May 18, 2023
1 check passed
@p0mvn p0mvn deleted the roman/remove-realloc branch May 18, 2023 18:25
MasterPi-2124 added a commit to notional-labs/osmosis that referenced this pull request May 20, 2023
* chore(deps): bump lycheeverse/lychee-action from 1.6.1 to 1.7.0 (osmosis-labs#5158)

Bumps [lycheeverse/lychee-action](https://github.com/lycheeverse/lychee-action) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/lycheeverse/lychee-action/releases)
- [Commits](lycheeverse/lychee-action@v1.6.1...v1.7.0)

---
updated-dependencies:
- dependency-name: lycheeverse/lychee-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump actions/cache from 2 to 3 (osmosis-labs#5145)

Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump mheap/github-action-required-labels from 2 to 4 (osmosis-labs#5146)

Bumps [mheap/github-action-required-labels](https://github.com/mheap/github-action-required-labels) from 2 to 4.
- [Release notes](https://github.com/mheap/github-action-required-labels/releases)
- [Commits](mheap/github-action-required-labels@v2...v4)

---
updated-dependencies:
- dependency-name: mheap/github-action-required-labels
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Clarify error message when you try to completely exit a pool (osmosis-labs#5165)

* Clarify error message when you try to completely exit a pool

Closes osmosis-labs#3427

* Add changelog

* Remove a section of PR template (osmosis-labs#5166)

* Remove a section of PR template

* Update .github/pull_request_template.md

Co-authored-by: Adam Tucker <adam@osmosis.team>

---------

Co-authored-by: Roman <roman@osmosis.team>
Co-authored-by: Adam Tucker <adam@osmosis.team>

* [CL Message Audit] MsgSwapExactAmountIn (osmosis-labs#5123)

* add comments from audit

* add tests for untested files and fix minor bugs and issues

* add test for rounding behavior

* clean up comments

* fix conflicts

* fix conflicts in tests relating to rounding changes

* romans and adams feedback

---------

Co-authored-by: stackman27 <sis1001@berkeley.edu>

* Speedup accumulator prefix keys (osmosis-labs#5174)

* Speedup some of the swap logic by doing more pre-computation in tick math (osmosis-labs#5171)

* osmomath: disable thelper for some helper functions (osmosis-labs#5164)

* mark helper functions

* disable thelper warnings

* chore(deps): bump lycheeverse/lychee-action from 1.7.0 to 1.8.0 (osmosis-labs#5180)

Bumps [lycheeverse/lychee-action](https://github.com/lycheeverse/lychee-action) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/lycheeverse/lychee-action/releases)
- [Commits](lycheeverse/lychee-action@v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: lycheeverse/lychee-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix localosmosis (osmosis-labs#5183)

* [CL Message Audit]: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition [1/2] (osmosis-labs#5178)

* initial push audit changes

* add back proto tag

* rename to validateGammLockForSuperfluidStaking

* remove unused errors

* fix: duplicate price for multiple ticks (osmosis-labs#5173)

* initial push

* update readme

* initial push

* implement round tick

* add test for round tick

* add readme

* return new lower and upper tick when create pos

* initial push audit changes

* use enum for migration type

* add back proto tag

* rename to validateGammLockForSuperfluidStaking

* remove unused errors

* Update x/superfluid/keeper/migrate.go

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>

* add check for both bonded and unbonding

* named return values createPosition

* Update x/concentrated-liquidity/tick.go

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>

* change roundTick to roundTickToCanonicalPriceTick

* initialize int64 vars

* Revert "Merge branch 'adam/MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition-audit' into adam/duplicate-price-for-multiple-ticks-patch"

This reverts commit 3ace477, reversing
changes made to b5923f0.

---------

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>

* fix: add split route message to codec and interface registration (osmosis-labs#5168)

* fix: add split route message to codec and interface registration

* Apply suggestions from code review

* Apply suggestions from code review

* refactor: remove cache context from swap out given in (osmosis-labs#5176)

* refactor: remove cache from swap out given in

* updates

* dead code

* update test name

* updates

* [CL][InternalReview] MsgAddToConcentratedLiquiditySuperfluidPosition (osmosis-labs#5157)

* [InternalReview] MsgAddToConcentratedLiquiditySuperfluidPosition

* updates

* updates

* updates

* updates

* revert me

* updates

* debug

* docs

* go sum

* go mod

* remove

* Update x/superfluid/README.md

* Update x/concentrated-liquidity/position.go

* comment

* coins

* remove Q

* remove Q

* revert name

* CL: benchmark for swaps (osmosis-labs#5170)

* test

* fix

* comments

* fix conflict

* updates

* normalize

* maxAmountDepositedFullRange

* chore(deps): bump lycheeverse/lychee-action from 1.7.0 to 1.8.0 (osmosis-labs#5188)

Bumps [lycheeverse/lychee-action](https://github.com/lycheeverse/lychee-action) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/lycheeverse/lychee-action/releases)
- [Commits](lycheeverse/lychee-action@v1.7.0...v1.8.0)

---
updated-dependencies:
- dependency-name: lycheeverse/lychee-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Revert "fix: duplicate price for multiple ticks (osmosis-labs#5173)" (osmosis-labs#5193)

* Revert "fix: duplicate price for multiple ticks (osmosis-labs#5173)"

This reverts commit f116d43.

* fix merge conflicts

* regen proto

* fix: duplicate price for multiple ticks (osmosis-labs#5196)

* initial push

* update gomod

* revert nolint

* update gomod

* perf: convert ticks to int64 (osmosis-labs#5189)

* perf: convert ticks to int64

* updates

* fix test

* updates

* updates

* Update x/concentrated-liquidity/math/tick.go

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

* nit

* comment

* comment

* >=

* lint

* lint

---------

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

* refactor: remove cache context from swap in given out (osmosis-labs#5198)

* remove cache context from in given out

* Update x/concentrated-liquidity/swaps_test.go

Co-authored-by: Roman <roman@osmosis.team>

* Update x/concentrated-liquidity/swaps_test.go

Co-authored-by: Roman <roman@osmosis.team>

---------

Co-authored-by: Roman <roman@osmosis.team>

* refactor: more discriptive error when no liquidity in swaps (osmosis-labs#5197)

* fix: merge conflict (osmosis-labs#5199)

* fix: make proto-docs; unsupported address proto tag (osmosis-labs#5195)

* [CL Message Audit]: MsgWithdrawPosition (osmosis-labs#5135)

* WIP

* Add test cases

* Uncomment tests

* Uncomment more tests

* Add lock test

* And uncomment test

* Update x/concentrated-liquidity/incentives.go

Co-authored-by: Roman <roman@osmosis.team>

* Romans feedback

* Update x/concentrated-liquidity/lp.go

Co-authored-by: Adam Tucker <adam@osmosis.team>

* Update x/concentrated-liquidity/lp_test.go

Co-authored-by: Adam Tucker <adam@osmosis.team>

* Adams review

---------

Co-authored-by: Roman <roman@osmosis.team>
Co-authored-by: Adam Tucker <adam@osmosis.team>

* Fix CL client to be compatible with recent state of Bigbang (osmosis-labs#5200)

* Fix cl client to follow most recent state

* Run go mod tidy

* Change to A:no-changelog (osmosis-labs#5201)

* fix: merge conflict (osmosis-labs#5210)

* readme error fixes (osmosis-labs#5208)

* perf: conver tick and exponent at price one to int64 (osmosis-labs#5190)

Closes: #XXX

## What is the purpose of the change

Convert pool's tick and exponent at price one to int64 for performance and readability

* chore: add vs code debug config for every module (osmosis-labs#5212)

* chore: add vs code debug config for every module

* restore e2e

* refactor: prototype reducing iterator overhead in swaps (osmosis-labs#5177)

* refactor: prototype reducing iterator overhead in swaps

* updates

* updates

* clean up

* godoc updates

* updates

* updates

* updates

* clean up

* updates

* chore: skip wasm tests in wsl and add a vs code task (osmosis-labs#5214)

* chore: skip wasm tests in wsl and add a vs code task

* updates

* update golangci-lint settings per https://golangci-lint.run/usage/integrations (osmosis-labs#5221)

* style: s instead of suite (osmosis-labs#5222)

* just use s. instead of suite.

* complete migration of suite to s for *KeeperTestSuite

---------

Co-authored-by: Roman <roman@osmosis.team>

* perf: remove repeated reallocations in swap step iterations (osmosis-labs#5211)

* perf: remove repeated reallocations in swap step iterations

* smallest dec

* unused

* comment

* Update x/concentrated-liquidity/swaps.go

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

* Update x/concentrated-liquidity/swaps.go

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

---------

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

* bug: add split route to message server in pool manager (osmosis-labs#5204)

* bug: add split route to message server in pool manager

* Update x/poolmanager/msg_server.go

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>

* Update x/poolmanager/msg_server.go

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>

---------

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>

* chore(deps): bump json-pointer from 0.6.1 to 0.6.2 in /client/docs (osmosis-labs#5215)

Bumps [json-pointer](https://github.com/manuelstofer/json-pointer) from 0.6.1 to 0.6.2.
- [Commits](https://github.com/manuelstofer/json-pointer/commits)

---
updated-dependencies:
- dependency-name: json-pointer
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump minimist from 1.2.5 to 1.2.8 in /client/docs (osmosis-labs#5216)

Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.8.
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](minimistjs/minimist@v1.2.5...v1.2.8)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github.com/docker/distribution (osmosis-labs#5220)

Bumps [github.com/docker/distribution](https://github.com/docker/distribution) from 2.8.1+incompatible to 2.8.2+incompatible.
- [Release notes](https://github.com/docker/distribution/releases)
- [Commits](distribution/distribution@v2.8.1...v2.8.2)

---
updated-dependencies:
- dependency-name: github.com/docker/distribution
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump ansi-regex from 5.0.0 to 5.0.1 in /client/docs (osmosis-labs#5226)

Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](chalk/ansi-regex@v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: commit at the end of benchmark (osmosis-labs#5229)

* chore: commit at the end of benchmark

* updates

* chore(deps): bump handlebars from 4.7.6 to 4.7.7 in /client/docs (osmosis-labs#5231)

Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7.
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](handlebars-lang/handlebars.js@v4.7.6...v4.7.7)

---
updated-dependencies:
- dependency-name: handlebars
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: add chosing an exponentAtPriceOne docs (osmosis-labs#4919)

* add chosing an exponenetAtPriceOne docs

* increase header sizes

* center the equation

* Update x/concentrated-liquidity/README.md

Co-authored-by: Roman <roman@osmosis.team>

* Update x/concentrated-liquidity/README.md

Co-authored-by: Roman <roman@osmosis.team>

* Update x/concentrated-liquidity/README.md

Co-authored-by: Roman <roman@osmosis.team>

* specify asset0 and asset1

* fix headers

---------

Co-authored-by: Roman <roman@osmosis.team>
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

* [CL][Incentives Query][Bug]: Implement support for CL gauges to incentivized pools query (osmosis-labs#5187)

* implement and test query support for CL gauges

* update changelog

* fix conflicts

* remove MsgCreateIncentive (osmosis-labs#5234)

* feat[CL]: separate fees into different module account (osmosis-labs#5230)

* separate account for fees

* update test var name

* Update x/concentrated-liquidity/swaps.go

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>

---------

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>

* chore(deps): bump github.com/docker/distribution (osmosis-labs#5218)

Bumps [github.com/docker/distribution](https://github.com/docker/distribution) from 2.8.1+incompatible to 2.8.2+incompatible.
- [Release notes](https://github.com/docker/distribution/releases)
- [Commits](distribution/distribution@v2.8.1...v2.8.2)

---
updated-dependencies:
- dependency-name: github.com/docker/distribution
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [CL Message Audit] MsgSwapExactAmountOut (osmosis-labs#5179)

* progress

* more checks

* checked logic

* moved all fmterror to errors

* added test

* cleanup

* cli tested

* resolved feedbacks

* resolved feedbacks

* fixed ci

* Update x/poolmanager/router_test.go

* Update x/poolmanager/router.go

---------

Co-authored-by: Roman <roman@osmosis.team>

* chore: lint tests and sync for app, osmomath, tests, and wasmbinding (osmosis-labs#5206)

* lint tests and sync: app, osmomath, tests, and wasmbinding

* add osmomath to lp_test

* sync

* chore(deps): bump github.com/docker/distribution in /x/ibc-hooks (osmosis-labs#5217)

Bumps [github.com/docker/distribution](https://github.com/docker/distribution) from 2.8.1+incompatible to 2.8.2+incompatible.
- [Release notes](https://github.com/docker/distribution/releases)
- [Commits](distribution/distribution@v2.8.1...v2.8.2)

---
updated-dependencies:
- dependency-name: github.com/docker/distribution
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [x/pool-incentives][tests]: Add tests for external gauge query (osmosis-labs#5236)

* add tests for external gauge query

* refactor tests to use string map

* test comment fix

* chore(deps): bump github.com/docker/docker (osmosis-labs#5219)

Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.19+incompatible to 20.10.24+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](moby/moby@v20.10.19...v20.10.24)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: v16 upgrade handler updates (osmosis-labs#5213)

* initial push upgrade handler changes

* properly set staking denom to usomo in test

* add further tests

* use comm pool for swap

* correct pool ID

* update pool id

* [CL Message Audit]: AddToPositions  (osmosis-labs#5167)

* WIP

* Trying to fix test

* Fix test

* Add min amount

* Update proto/osmosis/concentrated-liquidity/tx.proto

Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com>

* Update proto/osmosis/concentrated-liquidity/tx.proto

Co-authored-by: Adam Tucker <adam@osmosis.team>

* Update proto/osmosis/concentrated-liquidity/tx.proto

Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com>

* Update proto/osmosis/concentrated-liquidity/tx.proto

Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com>

* Update proto/osmosis/concentrated-liquidity/tx.proto

Co-authored-by: Adam Tucker <adam@osmosis.team>

* WIP for comments

* Review comments

* updates

---------

Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com>
Co-authored-by: Adam Tucker <adam@osmosis.team>
Co-authored-by: Roman <roman@osmosis.team>

* perf: change KVStore value from posID to boolean byte (osmosis-labs#5237)

* change KVStore value from posID to boolean byte

* replace redundant function

* fix prefix

* update godoc

* add incentive creation & querying section to readme (osmosis-labs#5242)

* add readme section on reward splitting (osmosis-labs#5244)

* refactor: rename swap fee to spread factor (osmosis-labs#5138)

* refactor: rename swap fee to spread factor

* lint

* updates

* updates

* [CL][bugfix] Update reward splitting logic to only use bonded balancer amounts (osmosis-labs#5239)

* implement/test necessary helper and implement/test bugfix for bonded share reward splitting

* changelog for gamm changes

* clean up tests and comments

* [CL Message Audit]: MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition [2/2] (osmosis-labs#5160)

* initial push

* update readme

* initial push audit changes

* use enum for migration type

* add back proto tag

* rename to validateGammLockForSuperfluidStaking

* remove unused errors

* Update x/superfluid/keeper/migrate.go

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>

* add check for both bonded and unbonding

* update gomod

* allow max length 1 for linked synth locks

* feat: partial superfluid undelegate (osmosis-labs#5162)

* partial superfluid undelegate

* further reduction of gas

* Update x/superfluid/keeper/migrate.go

Co-authored-by: Roman <roman@osmosis.team>

* reduce code duplication lock and lockNoSend

* lockNoSend as default

* add bug fix with expanded tests

* unit test for CreateLockNoSend

* Update x/superfluid/keeper/migrate.go

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>

* fix merge

* partialSuperfluidUndelegate named return values

* expand test checks for migrateDelegated

* expanded bonded checks

* check new lock and exact amount

* assign vars directly

* update merge

* check newly created lock

* add extra logic branch for fail case

* split up partial superfluid undelegate func

* expand partial undelegate test case

* roman's review

* Update x/lockup/keeper/lock_test.go

* nit

* fix test

* expand CreateLockNoSend comment

* rename lockNoSend back to lock

* expand partial unlock comment

---------

Co-authored-by: Roman <roman@osmosis.team>
Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>

* remove unused error

* lint

---------

Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>
Co-authored-by: Roman <roman@osmosis.team>

* Add amino proto annotations (osmosis-labs#4629)

* Add proto annotations

* Update go.mod

* Add changelog

* Adams review

* Make proto

---------

Co-authored-by: mattverse <mattverse@users.noreply.github.com>

* refactor: reinvest dust fees into pool accumulator (osmosis-labs#5245)

* refactor: reinvest dust fees into pool accumulator

* updates

* updates

* Update x/concentrated-liquidity/fees_test.go

Co-authored-by: Adam Tucker <adam@osmosis.team>

---------

Co-authored-by: Adam Tucker <adam@osmosis.team>

* perf: iterator improvements for swap in given out and liquidity for full range query (osmosis-labs#5248)

* perf: iterator improvements for swap in given out and liquidity for full range query

* updates

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Co-authored-by: Roman <roman@osmosis.team>
Co-authored-by: Adam Tucker <adam@osmosis.team>
Co-authored-by: alpo <62043214+AlpinYukseloglu@users.noreply.github.com>
Co-authored-by: stackman27 <sis1001@berkeley.edu>
Co-authored-by: Ruslan Akhtariev <46343690+pysel@users.noreply.github.com>
Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com>
Co-authored-by: Jacob Gadikian <jacobgadikian@gmail.com>
Co-authored-by: mattverse <mattverse@users.noreply.github.com>
pysel pushed a commit that referenced this pull request Jun 6, 2023
* perf: remove repeated reallocations in swap step iterations

* smallest dec

* unused

* comment

* Update x/concentrated-liquidity/swaps.go

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

* Update x/concentrated-liquidity/swaps.go

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

---------

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:no-changelog C:x/concentrated-liquidity V:state/compatible/no_backport State machine compatible PR, depends on prior breaks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants