@@ -31,8 +31,8 @@ use polkadot_node_subsystem_util::reexports::SubsystemContext;
31
31
use polkadot_overseer:: ActivatedLeaf ;
32
32
use polkadot_primitives:: {
33
33
vstaging:: {
34
- CandidateDescriptorV2 , CandidateDescriptorVersion , ClaimQueueOffset , CoreSelector ,
35
- MutateDescriptorV2 , UMPSignal , UMP_SEPARATOR ,
34
+ CandidateDescriptorV2 , CandidateDescriptorVersion , ClaimQueueOffset ,
35
+ CommittedCandidateReceiptError , CoreSelector , MutateDescriptorV2 , UMPSignal , UMP_SEPARATOR ,
36
36
} ,
37
37
CandidateDescriptor , CoreIndex , GroupIndex , HeadData , Id as ParaId , OccupiedCoreAssumption ,
38
38
SessionInfo , UpwardMessage , ValidatorId , DEFAULT_SCHEDULING_LOOKAHEAD ,
@@ -531,6 +531,7 @@ fn session_index_checked_only_in_backing() {
531
531
& Default :: default ( ) ,
532
532
Default :: default ( ) ,
533
533
VALIDATION_CODE_BOMB_LIMIT ,
534
+ Default :: default ( ) ,
534
535
) )
535
536
. unwrap ( ) ;
536
537
@@ -549,6 +550,7 @@ fn session_index_checked_only_in_backing() {
549
550
& Default :: default ( ) ,
550
551
Default :: default ( ) ,
551
552
VALIDATION_CODE_BOMB_LIMIT ,
553
+ Default :: default ( ) ,
552
554
) )
553
555
. unwrap ( ) ;
554
556
@@ -574,6 +576,7 @@ fn session_index_checked_only_in_backing() {
574
576
& Default :: default ( ) ,
575
577
Default :: default ( ) ,
576
578
VALIDATION_CODE_BOMB_LIMIT ,
579
+ Default :: default ( ) ,
577
580
) )
578
581
. unwrap ( ) ;
579
582
@@ -673,6 +676,7 @@ fn candidate_validation_ok_is_ok(#[case] v2_descriptor: bool) {
673
676
& Default :: default ( ) ,
674
677
Some ( ClaimQueueSnapshot ( cq) ) ,
675
678
VALIDATION_CODE_BOMB_LIMIT ,
679
+ Some ( Default :: default ( ) ) ,
676
680
) )
677
681
. unwrap ( ) ;
678
682
@@ -752,6 +756,7 @@ fn invalid_session_or_core_index() {
752
756
& Default :: default ( ) ,
753
757
Default :: default ( ) ,
754
758
VALIDATION_CODE_BOMB_LIMIT ,
759
+ Some ( Default :: default ( ) ) ,
755
760
) )
756
761
. unwrap ( ) ;
757
762
@@ -769,6 +774,7 @@ fn invalid_session_or_core_index() {
769
774
& Default :: default ( ) ,
770
775
Default :: default ( ) ,
771
776
VALIDATION_CODE_BOMB_LIMIT ,
777
+ Some ( Default :: default ( ) ) ,
772
778
) )
773
779
. unwrap ( ) ;
774
780
@@ -788,9 +794,15 @@ fn invalid_session_or_core_index() {
788
794
& Default :: default ( ) ,
789
795
Some ( Default :: default ( ) ) ,
790
796
VALIDATION_CODE_BOMB_LIMIT ,
797
+ Some ( Default :: default ( ) ) ,
791
798
) )
792
799
. unwrap ( ) ;
793
- assert_matches ! ( result, ValidationResult :: Invalid ( InvalidCandidate :: InvalidCoreIndex ) ) ;
800
+ assert_matches ! (
801
+ result,
802
+ ValidationResult :: Invalid ( InvalidCandidate :: InvalidUMPSignals (
803
+ CommittedCandidateReceiptError :: NoAssignment
804
+ ) )
805
+ ) ;
794
806
795
807
let result = executor:: block_on ( validate_candidate_exhaustive (
796
808
1 ,
@@ -804,9 +816,15 @@ fn invalid_session_or_core_index() {
804
816
& Default :: default ( ) ,
805
817
Some ( Default :: default ( ) ) ,
806
818
VALIDATION_CODE_BOMB_LIMIT ,
819
+ Some ( Default :: default ( ) ) ,
807
820
) )
808
821
. unwrap ( ) ;
809
- assert_matches ! ( result, ValidationResult :: Invalid ( InvalidCandidate :: InvalidCoreIndex ) ) ;
822
+ assert_matches ! (
823
+ result,
824
+ ValidationResult :: Invalid ( InvalidCandidate :: InvalidUMPSignals (
825
+ CommittedCandidateReceiptError :: NoAssignment
826
+ ) )
827
+ ) ;
810
828
811
829
let v = executor:: block_on ( validate_candidate_exhaustive (
812
830
1 ,
@@ -820,6 +838,7 @@ fn invalid_session_or_core_index() {
820
838
& Default :: default ( ) ,
821
839
Default :: default ( ) ,
822
840
VALIDATION_CODE_BOMB_LIMIT ,
841
+ Default :: default ( ) ,
823
842
) )
824
843
. unwrap ( ) ;
825
844
@@ -846,6 +865,7 @@ fn invalid_session_or_core_index() {
846
865
& Default :: default ( ) ,
847
866
Default :: default ( ) ,
848
867
VALIDATION_CODE_BOMB_LIMIT ,
868
+ Default :: default ( ) ,
849
869
) )
850
870
. unwrap ( ) ;
851
871
@@ -876,6 +896,7 @@ fn invalid_session_or_core_index() {
876
896
& Default :: default ( ) ,
877
897
Some ( ClaimQueueSnapshot ( cq. clone ( ) ) ) ,
878
898
VALIDATION_CODE_BOMB_LIMIT ,
899
+ Some ( Default :: default ( ) ) ,
879
900
) )
880
901
. unwrap ( ) ;
881
902
@@ -900,6 +921,7 @@ fn invalid_session_or_core_index() {
900
921
& Default :: default ( ) ,
901
922
Some ( ClaimQueueSnapshot ( cq) ) ,
902
923
VALIDATION_CODE_BOMB_LIMIT ,
924
+ Some ( Default :: default ( ) ) ,
903
925
) )
904
926
. unwrap ( ) ;
905
927
@@ -945,9 +967,15 @@ fn invalid_session_or_core_index() {
945
967
& Default :: default ( ) ,
946
968
Some ( Default :: default ( ) ) ,
947
969
VALIDATION_CODE_BOMB_LIMIT ,
970
+ Some ( Default :: default ( ) ) ,
948
971
) )
949
972
. unwrap ( ) ;
950
- assert_matches ! ( result, ValidationResult :: Invalid ( InvalidCandidate :: InvalidCoreIndex ) ) ;
973
+ assert_matches ! (
974
+ result,
975
+ ValidationResult :: Invalid ( InvalidCandidate :: InvalidUMPSignals (
976
+ CommittedCandidateReceiptError :: UMPSignalWithV1Decriptor
977
+ ) )
978
+ ) ;
951
979
}
952
980
953
981
// Validation doesn't fail for approvals and disputes, core/session index is not checked.
@@ -964,6 +992,7 @@ fn invalid_session_or_core_index() {
964
992
& Default :: default ( ) ,
965
993
Default :: default ( ) ,
966
994
VALIDATION_CODE_BOMB_LIMIT ,
995
+ Default :: default ( ) ,
967
996
) )
968
997
. unwrap ( ) ;
969
998
@@ -1021,6 +1050,7 @@ fn candidate_validation_bad_return_is_invalid() {
1021
1050
& Default :: default ( ) ,
1022
1051
Default :: default ( ) ,
1023
1052
VALIDATION_CODE_BOMB_LIMIT ,
1053
+ Default :: default ( ) ,
1024
1054
) )
1025
1055
. unwrap ( ) ;
1026
1056
@@ -1106,6 +1136,7 @@ fn candidate_validation_one_ambiguous_error_is_valid() {
1106
1136
& Default :: default ( ) ,
1107
1137
Default :: default ( ) ,
1108
1138
VALIDATION_CODE_BOMB_LIMIT ,
1139
+ Default :: default ( ) ,
1109
1140
) )
1110
1141
. unwrap ( ) ;
1111
1142
@@ -1150,6 +1181,7 @@ fn candidate_validation_multiple_ambiguous_errors_is_invalid() {
1150
1181
& Default :: default ( ) ,
1151
1182
Default :: default ( ) ,
1152
1183
VALIDATION_CODE_BOMB_LIMIT ,
1184
+ Default :: default ( ) ,
1153
1185
) )
1154
1186
. unwrap ( ) ;
1155
1187
@@ -1268,6 +1300,7 @@ fn candidate_validation_retry_on_error_helper(
1268
1300
& Default :: default ( ) ,
1269
1301
Default :: default ( ) ,
1270
1302
VALIDATION_CODE_BOMB_LIMIT ,
1303
+ Default :: default ( ) ,
1271
1304
) )
1272
1305
}
1273
1306
@@ -1314,6 +1347,7 @@ fn candidate_validation_timeout_is_internal_error() {
1314
1347
& Default :: default ( ) ,
1315
1348
Default :: default ( ) ,
1316
1349
VALIDATION_CODE_BOMB_LIMIT ,
1350
+ Default :: default ( ) ,
1317
1351
) ) ;
1318
1352
1319
1353
assert_matches ! ( v, Ok ( ValidationResult :: Invalid ( InvalidCandidate :: Timeout ) ) ) ;
@@ -1364,6 +1398,7 @@ fn candidate_validation_commitment_hash_mismatch_is_invalid() {
1364
1398
& Default :: default ( ) ,
1365
1399
Default :: default ( ) ,
1366
1400
VALIDATION_CODE_BOMB_LIMIT ,
1401
+ Default :: default ( ) ,
1367
1402
) )
1368
1403
. unwrap ( ) ;
1369
1404
@@ -1417,6 +1452,7 @@ fn candidate_validation_code_mismatch_is_invalid() {
1417
1452
& Default :: default ( ) ,
1418
1453
Default :: default ( ) ,
1419
1454
VALIDATION_CODE_BOMB_LIMIT ,
1455
+ Default :: default ( ) ,
1420
1456
) )
1421
1457
. unwrap ( ) ;
1422
1458
@@ -1479,6 +1515,7 @@ fn compressed_code_works() {
1479
1515
& Default :: default ( ) ,
1480
1516
Some ( Default :: default ( ) ) ,
1481
1517
VALIDATION_CODE_BOMB_LIMIT ,
1518
+ Some ( Default :: default ( ) ) ,
1482
1519
) ) ;
1483
1520
1484
1521
assert_matches ! ( v, Ok ( ValidationResult :: Valid ( _, _) ) ) ;
0 commit comments