new - #1
Merged
Merged
Conversation
…ai_nft::mint event on NFT creation with (nft_id, minter, metadata_hash) - Emit ai_nft::transfer event on NFT transfer with (nft_id, from, to) - Emit game::created event on tournament creation with (game_id, player1, wager) - Emit game::joined event when game starts with (game_id, player1, player2) - Emit game::won event on win with (game_id, winner) - Emit game::drawn event on draw with (game_id, player) - Emit game::forfeited event on forfeit with (game_id, forfeiting_player, winner) - Emit game::cancelled event on cancellation with (game_id, player) - Emit game::payout event on reward distribution with (game_id, winner) - Emit game::tournament_payout event on multi-winner distribution with (game_id, winner_count) These events enable efficient subgraph/indexer tracking of all major lifecycle actions: - Tournament creation and settlement - AI NFT minting and transfers - Escrow management (existing events retained) - Game state transitions (created, joined, settled) Fixes: #861
…eaker Closes #888 — AI-20: Integrate anomaly detection logs into centralized ELK/Datadog stack. - Added structured JSON anomaly logger (agent-engines/gpu_worker/anomaly_logger.py) that emits BotFarmReport findings as single-line JSON at WARNING level for ingest by ELK, Datadog, or Loki. - Optional async webhook alerting via KNIGHTVERSE_ANOMALY_WEBHOOK_URL env var with lazy aiohttp import. - Integrated into WorkerPool.submit() so anomalies are logged on every request when findings are present. Closes #870 — BE-22: Implement circuit breakers for external AI/Python engine API calls. - Added CircuitBreaker (backend/modules/service/src/circuit_breaker.rs) with Closed/Open/HalfOpen state machine, configurable thresholds, timeout-based auto-recovery, and 4 unit tests. - Wrapped ProcessEngine calls in EngineService with the circuit breaker to fail fast when the engine is offline, preventing thread pool starvation. - Added with_circuit_breaker_config() constructor and circuit_breaker_state() monitoring method.
…-auth Consolidate password handling to Argon2, add authenticate_player
fix(contract): cap tournament prize pools
…re contracts - game_contract: Add PAUSED storage key, ContractPaused error (39), pause()/unpause()/is_paused() restricted to CONTRACT_ADMIN, and check_not_paused() guard on all 25 state-mutating functions. - ai_nft: Add PAUSED storage key, ContractPaused error (7), pause()/unpause()/is_paused() restricted to ADMIN, and check_not_paused() guard on mint() and transfer(). - game_registry: Add DataKey::Paused, ContractPaused error (10), symbol_short import, pause()/unpause()/is_paused() restricted to DataKey::Admin, and check_not_paused() guard on record_game(), set_server(), set_admin(), create_tournament(), register_tournament(). - emergency_circuit_breaker: already had full Pausable implementation, no changes required. All 65 existing tests pass. Closes #889
…ame tournament_payout event symbol to 'payout_t' (8 chars max) - Soroban symbol_short! macro has 9 character limit - All tests pass: 49 passed, 0 failed
Adds automatic execution of SeaORM (sqlx-backed) migrations when the API server starts, ensuring the database schema is always up to date without manual CLI intervention. Wraps migration errors as warnings so the server can still start with an existing schema. Closes #867
Add a RedisRateLimiter middleware for actix-web that tracks request counts per client IP using Redis INCR + EXPIRE, ensuring state is shared across all server workers. - Added rate_limiter.rs: generic Redis-backed middleware with configurable per-window limits and sliding window via INCR/EXPIRE - Applied 5 req/min limit to /v1/auth (login, register, refresh, logout) - Applied 30 req/min limit to /v1/games - Added env config: REDIS_AUTH_RATE_LIMIT, REDIS_AUTH_RATE_LIMIT_WINDOW, REDIS_GAME_RATE_LIMIT, REDIS_GAME_RATE_LIMIT_WINDOW - Kept existing actix-governor middleware for per-second burst protection - Includes 4 unit tests: under-limit, exceeded, headers, independent IPs Closes #865
SC-11: Implement Pausable extension for emergency halts across all co…
Game Handlers, Player Profiles, Identity Spoofing, Websocket move
feat: run database migrations automatically on server startup
…ing-redis BE-16: Implement Redis-backed API rate limiting to prevent DoS attacks
…rnament_escrow Adds a require!(player1 != player2) check in create_tournament_escrow to prevent a player from creating a tournament escrow against themselves, preventing potential ELO and payout rounding exploits.
…t-secrets fix(backend): graceful shutdown and strict JWT/Redis env vars
fix: replace unwrap in is_username_taken with error propagationUpdate players.rs
#933 SC-24: Validate player addresses are not identical in create_tournament_escrow
…nk time scoreComplexitySpeed collected complex-position indices from playerMoves but read think times via thinkTimes[idx]. Those arrays are in different index spaces: thinkTimes starts at move 1 and is compacted by an elapsed filter, so thinkTimes[i] is the gap before playerMoves[i+1], not the think time of playerMoves[i]. The heuristic therefore matched each complex move to a neighbour's think time (systematic off-by-one) and silently dropped higher-index complex moves via the length guard. Compute each complex move's think time directly from its own previous move's timestamp instead of indexing the compacted array. Add vitest coverage. Closes #940
…sive-event-emissions SC-13: Add comprehensive Soroban event emissions for indexing - Emit …
feat: Desynced Wallet Reconnection Status...
Update OpenAPI UUID parameter types
…inktime-alignment fix(cheat-detection): align complexity-speed with each move's own think time
Fix inverted boolean logic in registration validation
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.
No description provided.