Skip to content

Commit

Permalink
Add teal3 consensus upgrade support; pending spec hash.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsachiherman committed Feb 18, 2021
1 parent e7b292d commit 8196a3d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
27 changes: 19 additions & 8 deletions config/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -853,12 +853,28 @@ func initConsensusProtocols() {
v25.EnableAssetCloseAmount = true
Consensus[protocol.ConsensusV25] = v25

// v24 can be upgraded to v25, with an update delay of 7 days ( see calculation above )
v24.ApprovedUpgrades[protocol.ConsensusV25] = 140000
// v26 adds support for teal3
v26 := v25
v26.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{}

// Enable the InitialRewardsRateCalculation fix
v26.InitialRewardsRateCalculation = true

// Enable transaction Merkle tree.
v26.PaysetCommit = PaysetCommitMerkle

// Enable teal3
v26.LogicSigVersion = 3

Consensus[protocol.ConsensusV26] = v26

// v25 or v24 can be upgraded to v26, with an update delay of 7 days ( see calculation above )
v25.ApprovedUpgrades[protocol.ConsensusV26] = 140000
v24.ApprovedUpgrades[protocol.ConsensusV26] = 140000

// ConsensusFuture is used to test features that are implemented
// but not yet released in a production protocol version.
vFuture := v25
vFuture := v26
vFuture.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{}

// FilterTimeout for period 0 should take a new optimized, configured value, need to revisit this later
Expand All @@ -871,11 +887,6 @@ func initConsensusProtocols() {
vFuture.CompactCertWeightThreshold = (1 << 32) * 30 / 100
vFuture.CompactCertSecKQ = 128

// enable the InitialRewardsRateCalculation fix
vFuture.InitialRewardsRateCalculation = true
// Enable transaction Merkle tree.
vFuture.PaysetCommit = PaysetCommitMerkle

Consensus[protocol.ConsensusFuture] = vFuture
}

Expand Down
5 changes: 5 additions & 0 deletions protocol/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ const ConsensusV25 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/bea19289bf41217d2c0af30522fa222ef1366466",
)

// ConsensusV26 adds support for teal3
const ConsensusV26 = ConsensusVersion(
"to-be-figured-out",
)

// ConsensusFuture is a protocol that should not appear in any production
// network, but is used to test features before they are released.
const ConsensusFuture = ConsensusVersion(
Expand Down

0 comments on commit 8196a3d

Please sign in to comment.