-
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
Protorev: Update timing for pool updating and dev fee payout #4827
Conversation
- Not optimal because it still stores state, but want to show minimal working version - All tests pass after setting dev account for the tests, no new tests added
This commit is a minimal code change version of sending developer profit after every trade: 5bacd9e It's not optimized for this change since it still stores state to track the dev fee (which is now unnecessary). Will be changed in a future commit to be an optimal version |
Should we interpret this as unfinished until the unnecessary state tracking is removed? |
ye all these draft PRs are kinda not in review state lol, just putting them up as drafts for my own organization |
- removes functions no longer necessary - Still needs upgrade migration work - Still needs a way to pay current dev fee payment to us during the upgrade - still needs to get tests to pass
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you! |
- When testing via the upgrades_test.go file, the protorev migration would not run since it treated the from and to version to be 2 (pulling from the new consensus version set) - When adding this line and hardcoding the from version to 1, the upgrade processes as expected
app/upgrades/v16/upgrades.go
Outdated
if err := keepers.ProtoRevKeeper.SendDeveloperFeesToDeveloperAccount(ctx); err != nil { | ||
ctx.Logger().Error("error sending developer fees to developer account during upgrade, expected in testing, not in prod", "error", err) | ||
} |
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.
I would prefer it if this is handled properly. I know the process for updating e2e is cumbersome. However, handling this in the right way and e2e testing will save us time during the upgrade if any issues occur.
The process for setting this account in e2e is the following:
- update e2e genesis for the protorev module in a separate PR:
osmosis/tests/e2e/initialization/config.go
Lines 234 to 237 in 1e56cc6
err = updateModuleGenesis(appGenState, staketypes.ModuleName, &staketypes.GenesisState{}, updateStakeGenesis) if err != nil { return err } - backport that PR to
v15.x
- Grab the chain init docker image with v15 tag from here: https://hub.docker.com/r/osmolabs/osmosis-e2e-init-chain/tags
- should be auto-uploaded
- Copy this tag:
osmosis/tests/e2e/containers/config.go
Line 27 in 1e56cc6
previousVersionOsmoTag = "v15.x-833705e4-1679340262"
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.
@p0mvn @stackman27 The PR for steps 1-2 is ready for review: #5312
If I understand correctly, once the above PR is merged, I will then be able to get the docker tag and then update the tag in this PR, to continue forward.
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.
hi @NotJeremyLiu is this PR r4r now. I think just needs rebasing right?
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.
@stackman27 I just updated the tag and removed the failing test, letting it run through workflow to see if all is good
Co-authored-by: Roman <[email protected]>
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 = "v15.x-833705e4-1679340262" | |||
previousVersionOsmoTag = "v15.x-63e3f053-1685053483" |
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.
please also bump previousVersionInitTag
below to v15.x-63e3f053-1685053483
All checks pass, finally r4r @stackman27 |
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
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
// Deprecated: Can be removed in v16 | ||
// UpdateDeveloperFees updates the fees that developers can withdraw from the module account | ||
func (k Keeper) UpdateDeveloperFees(ctx sdk.Context, denom string, profit sdk.Int) error { |
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.
Let's remove now?
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.
This is unused now. Please submit separate PR if agreed. Not going to block merge on this
* Update highest liquidity pools in daily epoch instead of weekly * Minimal code change to send dev profit after every trade - Not optimal because it still stores state, but want to show minimal working version - All tests pass after setting dev account for the tests, no new tests added * Handles dev fee payment without storing in kvstore - removes functions no longer necessary - Still needs upgrade migration work - Still needs a way to pay current dev fee payment to us during the upgrade - still needs to get tests to pass * Increase consensus version * Revert "Handles dev fee payment without storing in kvstore" This reverts commit 1f2f3dc. * add upgrade logic, new functions, and deprecated comments * add another todo * Revert "add another todo" This reverts commit 49c7eaf. * add another todo * Panic on migration error * Hardcode protorev from version to 1 - When testing via the upgrades_test.go file, the protorev migration would not run since it treated the from and to version to be 2 (pulling from the new consensus version set) - When adding this line and hardcoding the from version to 1, the upgrade processes as expected * Add tests to ensure protorev upgrade is successful * Remove deprecated comment to pass linter * lint * add changelog entry * Change documentation to reflect new timing cadence * Change developer_fees test for new SendDeveloperFee method - Removes tests for no longer used functions - Adds a test for the new SendDeveloperFee method * Update app/upgrades/v16/upgrades.go fix typo Co-authored-by: David Terpay <[email protected]> * move test to top of file, helper at bottom * fix merge conflict typo * added migration function to upgrades.go * bump consensus version to 2 * comment out everything upgrade related to isolate problem * Revert "comment out everything upgrade related to isolate problem" This reverts commit da4efca. * Revert "bump consensus version to 2" This reverts commit 127dc5b. * log instead of pass back up errors * Remove commented out code * clean up comments * add clarifying comment * fix typpo Co-authored-by: Roman <[email protected]> * update v15 prev version tag in e2e container * remove e2e test that checks protorev dev account not initialized * return err if protorev dev account payment errors during upgrade * Add dev fee payment check when testing trade execution --------- Co-authored-by: David Terpay <[email protected]> Co-authored-by: stackman27 <[email protected]> Co-authored-by: Roman <[email protected]>
What is the purpose of the change
This PR updates the timing cadence of certain protorev logic:
Brief Changelog
Testing and Verifying
Documentation and Release Note