Skip to content

Commit e7d84aa

Browse files
committed
Remove dead code: ~21,100 lines of unused P2P, legacy challenge, and jobs code
Major removals: - crates/challenge-runtime/ (entire crate - unused epoch sync) - crates/network/ (entire P2P networking crate - previously removed) - platform-server: rule_engine.rs, challenge_proxy.rs, api/jobs.rs, api/llm.rs - platform-server: 20+ unused db query functions, AuditLogger system - challenge-sdk: P2P modules (p2p.rs, distributed_storage.rs, etc.) - distributed-db: p2p_sync.rs Cleaned: - Unused struct fields in csudo, data_api, websocket - Dead auth functions (require_auth, require_validator, require_owner) - Unused Cargo.toml dependencies in platform-server All code compiles cleanly with cargo check.
1 parent 94682da commit e7d84aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+196
-21309
lines changed

Cargo.lock

Lines changed: 44 additions & 1672 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
resolver = "2"
33
members = [
44
"crates/core",
5-
"crates/network",
65
"crates/consensus",
76
"crates/storage",
87
"crates/challenge-sdk",
98
"crates/epoch",
10-
"crates/challenge-runtime",
119
"crates/bittensor-integration",
1210
"crates/subnet-manager",
1311
"crates/rpc-server",
@@ -54,9 +52,6 @@ hex = "0.4"
5452
sp-core = "38.1.0"
5553
parity-scale-codec = { version = "3.7.5", features = ["derive"] }
5654

57-
# P2P Networking
58-
libp2p = { version = "0.54", features = ["tokio", "noise", "yamux", "tcp", "dns", "gossipsub", "mdns", "request-response", "macros", "identify", "cbor", "serde"] }
59-
6055
# Storage
6156
sled = "0.34"
6257

bins/csudo/src/main.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,7 @@ struct RegisterChallengeRequest {
161161
struct Challenge {
162162
id: String,
163163
name: String,
164-
docker_image: String,
165164
mechanism_id: i32,
166-
emission_weight: f64,
167-
#[serde(default)]
168-
timeout_secs: u64,
169-
#[serde(default)]
170-
cpu_cores: f64,
171-
#[serde(default)]
172-
memory_mb: u64,
173-
#[serde(default)]
174-
gpu_required: bool,
175165
#[serde(default)]
176166
status: String,
177167
#[serde(default)]
@@ -185,8 +175,6 @@ struct ApiResponse {
185175
#[serde(default)]
186176
error: Option<String>,
187177
#[serde(default)]
188-
challenge_id: Option<String>,
189-
#[serde(default)]
190178
endpoint: Option<String>,
191179
}
192180

bins/platform/Cargo.toml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,11 @@ tower-http = { version = "0.5", features = ["cors", "trace"] }
4545
# Challenge orchestration
4646
challenge-orchestrator = { path = "../../crates/challenge-orchestrator" }
4747

48-
# Validator dependencies (conditional compilation could be used for smaller binary)
49-
platform-network = { path = "../../crates/network" }
50-
platform-consensus = { path = "../../crates/consensus" }
51-
platform-storage = { path = "../../crates/storage" }
52-
platform-epoch = { path = "../../crates/epoch" }
53-
platform-challenge-runtime = { path = "../../crates/challenge-runtime" }
48+
# Server dependencies
5449
platform-bittensor = { path = "../../crates/bittensor-integration" }
55-
platform-subnet-manager = { path = "../../crates/subnet-manager" }
56-
platform-rpc = { path = "../../crates/rpc-server" }
57-
distributed-db = { path = "../../crates/distributed-db" }
5850
secure-container-runtime = { path = "../../crates/secure-container-runtime" }
5951

6052
# Utils
6153
parking_lot = { workspace = true }
6254
hex = { workspace = true }
63-
chrono = { workspace = true }
6455
which = "7.0"

bins/platform/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use clap::Args;
1010
use platform_server::orchestration::ChallengeManager;
1111
use platform_server::state::AppState;
1212
use platform_server::websocket::handler::ws_handler;
13-
use platform_server::{api, challenge_proxy::ChallengeProxy, data_api, db, models, observability};
13+
use platform_server::{api, data_api, db, models};
1414
use secure_container_runtime::{ContainerBroker, SecurityPolicy, WsConfig};
1515
use std::sync::Arc;
1616
use tracing::{error, info, warn};

bins/validator-node/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ name = "validator-node"
33
version.workspace = true
44
edition.workspace = true
55

6-
[lib]
7-
name = "validator_node"
8-
path = "src/lib.rs"
9-
106
[[bin]]
117
name = "validator-node"
128
path = "src/main.rs"

bins/validator-node/src/lib.rs

Lines changed: 0 additions & 28 deletions
This file was deleted.

crates/challenge-runtime/Cargo.toml

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)