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

Implement a general upgrade mechanism #1479

Closed
Tracked by #1480
jbearer opened this issue May 16, 2024 · 1 comment
Closed
Tracked by #1480

Implement a general upgrade mechanism #1479

jbearer opened this issue May 16, 2024 · 1 comment

Comments

@jbearer
Copy link
Member

jbearer commented May 16, 2024

Rough Proposal

Add the following to genesis:

enum UpgradeType {
  // An upgrade type which replaces the chain config with the given one
  ChainConfig(ChainConfig),

  // More upgrade types may be added as the software evolves. For example, a specific protocol upgrade may just have a name
  // (like an Ethereum hardfork name) and a unit variant here, which the validation logic is hard-coded to handle.
}

struct Upgrade {
  type: UpgradeType,
  block: u64,
}

struct Genesis {
  ...
  upgrades: BTreeMap<Version, Upgrade>,
}

Add upgrades: BtreeMap<Version, Upgrade> to NodeState.

On startup, check the current version and find the next configured upgrade. If there is one, configure HotShot to upgrade to the next protocol version at the specified block.

In validation logic, check the current protocol version. If it is greater than the previous version, look up the corresponding upgrade and execute it. At first, the only type of upgrade we will support executing is a ChainConfig upgrade, which just sets the chain_config in ValidatedState

@imabdulbasit
Copy link
Contributor

#1530

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants