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

WIP: Software upgrade spec #2116

Closed
wants to merge 2 commits into from
Closed

WIP: Software upgrade spec #2116

wants to merge 2 commits into from

Conversation

jaekwon
Copy link
Contributor

@jaekwon jaekwon commented Aug 21, 2018

This spec proposal requires a new SoftwareUpgradeKeeper because the mechanics of that keeper should be different than the governance keeper.

For example, only validators can "vote" (though it should be automatic), and the acceptable values are not yes/no/abstain/veto, but the specific commit hash that the validator already upgraded to.

@jaekwon jaekwon requested a review from zramsay as a code owner August 21, 2018 23:15
@codecov
Copy link

codecov bot commented Aug 21, 2018

Codecov Report

Merging #2116 into develop will increase coverage by 1.03%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #2116      +/-   ##
===========================================
+ Coverage    63.83%   64.86%   +1.03%     
===========================================
  Files          113      115       +2     
  Lines         6684     6863     +179     
===========================================
+ Hits          4267     4452     +185     
+ Misses        2133     2127       -6     
  Partials       284      284

@jaekwon jaekwon mentioned this pull request Aug 22, 2018
1. Agree on software upgrade plan via governance (currently via a plaintext proposal).
2. Once the upgrade plan is accepted, validators each update their software according to proposal from step 1.
3. Each upgraded validator submits a transaction to the SoftwareUpgradeKeeper.
4. Once a sufficient quorum of validators has completed step 3, new logic kicks
Copy link
Contributor

Choose a reason for hiding this comment

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

what is "sufficient" here? kind of ambiguous should probably have a number of reference to a governance param or something.

Copy link
Contributor

@gamarin2 gamarin2 Aug 22, 2018

Choose a reason for hiding this comment

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

+1. Something not too close to 2/3rd so we don't risk halting on switch if a couple of validators go off

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, also we should clarify a bit how the new logic kicks in - conditionals in the code, for now?

should be heeded instead of the process declared here.
```

It is recommended that all links point to Github for now, for accountability.
Copy link
Contributor

Choose a reason for hiding this comment

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

What about the cosmos forum? - Is the idea that discussion moves from the forum then onto github for the implementation discussion?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is just referring to code links (@jaekwon)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

code links, signatures, everything but discussions.


Once the proposal from step 1 has been accepted, validators should upgrade
their software. For the standard upgrade procedure, it is OK for non-validator
full nodes to upgrade as well.
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't it required that full nodes upgrade as well? - I mean if they don't upgrade they just risk not being able to run transactions

Copy link
Contributor

Choose a reason for hiding this comment

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

Depends on the upgrade (e.g. with an upgrade which strictly reduces the set of valid transactions, they don't really need to upgrade).

In most cases they'll need to, the node should warn the user.

### Step 3: Update the SoftwareUpgradeKeeper

The new version of the software should automatically include a (single) signed
message to the SoftwareUpgradeKeeper w/ the new version of software that the
Copy link
Contributor

Choose a reason for hiding this comment

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

w/ -> with ?


## Procedure:

* Deadline: By 2 weeks from after the proposal has been accepted.
Copy link
Contributor

@gamarin2 gamarin2 Aug 22, 2018

Choose a reason for hiding this comment

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

Should we have some slashing logic for validators that did not submit the message to the SoftwareUpgradeKeeper in case the quorum isn't met?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this could be a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

Slashing would only occur if 1/3 < number of validator that signalled < quorum when deadline is met, i.e. we don't slash if less than a third of validators signalled. cf #2116 (comment)

1. Agree on software upgrade plan via governance (currently via a plaintext proposal).
2. Once the upgrade plan is accepted, validators each update their software according to proposal from step 1.
3. Each upgraded validator submits a transaction to the SoftwareUpgradeKeeper.
4. Once a sufficient quorum of validators has completed step 3, new logic kicks
Copy link
Contributor

@gamarin2 gamarin2 Aug 22, 2018

Choose a reason for hiding this comment

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

+1. Something not too close to 2/3rd so we don't risk halting on switch if a couple of validators go off

SOFTWARE_UPGRADE_[XXX]_ENABLED=true, where XXX is the commit hash of the new
software.

### Contingincies
Copy link
Contributor

Choose a reason for hiding this comment

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

Contingencies

The new version of the software should automatically include a (single) signed
message to the SoftwareUpgradeKeeper w/ the new version of software that the
validator is running. Even if a validator were to change their software
version multiple times, the SoftwareUpgradeKeeper ensures that nothing happens
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the keeper also ensures that validator can only signal a single version to a keeper? (1 to 1 map)

already taken place elsewhere. To gauge interest in a proposed upgrade,
users should instead submit a survey proposal with the following template:

Notethat the `Procedure` section has already been filled out. Do not change
Copy link
Contributor

Choose a reason for hiding this comment

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

Confusing to place that here ("following template:" should be immediately followed by said template)

@gamarin2 gamarin2 mentioned this pull request Aug 22, 2018
should be heeded instead of the process declared here.
```

