Skip to content

fix(host-reporter): compat-map disk reports for storage full#297

Merged
mateeullahmalik merged 1 commit into
masterfrom
fix/audit-storagefull-hotfix
May 25, 2026
Merged

fix(host-reporter): compat-map disk reports for storage full#297
mateeullahmalik merged 1 commit into
masterfrom
fix/audit-storagefull-hotfix

Conversation

@mateeullahmalik
Copy link
Copy Markdown
Collaborator

Summary

Temporary compatibility patch for the deployed mainnet v1.12.0 chain behavior where audit host requirements can POSTPONE supernodes in the 85..90% disk usage band before the audit STORAGE_FULL path can fire.

This patch changes only the audit epoch HostReport.DiskUsagePercent submitted by the supernode host reporter. Local REST/status and local disk metrics remain truthful.

Behavior:

  • ACTIVE / STORAGE_FULL with actual disk usage at or above the audit postpone threshold reports a value just above supernode.max_storage_usage_percent, forcing the chain's existing audit SetReport STORAGE_FULL transition.
  • POSTPONED with reason audit_host_requirements or an old empty reason reports exactly the audit threshold for one recovery epoch, allowing deployed chain recovery rules to move it back to ACTIVE. The next epoch then reports the storage-full signal and moves it to STORAGE_FULL.
  • Non-host-requirement POSTPONED nodes are not recovered through this compatibility path.
  • If params or current supernode state cannot be queried, the reporter fails closed and sends the actual disk value.

Invariant Table

Field / Behavior Valid Range / Contract Enforcement Points Test Coverage
Audit HostReport disk compatibility value Only audit epoch report disk may be compatibility-mapped; local metrics/status stay actual host_reporter.tick -> auditDiskUsagePercent; audit_msg.SubmitEpochReport preserves caller disk TestAuditDiskUsagePercentCompat, existing tick tests
Already-POSTPONED recovery shim Only POSTPONED with audit_host_requirements or legacy empty reason gets one compliant report latestSupernodeState, params overlap check, current state query postponed host requirements, postponed old no-reason, postponed non-host reason cases
Fail-closed behavior Missing/disabled params or invalid actual disk must not invent data params checks before override TestAuditDiskUsagePercentCompatFailsClosedWhenParamsUnavailable

Tests

  • go test -count=1 ./supernode/host_reporter
  • go test -count=1 ./supernode/host_reporter ./pkg/lumera/modules/audit_msg ./pkg/lumera/modules/supernode
  • go test -count=1 ./supernode/...
  • git diff --check

Risk / Rollback

Risk is intentionally scoped to audit epoch HostReport disk reporting. Rollback is reverting this PR or shipping the permanent chain fix so the compatibility mapping is no longer needed.

@mateeullahmalik mateeullahmalik requested a review from j-rafique May 25, 2026 22:05
@mateeullahmalik mateeullahmalik self-assigned this May 25, 2026
@mateeullahmalik mateeullahmalik merged commit 80ecbb7 into master May 25, 2026
7 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.

2 participants