Skip to content

Commit

Permalink
Update FlowEpoch.cdc
Browse files Browse the repository at this point in the history
  • Loading branch information
kc1116 committed Apr 26, 2024
1 parent cbb2885 commit ef46268
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions contracts/epochs/FlowEpoch.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -599,14 +599,16 @@ access(all) contract FlowEpoch {
FlowEpoch.borrowDKGAdmin().forceEndDKG()
}

// Calculate rewards for the current epoch
// and set the payout for the next epoch
/// Calculate rewards for the current epoch
/// and set the payout for the next epoch
FlowEpoch.calculateAndSetRewards()
// Start a new Epoch, which increments the current epoch counter
/// Start a new Epoch, which increments the current epoch counter
FlowEpoch.startNewEpoch()
// Emit the service event, which notifies the protocol state about the RecoveryEpoch

/// Create the recovery epoch metadata, this struct is used to hold
/// EpochRecover service event data.
let recoverEpochMetadata = FlowEpoch.RecoverEpochMetadata(
counter: FlowEpoch.currentEpochCounter,
counter: FlowEpoch.proposedEpochCounter(),
nodeIDs: nodeIDs,
firstView: startView,
finalView: endView,
Expand All @@ -621,11 +623,11 @@ access(all) contract FlowEpoch {
dkgPubKeys: dkgPubKeys,
)

/// save the recovery epoch metadata this will be emitted in the EpochRecover service event
/// Save the recovery epoch metadata to storage, this will be emitted in the EpochRecover service event
/// during the next heart beat interval.
FlowEpoch.account.storage.save(recoverEpochMetadata, to: /storage/recoverEpochMetadataStoragePath)

/// Create new metadata for the recovery epoch with the new values
/// Create new EpochMetadata for the recovery epoch with the new values
let newEpochMetadata = EpochMetadata(
/// When the network enters EFM the epoch counter will not be incremented
/// so it's safe to use current_epoch_counter + 1
Expand Down

0 comments on commit ef46268

Please sign in to comment.