[go: up one dir, main page]

Alpha/Baker: Add DAL attestable slots worker

What

Parent MR: !19948 (merged)

This MR introduces a DAL attestable slots worker module that:

  • Subscribes per-delegate to the DAL node’s monitor_attestable_slots stream.
  • Delivers a Backfill as the first event per subscriber, then processes live events.
  • Maintains an in-memory cache keyed by attestation level with per-delegate values.
  • Exposes some small public APIs: create, update_streams_subscriptions, get_dal_attestable_slots, and shutdown_worker.
  • No changes to the baker pipeline in this MR - only new module + wiring where necessary (types, events, mli).

Why

We want a dedicated, reusable component that tracks attestable slots incrementally (via streams) instead of polling from static RPCs. Having this worker land first keeps the next MRs small: later we will:

  • update subscriptions from the baker;
  • swap the baker's getter to the worker getter, without mixing concerns.

How

On subscribe, the stream wrapper returns exactly one Backfill event to that subscriber, then yields live events. Events update a mutex-protected cache mapping attestation_level -> delegate_id -> {published_level; slots} | Not_in_committee. attestation_level is computed as slot_level + attestation_lag - 1 (without worrying about the protocol migration cases, which are handled by the DAL node, therefore the stream only contains "safe" information) to match on-chain attestation time.

Manually testing the MR

CI green (this is a no-op for the baker or DAL node, we just have a background worker ready to be used in the next MRs, so we basically test it there).

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 Gabriel Moise

Merge request reports

Loading