sui_core/authority/
epoch_start_configuration.rs

1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4use enum_dispatch::enum_dispatch;
5use serde::{Deserialize, Serialize};
6use sui_config::NodeConfig;
7use sui_types::accumulator_root::get_accumulator_root_obj_initial_shared_version;
8use sui_types::address_alias::get_address_alias_state_obj_initial_shared_version;
9use sui_types::display_registry::get_display_registry_obj_initial_shared_version;
10
11use std::fmt;
12use sui_types::authenticator_state::get_authenticator_state_obj_initial_shared_version;
13use sui_types::base_types::SequenceNumber;
14use sui_types::bridge::{get_bridge_obj_initial_shared_version, is_bridge_committee_initiated};
15use sui_types::coin_registry::get_coin_registry_obj_initial_shared_version;
16use sui_types::deny_list_v1::get_deny_list_obj_initial_shared_version;
17use sui_types::epoch_data::EpochData;
18use sui_types::error::SuiResult;
19use sui_types::messages_checkpoint::{CheckpointDigest, CheckpointTimestamp};
20use sui_types::randomness_state::get_randomness_state_obj_initial_shared_version;
21use sui_types::storage::ObjectStore;
22use sui_types::sui_system_state::epoch_start_sui_system_state::{
23    EpochStartSystemState, EpochStartSystemStateTrait,
24};
25
26#[enum_dispatch]
27pub trait EpochStartConfigTrait {
28    fn epoch_digest(&self) -> CheckpointDigest;
29    fn epoch_start_state(&self) -> &EpochStartSystemState;
30    fn flags(&self) -> &[EpochFlag];
31    fn authenticator_obj_initial_shared_version(&self) -> Option<SequenceNumber>;
32    fn randomness_obj_initial_shared_version(&self) -> Option<SequenceNumber>;
33    fn coin_deny_list_obj_initial_shared_version(&self) -> Option<SequenceNumber>;
34    fn bridge_obj_initial_shared_version(&self) -> Option<SequenceNumber>;
35    fn bridge_committee_initiated(&self) -> bool;
36    fn accumulator_root_obj_initial_shared_version(&self) -> Option<SequenceNumber>;
37    fn coin_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber>;
38    fn display_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber>;
39    fn address_alias_state_obj_initial_shared_version(&self) -> Option<SequenceNumber>;
40}
41
42// IMPORTANT: Assign explicit values to each variant to ensure that the values are stable.
43// When cherry-picking changes from one branch to another, the value of variants must never
44// change.
45//
46// Unlikely: If you cherry pick a change from one branch to another, and there is a collision
47// in the value of some variant, the branch which has been released should take precedence.
48// In this case, the picked-from branch is inconsistent with the released branch, and must
49// be fixed.
50#[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq, Ord, PartialOrd)]
51pub enum EpochFlag {
52    // The deprecated flags have all been in production for long enough that
53    // we have deleted the old code paths they were guarding.
54    // We retain them here in order not to break deserialization.
55    _InMemoryCheckpointRootsDeprecated = 0,
56    _PerEpochFinalizedTransactionsDeprecated = 1,
57    _ObjectLockSplitTablesDeprecated = 2,
58    _WritebackCacheEnabledDeprecated = 3,
59    _GlobalStateHashV2EnabledDeprecated = 4,
60    _GlobalStateHashV2EnabledTestnetDeprecated = 5,
61    _GlobalStateHashV2EnabledMainnetDeprecated = 6,
62    _ExecutedInEpochTableDeprecated = 7,
63    _UseVersionAssignmentTablesV3 = 8,
64    _DataQuarantineFromBeginningOfEpochDeprecated = 9,
65    _UseCommitHandlerV2Deprecated = 10,
66
67    // Used for `test_epoch_flag_upgrade`.
68    #[cfg(msim)]
69    DummyFlag = 11,
70}
71
72impl EpochFlag {
73    pub fn default_flags_for_new_epoch(_config: &NodeConfig) -> Vec<Self> {
74        // NodeConfig arg is not currently used, but we keep it here for future
75        // flags that might depend on the config.
76        Self::default_flags_impl()
77    }
78
79    // Return flags that are mandatory for the current version of the code. This is used
80    // so that `test_epoch_flag_upgrade` can still work correctly even when there are no
81    // optional flags.
82    pub fn mandatory_flags() -> Vec<Self> {
83        vec![]
84    }
85
86    /// For situations in which there is no config available (e.g. setting up a downloaded snapshot).
87    pub fn default_for_no_config() -> Vec<Self> {
88        Self::default_flags_impl()
89    }
90
91    fn default_flags_impl() -> Vec<Self> {
92        #[cfg(msim)]
93        {
94            vec![EpochFlag::DummyFlag]
95        }
96        #[cfg(not(msim))]
97        {
98            vec![]
99        }
100    }
101}
102
103impl fmt::Display for EpochFlag {
104    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
105        // Important - implementation should return low cardinality values because this is used as metric key
106        match self {
107            EpochFlag::_InMemoryCheckpointRootsDeprecated => {
108                write!(f, "InMemoryCheckpointRoots (DEPRECATED)")
109            }
110            EpochFlag::_PerEpochFinalizedTransactionsDeprecated => {
111                write!(f, "PerEpochFinalizedTransactions (DEPRECATED)")
112            }
113            EpochFlag::_ObjectLockSplitTablesDeprecated => {
114                write!(f, "ObjectLockSplitTables (DEPRECATED)")
115            }
116            EpochFlag::_WritebackCacheEnabledDeprecated => {
117                write!(f, "WritebackCacheEnabled (DEPRECATED)")
118            }
119            EpochFlag::_GlobalStateHashV2EnabledDeprecated => {
120                write!(f, "GlobalStateHashV2EnabledDeprecated (DEPRECATED)")
121            }
122            EpochFlag::_ExecutedInEpochTableDeprecated => {
123                write!(f, "ExecutedInEpochTable (DEPRECATED)")
124            }
125            EpochFlag::_GlobalStateHashV2EnabledTestnetDeprecated => {
126                write!(f, "GlobalStateHashV2EnabledTestnet (DEPRECATED)")
127            }
128            EpochFlag::_GlobalStateHashV2EnabledMainnetDeprecated => {
129                write!(f, "GlobalStateHashV2EnabledMainnet (DEPRECATED)")
130            }
131            EpochFlag::_UseVersionAssignmentTablesV3 => {
132                write!(f, "UseVersionAssignmentTablesV3 (DEPRECATED)")
133            }
134            EpochFlag::_DataQuarantineFromBeginningOfEpochDeprecated => {
135                write!(f, "DataQuarantineFromBeginningOfEpoch (DEPRECATED)")
136            }
137            EpochFlag::_UseCommitHandlerV2Deprecated => {
138                write!(f, "UseCommitHandlerV2 (DEPRECATED)")
139            }
140            #[cfg(msim)]
141            EpochFlag::DummyFlag => {
142                write!(f, "DummyFlag")
143            }
144        }
145    }
146}
147
148/// Parameters of the epoch fixed at epoch start.
149#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
150#[enum_dispatch(EpochStartConfigTrait)]
151pub enum EpochStartConfiguration {
152    V1(EpochStartConfigurationV1),
153    V2(EpochStartConfigurationV2),
154    V3(EpochStartConfigurationV3),
155    V4(EpochStartConfigurationV4),
156    V5(EpochStartConfigurationV5),
157    V6(EpochStartConfigurationV6),
158    V7(EpochStartConfigurationV7),
159    V8(EpochStartConfigurationV8),
160    V9(EpochStartConfigurationV9),
161    V10(EpochStartConfigurationV10),
162}
163
164impl EpochStartConfiguration {
165    pub fn new(
166        system_state: EpochStartSystemState,
167        epoch_digest: CheckpointDigest,
168        object_store: &dyn ObjectStore,
169        initial_epoch_flags: Vec<EpochFlag>,
170    ) -> SuiResult<Self> {
171        let authenticator_obj_initial_shared_version =
172            get_authenticator_state_obj_initial_shared_version(object_store)?;
173        let randomness_obj_initial_shared_version =
174            get_randomness_state_obj_initial_shared_version(object_store)?;
175        let coin_deny_list_obj_initial_shared_version =
176            get_deny_list_obj_initial_shared_version(object_store);
177        let bridge_obj_initial_shared_version =
178            get_bridge_obj_initial_shared_version(object_store)?;
179        let accumulator_root_obj_initial_shared_version =
180            get_accumulator_root_obj_initial_shared_version(object_store)?;
181        let coin_registry_obj_initial_shared_version =
182            get_coin_registry_obj_initial_shared_version(object_store)?;
183        let display_registry_obj_initial_shared_version =
184            get_display_registry_obj_initial_shared_version(object_store)?;
185        let address_alias_state_obj_initial_shared_version =
186            get_address_alias_state_obj_initial_shared_version(object_store)?;
187        let bridge_committee_initiated = is_bridge_committee_initiated(object_store)?;
188        Ok(Self::V10(EpochStartConfigurationV10 {
189            system_state,
190            epoch_digest,
191            flags: initial_epoch_flags,
192            authenticator_obj_initial_shared_version,
193            randomness_obj_initial_shared_version,
194            coin_deny_list_obj_initial_shared_version,
195            bridge_obj_initial_shared_version,
196            bridge_committee_initiated,
197            accumulator_root_obj_initial_shared_version,
198            coin_registry_obj_initial_shared_version,
199            display_registry_obj_initial_shared_version,
200            address_alias_state_obj_initial_shared_version,
201        }))
202    }
203
204    pub fn new_at_next_epoch_for_testing(&self) -> Self {
205        // We only need to implement this function for the latest version.
206        // When a new version is introduced, this function should be updated.
207        match self {
208            Self::V10(config) => Self::V10(EpochStartConfigurationV10 {
209                system_state: config.system_state.new_at_next_epoch_for_testing(),
210                epoch_digest: config.epoch_digest,
211                flags: config.flags.clone(),
212                authenticator_obj_initial_shared_version: config
213                    .authenticator_obj_initial_shared_version,
214                randomness_obj_initial_shared_version: config.randomness_obj_initial_shared_version,
215                coin_deny_list_obj_initial_shared_version: config
216                    .coin_deny_list_obj_initial_shared_version,
217                bridge_obj_initial_shared_version: config.bridge_obj_initial_shared_version,
218                bridge_committee_initiated: config.bridge_committee_initiated,
219                accumulator_root_obj_initial_shared_version: config
220                    .accumulator_root_obj_initial_shared_version,
221                coin_registry_obj_initial_shared_version: config
222                    .coin_registry_obj_initial_shared_version,
223                display_registry_obj_initial_shared_version: config
224                    .display_registry_obj_initial_shared_version,
225                address_alias_state_obj_initial_shared_version: config
226                    .address_alias_state_obj_initial_shared_version,
227            }),
228            _ => panic!(
229                "This function is only implemented for the latest version of EpochStartConfiguration"
230            ),
231        }
232    }
233
234    pub fn epoch_data(&self) -> EpochData {
235        EpochData::new(
236            self.epoch_start_state().epoch(),
237            self.epoch_start_state().epoch_start_timestamp_ms(),
238            self.epoch_digest(),
239        )
240    }
241
242    pub fn epoch_start_timestamp_ms(&self) -> CheckpointTimestamp {
243        self.epoch_start_state().epoch_start_timestamp_ms()
244    }
245}
246
247#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
248pub struct EpochStartConfigurationV1 {
249    system_state: EpochStartSystemState,
250    /// epoch_digest is defined as following
251    /// (1) For the genesis epoch it is set to 0
252    /// (2) For all other epochs it is a digest of the last checkpoint of a previous epoch
253    /// Note that this is in line with how epoch start timestamp is defined
254    epoch_digest: CheckpointDigest,
255}
256
257#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
258pub struct EpochStartConfigurationV2 {
259    system_state: EpochStartSystemState,
260    epoch_digest: CheckpointDigest,
261    flags: Vec<EpochFlag>,
262}
263
264#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
265pub struct EpochStartConfigurationV3 {
266    system_state: EpochStartSystemState,
267    epoch_digest: CheckpointDigest,
268    flags: Vec<EpochFlag>,
269    /// Does the authenticator state object exist at the beginning of the epoch?
270    authenticator_obj_initial_shared_version: Option<SequenceNumber>,
271}
272
273#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
274pub struct EpochStartConfigurationV4 {
275    system_state: EpochStartSystemState,
276    epoch_digest: CheckpointDigest,
277    flags: Vec<EpochFlag>,
278    /// Do the state objects exist at the beginning of the epoch?
279    authenticator_obj_initial_shared_version: Option<SequenceNumber>,
280    randomness_obj_initial_shared_version: Option<SequenceNumber>,
281}
282
283#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
284pub struct EpochStartConfigurationV5 {
285    system_state: EpochStartSystemState,
286    epoch_digest: CheckpointDigest,
287    flags: Vec<EpochFlag>,
288    /// Do the state objects exist at the beginning of the epoch?
289    authenticator_obj_initial_shared_version: Option<SequenceNumber>,
290    randomness_obj_initial_shared_version: Option<SequenceNumber>,
291    coin_deny_list_obj_initial_shared_version: Option<SequenceNumber>,
292}
293
294#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
295pub struct EpochStartConfigurationV6 {
296    system_state: EpochStartSystemState,
297    epoch_digest: CheckpointDigest,
298    flags: Vec<EpochFlag>,
299    /// Do the state objects exist at the beginning of the epoch?
300    authenticator_obj_initial_shared_version: Option<SequenceNumber>,
301    randomness_obj_initial_shared_version: Option<SequenceNumber>,
302    coin_deny_list_obj_initial_shared_version: Option<SequenceNumber>,
303    bridge_obj_initial_shared_version: Option<SequenceNumber>,
304    bridge_committee_initiated: bool,
305}
306
307#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
308pub struct EpochStartConfigurationV7 {
309    system_state: EpochStartSystemState,
310    epoch_digest: CheckpointDigest,
311    flags: Vec<EpochFlag>,
312    /// Do the state objects exist at the beginning of the epoch?
313    authenticator_obj_initial_shared_version: Option<SequenceNumber>,
314    randomness_obj_initial_shared_version: Option<SequenceNumber>,
315    coin_deny_list_obj_initial_shared_version: Option<SequenceNumber>,
316    bridge_obj_initial_shared_version: Option<SequenceNumber>,
317    bridge_committee_initiated: bool,
318    accumulator_root_obj_initial_shared_version: Option<SequenceNumber>,
319}
320
321#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
322pub struct EpochStartConfigurationV8 {
323    system_state: EpochStartSystemState,
324    epoch_digest: CheckpointDigest,
325    flags: Vec<EpochFlag>,
326    /// Do the state objects exist at the beginning of the epoch?
327    authenticator_obj_initial_shared_version: Option<SequenceNumber>,
328    randomness_obj_initial_shared_version: Option<SequenceNumber>,
329    coin_deny_list_obj_initial_shared_version: Option<SequenceNumber>,
330    bridge_obj_initial_shared_version: Option<SequenceNumber>,
331    bridge_committee_initiated: bool,
332    accumulator_root_obj_initial_shared_version: Option<SequenceNumber>,
333    coin_registry_obj_initial_shared_version: Option<SequenceNumber>,
334}
335
336#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
337pub struct EpochStartConfigurationV9 {
338    system_state: EpochStartSystemState,
339    epoch_digest: CheckpointDigest,
340    flags: Vec<EpochFlag>,
341    /// Do the state objects exist at the beginning of the epoch?
342    authenticator_obj_initial_shared_version: Option<SequenceNumber>,
343    randomness_obj_initial_shared_version: Option<SequenceNumber>,
344    coin_deny_list_obj_initial_shared_version: Option<SequenceNumber>,
345    bridge_obj_initial_shared_version: Option<SequenceNumber>,
346    bridge_committee_initiated: bool,
347    accumulator_root_obj_initial_shared_version: Option<SequenceNumber>,
348    coin_registry_obj_initial_shared_version: Option<SequenceNumber>,
349    display_registry_obj_initial_shared_version: Option<SequenceNumber>,
350}
351
352#[derive(Serialize, Deserialize, Debug, Eq, PartialEq)]
353pub struct EpochStartConfigurationV10 {
354    system_state: EpochStartSystemState,
355    epoch_digest: CheckpointDigest,
356    flags: Vec<EpochFlag>,
357    /// Do the state objects exist at the beginning of the epoch?
358    authenticator_obj_initial_shared_version: Option<SequenceNumber>,
359    randomness_obj_initial_shared_version: Option<SequenceNumber>,
360    coin_deny_list_obj_initial_shared_version: Option<SequenceNumber>,
361    bridge_obj_initial_shared_version: Option<SequenceNumber>,
362    bridge_committee_initiated: bool,
363    accumulator_root_obj_initial_shared_version: Option<SequenceNumber>,
364    coin_registry_obj_initial_shared_version: Option<SequenceNumber>,
365    display_registry_obj_initial_shared_version: Option<SequenceNumber>,
366    address_alias_state_obj_initial_shared_version: Option<SequenceNumber>,
367}
368
369impl EpochStartConfigurationV1 {
370    pub fn new(system_state: EpochStartSystemState, epoch_digest: CheckpointDigest) -> Self {
371        Self {
372            system_state,
373            epoch_digest,
374        }
375    }
376}
377
378impl EpochStartConfigTrait for EpochStartConfigurationV1 {
379    fn epoch_digest(&self) -> CheckpointDigest {
380        self.epoch_digest
381    }
382
383    fn epoch_start_state(&self) -> &EpochStartSystemState {
384        &self.system_state
385    }
386
387    fn flags(&self) -> &[EpochFlag] {
388        &[]
389    }
390
391    fn authenticator_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
392        None
393    }
394
395    fn randomness_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
396        None
397    }
398
399    fn coin_deny_list_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
400        None
401    }
402
403    fn bridge_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
404        None
405    }
406
407    fn accumulator_root_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
408        None
409    }
410
411    fn coin_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
412        None
413    }
414
415    fn bridge_committee_initiated(&self) -> bool {
416        false
417    }
418
419    fn display_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
420        None
421    }
422
423    fn address_alias_state_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
424        None
425    }
426}
427
428impl EpochStartConfigTrait for EpochStartConfigurationV2 {
429    fn epoch_digest(&self) -> CheckpointDigest {
430        self.epoch_digest
431    }
432
433    fn epoch_start_state(&self) -> &EpochStartSystemState {
434        &self.system_state
435    }
436
437    fn flags(&self) -> &[EpochFlag] {
438        &self.flags
439    }
440
441    fn authenticator_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
442        None
443    }
444
445    fn randomness_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
446        None
447    }
448
449    fn coin_deny_list_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
450        None
451    }
452
453    fn bridge_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
454        None
455    }
456
457    fn bridge_committee_initiated(&self) -> bool {
458        false
459    }
460
461    fn accumulator_root_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
462        None
463    }
464
465    fn coin_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
466        None
467    }
468
469    fn display_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
470        None
471    }
472
473    fn address_alias_state_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
474        None
475    }
476}
477
478impl EpochStartConfigTrait for EpochStartConfigurationV3 {
479    fn epoch_digest(&self) -> CheckpointDigest {
480        self.epoch_digest
481    }
482
483    fn epoch_start_state(&self) -> &EpochStartSystemState {
484        &self.system_state
485    }
486
487    fn flags(&self) -> &[EpochFlag] {
488        &self.flags
489    }
490
491    fn authenticator_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
492        self.authenticator_obj_initial_shared_version
493    }
494
495    fn randomness_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
496        None
497    }
498
499    fn coin_deny_list_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
500        None
501    }
502
503    fn bridge_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
504        None
505    }
506    fn bridge_committee_initiated(&self) -> bool {
507        false
508    }
509
510    fn accumulator_root_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
511        None
512    }
513
514    fn coin_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
515        None
516    }
517
518    fn display_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
519        None
520    }
521
522    fn address_alias_state_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
523        None
524    }
525}
526
527impl EpochStartConfigTrait for EpochStartConfigurationV4 {
528    fn epoch_digest(&self) -> CheckpointDigest {
529        self.epoch_digest
530    }
531
532    fn epoch_start_state(&self) -> &EpochStartSystemState {
533        &self.system_state
534    }
535
536    fn flags(&self) -> &[EpochFlag] {
537        &self.flags
538    }
539
540    fn authenticator_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
541        self.authenticator_obj_initial_shared_version
542    }
543
544    fn randomness_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
545        self.randomness_obj_initial_shared_version
546    }
547
548    fn coin_deny_list_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
549        None
550    }
551
552    fn bridge_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
553        None
554    }
555
556    fn bridge_committee_initiated(&self) -> bool {
557        false
558    }
559
560    fn accumulator_root_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
561        None
562    }
563
564    fn coin_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
565        None
566    }
567
568    fn display_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
569        None
570    }
571
572    fn address_alias_state_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
573        None
574    }
575}
576
577impl EpochStartConfigTrait for EpochStartConfigurationV5 {
578    fn epoch_digest(&self) -> CheckpointDigest {
579        self.epoch_digest
580    }
581
582    fn epoch_start_state(&self) -> &EpochStartSystemState {
583        &self.system_state
584    }
585
586    fn flags(&self) -> &[EpochFlag] {
587        &self.flags
588    }
589
590    fn authenticator_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
591        self.authenticator_obj_initial_shared_version
592    }
593
594    fn randomness_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
595        self.randomness_obj_initial_shared_version
596    }
597
598    fn coin_deny_list_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
599        self.coin_deny_list_obj_initial_shared_version
600    }
601
602    fn bridge_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
603        None
604    }
605    fn bridge_committee_initiated(&self) -> bool {
606        false
607    }
608
609    fn accumulator_root_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
610        None
611    }
612
613    fn coin_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
614        None
615    }
616
617    fn display_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
618        None
619    }
620
621    fn address_alias_state_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
622        None
623    }
624}
625
626impl EpochStartConfigTrait for EpochStartConfigurationV6 {
627    fn epoch_digest(&self) -> CheckpointDigest {
628        self.epoch_digest
629    }
630
631    fn epoch_start_state(&self) -> &EpochStartSystemState {
632        &self.system_state
633    }
634
635    fn flags(&self) -> &[EpochFlag] {
636        &self.flags
637    }
638
639    fn authenticator_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
640        self.authenticator_obj_initial_shared_version
641    }
642
643    fn randomness_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
644        self.randomness_obj_initial_shared_version
645    }
646
647    fn coin_deny_list_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
648        self.coin_deny_list_obj_initial_shared_version
649    }
650
651    fn bridge_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
652        self.bridge_obj_initial_shared_version
653    }
654
655    fn bridge_committee_initiated(&self) -> bool {
656        self.bridge_committee_initiated
657    }
658
659    fn accumulator_root_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
660        None
661    }
662
663    fn coin_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
664        None
665    }
666
667    fn display_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
668        None
669    }
670
671    fn address_alias_state_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
672        None
673    }
674}
675
676impl EpochStartConfigTrait for EpochStartConfigurationV7 {
677    fn epoch_digest(&self) -> CheckpointDigest {
678        self.epoch_digest
679    }
680
681    fn epoch_start_state(&self) -> &EpochStartSystemState {
682        &self.system_state
683    }
684
685    fn flags(&self) -> &[EpochFlag] {
686        &self.flags
687    }
688
689    fn authenticator_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
690        self.authenticator_obj_initial_shared_version
691    }
692
693    fn randomness_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
694        self.randomness_obj_initial_shared_version
695    }
696
697    fn coin_deny_list_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
698        self.coin_deny_list_obj_initial_shared_version
699    }
700
701    fn bridge_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
702        self.bridge_obj_initial_shared_version
703    }
704
705    fn bridge_committee_initiated(&self) -> bool {
706        self.bridge_committee_initiated
707    }
708
709    fn accumulator_root_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
710        self.accumulator_root_obj_initial_shared_version
711    }
712
713    fn coin_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
714        None
715    }
716
717    fn display_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
718        None
719    }
720
721    fn address_alias_state_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
722        None
723    }
724}
725
726impl EpochStartConfigTrait for EpochStartConfigurationV8 {
727    fn epoch_digest(&self) -> CheckpointDigest {
728        self.epoch_digest
729    }
730
731    fn epoch_start_state(&self) -> &EpochStartSystemState {
732        &self.system_state
733    }
734
735    fn flags(&self) -> &[EpochFlag] {
736        &self.flags
737    }
738
739    fn authenticator_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
740        self.authenticator_obj_initial_shared_version
741    }
742
743    fn randomness_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
744        self.randomness_obj_initial_shared_version
745    }
746
747    fn coin_deny_list_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
748        self.coin_deny_list_obj_initial_shared_version
749    }
750
751    fn bridge_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
752        self.bridge_obj_initial_shared_version
753    }
754
755    fn bridge_committee_initiated(&self) -> bool {
756        self.bridge_committee_initiated
757    }
758
759    fn accumulator_root_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
760        self.accumulator_root_obj_initial_shared_version
761    }
762
763    fn coin_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
764        self.coin_registry_obj_initial_shared_version
765    }
766
767    fn display_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
768        None
769    }
770
771    fn address_alias_state_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
772        None
773    }
774}
775
776impl EpochStartConfigTrait for EpochStartConfigurationV9 {
777    fn epoch_digest(&self) -> CheckpointDigest {
778        self.epoch_digest
779    }
780
781    fn epoch_start_state(&self) -> &EpochStartSystemState {
782        &self.system_state
783    }
784
785    fn flags(&self) -> &[EpochFlag] {
786        &self.flags
787    }
788
789    fn authenticator_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
790        self.authenticator_obj_initial_shared_version
791    }
792
793    fn randomness_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
794        self.randomness_obj_initial_shared_version
795    }
796
797    fn coin_deny_list_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
798        self.coin_deny_list_obj_initial_shared_version
799    }
800
801    fn bridge_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
802        self.bridge_obj_initial_shared_version
803    }
804
805    fn bridge_committee_initiated(&self) -> bool {
806        self.bridge_committee_initiated
807    }
808
809    fn accumulator_root_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
810        self.accumulator_root_obj_initial_shared_version
811    }
812
813    fn coin_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
814        self.coin_registry_obj_initial_shared_version
815    }
816
817    fn display_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
818        self.display_registry_obj_initial_shared_version
819    }
820
821    fn address_alias_state_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
822        None
823    }
824}
825
826impl EpochStartConfigTrait for EpochStartConfigurationV10 {
827    fn epoch_digest(&self) -> CheckpointDigest {
828        self.epoch_digest
829    }
830
831    fn epoch_start_state(&self) -> &EpochStartSystemState {
832        &self.system_state
833    }
834
835    fn flags(&self) -> &[EpochFlag] {
836        &self.flags
837    }
838
839    fn authenticator_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
840        self.authenticator_obj_initial_shared_version
841    }
842
843    fn randomness_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
844        self.randomness_obj_initial_shared_version
845    }
846
847    fn coin_deny_list_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
848        self.coin_deny_list_obj_initial_shared_version
849    }
850
851    fn bridge_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
852        self.bridge_obj_initial_shared_version
853    }
854
855    fn bridge_committee_initiated(&self) -> bool {
856        self.bridge_committee_initiated
857    }
858
859    fn accumulator_root_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
860        self.accumulator_root_obj_initial_shared_version
861    }
862
863    fn coin_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
864        self.coin_registry_obj_initial_shared_version
865    }
866
867    fn display_registry_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
868        self.display_registry_obj_initial_shared_version
869    }
870
871    fn address_alias_state_obj_initial_shared_version(&self) -> Option<SequenceNumber> {
872        self.address_alias_state_obj_initial_shared_version
873    }
874}