diff --git a/config/consensus.go b/config/consensus.go index b153848230..faa8f87f48 100644 --- a/config/consensus.go +++ b/config/consensus.go @@ -1512,30 +1512,42 @@ func initConsensusProtocols() { // but our current max is 150000 so using that : v38.ApprovedUpgrades[protocol.ConsensusV39] = 150000 - // ConsensusFuture is used to test features that are implemented - // but not yet released in a production protocol version. - vFuture := v39 - vFuture.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{} + v40 := v39 + v40.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{} - vFuture.LogicSigVersion = 11 // When moving this to a release, put a new higher LogicSigVersion here + v40.LogicSigVersion = 11 - vFuture.EnableLogicSigSizePooling = true + v40.EnableLogicSigSizePooling = true - vFuture.Payouts.Enabled = true - vFuture.Payouts.Percent = 50 - vFuture.Payouts.GoOnlineFee = 2_000_000 // 2 algos - vFuture.Payouts.MinBalance = 30_000_000_000 // 30,000 algos - vFuture.Payouts.MaxBalance = 70_000_000_000_000 // 70M algos - vFuture.Payouts.MaxMarkAbsent = 32 - vFuture.Payouts.ChallengeInterval = 1000 - vFuture.Payouts.ChallengeGracePeriod = 200 - vFuture.Payouts.ChallengeBits = 5 + v40.Payouts.Enabled = true + v40.Payouts.Percent = 50 + v40.Payouts.GoOnlineFee = 2_000_000 // 2 algos + v40.Payouts.MinBalance = 30_000_000_000 // 30,000 algos + v40.Payouts.MaxBalance = 70_000_000_000_000 // 70M algos + v40.Payouts.MaxMarkAbsent = 32 + v40.Payouts.ChallengeInterval = 1000 + v40.Payouts.ChallengeGracePeriod = 200 + v40.Payouts.ChallengeBits = 5 - vFuture.Bonus.BaseAmount = 10_000_000 // 10 Algos + v40.Bonus.BaseAmount = 10_000_000 // 10 Algos // 2.9 sec rounds gives about 10.8M rounds per year. - vFuture.Bonus.DecayInterval = 1_000_000 // .99^(10.8M/1M) ~ .897. So ~10% decay per year + v40.Bonus.DecayInterval = 1_000_000 // .99^(10.8M/1M) ~ .897. So ~10% decay per year + + v40.Heartbeat = true + + Consensus[protocol.ConsensusV40] = v40 + + // v39 can be upgraded to v40, with an update delay of 7d: + // 208000 = (7 * 24 * 60 * 60 / 2.9 ballpark round times) + // our current max is 250000 + v39.ApprovedUpgrades[protocol.ConsensusV40] = 208000 + + // ConsensusFuture is used to test features that are implemented + // but not yet released in a production protocol version. + vFuture := v40 + vFuture.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{} - vFuture.Heartbeat = true + vFuture.LogicSigVersion = 12 // When moving this to a release, put a new higher LogicSigVersion here Consensus[protocol.ConsensusFuture] = vFuture diff --git a/config/version.go b/config/version.go index 94a82a6ca8..08f6cae898 100644 --- a/config/version.go +++ b/config/version.go @@ -29,11 +29,11 @@ import ( // VersionMajor is the Major semantic version number (#.y.z) - changed when first public release (0.y.z -> 1.y.z) // and when backwards compatibility is broken. -const VersionMajor = 3 +const VersionMajor = 4 // VersionMinor is the Minor semantic version number (x.#.z) - changed when backwards-compatible features are introduced. // Not enforced until after initial public release (x > 0). -const VersionMinor = 28 +const VersionMinor = 0 // Version is the type holding our full version information. type Version struct { diff --git a/data/transactions/logic/langspec_v1.json b/data/transactions/logic/langspec_v1.json index 5fd347507d..10ff7909f7 100644 --- a/data/transactions/logic/langspec_v1.json +++ b/data/transactions/logic/langspec_v1.json @@ -1,6 +1,6 @@ { "Version": 1, - "LogicSigVersion": 10, + "LogicSigVersion": 11, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v10.json b/data/transactions/logic/langspec_v10.json index 1a8986436a..dffcd9e328 100644 --- a/data/transactions/logic/langspec_v10.json +++ b/data/transactions/logic/langspec_v10.json @@ -1,6 +1,6 @@ { "Version": 10, - "LogicSigVersion": 10, + "LogicSigVersion": 11, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v11.json b/data/transactions/logic/langspec_v11.json index cb054ebcd8..80854a3192 100644 --- a/data/transactions/logic/langspec_v11.json +++ b/data/transactions/logic/langspec_v11.json @@ -1,6 +1,6 @@ { "Version": 11, - "LogicSigVersion": 10, + "LogicSigVersion": 11, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v2.json b/data/transactions/logic/langspec_v2.json index 24f9ad97f7..584339b88a 100644 --- a/data/transactions/logic/langspec_v2.json +++ b/data/transactions/logic/langspec_v2.json @@ -1,6 +1,6 @@ { "Version": 2, - "LogicSigVersion": 10, + "LogicSigVersion": 11, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v3.json b/data/transactions/logic/langspec_v3.json index 085084359a..8ed4c5f45c 100644 --- a/data/transactions/logic/langspec_v3.json +++ b/data/transactions/logic/langspec_v3.json @@ -1,6 +1,6 @@ { "Version": 3, - "LogicSigVersion": 10, + "LogicSigVersion": 11, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v4.json b/data/transactions/logic/langspec_v4.json index ddbf651876..988f628246 100644 --- a/data/transactions/logic/langspec_v4.json +++ b/data/transactions/logic/langspec_v4.json @@ -1,6 +1,6 @@ { "Version": 4, - "LogicSigVersion": 10, + "LogicSigVersion": 11, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v5.json b/data/transactions/logic/langspec_v5.json index 2cca3941da..5a7cbb6532 100644 --- a/data/transactions/logic/langspec_v5.json +++ b/data/transactions/logic/langspec_v5.json @@ -1,6 +1,6 @@ { "Version": 5, - "LogicSigVersion": 10, + "LogicSigVersion": 11, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v6.json b/data/transactions/logic/langspec_v6.json index 6795706db7..5cd1de7fc3 100644 --- a/data/transactions/logic/langspec_v6.json +++ b/data/transactions/logic/langspec_v6.json @@ -1,6 +1,6 @@ { "Version": 6, - "LogicSigVersion": 10, + "LogicSigVersion": 11, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v7.json b/data/transactions/logic/langspec_v7.json index 12d2594194..4152b01675 100644 --- a/data/transactions/logic/langspec_v7.json +++ b/data/transactions/logic/langspec_v7.json @@ -1,6 +1,6 @@ { "Version": 7, - "LogicSigVersion": 10, + "LogicSigVersion": 11, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v8.json b/data/transactions/logic/langspec_v8.json index c5fcdbf58d..d667cbb0d1 100644 --- a/data/transactions/logic/langspec_v8.json +++ b/data/transactions/logic/langspec_v8.json @@ -1,6 +1,6 @@ { "Version": 8, - "LogicSigVersion": 10, + "LogicSigVersion": 11, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v9.json b/data/transactions/logic/langspec_v9.json index 01e951cc3c..0d5dedf63c 100644 --- a/data/transactions/logic/langspec_v9.json +++ b/data/transactions/logic/langspec_v9.json @@ -1,6 +1,6 @@ { "Version": 9, - "LogicSigVersion": 10, + "LogicSigVersion": 11, "NamedTypes": [ { "Name": "[]byte", diff --git a/ledger/testing/consensusRange.go b/ledger/testing/consensusRange.go index 199a462afc..882fb0f05d 100644 --- a/ledger/testing/consensusRange.go +++ b/ledger/testing/consensusRange.go @@ -61,6 +61,7 @@ var consensusByNumber = []protocol.ConsensusVersion{ protocol.ConsensusV37, protocol.ConsensusV38, // AVM v9, ECDSA pre-check, stateproofs recoverability protocol.ConsensusV39, // AVM v10, logicsig opcode budget pooling, elliptic curve ops, dynamic round times + protocol.ConsensusV40, // Consensus incentives, AVM v11, mimc protocol.ConsensusFuture, } diff --git a/ledger/testing/consensusRange_test.go b/ledger/testing/consensusRange_test.go index 9b270e3bf7..1ee2fee8f1 100644 --- a/ledger/testing/consensusRange_test.go +++ b/ledger/testing/consensusRange_test.go @@ -56,6 +56,6 @@ func TestReleasedVersion(t *testing.T) { } require.Equal(t, versionStringFromIndex(len(consensusByNumber)-1), "vFuture") - require.Equal(t, versionStringFromIndex(39), "v39") + require.Equal(t, versionStringFromIndex(40), "v40") } diff --git a/protocol/consensus.go b/protocol/consensus.go index 51c023ec2a..1549ae76bd 100644 --- a/protocol/consensus.go +++ b/protocol/consensus.go @@ -223,6 +223,11 @@ const ConsensusV39 = ConsensusVersion( "https://github.com/algorandfoundation/specs/tree/925a46433742afb0b51bb939354bd907fa88bf95", ) +// ConsensusV40 enables consensus incentives and TEAL v11 featuring the mimc opcode +const ConsensusV40 = ConsensusVersion( + "https://github.com/algorandfoundation/specs/tree/236dcc18c9c507d794813ab768e467ea42d1b4d9", +) + // 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( @@ -252,7 +257,7 @@ const ConsensusVAlpha5 = ConsensusVersion("alpha5") // ConsensusCurrentVersion is the latest version and should be used // when a specific version is not provided. -const ConsensusCurrentVersion = ConsensusV39 +const ConsensusCurrentVersion = ConsensusV40 // Error is used to indicate that an unsupported protocol has been detected. type Error ConsensusVersion