From 684c24869f3362164138e41cd7aa70500c50be25 Mon Sep 17 00:00:00 2001 From: Gary Malouf <982483+gmalouf@users.noreply.github.com> Date: Tue, 26 Aug 2025 12:21:37 -0400 Subject: [PATCH 1/2] Consensus version v41 upgrade. --- config/consensus.go | 41 +++++++++++++++-------- data/transactions/logic/langspec_v1.json | 2 +- data/transactions/logic/langspec_v10.json | 2 +- data/transactions/logic/langspec_v11.json | 2 +- data/transactions/logic/langspec_v12.json | 2 +- data/transactions/logic/langspec_v2.json | 2 +- data/transactions/logic/langspec_v3.json | 2 +- data/transactions/logic/langspec_v4.json | 2 +- data/transactions/logic/langspec_v5.json | 2 +- data/transactions/logic/langspec_v6.json | 2 +- data/transactions/logic/langspec_v7.json | 2 +- data/transactions/logic/langspec_v8.json | 2 +- data/transactions/logic/langspec_v9.json | 2 +- ledger/testing/consensusRange.go | 1 + protocol/consensus.go | 7 +++- 15 files changed, 46 insertions(+), 27 deletions(-) diff --git a/config/consensus.go b/config/consensus.go index 3e5f09ffea..36daad899b 100644 --- a/config/consensus.go +++ b/config/consensus.go @@ -1435,24 +1435,37 @@ func initConsensusProtocols() { // 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{} + v41 := v40 + v41.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{} + + v41.LogicSigVersion = 12 - vFuture.LogicSigVersion = 12 // When moving this to a release, put a new higher LogicSigVersion here - vFuture.EnableAppVersioning = true // if not promoted when v12 goes into effect, update logic/field.go - vFuture.EnableSha512BlockHash = true + v41.EnableAppVersioning = true + v41.EnableSha512BlockHash = true - vFuture.EnableUnnamedBoxAccessInNewApps = true + v41.EnableUnnamedBoxAccessInNewApps = true // txn.Access work - vFuture.MaxAppTxnAccounts = 8 // Accounts are no worse than others, they should be the same - vFuture.MaxAppAccess = 16 // Twice as many, though cross products are explicit - vFuture.BytesPerBoxReference = 2048 // Count is more important that bytes, loosen up - vFuture.EnableInnerClawbackWithoutSenderHolding = true - vFuture.LogicSigMsig = false - vFuture.LogicSigLMsig = true + v41.MaxAppTxnAccounts = 8 // Accounts are no worse than others, they should be the same + v41.MaxAppAccess = 16 // Twice as many, though cross products are explicit + v41.BytesPerBoxReference = 2048 // Count is more important that bytes, loosen up + v41.EnableInnerClawbackWithoutSenderHolding = true + v41.LogicSigMsig = false + v41.LogicSigLMsig = true + + Consensus[protocol.ConsensusV41] = v41 + + // v40 can be upgraded to v41, with an update delay of 7d: + // 208000 = (7 * 24 * 60 * 60 / 2.9 ballpark round times) + // our current max is 250000 + v40.ApprovedUpgrades[protocol.ConsensusV41] = 208000 + + // ConsensusFuture is used to test features that are implemented + // but not yet released in a production protocol version. + vFuture := v41 + vFuture.ApprovedUpgrades = map[protocol.ConsensusVersion]uint64{} + + vFuture.LogicSigVersion = 13 // When moving this to a release, put a new higher LogicSigVersion here Consensus[protocol.ConsensusFuture] = vFuture diff --git a/data/transactions/logic/langspec_v1.json b/data/transactions/logic/langspec_v1.json index 10ff7909f7..cca94aaf01 100644 --- a/data/transactions/logic/langspec_v1.json +++ b/data/transactions/logic/langspec_v1.json @@ -1,6 +1,6 @@ { "Version": 1, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v10.json b/data/transactions/logic/langspec_v10.json index 51a83e7250..3257cfca4b 100644 --- a/data/transactions/logic/langspec_v10.json +++ b/data/transactions/logic/langspec_v10.json @@ -1,6 +1,6 @@ { "Version": 10, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v11.json b/data/transactions/logic/langspec_v11.json index 970ff01702..9fb5a995ba 100644 --- a/data/transactions/logic/langspec_v11.json +++ b/data/transactions/logic/langspec_v11.json @@ -1,6 +1,6 @@ { "Version": 11, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v12.json b/data/transactions/logic/langspec_v12.json index 1e2ebeea2a..8c6541e493 100644 --- a/data/transactions/logic/langspec_v12.json +++ b/data/transactions/logic/langspec_v12.json @@ -1,6 +1,6 @@ { "Version": 12, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v2.json b/data/transactions/logic/langspec_v2.json index 584339b88a..6ad55bb1ca 100644 --- a/data/transactions/logic/langspec_v2.json +++ b/data/transactions/logic/langspec_v2.json @@ -1,6 +1,6 @@ { "Version": 2, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v3.json b/data/transactions/logic/langspec_v3.json index 8ed4c5f45c..6193add93c 100644 --- a/data/transactions/logic/langspec_v3.json +++ b/data/transactions/logic/langspec_v3.json @@ -1,6 +1,6 @@ { "Version": 3, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v4.json b/data/transactions/logic/langspec_v4.json index 988f628246..06b7826eeb 100644 --- a/data/transactions/logic/langspec_v4.json +++ b/data/transactions/logic/langspec_v4.json @@ -1,6 +1,6 @@ { "Version": 4, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v5.json b/data/transactions/logic/langspec_v5.json index 5a7cbb6532..07fd2773c6 100644 --- a/data/transactions/logic/langspec_v5.json +++ b/data/transactions/logic/langspec_v5.json @@ -1,6 +1,6 @@ { "Version": 5, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v6.json b/data/transactions/logic/langspec_v6.json index 09e2476a06..962063ccf3 100644 --- a/data/transactions/logic/langspec_v6.json +++ b/data/transactions/logic/langspec_v6.json @@ -1,6 +1,6 @@ { "Version": 6, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v7.json b/data/transactions/logic/langspec_v7.json index f0148b970f..22a1c166ea 100644 --- a/data/transactions/logic/langspec_v7.json +++ b/data/transactions/logic/langspec_v7.json @@ -1,6 +1,6 @@ { "Version": 7, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v8.json b/data/transactions/logic/langspec_v8.json index fddcc13a31..196db5f565 100644 --- a/data/transactions/logic/langspec_v8.json +++ b/data/transactions/logic/langspec_v8.json @@ -1,6 +1,6 @@ { "Version": 8, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/data/transactions/logic/langspec_v9.json b/data/transactions/logic/langspec_v9.json index 28f3e9f995..5ac362e3c4 100644 --- a/data/transactions/logic/langspec_v9.json +++ b/data/transactions/logic/langspec_v9.json @@ -1,6 +1,6 @@ { "Version": 9, - "LogicSigVersion": 11, + "LogicSigVersion": 12, "NamedTypes": [ { "Name": "[]byte", diff --git a/ledger/testing/consensusRange.go b/ledger/testing/consensusRange.go index 4d15808925..c6d3265cbc 100644 --- a/ledger/testing/consensusRange.go +++ b/ledger/testing/consensusRange.go @@ -62,6 +62,7 @@ var consensusByNumber = []protocol.ConsensusVersion{ 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.ConsensusV41, // AVM v12, txn access, Sha512BlockHash, AppVersioning protocol.ConsensusFuture, } diff --git a/protocol/consensus.go b/protocol/consensus.go index e8bcfe1161..981eb37288 100644 --- a/protocol/consensus.go +++ b/protocol/consensus.go @@ -224,6 +224,11 @@ const ConsensusV40 = ConsensusVersion( "https://github.com/algorandfoundation/specs/tree/236dcc18c9c507d794813ab768e467ea42d1b4d9", ) +// ConsensusV41 enables txn access, Sha512BlockHash, AppVersioning and TEAL v12 including the falcon verify opcode +const ConsensusV41 = ConsensusVersion( + "https://github.com/algorandfoundation/specs/tree/953304de35264fc3ef91bcd05c123242015eeaed", +) + // 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( @@ -253,7 +258,7 @@ const ConsensusVAlpha5 = ConsensusVersion("alpha5") // ConsensusCurrentVersion is the latest version and should be used // when a specific version is not provided. -const ConsensusCurrentVersion = ConsensusV40 +const ConsensusCurrentVersion = ConsensusV41 // Error is used to indicate that an unsupported protocol has been detected. type Error ConsensusVersion From 88b8b1a2718bb1b819a45f57343c1ef38cba6377 Mon Sep 17 00:00:00 2001 From: cce <51567+cce@users.noreply.github.com> Date: Tue, 26 Aug 2025 12:49:32 -0400 Subject: [PATCH 2/2] update broken test for current --- data/transactions/verify/txn_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/transactions/verify/txn_test.go b/data/transactions/verify/txn_test.go index 55665cdae6..12d853af5b 100644 --- a/data/transactions/verify/txn_test.go +++ b/data/transactions/verify/txn_test.go @@ -1058,7 +1058,7 @@ byte base64 5rZMNsevs5sULO+54aN+OvU6lQ503z2X+SSYUABIx7E= signedTxn[i].Txn.Sender = multiAddress[s] signedTxn[i].Lsig.Args = [][]byte{[]byte("=0\x97S\x85H\xe9\x91B\xfd\xdb;1\xf5Z\xaec?\xae\xf2I\x93\x08\x12\x94\xaa~\x06\x08\x849b")} signedTxn[i].Lsig.Logic = op.Program - program := logic.Program(op.Program) + program := logic.MultisigProgram{Addr: crypto.Digest(multiAddress[s]), Program: op.Program} // create multi sig that 2 out of 3 has signed the txn var sigs [2]crypto.MultisigSig @@ -1069,7 +1069,7 @@ byte base64 5rZMNsevs5sULO+54aN+OvU6lQ503z2X+SSYUABIx7E= } msig, err := crypto.MultisigAssemble(sigs[:]) require.NoError(t, err) - signedTxn[i].Lsig.Msig = msig + signedTxn[i].Lsig.LMsig = msig } txnGroups := make([][]transactions.SignedTxn, len(signedTxn)) @@ -1079,10 +1079,10 @@ byte base64 5rZMNsevs5sULO+54aN+OvU6lQ503z2X+SSYUABIx7E= } breakSignatureFunc := func(txn *transactions.SignedTxn) { - txn.Lsig.Msig.Subsigs[0].Sig[0]++ + txn.Lsig.LMsig.Subsigs[0].Sig[0]++ } restoreSignatureFunc := func(txn *transactions.SignedTxn) { - txn.Lsig.Msig.Subsigs[0].Sig[0]-- + txn.Lsig.LMsig.Subsigs[0].Sig[0]-- } verifyGroup(t, txnGroups, &blkHdr, breakSignatureFunc, restoreSignatureFunc, crypto.ErrBatchHasFailedSigs.Error())