Skip to content

feat(app): trim and refresh the validator cache each epoch #529

Description

@emlautarom1-agent

Part of #402 — follow-up to the app-wiring PR.

Scope

Add a scheduler slot subscriber that trims and refreshes the shared ValidatorCache on each epoch's first slot (Charon app/app.go:484-532 at v1.7.1, including the firstValCacheRefresh/refreshedBySlot bookkeeping and the GetBySlot head-fallback re-fetch).

Cache seeding already shipped in the app-wiring PR (one shared Arc cache reaches the scheduler, broadcaster, and validator-API clients), so a single refresh covers all consumers. Without the refresh the validator set is frozen at startup: validators activating later never get duties scheduled, and exited validators keep being scheduled. ValidatorCache::trim (crates/eth2api/src/valcache.rs) currently has no production caller.

Dependencies

None — independent of the other follow-ups (can land in parallel with the fee-recipient subscriber; both are subscribe_slot consumers).

Acceptance

  • Trim + refresh on each epoch's first slot with refreshed_by_slot semantics matching Charon.
  • Test: a validator activated after startup is observed after the next epoch tick; an exited validator stops being resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrustPull requests that update rust codetrack:orchestration-cliDev C — orchestration + CLI

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions