Skip to content

device-health-oracle: Add activation criterion: devices must consistently call controller #3493

@nikw9944

Description

@nikw9944

See https://github.com/malbeclabs/doublezero/blob/main/rfcs/rfc12-network-provisioning.md for context.

Add a device activation criterion to device-health-oracle: Do not advance a device's health to ready-for-links or ready-for-users unless it has worth of records in the clickhouse controller_grpc_getconfig_success table. The query should check that the device has called the controller at least once per minute over the interval.

There is a different clickhouse database for each doublezero environment:

  • devnet.controller_grpc_getconfig_success
  • testnet.controller_grpc_getconfig_success
  • mainnet-beta.controller_grpc_getconfig_success

You can find a reference clickhouse client implementation here:

  • controlplane/telemetry/cmd/geoprobe-target/main.go
  • controlplane/telemetry/internal/geoprobe/migrations.go
  • controlplane/telemetry/internal/geoprobe/clickhouse.go
  • controlplane/telemetry/internal/geoprobe/clickhouse_test.go
  • controlplane/telemetry/db/clickhouse/migrations/20260401000001_location_offsets.sql

Regarding architecture:

  1. Today the oracle simply sets health to ready-for-users (devices) or ready-for-service (links). This is the first of many criteria we will be adding for devices and links. As the rfc explains, devices will go through 2 stages of readiness - ready-for-links and ready-for-users (and must pass through ready-for-links before proceeding to ready-for-users), while links only have 1 stage - ready-for-service. Please look for software design patterns suitable for this task, list 2 or 3 alternatives, and propose one.
  2. Today the oracle sets health to ready-for-users (devices) or ready-for-service (links) without regard for their current values. Please optimize this so we don't change a value if it's already set to the desired value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions