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

[x/gamm][StableSwap] Add boilerplate for stableswap #1214

Merged
merged 6 commits into from
Apr 8, 2022

Conversation

ValarDragon
Copy link
Member

Adds boilerplate proto definitions for stableswap. This should not affect the current state machine


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

Comment on lines 519 to -520

func ValidateFutureGovernor(governor string) error {
Copy link
Member Author

Choose a reason for hiding this comment

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

This function was duplicated, and existed in the types package.

@ValarDragon ValarDragon mentioned this pull request Apr 7, 2022
6 tasks
@ValarDragon ValarDragon requested a review from mattverse April 7, 2022 16:46
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.

Curious, why the decision to have a sub-package called under x/gamm? Instead of:

  • directly in x/gamm, OR
  • separate module entirely

];
}

message Pool {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: proto doc :p

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really sure what doc to put here yet, I think It'll become clearer when I go to make one go-side after an initial impl of the math. Added a placeholder for now though

proto/osmosis/gamm/pool-models/stableswap/tx.proto Outdated Show resolved Hide resolved
proto/osmosis/gamm/pool-models/stableswap/tx.proto Outdated Show resolved Hide resolved
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
@codecov-commenter
Copy link

Codecov Report

Merging #1214 (c76ace5) into main (eed3294) will decrease coverage by 0.04%.
The diff coverage is 28.12%.

@@            Coverage Diff             @@
##             main    #1214      +/-   ##
==========================================
- Coverage   21.03%   20.99%   -0.05%     
==========================================
  Files         196      196              
  Lines       25349    25345       -4     
==========================================
- Hits         5332     5320      -12     
- Misses      19054    19066      +12     
+ Partials      963      959       -4     
Impacted Files Coverage Δ
x/gamm/keeper/pool.go 64.91% <0.00%> (ø)
x/gamm/pool-models/balancer/balancer_pool.go 62.06% <ø> (-1.82%) ⬇️
x/gamm/types/pool.go 0.00% <ø> (ø)
x/gamm/types/tx.pb.go 0.66% <ø> (ø)
x/gamm/keeper/pool_service.go 56.61% <23.07%> (-0.61%) ⬇️
x/gamm/keeper/invariants.go 29.41% <29.41%> (+29.41%) ⬆️
x/gamm/pool-models/balancer/msgs.go 81.08% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9cf9f6...c76ace5. Read the comment docs.

@ValarDragon
Copy link
Member Author

ValarDragon commented Apr 8, 2022

I'm down for changing how we do the proto package structure. I don't know whats standard.

Go-side, I think the x/gamm/pool-models/balancer and x/gamm/pool-models/stableswap; is better than x/gamm/balancer and x/gamm/stableswap. We eventually may have dozens here, and this packages them all into one pool-models directory.

Don't want to be in a situation where we have 10+ pool models clogging the top level go structure, and they each have disparate names that makes the folder structure not as quickly grokable.

Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

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

LGTM!

I also agree with @ValarDragon that we maintain the sub-package structure where different gamm models are structured like x/gamm/pool-models/balancer and x/gamm/pool-models/stableswap. One of the reasons I'm in support of this structure is that go import cycle can be rather tricky and keeping a sub-package is helpful in managing this import cycle structure between packages.

@ValarDragon
Copy link
Member Author

Lets discuss package structure in a separate issue, going to go ahead and merge this to simplify rebasing further logic work on stableswap!

@ValarDragon ValarDragon merged commit 3c582ef into main Apr 8, 2022
@ValarDragon ValarDragon deleted the dev/stableswap_proto branch April 8, 2022 03:25
@p0mvn p0mvn changed the title Add boilerplate for stableswap [x/gamm] Add boilerplate for stableswap May 9, 2022
@p0mvn p0mvn mentioned this pull request May 9, 2022
55 tasks
@p0mvn p0mvn changed the title [x/gamm] Add boilerplate for stableswap [x/gamm][StableSwap] Add boilerplate for stableswap May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants