summaryrefslogtreecommitdiff
path: root/config/consensus.go
diff options
context:
space:
mode:
Diffstat (limited to 'config/consensus.go')
-rw-r--r--config/consensus.go47
1 files changed, 38 insertions, 9 deletions
diff --git a/config/consensus.go b/config/consensus.go
index 7c485c36d..c9589006e 100644
--- a/config/consensus.go
+++ b/config/consensus.go
@@ -283,6 +283,9 @@ type ConsensusParams struct {
// maximum sum of the lengths of the key and value of one app state entry
MaxAppSumKeyValueLens int
+ // maximum number of inner transactions that can be created by an app call
+ MaxInnerTransactions int
+
// maximum number of applications a single account can create and store
// AppParams for at once
MaxAppsCreated int
@@ -428,8 +431,11 @@ var MaxEvalDeltaAccounts int
var MaxStateDeltaKeys int
// MaxLogCalls is the highest allowable log messages that may appear in
-// any version, used for decoding purposes. Never decrease this value.
-const MaxLogCalls = 32
+// any version, used only for decoding purposes. Never decrease this value.
+var MaxLogCalls int
+
+// MaxInnerTransactions is the maximum number of inner transactions that may be created in an app call.
+var MaxInnerTransactions int
// MaxLogicSigMaxSize is the largest logical signature appear in any of the supported
// protocols, used for decoding purposes.
@@ -491,6 +497,10 @@ func checkSetAllocBounds(p ConsensusParams) {
checkSetMax(p.MaxExtraAppProgramPages, &MaxExtraAppProgramLen)
// MaxAvailableAppProgramLen is the max of supported app program size
MaxAvailableAppProgramLen = MaxAppProgramLen * (1 + MaxExtraAppProgramLen)
+ // There is no consensus parameter for MaxLogCalls and MaxAppProgramLen as an approximation
+ // Its value is much larger than any possible reasonable MaxLogCalls value in future
+ checkSetMax(p.MaxAppProgramLen, &MaxLogCalls)
+ checkSetMax(p.MaxInnerTransactions, &MaxInnerTransactions)
}
// SaveConfigurableConsensus saves the configurable protocols file to the provided data directory.
@@ -992,9 +1002,34 @@ func initConsensusProtocols() {
// v28 can be upgraded to v29, with an update delay of 3 days ( see calculation above )
v28.ApprovedUpgrades[protocol.ConsensusV29] = 60000
+ // v30 introduces AVM 1.0 and TEAL 5, increases the app opt in limit to 50,
+ // and allows costs to be pooled in grouped stateful transactions.
+ v30 := v29
+ v30.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{}
+
+ // Enable TEAL 5 / AVM 1.0
+ v30.LogicSigVersion = 5
+
+ // Enable App calls to pool budget in grouped transactions
+ v30.EnableAppCostPooling = true
+
+ // Enable Inner Transactions, and set maximum number. 0 value is
+ // disabled. Value > 0 also activates storage of creatable IDs in
+ // ApplyData, as that is required to support REST API when inner
+ // transactions are activated.
+ v30.MaxInnerTransactions = 16
+
+ // Allow 50 app opt ins
+ v30.MaxAppsOptedIn = 50
+
+ Consensus[protocol.ConsensusV30] = v30
+
+ // v29 can be upgraded to v30, with an update delay of 7 days ( see calculation above )
+ v29.ApprovedUpgrades[protocol.ConsensusV30] = 140000
+
// ConsensusFuture is used to test features that are implemented
// but not yet released in a production protocol version.
- vFuture := v29
+ vFuture := v30
vFuture.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{}
// FilterTimeout for period 0 should take a new optimized, configured value, need to revisit this later
@@ -1007,12 +1042,6 @@ func initConsensusProtocols() {
vFuture.CompactCertWeightThreshold = (1 << 32) * 30 / 100
vFuture.CompactCertSecKQ = 128
- // Enable TEAL 5 / AVM 1.0
- vFuture.LogicSigVersion = 5
-
- // Enable App calls to pool budget in grouped transactions
- vFuture.EnableAppCostPooling = true
-
Consensus[protocol.ConsensusFuture] = vFuture
}