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

[InternalReview][MsgFungifyChargedPositions] #5091

Merged
merged 31 commits into from
May 10, 2023
Merged

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented May 5, 2023

Closes: #XXX

What is the purpose of the change

https://app.clickup.com/37420681/v/dc/13nzm9-19302/13nzm9-35382

Review of MsgFungifyChargedPositions

This is part 1 only, will be continuing with more internal review.

Documentation and Release Note

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

.vscode/launch.json Outdated Show resolved Hide resolved
@@ -257,13 +255,6 @@ func (server msgServer) FungifyChargedPositions(goCtx context.Context, msg *type
sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory),
sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender),
),
sdk.NewEvent(
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: moved to keeper

@p0mvn p0mvn changed the title [InternalReview][MsgFungifyChargedPositions] [InternalReview][MsgFungifyChargedPositions] part 1 May 5, 2023
@p0mvn p0mvn added V:state/compatible/no_backport State machine compatible PR, depends on prior breaks no-changelog labels May 5, 2023
@github-actions github-actions bot added the C:x/gamm Changes, features and bugs related to the gamm module. label May 9, 2023
@github-actions github-actions bot added the C:docs Improvements or additions to documentation label May 9, 2023
@p0mvn p0mvn changed the title [InternalReview][MsgFungifyChargedPositions] part 1 [InternalReview][MsgFungifyChargedPositions] May 9, 2023
@p0mvn p0mvn marked this pull request as ready for review May 9, 2023 19:38
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.

Nice work! Would be great if you could add the pagination to the AllPools query, but is not blocking (just don't want to forget about it until later when we need to use it)

osmoutils/accum/accum.go Show resolved Hide resolved
x/concentrated-liquidity/client/cli/tx.go Outdated Show resolved Hide resolved
x/concentrated-liquidity/fees.go Show resolved Hide resolved
x/concentrated-liquidity/fees_test.go Outdated Show resolved Hide resolved
x/concentrated-liquidity/incentives.go Show resolved Hide resolved
x/concentrated-liquidity/position.go Show resolved Hide resolved
x/concentrated-liquidity/position.go Outdated Show resolved Hide resolved
// - positions are not in the same pool
// - positions are all not fully charged
// - positions are not in the same tick range
// - all positions are unlocked
func (k Keeper) validatePositionsAndGetTotalLiquidity(ctx sdk.Context, owner sdk.AccAddress, positionIds []uint64) (uint64, int64, int64, sdk.Dec, error) {
Copy link
Member

Choose a reason for hiding this comment

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

This function is only used to validate for fungify right? If so, can we be more specific with the method name so we know what this is validating for?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think this has to be married to fungify. Methods should be reusable. The spec already outlines what is being validated if someone would like to reuse it

x/concentrated-liquidity/position_test.go Outdated Show resolved Hide resolved
Comment on lines +72 to +80
// GetCmdAllPools return all pools available across Osmosis modules.
func GetCmdAllPools() (*osmocli.QueryDescriptor, *queryproto.AllPoolsRequest) {
return &osmocli.QueryDescriptor{
Use: "all-pools",
Short: "Query all pools on the Osmosis chain",
Long: "{{.Short}}",
}, &queryproto.AllPoolsRequest{}
}

Copy link
Member

Choose a reason for hiding this comment

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

Just a note here, under QueryDescriptor I think we need to add hasPagination to true. This will add the corresponding flags and such, but I don't think its properly paginates out of the box (there is no osmocli query that currently uses it, and any paginated query we actually rely on uses to old cli setup).

Copy link
Member Author

Choose a reason for hiding this comment

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

Pagination isn't implemented for this query. Since they are they only known client, spoke to Jon and decided not to added for now due to time constraints

@p0mvn p0mvn merged commit 8fe28cb into main May 10, 2023
@p0mvn p0mvn deleted the roman/msg-fungify-audit branch May 10, 2023 14:00
pysel pushed a commit that referenced this pull request Jun 6, 2023
* [InternalReview][MsgFungifyChargedPositions]

* comment

* remove nit

* comment

* comment

* revert launch json

* lint

* fix ctx

* updates

* CLI fix

* revert me

* Revert "revert me"

This reverts commit 8acf2ce.

* remove debug event

* fix test

* fix e2e

* clean up comments

* updates

* updates

* message server

* fix test

* update README

* README update

* README

* tick spacing 100

* negative rewards

* comments

* comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:CLI C:docs Improvements or additions to documentation C:x/concentrated-liquidity C:x/gamm Changes, features and bugs related to the gamm module. C:x/poolmanager 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.

2 participants