stackitem: completely drop MaxArraySize

Turns out C# VM doesn't have it since preview2, so our limiting of
MaxArraySize in incompatible with it. Removing this limit shouldn't be a
problem with the reference counter we have, both APPEND and SETITEM add things
to reference counter and we can't exceed MaxStackSize. PACK on the other hand
can't get more than MaxStackSize-1 of input elements.

Unify NEWSTRUCT with NEWARRAY* and use better integer checks at the same time.

Multisig limit is still 1024.
This commit is contained in:
Roman Khimov 2021-07-19 13:35:48 +03:00
parent ee4a647934
commit 233307aca5
8 changed files with 50 additions and 67 deletions

View file

@ -3,8 +3,6 @@ package compiler_test
import (
"math/big"
"testing"
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
)
var assignTestCases = []testCase{
@ -154,9 +152,9 @@ func TestManyAssignments(t *testing.T) {
src2 := `return a
}`
for i := 0; i < stackitem.MaxArraySize; i++ {
for i := 0; i < 1024; i++ {
src1 += "a += 1\n"
}
eval(t, src1+src2, big.NewInt(stackitem.MaxArraySize))
eval(t, src1+src2, big.NewInt(1024))
}