-
Notifications
You must be signed in to change notification settings - Fork 106
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(zetacore): add upgrade tracker #2095
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2095 +/- ##
===========================================
- Coverage 72.34% 68.24% -4.11%
===========================================
Files 249 259 +10
Lines 14007 14927 +920
===========================================
+ Hits 10134 10187 +53
- Misses 3412 4278 +866
- Partials 461 462 +1
|
!!!WARNING!!! Be very careful about using Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203 Pay extra attention to the way |
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.
Blocked by resolution of #2077. I could fix that in this PR too.
Is it what #2101 is about? @kingpinXD
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.
@gartnera , it would be helpful it ,you could add details of how this upgrade tracker is going to be used , and also why its needed .
Some context would be helpful in reviewing this PR .
@kingpinXD I added a bit more info in the PR description, please let me know which areas need additional clarification. |
Thanks that was quite helpful , I am wondering though , why cant we use the existing releases that we have , to ru upgrade developnet , without having to manage it through a tracker . For example we could apply updates 1 to 14 , one by one after every X number of blocks to reach a v14 network , if needed .The gov proposals can be managed via an external script without baking anything into the zetacored binary I would imagine development to be very similar to athens 3 , just that the users would be internal . |
because
The existing upgrade handler logic will not tolerate the migrations being run multiple times. We must be more granular in how we track and apply upgrades for develop builds. |
Yeah, I am just saying, that can't Developnet use only the existing releases? |
We could but we would have to reset the state of the network every deployment. That would increase the difficulty of connecting to btc/eth testnets. Not impossible, but we would require much more protocol support.
The main purpose of developnet is giving internal and external developers the ability to interact with the latest code from develop. Our team is specifically interested in detecting breaking changes to metrics for example. |
b822b3c
to
0262f99
Compare
To add to this. The last release v15 was Mar 20 which means we haven't ran the latest code on any public networks for almost two months. The goal with DevelopNet is to decrease the delay between when the Protocol team commits code and when internal and external devs see it running on a long(ish) lived public network. |
@gartnera can you fix the merge conflict? @kingpinXD @lumtis anything else blocking this from moving forward? |
f1b2d8d
to
044d312
Compare
done |
9490300
to
a6c3fe1
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.
looks good overall
f3e2743
to
de99a89
Compare
de99a89
to
a342b84
Compare
a342b84
to
a45ab9c
Compare
works when #2198 is applied |
Description
When we start deploying every change from develop on "developnet", we will need the ability to run each store upgrade/migration function individually as the are added.
Introduce the upgrade version tracker which will manage tracking these upgrades. You must now assign a monotonically increasing index for each store upgrade. We store the maximum index on the disk and skip any store upgrades with indexes less than the stored value.
This tracker is only fully used when you explicitly enable it via environment variable. Otherwise, we assume you're doing a major version upgrade (v14 -> v16) and apply all upgrades.
Blocked by resolution of #2077. Update: I am fixing that in this PR too.
Part of DEVOP-642
More About developnet
developnet will be a stateful network where every change from develop is automatically built and deployed via governance proposals. We will use the git commit timestamp for the version number each build, so upgrades will look like this:
v0.0.1714761000-develop
v0.0.1714764425-develop
v0.0.1714771234-develop
Since each change will be deployed individually, we must adjust the upgrade handler logic to only run the specific migration logic for each change rather than all migrations every upgrade. An upgrade handler must be defined for every upgrade even if there are no migrations being run.
It is expected that developnet will occasionally need to have it's state reset due to breakages. We will try to minimize the need to reset it's state over time by improving CI checks.
How Has This Been Tested?
Checklist: