You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Design a comprehensive, layered test plan for issues #4 and #5 before they go to implementation. The plan must give confidence that the changes work correctly in isolation AND in the live network scenario.
HEALTHY: miss rate > 25% but <4 samples → NOT excluded (insufficient data)
HEALTHY: miss rate ≤ 25% with any sample count → stays HEALTHY
EXCLUDED: cooldown not passed → still excluded from filter
EXCLUDED: cooldown passed → promoted to PROBE
PROBE → HEALTHY: successful inference recorded
PROBE → EXCLUDED: miss → doubles cooldown
PROBE → EXCLUDED (3rd time): cooldown = initial × 4, capped at max
All-degraded fallback: all nodes excluded → filter returns original list (no empty pool)
Epoch boundary: all CB state cleared regardless of current state
3. Integration test scenarios (Testermint)
Examine existing tests to understand how to set up controlled miss scenarios:
How does InferenceFailureAccountingTests.kt simulate node failures?
How does ValidationTests.kt verify participant status changes?
How are ValidationParams overridden in test genesis specs?
Propose Testermint test scenarios:
Scenario A (reputation weight): Two nodes, different reputation histories (manipulate EpochPerformanceSummary). Verify over 100 inference requests that high-reputation node receives ~2× more requests than 50-reputation node
Scenario B (fast exclusion): One node starts missing inferences (simulate via node shutdown or mock). Verify it stops receiving requests within 4 misses, not after SPRT threshold
Scenario C (probe recovery): Excluded node's cooldown expires → verify it receives exactly one probe inference → bring node back up → verify HEALTHY state and normal traffic resumes
Scenario D (exponential backoff): Node keeps failing probes → verify cooldown doubles each time up to max
Scenario E (network resilience): All nodes briefly offline → verify filter fallback prevents empty pool, traffic resumes when any node recovers
4. Param testing
How to test with non-default params (e.g., lower min_samples=2 for faster test execution):
Identify if ValidationParams can be overridden in Testermint genesis spec (check SpecTests.kt and TestUtils.kt)
What's the minimum epoch length for integration tests? (affects cooldown block counts — may need to set health_cb_initial_cooldown_blocks very low, e.g. 5 blocks for tests)
5. Regression risks
What existing behavior could break:
GetRandomExecutor returning empty result (most critical — network stops)
Nodes incorrectly excluded due to param misconfiguration
CB state not cleared on epoch boundary (nodes permanently excluded)
Background
Goal
Design a comprehensive, layered test plan for issues #4 and #5 before they go to implementation. The plan must give confidence that the changes work correctly in isolation AND in the live network scenario.
Changes Being Tested
Issue #4 — Reputation-adjusted selection weight
addEpochMembersinmodule.go: selection weight =stakeWeight * reputation / 100(floor 1%)calculateSelectionWeightIssue #5 — Intra-epoch circuit breaker + cooldown/probe recovery
createHealthFilterFninquery_get_random_executor.goCircuitBreakerStateper-participant, cleared on epoch boundaryMsgFinishInferenceandEndBlock/handleInferenceExpiryValidationParams: miss threshold (25%), min samples (4), initial cooldown (50 blocks), max cooldown (500 blocks)Test Infrastructure Available
Unit tests (Go):
inference-chain/x/inference/keeper/*_test.gokeepertest.InferenceKeeper(t)gives keeper + contextparticipant_test.go,participant_status_test.goIntegration/E2E tests (Kotlin/Testermint):
testermint/src/test/kotlin/initCluster(reboot = true)InferenceTests.kt,InferenceFailureAccountingTests.kt,ValidationTests.kt,MultiNodeTests.kt,ParticipantPowerTests.ktValidationParamscan be set in genesis for test params)What to Investigate
1. Unit test scenarios for #4 (reputation weight)
Map out test cases for
calculateSelectionWeightandaddEpochMembers:GetRandomMemberForModeltest cover weighted selection? Checkinference-chain/x/inference/keeper/for existing random executor tests2. Unit test scenarios for #5 (circuit breaker)
Map out all state machine transitions:
3. Integration test scenarios (Testermint)
Examine existing tests to understand how to set up controlled miss scenarios:
InferenceFailureAccountingTests.ktsimulate node failures?ValidationTests.ktverify participant status changes?ValidationParamsoverridden in test genesis specs?Propose Testermint test scenarios:
EpochPerformanceSummary). Verify over 100 inference requests that high-reputation node receives ~2× more requests than 50-reputation node4. Param testing
How to test with non-default params (e.g., lower min_samples=2 for faster test execution):
ValidationParamscan be overridden in Testermint genesis spec (checkSpecTests.ktandTestUtils.kt)health_cb_initial_cooldown_blocksvery low, e.g. 5 blocks for tests)5. Regression risks
What existing behavior could break:
GetRandomExecutorreturning empty result (most critical — network stops)Check: are there existing tests for
GetRandomExecutorthat need updating?Key Files
inference-chain/x/inference/keeper/participant_test.go— unit test patternsinference-chain/x/inference/keeper/participant_status_test.go— SPRT test patternstestermint/src/test/kotlin/InferenceFailureAccountingTests.kt— failure simulationtestermint/src/test/kotlin/ValidationTests.kt— participant status E2Etestermint/src/test/kotlin/MultiNodeTests.kt— multi-node scenariostestermint/src/test/kotlin/ParticipantPowerTests.kt— power/weight teststestermint/src/test/kotlin/TestUtils.kt— test helpersDeliverables
Focus Areas