fuel-core icon indicating copy to clipboard operation
fuel-core copied to clipboard

Decide on how to perform a forkless upgrade

Open xgreenx opened this issue 1 year ago • 1 comments

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 avatar Dec 14 '23 16:12 xgreenx

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.

Voxelot avatar Dec 14 '23 17:12 Voxelot

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:

  • https://github.com/FuelLabs/fuel-core/issues/1753
  • https://github.com/FuelLabs/fuel-core/issues/1754

xgreenx avatar Mar 18 '24 14:03 xgreenx