Skip to content

Lep 6 postponed target assignment fix#139

Merged
j-rafique merged 1 commit into
1.12.0from
LEP-6-postponed-target-assignment-fix
May 12, 2026
Merged

Lep 6 postponed target assignment fix#139
j-rafique merged 1 commit into
1.12.0from
LEP-6-postponed-target-assignment-fix

Conversation

@j-rafique
Copy link
Copy Markdown
Contributor

@j-rafique j-rafique commented May 12, 2026

Summary

Fix LEP-6 storage-truth target assignment so POSTPONED supernodes remain challengeable by active challengers after they are postponed.

Before this change, storage-truth assignment computed targets by intersecting the epoch anchor’s target set with the active challenger set. That accidentally removed POSTPONED supernodes from future storage-truth assignments, even though the epoch anchor already records POSTPONED nodes in TargetSupernodeAccounts.

This made the LEP-6 recovery path unreachable in some cases:

text
storage failure → suspicion threshold crossed → POSTPONED
→ target no longer assigned
→ no clean PASS proofs can accrue
→ clean-pass recovery predicate cannot be satisfied

The fix keeps challenger eligibility active-only, but uses the anchored target set as the storage-truth target candidate set.

Why this is required

LEP-6 recovery requires both:

  1. suspicion score decay below the recovery threshold, and
  2. a configured number of clean PASS results after postponement.

The current chain implementation already separates:

  • ActiveSupernodeAccounts: active/storage-full nodes eligible to challenge/report
  • TargetSupernodeAccounts: active/storage-full/postponed nodes eligible to be challenged

CreateEpochAnchorIfNeeded already includes POSTPONED nodes in the target set. Existing test coverage also asserts this behavior. The assignment code was the inconsistent piece: it filtered the target set back down to active nodes, making POSTPONED targets unreachable.

Implementation

Updated computeStorageTruthTargetsForReporter so:

  • reporters/challengers must still be active/eligible
  • target candidates come from the epoch anchor’s TargetSupernodeAccounts
  • POSTPONED targets remain challengeable by active peers
  • fallback behavior for empty target sets is preserved
  • legacy assignment behavior for UNSPECIFIED mode is unchanged

Added regression coverage to prove active challengers can be assigned POSTPONED storage-truth targets.

Spec / design alignment

This is aligned with LEP-6’s objective of storage-truth enforcement and recovery:

  • does not allow POSTPONED nodes to act as challengers
  • does not bypass recovery predicates
  • does not weaken suspicion scoring or clean-pass requirements
  • preserves bounded target count based on active challenger population
  • enables the intended recovery loop:
      text
    failure → POSTPONED → clean PASS evidence → ACTIVE recovery

This also matches the implementation guide’s SOFT/FULL behavior: storage-truth enforcement can postpone nodes, and FULL mode requires complete proof coverage for assigned storage-truth targets.

Validation

Ran targeted keeper tests:

bash
go test ./x/audit/v1/keeper -run 'TestStorageTruthAssignment(UsesOneThirdCoverage|IncludesPostponedTargets|DisabledUsesLegacyCoverage)$' -count=1

Result:

text
ok github.com/LumeraProtocol/lumera/x/audit/v1/keeper 0.071s

Also ran full keeper package after review:

bash
go test ./x/audit/v1/keeper -count=1

Result:

text
ok github.com/LumeraProtocol/lumera/x/audit/v1/keeper 0.203s

Validated through the supernode LEP-6 local E2E flow consuming this chain fix:

Result: PASS

Key passing tests:

  • TestLEP6StorageTruthEnforcementLifecycle
  • TestLEP6RuntimeE2E_CascadeChallengeHealVerifyAndStore
  • TestLEP6RealChainIntegration

@j-rafique j-rafique self-assigned this May 12, 2026
@a-ok123 a-ok123 requested a review from Copilot May 12, 2026 15:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes LEP-6 storage-truth target assignment so supernodes in POSTPONED state remain eligible to be challenged (and thus can accumulate clean PASS proofs for recovery), by using the epoch anchor’s stored target set instead of re-filtering targets down to the active challenger set.

Changes:

  • Update storage-truth target candidate selection to use the anchor’s TargetSupernodeAccounts directly (keeping challenger eligibility restricted to the active/eligible set).
  • Add a regression test ensuring active challengers can be assigned a postponed target.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
x/audit/v1/keeper/audit_peer_assignment.go Adjusts storage-truth target candidate selection to include anchored (postponed-inclusive) targets.
x/audit/v1/keeper/audit_peer_assignment_test.go Adds regression coverage for postponed targets being assignable to active challengers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread x/audit/v1/keeper/audit_peer_assignment.go
@j-rafique j-rafique merged commit 28b0f1c into 1.12.0 May 12, 2026
11 checks passed
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.

3 participants