@@ -68,6 +68,10 @@ pub enum EpochFlag {
68
68
// This flag indicates whether data quarantining has been enabled from the
69
69
// beginning of the epoch.
70
70
DataQuarantineFromBeginningOfEpoch = 9 ,
71
+
72
+ // Used for `test_epoch_flag_upgrade`.
73
+ #[ cfg( msim) ]
74
+ DummyFlag = 10 ,
71
75
}
72
76
73
77
impl EpochFlag {
@@ -77,6 +81,16 @@ impl EpochFlag {
77
81
Self :: default_flags_impl ( )
78
82
}
79
83
84
+ // Return flags that are mandatory for the current version of the code. This is used
85
+ // so that `test_epoch_flag_upgrade` can still work correctly even when there are no
86
+ // optional flags.
87
+ pub fn mandatory_flags ( ) -> Vec < Self > {
88
+ vec ! [
89
+ EpochFlag :: UseVersionAssignmentTablesV3 ,
90
+ EpochFlag :: DataQuarantineFromBeginningOfEpoch ,
91
+ ]
92
+ }
93
+
80
94
/// For situations in which there is no config available (e.g. setting up a downloaded snapshot).
81
95
pub fn default_for_no_config ( ) -> Vec < Self > {
82
96
Self :: default_flags_impl ( )
@@ -86,6 +100,8 @@ impl EpochFlag {
86
100
vec ! [
87
101
EpochFlag :: UseVersionAssignmentTablesV3 ,
88
102
EpochFlag :: DataQuarantineFromBeginningOfEpoch ,
103
+ #[ cfg( msim) ]
104
+ EpochFlag :: DummyFlag ,
89
105
]
90
106
}
91
107
}
@@ -124,6 +140,10 @@ impl fmt::Display for EpochFlag {
124
140
EpochFlag :: DataQuarantineFromBeginningOfEpoch => {
125
141
write ! ( f, "DataQuarantineFromBeginningOfEpoch" )
126
142
}
143
+ #[ cfg( msim) ]
144
+ EpochFlag :: DummyFlag => {
145
+ write ! ( f, "DummyFlag" )
146
+ }
127
147
}
128
148
}
129
149
}
0 commit comments