Skip to content

new - #1

Merged
Henrichy merged 40 commits into
Henrichy:mainfrom
OpenKnight-Foundation:main
Aug 3, 2026
Merged

new#1
Henrichy merged 40 commits into
Henrichy:mainfrom
OpenKnight-Foundation:main

Conversation

@Henrichy

@Henrichy Henrichy commented Aug 3, 2026

Copy link
Copy Markdown
Owner

No description provided.

Maryermarh and others added 30 commits July 25, 2026 20:31
…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 consolidation, clippy fixes, user module, adopt upstream formatting
…-auth

Consolidate password handling to Argon2, add authenticate_player
fix(contract): cap tournament prize pools
…88-870

fix: resolve Mirabel64 assigned issues — anomaly logging (#888) + circuit breaker (#870)
…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
chinweobtagaz and others added 10 commits July 30, 2026 22:55
#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...
…inktime-alignment

fix(cheat-detection): align complexity-speed with each move's own think time
Fix inverted boolean logic in registration validation
@Henrichy
Henrichy merged commit 71aa30c into Henrichy:main Aug 3, 2026
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.