Skip to content

feat: WASM-only architecture with sudo challenge management and P2P distribution#8

Open
echobt wants to merge 1 commit intomainfrom
refactor/wasm-only-remove-docker-legacy
Open

feat: WASM-only architecture with sudo challenge management and P2P distribution#8
echobt wants to merge 1 commit intomainfrom
refactor/wasm-only-remove-docker-legacy

Conversation

@echobt
Copy link

@echobt echobt commented Feb 18, 2026

Summary

Removes all legacy Docker/container orchestration code and establishes a pure WASM-based challenge execution architecture. Adds sudo-controlled challenge management with hotkey-based consensus verification and P2P distribution of WASM modules with SHA-256 integrity checks.

Changes

Docker/Container Removal

  • Delete crates/challenge-orchestrator/ (Docker-based challenge container orchestration)
  • Delete crates/secure-container-runtime/ (Docker socket broker, container security)
  • Remove container references from wasm-runtime-interface (container.rs gutted, container re-exports removed)
  • Remove docker_image and endpoint fields from ChallengeEntry in challenge-registry
  • Remove DockerRegistry variant from DiscoverySource enum
  • Remove ContainerRunRequest/ContainerRunResponse re-exports from challenge-sdk-wasm
  • Remove Docker-in-Docker config from docker-compose.yml (privileged: true, docker.sock mount, port 8090)
  • Remove tests/docker/ directory
  • Remove PLATFORM_TEST_DOCKER_MODE env var from CI
  • Clean up workspace Cargo.toml members and validator-node dependencies

Sudo Challenge Management

  • Add SudoAction variants: AddChallenge, RemoveChallenge, EditChallenge, StopNetwork
  • Add state mutation methods (add_challenge_from_sudo, remove_challenge_from_sudo, etc.) to both core::ChainState and p2p-consensus::ChainState
  • Handle NetworkMessage::SudoAction in validator-node with hotkey verification (is_sudo)
  • StopNetwork routes all emissions to UID 0 (burn)

Challenge Weight System

  • Per-challenge emission weights stored in blockchain state (ChallengeWeightAllocation)
  • Weights applied during process_wasm_evaluations for Bittensor weight submission
  • SetChallengeWeight sudo action updates weights with P2P propagation

WASM Module P2P Distribution

  • Add WasmModuleRequest/WasmModuleResponse P2P message types
  • Store WASM bytecode in distributed storage on AddChallenge
  • Validators request missing modules via DataRequest on startup
  • SHA-256 hash verification against WasmModuleMetadata.code_hash
  • Verified modules saved to wasm_module_dir for executor loading

State Versioning

  • Increment CURRENT_STATE_VERSION to V7
  • Add V6→V7 migration path with new challenge management fields
  • All new serialized fields use #[serde(default)] for backward compatibility

Documentation & CI

  • Update AGENTS.md, challenge-integration.md, security.md, validator_wasm_audit.md
  • Remove references to challenge-orchestrator and secure-container-runtime
  • Add comprehensive sudo action test suite

Breaking Changes

  • ChallengeEntry no longer has docker_image or endpoint fields
  • DiscoverySource::DockerRegistry variant removed
  • ContainerHostFunctions and related container types removed from wasm-runtime-interface
  • State version bumped to V7 (automatic migration from V6)

…istribution

Remove all legacy Docker/container code (challenge-orchestrator, secure-container-runtime)
and clean up container references from wasm-runtime-interface, challenge-registry, and SDK.

Add sudo actions for challenge management (AddChallenge, RemoveChallenge, EditChallenge,
StopNetwork) with hotkey-based consensus verification. Store per-challenge emission weights
in blockchain state with proper versioning (V7).

Implement WASM module P2P distribution via DataRequest/DataResponse messages with SHA-256
peer verification. New validators automatically download missing modules on startup.

Key changes:
- Delete crates/challenge-orchestrator and crates/secure-container-runtime
- Remove Docker-in-Docker from docker-compose.yml (privileged, docker.sock)
- Add challenge weight system integrated into emission calculations
- Add state mutation methods for sudo-initiated challenge operations
- Add P2P message types for WASM module distribution
- Increment state version to V7 with migration from V6
- Update documentation to reflect WASM-only architecture
- Add comprehensive test suite for sudo actions
@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

Important

Review skipped

Too many files!

This PR contains 207 files, which is 57 over the limit of 150.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/wasm-only-remove-docker-legacy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant