-
Notifications
You must be signed in to change notification settings - Fork 13
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
[Upgrades] v0.0.12 upgrade #1043
Conversation
5a3decc
to
f187c35
Compare
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! I feel we are starting to improve our migration plans 👏
app/upgrades/v0.0.12.go
Outdated
// Force all services to have a 100% revshare to the supplier. | ||
// Not something we would do on a real mainnet, but it's a quick way to resolve the issue. | ||
// Currently, we don't break any existing suppliers (as all of them have a 100% revshare to the supplier). | ||
service.RevShare = []*sharedtypes.ServiceRevenueShare{ |
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.
Ideally we would be able to loop over the old revshare map by unmashalling to the old proto type then create the new Supplier
proto with the new values.
But since we don't have proto versioning and we marked the old (float32) value as reserved, this is the next best option offered to us.
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.
@red-0ne Really appreciate this feedback & input.
@okdas Can you #PUC what the "best" approach would be an "why" - essentially paragraphsing @red-0ne's comments.
In particular, explaining why we're not doing it would help. I'm thinking:
- Requires multiple copies of the protobuf
- Requiers multiple steps in the migration (overkill given that we're not in prod)
- Etc...
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.
Rephrased the whole block.
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.
@okdas Looks good!
Overall, I do want us to take this as an opportunity to create a good reference + example.
- keep it clean
- do things right
- iterate on process / template
Things aren't "on fire" and it's a "simple migration", so now is the time!
@@ -11,9 +11,7 @@ import ( | |||
// The chain upgrade can be scheduled AFTER the new version (with upgrade strategy implemented) is released, |
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.
Isn't there a certain .md you're supposed to update (for documentation purposes) when we do an upgrade?
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.
At the moment of release, we don't know when the upgrade will happen. My thinking, this should be a separate PR. But! We can prepare some changes in advance - that's a good idea.
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.
But! We can prepare some changes in advance - that's a good idea.
Let's do it!
Wdyt of creating another PR (updating the docs that's a draft), and leave a TODO here.
var allUpgrades = []upgrades.Upgrade{
// v0.0.4 was the first upgrade we implemented and tested on network that is no longer used.
// upgrades.Upgrade_0_0_4,
// v0.0.10 was the first upgrade we implemented on Alpha TestNet.
// upgrades.Upgrade_0_0_10,
// v0.0.11 was the Alpha TestNet exclusive upgrade to bring it on par with Beta TestNet.
// upgrades.Upgrade_0_0_11,
// TODO(@okdas, #XX): Update the documentation once a block height has been selected.
// Ref: https://dev.poktroll.com/protocol/upgrades/upgrade_list
// v0.0.12 - the first upgrade going live on both Alpha and Beta TestNets.
upgrades.Upgrade_0_0_12,
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.
Nvm: I saw your changes in .md
AFTER writing the message above. Leaving it as a reference.
Wdyt of adding the output of the CLI transaction to say "Please update docusaurus/docs/protocol/upgrades/upgrade_list.md` now that you've submitted the plan?
You know how they say "Go to where your users are", I'm trying to "Go where the dev's eyes are".
They're looking at the CLI when something says !!!!!!!!!
:)
app/upgrades/v0.0.12.go
Outdated
|
||
err := applyNewParameters(ctx) | ||
if err != nil { | ||
logger.Error("Failed to apply new parameters", "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.
Thoughts on (here and elsewhere) adding the version upgrade a a (key,val) as well?
You can either have a local v0.0.12
const, or update the logger context, or both!
app/upgrades/v0.0.12.go
Outdated
return vm, err | ||
} | ||
|
||
// Since we changed the type of RevSharePercent from float32 to uint64, we need to update all on-chain data. |
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.
Can we moved this into a local helper to scope / separate the changes from the "boilerplate"?
app/upgrades/v0.0.12.go
Outdated
return vm, err | ||
} | ||
|
||
logger.Info("Successfully completed v0.0.12 upgrade handler") |
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 make v0.0.12
a local constant and do some string formatting here.
It'll avoid copy-pasta errors in the future.
app/upgrades/v0.0.12.go
Outdated
logger.Info("Updating all suppliers to have a 100% revshare to the supplier", "num_suppliers", len(suppliers)) | ||
for _, supplier := range suppliers { | ||
for _, service := range supplier.Services { | ||
// Force all services to have a 100% revshare to the supplier. |
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.
Can you change this to read the prior state and use it for the new state/
I realize it's not a big deal here, but I want us to take this as an opportunity to do it right, and set a right example/reference in the future.
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.
Can you please elaborate? GetAllSuppliers
gives us the current state from what I understand.
I do want to add a warning if there's a supplier with more than 1 revshare, which would signal us if we broke somebody's setup.
Co-authored-by: Daniel Olshansky <[email protected]>
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.
Looking great @okdas!
Just a handful of more comments & NITs but we should be g2g after the next set of changes.
@@ -11,9 +11,7 @@ import ( | |||
// The chain upgrade can be scheduled AFTER the new version (with upgrade strategy implemented) is released, |
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.
But! We can prepare some changes in advance - that's a good idea.
Let's do it!
Wdyt of creating another PR (updating the docs that's a draft), and leave a TODO here.
var allUpgrades = []upgrades.Upgrade{
// v0.0.4 was the first upgrade we implemented and tested on network that is no longer used.
// upgrades.Upgrade_0_0_4,
// v0.0.10 was the first upgrade we implemented on Alpha TestNet.
// upgrades.Upgrade_0_0_10,
// v0.0.11 was the Alpha TestNet exclusive upgrade to bring it on par with Beta TestNet.
// upgrades.Upgrade_0_0_11,
// TODO(@okdas, #XX): Update the documentation once a block height has been selected.
// Ref: https://dev.poktroll.com/protocol/upgrades/upgrade_list
// v0.0.12 - the first upgrade going live on both Alpha and Beta TestNets.
upgrades.Upgrade_0_0_12,
@@ -23,7 +23,7 @@ metrics: | |||
addr: :9070 | |||
pocket_node: | |||
query_node_rpc_url: tcp://localhost:26657 | |||
query_node_grpc_url: tcp://localhost:36658 |
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.
So confirming this should be left as is or no?
It's just a little confusing (without comments) why some ports are 26657
but the other is 9090
@@ -11,9 +11,7 @@ import ( | |||
// The chain upgrade can be scheduled AFTER the new version (with upgrade strategy implemented) is released, |
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.
Nvm: I saw your changes in .md
AFTER writing the message above. Leaving it as a reference.
Wdyt of adding the output of the CLI transaction to say "Please update docusaurus/docs/protocol/upgrades/upgrade_list.md` now that you've submitted the plan?
You know how they say "Go to where your users are", I'm trying to "Go where the dev's eyes are".
They're looking at the CLI when something says !!!!!!!!!
:)
app/upgrades/v0.0.12.go
Outdated
} | ||
keepers.SupplierKeeper.SetSupplier(ctx, supplier) | ||
logger.Info("Updated supplier", | ||
"supplier", supplier.OperatorAddress) |
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.
Owner & operator please!
app/upgrades/v0.0.12.go
Outdated
return vm, err | ||
} | ||
|
||
logger.Info("Running module migrations", "upgrade_plan_name", Upgrade_0_0_12_PlanName) |
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.
Can we add a log like this before every section / update?
Co-authored-by: Daniel Olshansky <[email protected]>
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.
A few NITs.
Preliminary approval so we can start working on the upgrade while tending to the discussion / comments in parallel.
Feel free to merge at your pace.
app/upgrades/v0.0.12.go
Outdated
// Parameter configurations aligned with repository config.yml specifications | ||
// These values reflect the delta between v0.0.11 and current main branch | ||
// Reference: | ||
// - Comparison: https://github.com/pokt-network/poktroll/compare/v0.0.11..main |
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.
Moving conversation to discord to get this over the finish line.
https://discord.com/channels/824324475256438814/1332065342746525778/1336434350660784239
Co-authored-by: Daniel Olshansky <[email protected]>
Had a successful upgrade locally (using this guide). |
Summary
Adding an upgrade handler for
v0.0.12
Type of change
Select one or more from the following:
consensus-breaking
label if so. See [Infra] Automatically add theconsensus-breaking
label #791 for detailsSanity Checklist
assignees
,reviewers
,labels
,project
,iteration
andmilestone
make docusaurus_start
make go_develop_and_test
andmake test_e2e
devnet-test-e2e
label to run E2E tests in CI