[go: up one dir, main page]

Draft: Etherlink/Kernel: store next blueprint number outside of world state

What

This MR provides a way to access the number of the next blueprint to be applied without reading the world state.

Depends on !16618 (merged).

Why

This is a step toward the multichain feature. We want all the chains to progress in sync so they all have the same notion of blueprint number and we want to access this common number only once, before moving to the world states.

How

There are two functions used in the kernel to access the number of the current block or next blueprint:

  • block_storage::read_current_number: attempts to read the number from the current block, fails if no block has been stored yet,
  • blueprint_storage::read_next_blueprint_number: calls the previous function and add one; if the call fails, return 0.

The first commit replaces two calls to block_storage::read_current_number with calls to blueprint_storage::read_next_blueprint_number.

The second commit introduces a new field in the storage at path /evm/blueprints/next, the field is updated at block promotion.

The third commit modifies the implementation of blueprint_storage::read_next_blueprint_number function to read this field instead of calling block_storage::read_current_number.

Manually testing the MR

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Raphaël Cauderlier

Merge request reports

Loading