@@ -373,9 +373,6 @@ impl RpcHandler {
373373 // Sudo namespace (for subnet owner actions)
374374 [ "sudo" , "submit" ] => self . sudo_submit ( req. id , req. params ) ,
375375
376- // Dev namespace (for local testing)
377- [ "dev" , "addChallenge" ] => self . dev_add_challenge ( req. id , req. params ) ,
378-
379376 // Monitor namespace (for csudo monitoring)
380377 [ "monitor" , "getChallengeHealth" ] => self . monitor_get_challenge_health ( req. id ) ,
381378 [ "monitor" , "getChallengeLogs" ] => self . monitor_get_challenge_logs ( req. id , req. params ) ,
@@ -1568,88 +1565,6 @@ impl RpcHandler {
15681565 )
15691566 }
15701567
1571- // ==================== Dev Namespace (Local Testing Only) ====================
1572-
1573- /// Add a challenge directly (bypasses P2P consensus - dev only!)
1574- fn dev_add_challenge ( & self , id : Value , params : Value ) -> JsonRpcResponse {
1575- use platform_core:: { ChallengeContainerConfig , ChallengeId } ;
1576-
1577- // Parse parameters
1578- let name = match self . get_param_str ( & params, 0 , "name" ) {
1579- Some ( n) => n,
1580- None => return JsonRpcResponse :: error ( id, INVALID_PARAMS , "Missing 'name' parameter" ) ,
1581- } ;
1582-
1583- let docker_image = match self . get_param_str ( & params, 1 , "dockerImage" ) {
1584- Some ( i) => i,
1585- None => {
1586- return JsonRpcResponse :: error (
1587- id,
1588- INVALID_PARAMS ,
1589- "Missing 'dockerImage' parameter" ,
1590- )
1591- }
1592- } ;
1593-
1594- let mechanism_id = self . get_param_u64 ( & params, 2 , "mechanismId" ) . unwrap_or ( 1 ) as u8 ;
1595- let emission_weight = params
1596- . get ( "emissionWeight" )
1597- . and_then ( |v| v. as_f64 ( ) )
1598- . unwrap_or ( 1.0 ) ;
1599-
1600- // Create challenge config
1601- let config = ChallengeContainerConfig {
1602- challenge_id : ChallengeId :: new ( ) ,
1603- name : name. clone ( ) ,
1604- docker_image : docker_image. clone ( ) ,
1605- mechanism_id,
1606- emission_weight,
1607- timeout_secs : 3600 ,
1608- cpu_cores : 2.0 ,
1609- memory_mb : 4096 ,
1610- gpu_required : false ,
1611- } ;
1612-
1613- // Add to chain state directly (dev mode bypass)
1614- {
1615- let mut chain = self . chain_state . write ( ) ;
1616- let challenge_id = config. challenge_id ;
1617- chain. challenge_configs . insert ( challenge_id, config. clone ( ) ) ;
1618- info ! ( "DEV: Added challenge '{}' ({})" , name, challenge_id) ;
1619- }
1620-
1621- // Register standard routes using the challenge NAME (not UUID)
1622- // This allows users to access routes via /challenge/term-bench/config
1623- use platform_challenge_sdk:: ChallengeRoute ;
1624- let routes = vec ! [
1625- ChallengeRoute :: post( "/submit" , "Submit an agent" ) ,
1626- ChallengeRoute :: get( "/status/:hash" , "Get agent status" ) ,
1627- ChallengeRoute :: get( "/leaderboard" , "Get leaderboard" ) ,
1628- ChallengeRoute :: get( "/config" , "Get challenge config" ) ,
1629- ChallengeRoute :: get( "/stats" , "Get statistics" ) ,
1630- ChallengeRoute :: get( "/health" , "Health check" ) ,
1631- ] ;
1632- self . register_challenge_routes ( & name, routes) ;
1633- info ! (
1634- "DEV: Registered routes for challenge '{}' at /challenge/{}/" ,
1635- name, name
1636- ) ;
1637-
1638- JsonRpcResponse :: result (
1639- id,
1640- json ! ( {
1641- "success" : true ,
1642- "challengeId" : config. challenge_id. to_string( ) ,
1643- "name" : name,
1644- "dockerImage" : docker_image,
1645- "mechanismId" : mechanism_id,
1646- "routesRegistered" : 6 ,
1647- "routePath" : format!( "/challenge/{}/" , name) ,
1648- "message" : "Challenge added with routes (dev mode - no P2P consensus)"
1649- } ) ,
1650- )
1651- }
1652-
16531568 // ==================== Monitor Namespace ====================
16541569
16551570 /// Get challenge container health status for this validator
0 commit comments