@@ -838,91 +838,3 @@ fn test_emission_all_validator_miners_varying_cuts() {
838838 }
839839 } ) ;
840840}
841-
842- #[ test]
843- fn test_emission_extreme_cuts_edge_cases ( ) {
844- // Test extreme validator cut values: 0 (all to miners) and MAX (all to validators)
845- new_test_ext ( 1 ) . execute_with ( || {
846- let validator_coldkey = U256 :: from ( 1 ) ;
847- let validator_hotkey = U256 :: from ( 2 ) ;
848- let miner_coldkey = U256 :: from ( 3 ) ;
849- let miner_hotkey = U256 :: from ( 4 ) ;
850- let netuid = NetUid :: from ( 1 ) ;
851- let subnet_tempo = 10 ;
852- let stake = 100_000_000_000 ;
853-
854- // Setup network
855- add_network ( netuid, subnet_tempo, 0 ) ;
856- register_ok_neuron ( netuid, validator_hotkey, validator_coldkey, 0 ) ;
857- register_ok_neuron ( netuid, miner_hotkey, miner_coldkey, 1 ) ;
858-
859- SubtensorModule :: add_balance_to_coldkey_account (
860- & validator_coldkey,
861- stake + ExistentialDeposit :: get ( ) ,
862- ) ;
863- SubtensorModule :: add_balance_to_coldkey_account (
864- & miner_coldkey,
865- stake + ExistentialDeposit :: get ( ) ,
866- ) ;
867-
868- SubtensorModule :: set_weights_set_rate_limit ( netuid, 0 ) ;
869- step_block ( subnet_tempo) ;
870- SubnetOwnerCut :: < Test > :: set ( 0 ) ;
871- MaxAllowedUids :: < Test > :: set ( netuid, 2 ) ;
872- SubtensorModule :: set_max_allowed_validators ( netuid, 1 ) ;
873-
874- assert_ok ! ( SubtensorModule :: add_stake(
875- RuntimeOrigin :: signed( validator_coldkey) ,
876- validator_hotkey,
877- netuid,
878- stake. into( )
879- ) ) ;
880-
881- Weights :: < Test > :: insert ( NetUidStorageIndex :: from ( netuid) , 0 , vec ! [ ( 1 , 0xFFFF ) ] ) ;
882-
883- BlockAtRegistration :: < Test > :: set ( netuid, 0 , 1 ) ;
884- BlockAtRegistration :: < Test > :: set ( netuid, 1 , 1 ) ;
885- LastUpdate :: < Test > :: set ( NetUidStorageIndex :: from ( netuid) , vec ! [ 2 , 2 ] ) ;
886- Kappa :: < Test > :: set ( netuid, u16:: MAX / 5 ) ;
887- ActivityCutoff :: < Test > :: set ( netuid, u16:: MAX ) ;
888- ValidatorPermit :: < Test > :: insert ( netuid, vec ! [ true , false ] ) ;
889-
890- // Test cut = 0: all emissions should go to miners
891- {
892- let validator_before = SubtensorModule :: get_total_stake_for_coldkey ( & validator_coldkey) ;
893- let miner_before = SubtensorModule :: get_total_stake_for_coldkey ( & miner_coldkey) ;
894-
895- assert_ok ! ( SubtensorModule :: set_validator_cut( netuid, 0 ) ) ;
896- step_block ( subnet_tempo) ;
897-
898- let validator_emission =
899- SubtensorModule :: get_total_stake_for_coldkey ( & validator_coldkey) - validator_before;
900- let miner_emission =
901- SubtensorModule :: get_total_stake_for_coldkey ( & miner_coldkey) - miner_before;
902-
903- // Validator should get nearly nothing (within rounding error)
904- assert_abs_diff_eq ! ( validator_emission, 0 . into( ) , epsilon = 5 . into( ) ) ;
905- // Miner should get almost all emissions
906- assert ! ( miner_emission. to_u64( ) > 0 ) ;
907- }
908-
909- // Test cut = u64::MAX: all emissions should go to validators
910- {
911- let validator_before = SubtensorModule :: get_total_stake_for_coldkey ( & validator_coldkey) ;
912- let miner_before = SubtensorModule :: get_total_stake_for_coldkey ( & miner_coldkey) ;
913-
914- assert_ok ! ( SubtensorModule :: set_validator_cut( netuid, u64 :: MAX ) ) ;
915- step_block ( subnet_tempo) ;
916-
917- let validator_emission =
918- SubtensorModule :: get_total_stake_for_coldkey ( & validator_coldkey) - validator_before;
919- let miner_emission =
920- SubtensorModule :: get_total_stake_for_coldkey ( & miner_coldkey) - miner_before;
921-
922- // Miner should get nearly nothing (within rounding error)
923- assert_abs_diff_eq ! ( miner_emission, 0 . into( ) , epsilon = 5 . into( ) ) ;
924- // Validator should get almost all emissions
925- assert ! ( validator_emission. to_u64( ) > 0 ) ;
926- }
927- } ) ;
928- }
0 commit comments