-
Notifications
You must be signed in to change notification settings - Fork 607
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
feat: multi-network upgrade handler #5959
Conversation
tests/e2e/configurer/upgrade.go
Outdated
wg.Add(4) | ||
|
||
go func() { | ||
defer wg.Done() | ||
chainANode.FundCommunityPool(initialization.ValidatorWalletName, strAllUpgradeBaseDenoms()) | ||
}() | ||
|
||
go func() { | ||
defer wg.Done() | ||
chainBNode.FundCommunityPool(initialization.ValidatorWalletName, strAllUpgradeBaseDenoms()) | ||
}() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer, we no longer need to fund the community pool with every baseAsset because we now swap osmo from the community pool for the baseAsset!
tests/e2e/containers/config.go
Outdated
@@ -24,7 +24,7 @@ const ( | |||
// It should be uploaded to Docker Hub. OSMOSIS_E2E_SKIP_UPGRADE should be unset | |||
// for this functionality to be used. | |||
previousVersionOsmoRepository = "osmolabs/osmosis-dev" | |||
previousVersionOsmoTag = "16.0" | |||
previousVersionOsmoTag = "16.0-alpine" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer: I am tired of not being able to run a shell within our docker containers, so I changed the image
@@ -689,7 +689,7 @@ func (n *NodeConfig) SendIBC(dstChain *Config, recipient string, token sdk.Coin) | |||
return false | |||
} | |||
}, | |||
time.Minute, | |||
3*time.Minute, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer: This is a drive by "fix". It became apparent to me that some packets get stuck, so a minute at times in not enough to wait for the result on the receiving chain.
devbot add changelog misc allow testing with different chain-id's in E2E testing |
devbot merge base; |
# Conflicts: # CHANGELOG.md
devbot help |
Hi! I'm DevBot, a bot that helps with common tasks in the development process. Commands:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
e2eChainB = "osmo-test-b" | ||
) | ||
|
||
var notEnoughLiquidityForSwapErr = errorsmod.Wrapf(gammtypes.ErrInvalidMathApprox, "token amount must be positive") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why don't we import this error from the place where it is returned in superfluid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no error to import. Its from gamm, and every instance of this is manually entered. Example:
Lines 61 to 62 in ecbb383
return sdk.Int{}, errorsmod.Wrapf(types.ErrInvalidMathApprox, "token amount must be positive") | |
} |
osmosis/x/gamm/pool-models/balancer/pool.go
Lines 519 to 520 in ecbb383
return sdk.Coin{}, errorsmod.Wrapf(types.ErrInvalidMathApprox, "token amount must be positive") | |
} |
osmosis/x/gamm/pool-models/balancer/pool.go
Lines 576 to 577 in ecbb383
return sdk.Coin{}, errorsmod.Wrapf(types.ErrInvalidMathApprox, "token amount must be positive") | |
} |
* multi-network upgrade handler * run mainnet upgrade handler for e2e network IDs * fixes * fix * widen tolerance * more resilient way to calculate coins used * add logs to upgrade handler * scale error tolerance with spread factor * change back init tag * update changelog * Fix imports * check liquidity prior to creating pool * check base/quote rather than all denoms * check if pool only has 2 assets * skip pools that are already linked * add log and fix issue * add an additional log * more logs * more prints * skip if incentive gauge duration does not exist * use gogotypes * use store.Has * error instead of panic on getgaugeId from poolId * Update app/upgrades/v17/upgrades_test.go Co-authored-by: Roman <[email protected]> * remove extra prints * remove old logs * enable superfluid assets both chains * remove unused func * setting the default ibc-hooks params * separate method for enable superfluid for testnet * drastically simplify the upgrade handler * check superfluid error type directly * remove use of pointer of coinsUsed and poolLinks * Update app/upgrades/v17/upgrades.go * Update app/upgrades/v17/upgrades.go * add spot price check when adding testnet assets * fix osmo amount * add error check * add additional check from testnet to mainnet * remove this check from mainnet handler * fix lingering merge conflict --------- Co-authored-by: devbot-wizard <[email protected]> Co-authored-by: Roman <[email protected]> Co-authored-by: Nicolas Lara <[email protected]>
Closes: #XXX
What is the purpose of the change
This PR introduces logic to the upgrade handler to work with both osmosis-1 and any other network-id (but specifically for osmo-test-5).
If the network ID matches the mainnet ID, osmo-test-a, or osmo-test-b, we create CL pools for all balancer pools defined in the asset pairs struct. Note, we use osmo-test-a and osmo-test-b for E2E, so we want to use the same upgrade handler that mainnet uses whenever possible.
If the network ID is something else, we create CL pools for all existing balancer pools.
From that point, the logic is shared.
A majority of the logic in the PR was pre-existing, but was extracted from the CreateUpgradeHandler method to make it easier to parse.
I did, however, make a core logic change to the upgrade handler where, instead of expecting the baseAsset to be in the community pool already, we swap 0.1 OSMO for the base asset, which is enough to create a full range position.
Testing and Verifying
The upgrade_test.go file was updated to test both "osmosis-1" and "osmo-test-5" network ID.
Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)