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

Setup e2e test for Stride pool migration #4393

Merged
merged 7 commits into from
Feb 22, 2023
Merged

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Feb 22, 2023

Closes: #XXX

What is the purpose of the change

This PR sets up e2e for Stride's pool migration in #4384

It does so by modifying genesis to create all pools up until and including the last pool id of the Stride's osmo - stOsmo pool.

It then adds a swap test to make sure that we can continue swapping after running the upgrade handler with migrations.

The test is currently disabled as we need to backport this genesis change to v14 and update the chain init image here: https://hub.docker.com/r/osmolabs/osmosis-e2e-init-chain

However, this has been successfully tested via current branch e2e test.

Brief Changelog

  • update poolmanager genesis to contain the mapping from pool id to pool type
    • this is needed to set up the routes correctly in e2e
  • create pools in genesis up until and including the last Stride's pool
  • update pool balances in genesis
  • update twap records for genesis pools
  • create a test that swaps against pools made from genesis and test from current branch configurer.

@p0mvn p0mvn added the A:backport/v15.x backport patches to v15.x branch label Feb 22, 2023
@p0mvn p0mvn added V:state/compatible/backport State machine compatible PR, should be backported and removed C:x/poolmanager labels Feb 22, 2023
@@ -31,9 +30,6 @@ func FormatModuleRouteKey(poolId uint64) []byte {
// ParseModuleRouteFromBz parses the raw bytes into ModuleRoute.
// Returns error if fails to parse or if the bytes are empty.
func ParseModuleRouteFromBz(bz []byte) (ModuleRoute, error) {
if len(bz) == 0 {
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: bz of length zero is expected because when we serialize ModuleRoute that has PoolType Balancer that is equal to zero, the serialization ends up being empty bytes.

@p0mvn p0mvn force-pushed the roman/stride-migration-e2e branch from 6bdecc7 to 48418b3 Compare February 22, 2023 20:56
@p0mvn p0mvn marked this pull request as ready for review February 22, 2023 20:57
Copy link
Contributor

@stackman27 stackman27 left a comment

Choose a reason for hiding this comment

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

overall logic LGTM, left some nit comments

proto/osmosis/poolmanager/v1beta1/genesis.proto Outdated Show resolved Hide resolved
x/poolmanager/router.go Outdated Show resolved Hide resolved
x/poolmanager/create_pool.go Outdated Show resolved Hide resolved
tests/e2e/initialization/config.go Outdated Show resolved Hide resolved
@p0mvn p0mvn added V:state/breaking State machine breaking PR and removed V:state/compatible/backport State machine compatible PR, should be backported labels Feb 22, 2023
@p0mvn
Copy link
Member Author

p0mvn commented Feb 22, 2023

Marked this as state-breaking since modified some state entries in the new poolmanager module.

Also, would like to give this another round of eyes before v15

@p0mvn p0mvn added the A:backport/v14.x backport patches to v14.x branch label Feb 22, 2023
@p0mvn p0mvn merged commit b3cd00c into main Feb 22, 2023
@p0mvn p0mvn deleted the roman/stride-migration-e2e branch February 22, 2023 22:02
mergify bot pushed a commit that referenced this pull request Feb 22, 2023
* Setup e2e test for Stride pool migratio

* add pool shares to balances of pool addresses in e2e genesis

* remove debugging log

* Update x/poolmanager/create_pool.go

Co-authored-by: Sishir Giri <[email protected]>

* Update proto/osmosis/poolmanager/v1beta1/genesis.proto

Co-authored-by: Sishir Giri <[email protected]>

* Update tests/e2e/initialization/config.go

Co-authored-by: Sishir Giri <[email protected]>

* proto

---------

Co-authored-by: Sishir Giri <[email protected]>
(cherry picked from commit b3cd00c)

# Conflicts:
#	proto/osmosis/poolmanager/v1beta1/genesis.proto
#	proto/osmosis/poolmanager/v1beta1/module_route.proto
#	tests/e2e/initialization/config.go
#	x/poolmanager/create_pool.go
#	x/poolmanager/create_pool_test.go
#	x/poolmanager/export_test.go
#	x/poolmanager/keeper.go
#	x/poolmanager/keeper_test.go
#	x/poolmanager/types/genesis.pb.go
#	x/poolmanager/types/keys.go
#	x/poolmanager/types/module_route.pb.go
mergify bot pushed a commit that referenced this pull request Feb 22, 2023
* Setup e2e test for Stride pool migratio

* add pool shares to balances of pool addresses in e2e genesis

* remove debugging log

* Update x/poolmanager/create_pool.go

Co-authored-by: Sishir Giri <[email protected]>

* Update proto/osmosis/poolmanager/v1beta1/genesis.proto

Co-authored-by: Sishir Giri <[email protected]>

* Update tests/e2e/initialization/config.go

Co-authored-by: Sishir Giri <[email protected]>

* proto

---------

Co-authored-by: Sishir Giri <[email protected]>
(cherry picked from commit b3cd00c)

# Conflicts:
#	x/poolmanager/types/module_route.pb.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v14.x backport patches to v14.x branch A:backport/v15.x backport patches to v15.x branch C:x/poolmanager V:state/breaking State machine breaking PR
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants