diff options
author | Tsachi Herman <tsachi.herman@algorand.com> | 2022-02-24 14:45:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-24 14:45:55 -0500 |
commit | 8e4da4980e1ff6fb597c693719506d2e015d3f33 (patch) | |
tree | c722f2d84c9f519cc3360cfcd1ea6410dfb591f2 | |
parent | 944448278430ee15aa39524454f99348645cdc31 (diff) |
ledger refactoring: make consensus upgrade (#3674)
## Summary
Create consensus upgrade to V32
## Test Plan
Use existing unit tests.
-rw-r--r-- | config/consensus.go | 46 | ||||
-rw-r--r-- | protocol/consensus.go | 7 |
2 files changed, 33 insertions, 20 deletions
diff --git a/config/consensus.go b/config/consensus.go index 4a61c11df..79617a805 100644 --- a/config/consensus.go +++ b/config/consensus.go @@ -1083,38 +1083,46 @@ func initConsensusProtocols() { // v30 can be upgraded to v31, with an update delay of 7 days ( see calculation above ) v30.ApprovedUpgrades[protocol.ConsensusV31] = 140000 - // ConsensusFuture is used to test features that are implemented - // but not yet released in a production protocol version. - vFuture := v31 - vFuture.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{} - - // FilterTimeout for period 0 should take a new optimized, configured value, need to revisit this later - vFuture.AgreementFilterTimeoutPeriod0 = 4 * time.Second - - // Enable compact certificates. - vFuture.CompactCertRounds = 256 - vFuture.CompactCertTopVoters = 1024 * 1024 - vFuture.CompactCertVotersLookback = 16 - vFuture.CompactCertWeightThreshold = (1 << 32) * 30 / 100 - vFuture.CompactCertSecKQ = 128 + v32 := v31 + v32.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{} // Enable extended application storage; binaries that contain support for this // flag would already be restructuring their internal storage for extended // application storage, and therefore would not produce catchpoints and/or // catchpoint labels prior to this feature being enabled. - vFuture.EnableAccountDataResourceSeparation = true + v32.EnableAccountDataResourceSeparation = true // Remove limits on MinimumBalance - vFuture.MaximumMinimumBalance = 0 + v32.MaximumMinimumBalance = 0 // Remove limits on assets / account. - vFuture.MaxAssetsPerAccount = 0 + v32.MaxAssetsPerAccount = 0 // Remove limits on maximum number of apps a single account can create - vFuture.MaxAppsCreated = 0 + v32.MaxAppsCreated = 0 // Remove limits on maximum number of apps a single account can opt into - vFuture.MaxAppsOptedIn = 0 + v32.MaxAppsOptedIn = 0 + + Consensus[protocol.ConsensusV32] = v32 + + // v31 can be upgraded to v32, with an update delay of 7 days ( see calculation above ) + v31.ApprovedUpgrades[protocol.ConsensusV32] = 140000 + + // ConsensusFuture is used to test features that are implemented + // but not yet released in a production protocol version. + vFuture := v32 + vFuture.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{} + + // FilterTimeout for period 0 should take a new optimized, configured value, need to revisit this later + vFuture.AgreementFilterTimeoutPeriod0 = 4 * time.Second + + // Enable compact certificates. + vFuture.CompactCertRounds = 256 + vFuture.CompactCertTopVoters = 1024 * 1024 + vFuture.CompactCertVotersLookback = 16 + vFuture.CompactCertWeightThreshold = (1 << 32) * 30 / 100 + vFuture.CompactCertSecKQ = 128 Consensus[protocol.ConsensusFuture] = vFuture } diff --git a/protocol/consensus.go b/protocol/consensus.go index 7b59ddcea..e37f2dbe6 100644 --- a/protocol/consensus.go +++ b/protocol/consensus.go @@ -171,6 +171,11 @@ const ConsensusV31 = ConsensusVersion( "https://github.com/algorandfoundation/specs/tree/85e6db1fdbdef00aa232c75199e10dc5fe9498f6", ) +// ConsensusV32 enables the unlimited assets. +const ConsensusV32 = ConsensusVersion( + "https://github.com/algorandfoundation/specs/tree/d5ac876d7ede07367dbaa26e149aa42589aac1f7", +) + // 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( @@ -183,7 +188,7 @@ const ConsensusFuture = ConsensusVersion( // ConsensusCurrentVersion is the latest version and should be used // when a specific version is not provided. -const ConsensusCurrentVersion = ConsensusV31 +const ConsensusCurrentVersion = ConsensusV32 // Error is used to indicate that an unsupported protocol has been detected. type Error ConsensusVersion |