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