Skip to content

Commit

Permalink
Merge pull request #1141 from FactomProject/AccumulateActivation
Browse files Browse the repository at this point in the history
Accumulate Activation
  • Loading branch information
PaulSnow authored Oct 25, 2022
2 parents 83d99e6 + 38cf0c2 commit 5a0cc0c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions activations/activationHeight.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const (
TESTNET_COINBASE_PERIOD = iota // 1 -- this is a passing activation and this ID may be reused once that height is passes and the references are removed
//
AUTHRORITY_SET_MAX_DELTA = iota
MAX_FACTOM_HEIGHT = iota
ACTIVATION_TYPE_COUNT = iota - 1 // Always Last
)

Expand Down Expand Up @@ -55,6 +56,15 @@ func init() {
"CUSTOM:fct_community_test": 109387,
},
},
{"FactomMaxHeight", MAX_FACTOM_HEIGHT,
"The maximum Height of the Factom Blockchain prior to Accumulate Activation",
math.MaxInt32, // Don't activate by default
map[string]int{ //
"MAIN": 374000, // The Last Block of the Factom ERA
"LOCAL": 400000, // Factom will continue processing into the next block, but
"CUSTOM:fct_community_test": 400000, // stop at minute 2. That last block will not be included
}, // in the History provided to the Accumulate ERA.
},
}

if ACTIVATION_TYPE_COUNT != len(activations) {
Expand Down
10 changes: 10 additions & 0 deletions state/stateConsensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,16 @@ func (s *State) LeaderExecuteEOM(m interfaces.IMsg) {
return
}

// ======================================================================================================
// When the maximum Factom Height is reached, stop the Factom Protocol. ||
// This ends the Factom Era, and begins the Accumulate Era ||
if s.IsActive(activations.MAX_FACTOM_HEIGHT) && s.GetCurrentMinute() > 1 { // ||
fmt.Printf("The End of the Factom Era: Block %d\n", s.GetEntryBlockDBHeightComplete()) // ||
fmt.Printf("The Beginning of the Accumulate Era\n") // ||
return // ||
} // ||
// ======================================================================================================

pl := s.ProcessLists.Get(s.LLeaderHeight)
vm := pl.VMs[s.LeaderVMIndex]

Expand Down

0 comments on commit 5a0cc0c

Please sign in to comment.