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 second source of (minor) over-LP shares #1716

Merged
merged 6 commits into from
Jun 9, 2022
Merged

Fix second source of (minor) over-LP shares #1716

merged 6 commits into from
Jun 9, 2022

Conversation

ValarDragon
Copy link
Member

@ValarDragon ValarDragon commented Jun 8, 2022

What is the purpose of the change

Another bug, spotted by samczun. Not caught in tests, because it occurs on uneven swap amounts.

For uneven swap amounts, we tend to have tokens remaining after doing an equal ratio swap. For each of the tokens, we do a single asset pool join.

The logic was broken in providing the correct number fo shares for single asset joins. This PR fixes it.

This change added tests and can be verified as follows:

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? yes
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? yes
  • How is the feature or change documented? not applicable

@github-actions github-actions bot added the C:x/gamm Changes, features and bugs related to the gamm module. label Jun 8, 2022
@ValarDragon ValarDragon changed the title Fix insufficient total share creation Fix second source of (minor) over-LP shares Jun 8, 2022
@p0mvn p0mvn self-assigned this Jun 8, 2022
Copy link
Contributor

@alexanderbez alexanderbez 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 so far. Are we just working on a unit test for this?

@p0mvn p0mvn force-pushed the dev/fix_second_bug branch from 5172ccd to 73f12d5 Compare June 8, 2022 23:37
@ValarDragon
Copy link
Member Author

yeah we just need unit tests

@p0mvn
Copy link
Member

p0mvn commented Jun 9, 2022

Working on unit tests and more comments here: #1721

@p0mvn
Copy link
Member

p0mvn commented Jun 9, 2022

I think we should merge this and review #1721 separately. What do you all think?

@alexanderbez alexanderbez marked this pull request as ready for review June 9, 2022 03:15
@alexanderbez alexanderbez requested a review from a team June 9, 2022 03:15
@stackman27
Copy link
Contributor

Should #1723 be address in this PR as well?

@mattverse
Copy link
Member

Should #1723 be address in this PR as well?

IMO, it's definitely a fix that we need but not with this PR since stableswap is a completely different component

@p0mvn
Copy link
Member

p0mvn commented Jun 9, 2022

Going to add a changelog entry and merge.

Unit tests are coming in:

@p0mvn p0mvn merged commit 089ce41 into main Jun 9, 2022
@p0mvn p0mvn deleted the dev/fix_second_bug branch June 9, 2022 16:09
@ValarDragon ValarDragon added the A:backport/v10.x backport patches to v10.x branch label Jun 9, 2022
mergify bot pushed a commit that referenced this pull request Jun 9, 2022
* Fix insufficient total share creation

* More correctx

* changelog entry

Co-authored-by: Roman <[email protected]>
(cherry picked from commit 089ce41)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v10.x backport patches to v10.x branch C:x/gamm Changes, features and bugs related to the gamm module.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants