Skip to content

feat(host_reporter): add LUMERA_SUPERNODE_DISABLE_HOST_REPORTER test affordance#285

Merged
mateeullahmalik merged 1 commit intomasterfrom
feat/host-reporter-test-knobs
Apr 27, 2026
Merged

feat(host_reporter): add LUMERA_SUPERNODE_DISABLE_HOST_REPORTER test affordance#285
mateeullahmalik merged 1 commit intomasterfrom
feat/host-reporter-test-knobs

Conversation

@mateeullahmalik
Copy link
Copy Markdown
Collaborator

@mateeullahmalik mateeullahmalik commented Apr 27, 2026

Summary

Adds an env-gated knob to disable the on-chain host_reporter service:

  • LUMERA_SUPERNODE_DISABLE_HOST_REPORTER=1 (or true) → host_reporter is not started.
  • Unset / any other value → canonical behavior, host_reporter runs as today.

Why

The everlight devnet test (devnet/tests/everlight/everlight_test.sh in the lumera repo) drives MsgSubmitEpochReport from outside the SN to exercise the STORAGE_FULL state transition (S2.3–S2.6) and anti-gaming guardrails (S5.x) as black-box state-machine tests. The SN's own host_reporter ticks every ~5s and auto-submits using the same reporter key — the test loses every account-sequence race and the scenarios cannot complete.

This was not a chain bug: epoch math is immutable-by-design, MsgSubmitEpochReport.Creator must be the registered SN account, and host_reporter's auto-submit (PR #284) is correct. The fix is a test affordance, not a behavior change.

Scope

  • One file (supernode/cmd/start.go), ~27 LOC.
  • Env-var gated; no config-file surface.
  • Production deployments are unaffected unless they explicitly set the var.
  • hostReporter is now optional in the services slice; nil-guarded before append.

Verification

Built locally, deployed in 5-validator devnet with EVERLIGHT_TEST_TARGET=1 only on supernova_validator_1:

  • v1 startup log: INFO host_reporter disabled via LUMERA_SUPERNODE_DISABLE_HOST_REPORTER
  • v2–v5: host_reporter running normally (epoch report submitted lines flowing).
  • Full make devnet-tests-everlight run: PASS: 39 FAIL: 0 SKIP: 4 (skips are intentional — full-lifecycle / pre-Everlight genesis scenarios that are out of scope for the everlight feature flag).

Risks

  • None to production: when the env var is unset the code path is byte-identical to today (same NewService call, same fatal-on-error, same services-slice membership).
  • The new if hostReporter != nil guard before append is a no-op in the canonical path.

Rollback

Revert this single commit. Companion lumera-side changes (devnet compose + everlight test fixes) ship in a separate PR on the lumera repo.

…affordance

Allow disabling the on-chain host_reporter service via the
LUMERA_SUPERNODE_DISABLE_HOST_REPORTER=1 env var so devnet/CI test
scenarios can drive MsgSubmitEpochReport directly without losing the
account-sequence race against the SN's own ~5s auto-submit ticker.

Production deployments must leave this unset; the canonical path is
unchanged when the env var is absent.

This unblocks the everlight devnet test's STORAGE_FULL transition
scenarios (S2.3-S2.6) which submit audit reports from the SN reporter
key as part of a black-box state-machine test.
@roomote-v0
Copy link
Copy Markdown

roomote-v0 Bot commented Apr 27, 2026

Rooviewer Clock   See task

No issues found. The change is minimal and well-scoped: env-var gating is clean, the nil guard before append is correct and consistent with the existing storageChallengeRunner pattern, and the canonical code path is unchanged when the variable is unset.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@mateeullahmalik mateeullahmalik merged commit e349971 into master Apr 27, 2026
8 checks passed
mateeullahmalik added a commit to LumeraProtocol/lumera that referenced this pull request Apr 27, 2026
Multi-faceted fix to make 'make devnet-tests-everlight' green on master:

- devnet/go.mod: activate the local 'replace lumera => ..' block (was
  pinned to v1.10.0 but tests/validator imports x/action/v1/merkle
  which only exists at HEAD).  Bump baseline require to v1.11.1.

- devnet/default-config/devnet-genesis.json: set epoch_length_blocks=20
  in genesis.  The audit module enforces 'epoch_length_blocks is
  immutable after genesis' (consensus-critical math); the previous
  test attempted to gov-update this at runtime which is correctly
  rejected.  Devnet wants short epochs (~20s) for fast lifecycle
  coverage.

- devnet/generators/docker-compose.go: emit EVERLIGHT_TEST_TARGET=1
  on supernova_validator_1 only.  The companion supernode change
  (LumeraProtocol/supernode#285) suppresses host_reporter on that
  validator so the test can drive MsgSubmitEpochReport without losing
  the account-sequence race.  Other validators keep host_reporter
  running so peer reachability data still flows for ACTIVE eligibility.

- devnet/scripts/supernode-setup.sh: forward EVERLIGHT_TEST_TARGET=1
  through to LUMERA_SUPERNODE_DISABLE_HOST_REPORTER=1 when starting
  the supernode binary.

- devnet/tests/everlight/everlight_test.sh: six fixes
  1. Rewrite 9 'cmd; rc=$?' sites to 'rc=0; cmd || rc=$?' so 'set -e'
     no longer aborts before FAIL/SKIP can be recorded.
  2. audit_current_epoch_id: '.epoch_id // empty' -> '.epoch_id // 0'.
     proto3/gogoproto omits zero-valued scalars; epoch 0 (first 400
     blocks under default params, first 20 blocks under devnet) is a
     valid epoch but renders without the .epoch_id key.
  3. 'audit assigned-targets --supernode-account FOO' -> positional
     'FOO'.  The CLI takes a positional arg, the flag does not exist
     and silently fails the entire submit pipeline.
  4. 'supernode report-supernode-metrics --validator-address FOO' ->
     positional 'FOO'.  Same shape as #3, on the legacy metrics path.
  5. S7.7: stop trying to gov-update epoch_length_blocks (immutable by
     design) and convert the assertion into a presence + value check.
  6. Scenario 2 entry: drive a healthy self-report and wait one epoch
     so the target supernode recovers from POSTPONED -> ACTIVE before
     S2.3 attempts the STORAGE_FULL transition.  POSTPONED is the
     expected starting state when host_reporter is disabled
     (missing-report consecutive postponement is correct chain
     behavior).
  7. S5.4: rewrite assertion from 'eligible after growth jump' to
     'smoothed_weight < raw post-jump bytes'.  The original assertion
     races the growth-cap clamp; the rewritten one tests the actual
     anti-gaming property without a timing dependency on smoothing
     ramp-up.

## Verification

5-validator devnet, fresh genesis, full make devnet-tests-everlight:

  PASS: 39   FAIL: 0   SKIP: 4
  EXIT=0

The 4 SKIPs are intentional: S3.5-S3.7 (payout candidates not yet
eligible at distribution time on devnet timing), S4 (needs longer
state setup), S9 (pre-Everlight upgrade flow), S10 (full lifecycle).

## Companion change

Requires LumeraProtocol/supernode#285 (LUMERA_SUPERNODE_DISABLE_HOST_REPORTER
env var).  Without it the EVERLIGHT_TEST_TARGET env propagation in this
PR is a no-op.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant