File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ impl From<&proto::FeatureSet> for FeatureSet {
3535 let mut feature_set = FeatureSet :: default ( ) ;
3636 for id in & input. features {
3737 if let Some ( pubkey) = INDEXED_FEATURES . get ( id) {
38+ if !crate :: SUPPORTED_FEATURES . contains ( id)
39+ && !crate :: HARDCODED_FEATURES . contains ( id)
40+ {
41+ panic ! ( "Feature: ({}, {}) is not supported: " , pubkey, id) ;
42+ }
3843 feature_set. activate ( pubkey, 0 ) ;
3944 }
4045 }
@@ -78,3 +83,13 @@ pub const fn pchash_inverse(hash: u32) -> u32 {
7883 x = x. wrapping_mul ( 0xdee13bb1 ) ;
7984 x
8085}
86+
87+ #[ test]
88+ #[ should_panic( expected = "is not supported" ) ]
89+ fn test_reject_unsupported_feature ( ) {
90+ let unsupported_feature = feature_u64 ( & agave_feature_set:: reenable_sbpf_v0_execution:: id ( ) ) ;
91+ let proto_features = proto:: FeatureSet {
92+ features : vec ! [ unsupported_feature] ,
93+ } ;
94+ let _ = FeatureSet :: from ( & proto_features) ;
95+ }
You can’t perform that action at this time.
0 commit comments