[go: up one dir, main page]

Etherlink/Kernel/Stage 2: avoid reading the next blueprint number twice

What

Stacked on !16685 (merged).

In stage 2, the last stored block is typically read twice to get the number of the next blueprint:

  • first at the beginning of the block::produce function to initialize the current_block_number mutable variable,
  • then, if no BIP is found in storage, the block::next_bip_from_blueprints function is called with current_block_number as argument but this argument is not passed to the blueprint_storage::read_next_blueprint function which therefore rereads the storage.

Note: if the block application succeeds, block_storage::read_current_number is also called in promote_block to forge the BlueprintApplied event but this MR is not about this. See !16661 (merged).

Why

It's always good to save some IOs + it simplifies !16569 (closed) a bit.

How

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