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

docs: ADR 016 Removing Token Voting for Upgrades #1491

Closed
wants to merge 21 commits into from

Conversation

evan-forbes
Copy link
Member

@evan-forbes evan-forbes commented Mar 16, 2023

Overview

rendered

TLDR; just remove the upgrade module and do this

// ValidateBasic performs stateless validation on a Header returning an error
// if any validation fails.
//
// NOTE: Timestamp validation is subtle and handled elsewhere.
func (h Header) ValidateBasic() error {
    if h.Height >= consts.BombHeight {
        return errors.New("bomb height reached or exceeded")
    }
    ...
    return nil
}

closes #1477

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

@evan-forbes evan-forbes self-assigned this Mar 16, 2023
@evan-forbes evan-forbes added this to the Mainnet milestone Mar 16, 2023
@evan-forbes evan-forbes marked this pull request as ready for review March 16, 2023 19:45
@evan-forbes evan-forbes added the ADR item is directly relevant to writing or modifying an ADR label Mar 16, 2023
@MSevey MSevey requested a review from a team March 16, 2023 20:01
rootulp
rootulp previously approved these changes Mar 17, 2023
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

Overall LGTM

Co-authored-by: Rootul P <[email protected]>
@MSevey MSevey requested a review from a team March 22, 2023 11:25
Co-authored-by: Rootul P <[email protected]>
@github-actions
Copy link

PR Preview Action v1.3.0
🚀 Deployed preview to https://celestiaorg.github.io/celestia-app/pr-preview/pr-1491/
on branch gh-pages at 2023-03-22 11:25 UTC

rootulp
rootulp previously approved these changes Mar 23, 2023
@MSevey MSevey requested a review from a team March 23, 2023 20:14
Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Just need to capture that between the options a decision was made. Otherwise LGTM

@evan-forbes evan-forbes changed the title ADR 016: Removing Token Voting for Upgrades docs: ADR 016 Removing Token Voting for Upgrades Apr 2, 2023
@MSevey MSevey requested a review from a team April 3, 2023 10:34

## Context

Standard cosmos-sdk based chains are sovereign and have the ability to hardfork, but the current implementation makes heavy use of onchain token voting. This bypasses social consensus, one of the core principles of Celestia. After a proposal is submitted and crosses some threshold of agreement, the halt height is set in the state machine for all nodes, and validators are expected to switch binaries after the state machine halts the node. The ultimate security, ruleset, and result of that ruleset rests solely on the shoulders of node operators, not validators or token holders. Therefore we are seeking a solution that engraves social consensus into the implementation itself.
Copy link
Contributor

Choose a reason for hiding this comment

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

Token voting doesn't actually bypass social consensus. It is still only a coordinating mechanism that forces nodes to halt at an agreed upon height (kind of like a difficulty bomb). There is no enforcement of what the next binary could be.

Copy link
Member Author

@evan-forbes evan-forbes Apr 3, 2023

Choose a reason for hiding this comment

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

You are correct that people can always use which ever binary they choose, which is what the first part of the sentence was attempting to address.

Standard cosmos-sdk based chains are sovereign and have the ability to hardfork,

but the upgrade module does put a loose blocker to this by stopping binaries that don't match the version and the point of the onchain mechanism is to use token voting to decide. Meaning that the social contract is to do whatever token voting determines, which is not the social contract that celestia wants to adhere to.

Copy link
Member Author

@evan-forbes evan-forbes Apr 3, 2023

Choose a reason for hiding this comment

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

I understand avoiding the term bypass and will try to find a different word

Copy link
Member Author

Choose a reason for hiding this comment

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

updated, and I tried to focus on difference in social contract more

Given that we don't have a lot of time until mainnet, we could leave the current implementation in place which gives us the option to use it if needed. Ideally, we would work on the longer term upgrade mechanism that respects social consensus and finish it before the first upgrade. While this option does allow for maximum flexibility, it is also very risky because if the mechanism is ever needed or used, then it could set a precedent for future upgrades.

### Option 2: Removal of token voting for upgrades
The goal of this approach is to force social consensus to reach an upgrade instead of relying on token voting. It works by simply removing the current upgrade module. This way, the only way to upgrade the chain is to agree on the upgrade logic and the upgrade height.
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be helpful to expand on what the upgrade mechanism would be. Given that we've decided to use a single binary sync which basically enables rolling upgrades, operators can update their binaries ahead of time and a height is embedded in the binary which indicates when to switch to the next state machine.

Co-authored-by: Callum Waters <[email protected]>
@MSevey MSevey requested a review from a team April 3, 2023 12:39
MSevey
MSevey previously approved these changes Apr 5, 2023
Copy link
Member

@MSevey MSevey left a comment

Choose a reason for hiding this comment

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

Are there pending open questions/decisions that need to happen offline to move forward with this? Leaving my approval so we can merge if not.

@evan-forbes
Copy link
Member Author

I have some offline updates that I still want to push, just been busy or ooo, apologies for any delay

@MSevey MSevey requested a review from a team April 7, 2023 03:15
@evan-forbes evan-forbes requested a review from cmwaters April 7, 2023 03:34
@evan-forbes
Copy link
Member Author

before merging, we should also understand how ibc uses the upgrade module. we might only want to remove the ability for the gov module to use the upgrade module, and then incorporate the existing upgrade management into social upgrades #1014

@cmwaters
Copy link
Contributor

So the idea now is that the upgrade module still remains but we remove the proposal handler and the messages (do we even need to remove the messages if only governance can call this?).

I still think it's important that we clarify how, after these changes, a chain would expect to upgrade else this ADR feels incomplete.

@evan-forbes
Copy link
Member Author

I still think it's important that we clarify how, after these changes, a chain would expect to upgrade else this ADR feels incomplete.

That's fair, we can postpone merging this one until ADR018 is finished, as I think that topic requires an entire separate ADR. Or perhaps we could just move the relevant portions of this ADR into that one and only merge that ADR.

@cmwaters
Copy link
Contributor

That's fair, we can postpone merging this one until ADR018 is finished, as I think that topic requires an entire separate ADR. Or perhaps we could just move the relevant portions of this ADR into that one and only merge that ADR.

My personal view is that these shouldn't be considered two separate decisions but one

@evan-forbes
Copy link
Member Author

that makes a lot of sense!

iirc per sync discussion this ADR was initially separate because we just wanted to explore what a difficulty bomb and removing the upgrade module would look like before we discussed it during the onsite, but wanted to wait on upgrades.

I'll close this ADR for now, and we can update ADR018 to ADR016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADR item is directly relevant to writing or modifying an ADR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write ADR for governance minimization and "difficulty bomb"
5 participants