It is recommended that all links point to Github for now, for accountability.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is just referring to code links (@jaekwon)?


Once the proposal from step 1 has been accepted, validators should upgrade
their software. For the standard upgrade procedure, it is OK for non-validator
full nodes to upgrade as well.
Copy link
Contributor

Choose a reason for hiding this comment

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

Depends on the upgrade (e.g. with an upgrade which strictly reduces the set of valid transactions, they don't really need to upgrade).

In most cases they'll need to, the node should warn the user.


## Conflict Resolution

In case there are conflicting proposals, the most recent proposal to get
Copy link
Contributor

Choose a reason for hiding this comment

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

To get accepted or to pass the SoftwareUpgradeKeeper quorum requirement? What if two proposals are accepted but the latter passes the quorum first?

Copy link
Contributor

Choose a reason for hiding this comment

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

We could have a second accepted proposal reset the SoftwareUpgradeKeeper, useful if a proposal is passed and validators start upgrading but discover an issue.

Copy link
Contributor

@gamarin2 gamarin2 Aug 22, 2018

Choose a reason for hiding this comment

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

Oh! This gives me an idea.

Maybe we don't need a second proposal, but just the ability for individual validators to reset/cancel their entry in the keeper's map. A proposal won't pass if the quorum is not met. The only problem then is slashing, but we could have the slashing condition require a minimum quorum. Like if less than a third of validators signal, noone gets slashed.

Only if 1/3 < number of validators that signalled < Switch-triggering quorum and deadline is met do we slash validators that did not signalled.

until a quorum (SOFTWARE_UPGRADE_QUORUM) are on an identical version of the
software.

Only validators can vote here, as delegators do not actually run the validation
Copy link
Contributor

Choose a reason for hiding this comment

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

But with their delegators' stake, presumably, which could be redelegated? How are these votes tallied?


## Procedure:

* Deadline: By 2 weeks from after the proposal has been accepted.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this could be a good idea.

1. Agree on software upgrade plan via governance (currently via a plaintext proposal).
2. Once the upgrade plan is accepted, validators each update their software according to proposal from step 1.
3. Each upgraded validator submits a transaction to the SoftwareUpgradeKeeper.
4. Once a sufficient quorum of validators has completed step 3, new logic kicks
Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, also we should clarify a bit how the new logic kicks in - conditionals in the code, for now?

* Audited by:
- <name/handle> on <date>; report: https://github.com/...
- <name/handle> on <date>; report: https://github.com/...

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we include a suggestion for signed authorship / endorsement, using ICS 030?


- [ ] Any new hardware requirements?
- [ ] Any new bandwidth requirements?
- [ ] Any dependencies on other proposals?
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these be handled by the SoftwareUpgradeKeeper or are these just "suggested dependencies"?

@ValarDragon
Copy link
Contributor

ValarDragon commented Aug 28, 2018

I don't think we should indicate the specific commit hash indicated on-chain, this ties us down to AIB's implementation being canonical. If we really want commit-hash, I think we should prefix it by "implementation name" then. But also there are other non-breaking changes I may want to include, but that would yield a different commit hash. Then I have to either lie, or not take in the non-breaking changes. Valid non-breaking changes include switching to your own fork of tendermint so you can upgrade your mempool, or change something about the peer rating mechanism.

* Deadline: By 2 weeks from after the proposal has been accepted.

Once this proposal has been accepted, validators should upgrade to the new
software as described above by the deadline. Once the new software is
Copy link
Contributor

Choose a reason for hiding this comment

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

A question here, how can we ensure that the version of software that upgraded to is identical to the version proposed because the proposal is not structured.


Once this proposal has been accepted, validators should upgrade to the new
software as described above by the deadline. Once the new software is
deployed, the new software will automaticaly submit a message to the
Copy link
Member

Choose a reason for hiding this comment

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

don't really understand this part - presumably the validator operator keys arent on the machine running the software and dont interact direct with the gaiad they just upgraded. so not clear to me how this should be automatic.

It does make sense that validators should publish something that indicates they upgraded. I'm wondering:

  • what is our appetite for not having this extra trigger for now, just letting folks download the new software and have it do a switchover at some height
  • shouldn't we do this extra confirmation step through some other means, like including it in votes or proposals, rather than this app-level extra tx?

@aaronc aaronc mentioned this pull request Mar 26, 2019
5 tasks
@ebuchman ebuchman closed this Apr 26, 2019
@aaronc aaronc mentioned this pull request Apr 29, 2019
5 tasks
@alessio alessio deleted the jae/upgradeproposal branch June 15, 2019 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants