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

Add liquidity module to gaia #859

Merged
merged 9 commits into from
Jun 25, 2021

Conversation

dongsam
Copy link
Contributor

@dongsam dongsam commented May 20, 2021

Closes: #858

Description

Add a tendermint/liquidity module to the Gaia for Gravity DEX.

ref


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@zmanian
Copy link
Member

zmanian commented May 22, 2021

We need some handler code to initialize the keepers during the upgrade correct.

My mental model is we aren't doing a state dump during this upgrade and instead using the upgrade module functionality.

@codecov
Copy link

codecov bot commented May 24, 2021

Codecov Report

Merging #859 (fd6bb72) into main (94a30c6) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@           Coverage Diff            @@
##            main    #859      +/-   ##
========================================
- Coverage   0.41%   0.39%   -0.02%     
========================================
  Files          7       7              
  Lines        483     505      +22     
========================================
  Hits           2       2              
- Misses       480     502      +22     
  Partials       1       1              

@dongsam
Copy link
Contributor Author

dongsam commented May 26, 2021

We need some handler code to initialize the keepers during the upgrade correct.

My mental model is we aren't doing a state dump during this upgrade and instead using the upgrade module functionality.

I'm currently writing the initializers code. I'll commit it within this week. Thank you for your comments.

@dongsam
Copy link
Contributor Author

dongsam commented Jun 11, 2021

Hello, we are planning to finalize the Liquidity module by the 15th of June and release the version for Gaia. And I'll make it R4R.
You can find the progress on here

I'd like to hear your all opinion.
Currently REST endpoint path is using /tendermint/liquidity/v1beta1/* Liquidity Swagger
but for the consistency with cosmos-sdk modules It could be /cosmos/liquidity/v1beta1/* Comos Swagger

What do you think? here is the issue tendermint/liquidity#404
@zmanian @shahankhatch @Rose2161

@zmanian
Copy link
Member

zmanian commented Jun 13, 2021

The rest path should be Cosmos

@dongsam
Copy link
Contributor Author

dongsam commented Jun 14, 2021

The rest path should be Cosmos

Sure, Thanks for your opinion, Let me change it to /cosmos/liquidity/v1beta1/*

@dongsam dongsam marked this pull request as ready for review June 16, 2021 07:49
@dongsam
Copy link
Contributor Author

dongsam commented Jun 16, 2021

The finalized version of liquidity module for Gaia is released https://github.com/tendermint/liquidity/releases/tag/v1.2.8
and above final codebase copied to https://github.com/Gravity-Devs/liquidity/releases/tag/v1.2.8 with changing package name from tendermint/liquidity to gravity-devs/liquidity and It applied on this PR

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.

🎉

@aaronc
Copy link
Member

aaronc commented Jun 18, 2021

You all probably already know this, but this upgrade does need to be tested on an exported state of the cosmos hub on a devnet. Basically, the cosmos hub genesis needs to be exported, the validator set needs to be tweaked to run with just a few nodes and the voting window needs to be reduced to a few minutes. Then a trial run of this upgrade should be run with a few nodes running cosmovisor.

@Hyung-bharvest
Copy link

Hyung-bharvest commented Jun 19, 2021

You all probably already know this, but this upgrade does need to be tested on an exported state of the cosmos hub on a devnet. Basically, the cosmos hub genesis needs to be exported, the validator set needs to be tweaked to run with just a few nodes and the voting window needs to be reduced to a few minutes. Then a trial run of this upgrade should be run with a few nodes running cosmovisor.

Yes I agree.

https://github.com/b-harvest/cosmoshub-3-testnet

This is not exactly what we need because the testnet was not for testing onchain upgrade, but it contains scripts for substituting validator keys for operation convenience. There exists several invariant check around validator info, so this should be helpful. Please reference it.

@dongsam
Copy link
Contributor Author

dongsam commented Jun 20, 2021

You all probably already know this, but this upgrade does need to be tested on an exported state of the cosmos hub on a devnet. Basically, the cosmos hub genesis needs to be exported, the validator set needs to be tweaked to run with just a few nodes and the voting window needs to be reduced to a few minutes. Then a trial run of this upgrade should be run with a few nodes running cosmovisor.

Thank you for the suggestions and the review. @aaronc @alexanderbez
I will apply the code you suggested about multi-store with the upgrade testing using exported state of the cosmoshub-4 as soon as possible


I applied the code you suggested in the last commit.
The upgrade was successful based on the cosmosub-4 states with the applied code, and I will organize the details and share them again.

@dongsam
Copy link
Contributor Author

dongsam commented Jun 22, 2021

We performed an upgrade test using the states of cosmoshub-4 through the binary version of the commit above to confirm that there was no problem with adding liquidity module

The script and procedure description and results used for the test are written on this repo

@alexanderbez
Copy link
Contributor

Excellent write up @dongsam 👍

@aaronc
Copy link
Member

aaronc commented Jun 22, 2021

Great!

@shahankhatch
Copy link
Contributor

Excellent example of how to run an upgrade on a local machine. Very helpful for module development.
Amazing result too!

@dongsam dongsam requested a review from yaruwangway as a code owner June 23, 2021 05:56
@dongsam
Copy link
Contributor Author

dongsam commented Jun 23, 2021

I'm sorry for the additional commit after the review request.
There are no logical changes between liquidity version v1.2.8 and v1.2.7, but it includes adjusting default parameters of liquidity module and improving the test code's error check logic.

Copy link
Contributor

@shahankhatch shahankhatch left a comment

Choose a reason for hiding this comment

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

Thank you for contributing this module! Great work!

@shahankhatch shahankhatch merged commit fe093ef into cosmos:main Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Liquidity module
7 participants