test: add empty active set deadlock and bootstrap tests for audit module#105
Open
mateeullahmalik wants to merge 1 commit intomasterfrom
Open
test: add empty active set deadlock and bootstrap tests for audit module#105mateeullahmalik wants to merge 1 commit intomasterfrom
mateeullahmalik wants to merge 1 commit intomasterfrom
Conversation
Add unit and system tests that reproduce the testnet deadlock where all supernodes are POSTPONED and the epoch anchor has an empty active set. Without active probers, peer observations cannot be generated, making audit recovery impossible. Tests: - TestEnforceEpochEnd_EmptyActiveSet_PostponedCannotRecover (unit) Proves that compliant host-only reports from POSTPONED SNs are insufficient for recovery when no peer observations exist. - TestEnforceEpochEnd_LegacyRecoveredSN_SurvivesWithReport (unit) Proves that SNs recovered to ACTIVE mid-epoch (via legacy metrics) with audit reports survive the EndBlocker enforcement. - TestAuditEmptyActiveSetDeadlock_HostOnlyReportsCannotRecover (system) Full-chain E2E: registers SNs, misses epoch 0, submits host-only reports for 3 epochs — all remain POSTPONED throughout. - TestAuditEmptyActiveSetBootstrap_LegacyMetricsBreaksDeadlock (system) Full-chain E2E: same deadlock setup, then legacy metrics recovery breaks the deadlock — SNs survive enforcement and remain ACTIVE. Ref: LumeraProtocol/supernode#275
Reviewed all changes. No issues found -- the unit tests and system tests are well-structured, mock expectations align with the enforcement logic, and the helper usage follows existing patterns. Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add unit and system tests that reproduce the testnet deadlock where all supernodes are POSTPONED and the epoch anchor has an empty active set. Without active probers, peer observations cannot be generated, making audit recovery impossible.
Tests Added
Unit tests (
x/audit/v1/keeper/enforcement_empty_active_set_test.go)TestEnforceEpochEnd_EmptyActiveSet_PostponedCannotRecover— Proves that compliant host-only reports from POSTPONED SNs are insufficient for recovery when no peer observations exist.TestEnforceEpochEnd_LegacyRecoveredSN_SurvivesWithReport— Proves that SNs recovered to ACTIVE mid-epoch (via legacy metrics) with audit reports survive the EndBlocker enforcement.System tests (
tests/systemtests/audit_empty_active_set_bootstrap_test.go)TestAuditEmptyActiveSetDeadlock_HostOnlyReportsCannotRecover— Full-chain E2E: registers SNs, misses epoch 0, submits host-only reports for 3 epochs — all remain POSTPONED throughout.TestAuditEmptyActiveSetBootstrap_LegacyMetricsBreaksDeadlock— Full-chain E2E: same deadlock setup, then legacy metrics recovery breaks the deadlock — SNs survive enforcement and remain ACTIVE.Context
On testnet (
lumera-testnet-2), all supernodes runningv2.4.5-testnetwere POSTPONED before the audit module activated (legacy staleness handler). The audit module's recovery requires peer observations from active probers, but the active set has been empty since epoch 1. Fix applied in supernode#275.These tests ensure the edge case is covered for future upgrades.