feat: solver anti-griefing controls, AsyncAPI v1 WS protocol, Redis-backed replay (#453, #456, #457) - #579
Merged
NanaKhadija1980j merged 5 commits intoOct 2, 2026
Conversation
…x-protocol#453) - SolverGriefingService: rolling unfilled-accept ratio per solver over configurable time window (GRIEFING_WINDOW_SECONDS, default 1h) - Escalating state machine: ok -> cooldown -> reduced-concurrency -> suspended driven by configurable ratio thresholds - Enforced at accept time in IntentsController.accept before acceptIfOpen write - recordUnfilled wired into IntentsSweeperService.slashMissedFill - Incident exclusion: operators can exclude network-outage intents from ratio - Manual reset endpoint: DELETE /api/v1/admin/griefing/:address - Audit/reputation log with per-solver and global query - Metrics: griefing_state_transitions_total, griefing_unfilled_ratio, griefing_enforced_solvers added to MetricsService - SolverGriefingController at /api/v1/admin/griefing (admin-guarded) - Canary solvers exempt from enforcement counters - 19 unit tests in solver-griefing.service.spec.ts (all passing) - sweeper specs updated for new optional griefingService constructor arg
…riteria
Criterion 2 - reputation impact:
- Add GRIEFING_REPUTATION_MULTIPLIERS (ok=1.0, cooldown=0.8,
reduced-concurrency=0.5, suspended=0.0) to solver-griefing.types.ts
- Add applyGriefingPenalty() pure function
- Apply penalty in SolversController.getLeaderboard and getSolverStats
- leaderboard/stats responses now include griefingState field
- Suspended solvers always rank last regardless of historical fill rate
Criterion 3 - per-solver metrics fully wired:
- SolverGriefingService.setMetrics() called from SolversModule.onModuleInit
- transitionState emits recordGriefingTransition, setGriefingEnforcementState,
setGriefingConcurrencyLimit, setGriefingEnforcedCount on every state change
- recordUnfilled emits setGriefingRatio after each unfilled event
- MetricsService: add griefing_enforcement_state{solver,state} gauge and
griefing_concurrency_limit{solver} gauge (previously only declared, not
initialised or called)
Tests: 33 tests in solver-griefing.service.spec.ts (14 new), all passing
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.
Closes #453
Closes #456
Closes #457