Skip to content

Pipelining: adapt headers context hash semantics

Context

This MR is the final environment-dependent component required to implement the full pipelining. This MR changes the semantics of block header's context hash field. Previously, and for protocols < alpha, a valid block header must contains the context hash resulting of the application of this block. This changes this so that the context hash is the predecessor's resulting context hash (and so on). This allows the baker to skip this block's application entirely and focus on the validation part which doesn't require a direct access to the context.

For the time being, we still make the baker fully apply blocks until we gain more confidence and unplug this entirely.

In order to implement this new semantics (and support the previous one), a significant adaptation of the store and validation's code was required. In particular, it requires a store, snapshot and baker (persistent file) upgrade (and version bump). In the current state, the backward compatibility is ensured: i.e., we are able to import legacy snapshots.

Manually testing the MR

The upgrades and global correctness were manually tested:

  • Imported a legacy snapshot from mainnet;
  • Upgraded a legacy data-dir to the new store's format;
  • Performed a mainnet protocol transition from Kathmandu -> Lima -> Alpha and made sure that the new baker was correctly updated and able to bake.

The existing tests should cover most of cases but more scenario should be added.

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 vbot

Merge request reports