Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 26 additions & 16 deletions config/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -1002,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
Expand All @@ -1017,21 +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

// 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.
vFuture.MaxInnerTransactions = 16

// Allow 50 app opt ins
vFuture.MaxAppsOptedIn = 50

Consensus[protocol.ConsensusFuture] = vFuture
}

Expand Down
8 changes: 4 additions & 4 deletions ledger/applications_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ return`
Header: txHeader,
ApplicationCallTxnFields: appCreateFields,
}
err = l.appendUnvalidatedTx(t, genesisInitState.Accounts, initKeys, appCreate, transactions.ApplyData{})
err = l.appendUnvalidatedTx(t, genesisInitState.Accounts, initKeys, appCreate, transactions.ApplyData{ApplicationID: 1})
a.NoError(err)

appIdx := basics.AppIndex(1) // first tnx => idx = 1
Expand Down Expand Up @@ -711,7 +711,7 @@ return`
Header: txHeader,
ApplicationCallTxnFields: appCreateFields,
}
err = l.appendUnvalidatedTx(t, genesisInitState.Accounts, initKeys, appCreate, transactions.ApplyData{})
err = l.appendUnvalidatedTx(t, genesisInitState.Accounts, initKeys, appCreate, transactions.ApplyData{ApplicationID: 1})
a.NoError(err)

appIdx := basics.AppIndex(1) // first tnx => idx = 1
Expand Down Expand Up @@ -966,7 +966,7 @@ return`
Header: txHeader,
ApplicationCallTxnFields: appCreateFields,
}
err = l.appendUnvalidatedTx(t, genesisInitState.Accounts, initKeys, appCreate, transactions.ApplyData{})
err = l.appendUnvalidatedTx(t, genesisInitState.Accounts, initKeys, appCreate, transactions.ApplyData{ApplicationID: 1})
a.NoError(err)

appIdx := basics.AppIndex(1) // first tnx => idx = 1
Expand Down Expand Up @@ -1125,7 +1125,7 @@ return`
Header: txHeader,
ApplicationCallTxnFields: appCreateFields,
}
err = l.appendUnvalidatedTx(t, genesisInitState.Accounts, initKeys, appCreate, transactions.ApplyData{})
err = l.appendUnvalidatedTx(t, genesisInitState.Accounts, initKeys, appCreate, transactions.ApplyData{ApplicationID: 1})
a.NoError(err)

appIdx := basics.AppIndex(1) // first tnx => idx = 1
Expand Down
4 changes: 3 additions & 1 deletion ledger/eval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,9 @@ ok:
ApplyData: transactions.ApplyData{
EvalDelta: transactions.EvalDelta{GlobalDelta: map[string]basics.ValueDelta{
"creator": {Action: basics.SetBytesAction, Bytes: string(addrs[0][:])}},
}},
},
ApplicationID: 1,
},
},
{
SignedTxn: stxn2,
Expand Down
8 changes: 7 additions & 1 deletion protocol/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ const ConsensusV29 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/abc54f79f9ad679d2d22f0fb9909fb005c16f8a1",
)

// ConsensusV30 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.
const ConsensusV30 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/bc36005dbd776e6d1eaf0c560619bb183215645c",
)

// 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 All @@ -170,7 +176,7 @@ const ConsensusFuture = ConsensusVersion(

// ConsensusCurrentVersion is the latest version and should be used
// when a specific version is not provided.
const ConsensusCurrentVersion = ConsensusV29
const ConsensusCurrentVersion = ConsensusV30

// Error is used to indicate that an unsupported protocol has been detected.
type Error ConsensusVersion
Expand Down