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

Decide on how to perform a forkless upgrade #1550

Closed
xgreenx opened this issue Dec 14, 2023 · 2 comments
Closed

Decide on how to perform a forkless upgrade #1550

xgreenx opened this issue Dec 14, 2023 · 2 comments
Assignees
Labels
SDK team The issue is ready to be addressed by SDK team upgradability

Comments

@xgreenx
Copy link
Collaborator

xgreenx commented Dec 14, 2023

Maybe via Transaction::Upgrade. How can we later add governance on top of that? What to do with a huge size of the byte code? How does the network know what is the current bytecode hash?

@xgreenx xgreenx added SDK team The issue is ready to be addressed by SDK team upgradability labels Dec 14, 2023
@Voxelot
Copy link
Member

Voxelot commented Dec 14, 2023

Maybe this should be a v2 of the upgradeability epic? It seems like we should be able to enable this in the future with a regular hard-fork.

@xgreenx xgreenx self-assigned this Jan 24, 2024
@xgreenx
Copy link
Collaborator Author

xgreenx commented Mar 18, 2024

We've decided to split the updating of the consensus parameters and WASM bytecode into separate processes.

The BlockHeader will contain the consensus_parameters_version: u32 and state_transition_bytecode_version: u32 fields as part of the application hash.

The upgrade transaction will post a serialized version of the consensus parameters. By default, we will use postcard to serialize it. The version will be automatically increased for the next block. The state transition will advance the version by one based on the current block header during the processing of the upgrade transaction.

The state transition function will verify that the block header uses the latest version by checking that a higher version doesn't exist.

Relayed following taks:

@xgreenx xgreenx closed this as completed Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK team The issue is ready to be addressed by SDK team upgradability
Projects
None yet
Development

No branches or pull requests

2 participants