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

Rebase #3

Open
wants to merge 376 commits into
base: feature/icq_integration
Choose a base branch
from
Open

Rebase #3

wants to merge 376 commits into from

Conversation

0xLaurenzo
Copy link

@0xLaurenzo 0xLaurenzo commented Sep 28, 2022

rebase the icq integration onto osmosis v12

xBalbinus and others added 30 commits July 26, 2022 13:54
…2171)

* rebase to main

* markdown lint fixes

* doc lint fixes
* remove unused cdc

* remove unused cdc in appmodule
Closes: #XXX

## What is the purpose of the change

This is a fix for some broken docs on the GAMM module specs


## Brief Changelog

-Fixed duplicate transactions documentation to only contain the most updated and accurate ones.

## Testing and Verifying

*(Please pick one of the following options)*

**This change is a trivial rework / code cleanup without any test coverage.**

*(or)*

This change is already covered by existing tests, such as *(please describe tests)*.

*(or)*

This change added tests and can be verified as follows:

**This has been tested by locally reproducing by building.**

## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? (yes / **no**)
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? (yes / **no**)
  - How is the feature or change documented? (**not applicable**   /   specification (`x/<module>/spec/`)  /  [Osmosis docs repo](https://github.com/osmosis-labs/docs)   /   not documented)
Closes: osmosis-labs#2200

## What is the purpose of the change
Add test for function GetPoolDenoms 

## Brief Changelog
n/a

## Testing and Verifying
added unit test 

## 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   /   specification (`x/<module>/spec/`)  /  [Osmosis docs repo](https://github.com/osmosis-labs/docs)   /   not documented)
* Create guide.md

* adds testnet guide

* Update guide.md

* Update guide.md

* Apply suggestions from code review

Co-authored-by: Roman <[email protected]>

* Update guide.md

* Update guide.md

Co-authored-by: Roman <[email protected]>
* validate msgs

* add tests

* format

* conflict with exist test: cli/begin_unlocking_by_id

* add amount to unlock_by_id in cli

* refactor the tests

* refactor tests

* test_helper

* move to apptesting

* fix import cycle
…is-labs#2216)

* chore(upgrade): move v11 upgrade handler to v12, no-op for v11

* init store upgrades

* no run migrations

* add v12 additions

* make v11 upgrade handler close to v11.x

* Update app/upgrades/v12/upgrades.go

Co-authored-by: Adam Tucker <[email protected]>

Co-authored-by: Adam Tucker <[email protected]>
* Add README

* Update for PR suggestions

* Apply suggestions from code review

Co-authored-by: Roman <[email protected]>

Co-authored-by: Roman <[email protected]>
* tokenfactory sim updates

* add go docs

* Update x/tokenfactory/simulation/sim_msgs.go

Co-authored-by: Roman <[email protected]>

* address Roman comments

* use Roman's denom suggestion

* Address Dev's comments

* Remove use of appparams

* hardcode tokenfactory creation fee

Co-authored-by: Roman <[email protected]>
* TWAP store.go & store_test.go files

* Add godocs

* fix lint

* Apply suggestions from code review

Co-authored-by: Roman <[email protected]>

* Add struct types for TestGetAllMostRecentRecordsForPool

* Add pool 2 test

* Port from twap_wip

* Update x/gamm/twap/store.go

Co-authored-by: Adam Tucker <[email protected]>

* Add GetAllMostRecentTwapsForPool comment

Co-authored-by: Roman <[email protected]>
Co-authored-by: Adam Tucker <[email protected]>
…mosis-labs#2243)

* chore(deps): upgrade sdk with min proposer deposit and update e2e

* update to correct tag

* update tag

* changelog

* use default value from gov types for min deposit
* refactor(x/mint): AfterEpochEndHook and tests

* refactor/test(x/mint): after epoch end hooks

* clean up

* add panic case

* remove TestEndOfEpochNoDistributionWhenIsNotYetStartTime - covered by table-driven

* remove TestEndOfEpochMintedCoinDistribution - covered by table driven

* remove TestMintedCoinDistributionWhenDevRewardsAddressEmpty - covered at different abstraction level

* clean up

* reuse variables and constants in hook tests

* revert AfterEpochEnd

* reduce duplicaton

* Update x/mint/keeper/hooks_test.go

Co-authored-by: Adam Tucker <[email protected]>

* Update x/mint/keeper/hooks_test.go

Co-authored-by: Adam Tucker <[email protected]>

* Update x/mint/keeper/hooks.go

Co-authored-by: Adam Tucker <[email protected]>

Co-authored-by: Adam Tucker <[email protected]>
* remove vestigial test files

* move params into keeper.go

* move stableswap scaling factor

* change pool number to pool id where applicable

* further pool number changes

* make proto level pool number changes

* add changelog entry

* remove completed TODO comment

* undo proto change

Co-authored-by: Dev Ojha <[email protected]>
…es denom (osmosis-labs#2283)

* revert to use dynamic denom

* fixed keeper issue

* rom comments

* nit

* adam comments
Closes: #XXX

## What is the purpose of the change

Some minor pass through changes discovered while reviewing osmosis-labs#2168 
## 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
* test(x/gamm): remove liquidity events

* remove capacity pre-allocation

* Update x/gamm/keeper/internal/events/emit_test.go

Co-authored-by: Adam Tucker <[email protected]>

* Update x/gamm/keeper/msg_server_test.go

Co-authored-by: Adam Tucker <[email protected]>

* Update x/gamm/keeper/pool_service_test.go

Co-authored-by: Adam Tucker <[email protected]>

* shareIn

* update event comments

* changelog

* Update CHANGELOG.md

Co-authored-by: Aleksandr Bezobchuk <[email protected]>

* add docs

Co-authored-by: Adam Tucker <[email protected]>
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
)

* add makefile and fix determinism non-commit

* make sim steps clearer

* fix cmd
* Try to speedup dockerfile build time

* retry

* Remove from tag

* Reorder cosmwasm steps to be before copying whole directory

* Try cache

* add -v flag to go build

* verbose flag try 2

* Try cache again

* try changing Github actions caching

* Try cache fixing

* Fix cache

* See if failure was a fluke

* Move-cache to right spot

* Try using absolute path

* Try the buildkit cache workflow

* tryfix buildkit cache

* More buildkit tries

* Check CI re-run

* See if this makes cache get found again

* Retry

* retry

* retry

* revert back to main .github folder

* Rename tests CI job

* Undo -v flag in install

* Add go mod download earlier in build process

* Try staging download better

* Accidental local change

* correct filename

* Try further layer reduction, use cache in go mod download

* See speed on cache re-run
* precommit timeout

* this ought to do it

* Update CHANGELOG.md
* set epoch time KeeperTestHelper; change BeginNewBlockWithProposer

* fix test
* refactor(x/mint): simplify TestDistributeMintedCoin

* rename mock

* clean up
…n of JoinPool (osmosis-labs#2301)

* ensure that assets in pool not change after joining

* check joining assets already exist in pool

* format

* refactor panic
* refactor reverseselice fn

* write tests

* wrap tests with Run, add field names to test cases

* use package osmoutils_test
* rename package in gamm msg_test.go

* incentives: msg_test.go

* gamm pool-modules : balancer and stable swap
AlpinYukseloglu and others added 30 commits September 19, 2022 21:11
…smosis-labs#2777)

* convert all core stableswap arithmetic to use bigdec

* fix conversion from sdkDec to BigDec

* use correct precision for conversions

* improve readability and update Sdk -> SDK in function names

* fix merge conflicts
…ase two-asset pool capacity to $100M – $1B per asset (osmosis-labs#2731)
* bump IBC version

* Update SDK verison
Progress towards: osmosis-labs#2794 and osmosis-labs#2702

## What is the purpose of the change

This PR implements a `BigDec` binary search function for our general osmoutils package.

## Brief Changelog

- Add `BinarySearchBigDec` to osmoutils
- Add `CompareBigDec` to osmoutils
- Refactor existing and new tests to be more readable (string map names, `t.Run` etc.)

## Testing and Verifying

This change added tests for both new functions in `osmoutils/binary_search_test.go`

## 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 documented)
…-labs#2795)

* Refactor testnetify and remove Dockerfile

* Manually replace new validator public key

* Improve output formatting

* Bug fixes

* Add ACCOUNT_PUBKEY and ACCOUNT_ADDRESS input

* Add environment variables as input and config folder check

* Update docs, Makefile and rename folder

* Modify CLI arguments

* Update docker-compose.yaml defaults and print updated values

* Invert printing logic replacing verbose with quiet
…rch (osmosis-labs#2816)

Progress towards: osmosis-labs#2794 

## What is the purpose of the change

This PR replaces our stableswap two-asset CFMM solver to use the `BigDec` binary search implementation in osmosis-labs#2802 

Note: most of the diff is tests merged from osmosis-labs#2697 and the core binary search logic from osmosis-labs#2802, both of which had to be merged into this branch

## Brief Changelog

- Replace binary search solver logic with our `BigDec` binary search implementation

## Testing and Verifying

- All two-asset CFMM test cases were set up to test this implementation in `amm_test.go`

## 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 documented)
* add cosmovisor json

* update binaries
* Added link to contribute page

Closes old issue from docs here: osmosis-labs/docs#18

* Update CONTRIBUTING.md

Thank you!

Co-authored-by: Roman <[email protected]>
* add pools to localosmosis

* make Roman's suggestion
* Remove docs folde

* Remove DevDoc section in Makefile

Co-authored-by: Dev Ojha <[email protected]>
* multi asset, create new record

* multi-asset pool; pre-set at t and t + 1 with errs

* format

* add more pre records & spOverrides & expected records

* remove print

* fix spell

* Update x/twap/logic_test.go

* Update x/twap/logic_test.go

* Update x/twap/logic_test.go

* Update x/twap/logic_test.go

Co-authored-by: Matt, Park <[email protected]>
* mainnet and testnet guides

* small verbiage change

* clarify instructions

* Update networks/osmosis-1/upgrades/v12/mainnet/guide.md

* Update networks/osmosis-1/upgrades/v12/mainnet/guide.md

Co-authored-by: Dev Ojha <[email protected]>
Closes: osmosis-labs#2739 

## What is the purpose of the change

Adds pool type query to query the type of pool. The query would return a string of the type of pool in a string, depending on the type of pool, would return an error otherwise.


## Brief Changelog
- Add pool type query 


## Testing and Verifying
Added new test cases 
## 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   /   specification (`x/<module>/spec/`)  /  [Osmosis docs repo](https://github.com/osmosis-labs/docs)   /   not documented)
change `COPY go.* .` to `COPY go.* ./` without it make file will fail



Closes: #XXX

## What is the purpose of the change

Without the change make will fail when copying go


## Brief Changelog

*(for example:)*
 
  - change `COPY go.*` . to` COPY go.* ./`


## Testing and Verifying

This change is already covered by existing tests, such as *(please describe tests)*.


## 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`? (yes )
  - How is the feature or change documented? (not applicable  )
…2847)

Closes: osmosis-labs#2845

## What is the purpose of the change

This PR merges `solveCfmmMulti` into `solveCfmm` and updates tests and pool logic accordingly.

Note: majority of diff is from osmosis-labs#2843 and test refactors (one side benefit of this change is that it allows our tests to be _drastically_ cleaner and more readable (no more manual `uReserve` and `wSumSquares` calculations!))

Context from issue:

> All pool-level CFMM calls currently only use solveCfmm, which is only connected to our two-asset CFMM solver. Many of these functions also hard code the assumption that there are only two assets (e.g. by always specifically taking the [first two](https://github.com/osmosis-labs/osmosis/blob/39b32018d736f93fbb4ecdc85d53dae457eec5a1/x/gamm/pool-models/stableswap/amm.go#L379) assets in pool reserves).
> 
> We should combine these two solver functions and properly direct inputs towards the correct solver depending on the number of assets they have.

## Brief Changelog

- Merge `solveCfmmMulti` into `solveCfmm`
- Change `solveCfmm` to take a single `sdk.Coins` or `PoolAssets` input (latter might be safer if possible)
- Add logic in `solveCfmm` that routes to two-asset solver if only two assets and to multi-asset solver otherwise. This logic should calculate `uReserve` and `wSumSquares` internally from the input tokens to prevent unintuitive calculations elsewhere in the codebase and to prevent user error around these calcs in the future
- Update pool function logic to accommodate multi-asset pools (previously would just take first two tokens in token reserves)

## Testing and Verifying

All tests previously relating to `solveCfmm` and `solveCfmmMulti` should now be properly refactored to use the new `solveCfmm`

## 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 documented)
* add checks for invalid cfmm inputs

* implement simplified two-asset cfmm solver

* add further error and validation checks

* reduce largest term's exponent from 12 to 8

* update comments to match new solver method

Co-authored-by: Dev Ojha <[email protected]>

* reduce largest terms from x^8 to x^4 and k^2 to k respectively

* linter

* linter

* factor out test cases

* add overflow and uneven pool tests

* add thorough comments and links explaining solver math

Co-authored-by: Dev Ojha <[email protected]>
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.