[go: up one dir, main page]

Dal: check validity of pages indices in imports and/or proofs

What

Currently, when importing a DAL page or producing/verifying a proof, we check that the slot index is within the expected boundaries (among other checks), but we don't perform any check on the page index. This MR fixes this by adding a check for pages indices when known as well.

Why

We want to define a uniform semantics (between the rollup operator and the proofs module) on what to do in case a page with an incorrect index in requested. Before this MR, the proofs part behaves correctly by producing unconfirmation proofs, but we had a crash at the rollup level because such a check is missing.

How

  • Old function slot_id_is_valid becomes import_level_is_valid and only focuses on import validity w.r.t. to level: published level not in the future, not before rollup origination and the slot's validity is not expired (w.r.t. to newly introduced TTL dal_attested_slots_validity_lag). The function is still used by both Sc_rollup_proofs and Dal_pages_request modules
  • Checking that slots and pages indices are in the expected boundaries are delegated to Sc_rollup_proofs and Dal_pages_request modules via two additional helpers.

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

Merge request reports

Loading