File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -946,6 +946,16 @@ async fn main() -> Result<()> {
946946 cid,
947947 route_infos. clone ( ) ,
948948 ) ;
949+ // If challenge_id is a human-readable name (not UUID), ensure the
950+ // challenge config uses that name so HTTP name-based routing works.
951+ if uuid:: Uuid :: parse_str ( challenge_id) . is_err ( ) {
952+ let needs_rename = state. wasm_challenge_configs . get ( & cid)
953+ . map ( |c| c. name != challenge_id)
954+ . unwrap_or ( false ) ;
955+ if needs_rename {
956+ state. rename_challenge ( & cid, challenge_id. to_string ( ) ) ;
957+ }
958+ }
949959 info ! (
950960 challenge_id = challenge_id,
951961 routes_count = route_infos. len( ) ,
Original file line number Diff line number Diff line change @@ -326,6 +326,11 @@ pub enum SudoAction {
326326 challenge_id : ChallengeId ,
327327 new_name : String ,
328328 } ,
329+
330+ /// Remove a challenge entirely
331+ RemoveChallenge {
332+ challenge_id : ChallengeId ,
333+ } ,
329334}
330335
331336/// Configuration for how weights are distributed on a mechanism
Original file line number Diff line number Diff line change @@ -498,6 +498,10 @@ impl ChainState {
498498 ) ;
499499 self . rename_challenge ( challenge_id, new_name. clone ( ) ) ;
500500 }
501+ SudoAction :: RemoveChallenge { challenge_id } => {
502+ tracing:: info!( challenge_id = %challenge_id, "Sudo: removing challenge" ) ;
503+ self . remove_wasm_challenge ( challenge_id) ;
504+ }
501505 }
502506 self . increment_mutation_sequence ( ) ;
503507 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments