diff --git a/EOFTests/efExample/validInvalid.json b/EOFTests/efExample/validInvalid.json index c00acb00e73..721d29d8d11 100644 --- a/EOFTests/efExample/validInvalid.json +++ b/EOFTests/efExample/validInvalid.json @@ -1,396 +1,625 @@ { "validInvalid" : { "_info" : { - "comment" : "", - "filling-rpc-server" : "evm version 1.11.0-unstable-df238889-20230119", - "filling-tool-version" : "retesteth-0.2.3-postmerge+commit.099542b3.Linux.g++", - "generatedTestHash" : "c5969a7ec293ee2389f42c10e5d8e3b4084cafe357f8321ea4db2eb474215f82", - "lllcversion" : "Version: 0.5.14-develop.2023.1.22+commit.a096d7a9.Linux.g++", + "comment" : "Test various examples to see if they are valid or invalid.\nImplements\n EOF1I0001 check that EOF1 with a bad magic number fails\n EOF1I0002 check that EOF1 with a bad version number fails\n EOF1I0003 check that EOF1 with a bad section order fails\n EOF1I0004 check that EOF1 missing a section fails\n EOF1I0005 check that EOF1 with a bad end of sections number fails\n EOF1I0006 check that EOF1 with too many or too few bytes fails\n EOF1I0007 check that EOF1 with a malformed code section fails\n EOF1I0008 check that EOF1 with an illegal opcode fails\n EOF1I0009 check that EOF1 with the wrong maxStackDepth fails\n EOF1I0010 check that return values are not allowed on section 0\n EOF1I0011 check that function calls to code sections that don't exist fail\n EOF1I0012 check that code sections that cause stack underflow fail\n EOF1I0013 check that we can't return more values than we declare\n EOF1I0014 check that code that looks deeper in the stack than the parameters fails\n EOF1I0015 check that code that uses removed opcodes fails\n EOF1I0016 check that code that uses new relative jumps to outside the section fails\n EOF1I0017 check that parameters are not allowed on section 0\n EOF1I0018 inconsistent number of code sections (between types and code)\n EOF1I0019 check that jumps into the middle on an opcode are not allowed\n EOF1I0020 check that you can't get to the same opcode with two different stack heights\n EOF1I0021 empty jump table\n EOF1I0022 stack underflow caused by a function call\n EOF1I0023 sections with unreachable code fail\n EOF1I0024 sections that end with a non-terminator opcode fail\n EOF1I0025 data stack height of 1024 is invalid\n EOF1V0001 check that simple valid EOF1 deploys\n EOF1V0002 check that valid EOF1 with two code sections deploys\n EOF1V0003 check that valid EOF1 with four code sections deploys\n EOF1V0004 check that valid EOF1 can include 0xFE, the designated invalid opcode\n EOF1V0005 check that EOF1 with the right maxStackDepth deploys\n EOF1V0006 check that return values are allowed on code sections that aren't zero\n EOF1V0007 check that function calls to code sections that exist are allowed\n EOF1V0008 check that code that uses a new style relative jump (5C) succeeds\n EOF1V0009 check that parameters are allowed on code sections that aren't zero\n EOF1V0010 parameters are part of the max stack height\n EOF1V0011 check that code that uses a new style conditional jump (5D) succeeds\n EOF1V0012 return values on code sections affect maxStackHeight of the caller\n EOF1V0013 jump tables work\n EOF1V0014 sections that end with a legit terminating opcode are OK\n EOF1V0015 data stack height of 1023 is valid\n", + "filling-rpc-server" : "evm version 1.11.0-unstable-97c49b85-20230411", + "filling-tool-version" : "retesteth-0.3.1-shanghai+commit.9e1f1208.Linux.g++", + "generatedTestHash" : "36f0d04d49c407e1a97e8fc22110d81caa4ff87c4698013729036ba3616ca6a9", + "lllcversion" : "Version: 0.5.14-develop.2022.7.30+commit.a096d7a9.Linux.g++", "solidity" : "Version: 0.8.17+commit.8df45f5f.Linux.g++", "source" : "src/EOFTestsFiller/efExample/validInvalidFiller.yml", - "sourceHash" : "ab155d1b658932cf78f77a110d26fe7e71f4b725df2f55486f7d2b83496cf953" + "sourceHash" : "e677b5d86875d7c8b2b9208a804ed232b56093a7a477d3b5b071f1089163b3f5" }, "vectors" : { "validInvalid_0" : { - "code" : "0x386000600039600d3803600df3ef000101000402000100030300010000000001305000ef", + "code" : "0xef000101000402000100030300010000000001305000ef", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_1" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000303000400000000013050000bad", + "code" : "0xef0001010004020001000303000400000000013050000bad", "results" : { + "Cancun" : { + "exception" : "invalid container size", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_10" : { - "code" : "0x386000600039600d3803600df3ef0001010014020005000100050005000100010300040000000000000000020000000200000000000000000060006000f360006000fdfeb10bad60a7", + "code" : "0xef0001010014020005000100050005000100010300040000000000000000020000000200000000000000000060006000f360006000fdfeb10bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_11" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000d030004000000000160015e020002000030503050000bad60a7", + "code" : "0xef0001010004020001000d030004000000000160015e020002000030503050000bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_12" : { - "code" : "0x386000600039600d3803600df3ef00010100040200010009030004000000000160015e0030503050000bad60a7", + "code" : "0xef00010100040200010009030004000000000160015e0030503050000bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid number of branches in jump table", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_13" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000d030004000000000160015e020002ffff30503050000bad60a7", + "code" : "0xef0001010004020001000d030004000000000160015e020002ffff30503050000bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid jump destination", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_14" : { - "code" : "0x386000600039600d3803600df3ef00010100040200010008030004000000000260015d0001305b000bad60a7", + "code" : "0xef00010100040200010008030004000000000260015d0001305b000bad60a7", "results" : { + "Cancun" : { + "exception" : "conflicting stack height", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_15" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000a03000400000000005c00035c00025cfffa000bad60a7", + "code" : "0xef0001010004020001000a03000400000000005c00035c00025cfffa000bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid jump destination", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_16" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001001003000400000000036000600060005d00035d00025dfffa000bad60a7", + "code" : "0xef0001010004020001001003000400000000036000600060005d00035d00025dfffa000bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid jump destination", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_17" : { - "code" : "0x386000600039600d3803600df3ef0001010008020001000303000400000000013050000bad60a7", + "code" : "0xef0001010008020001000303000400000000013050000bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid code size", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_18" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000503000100000000016003565b00ef", + "code" : "0xef0001010004020001000503000100000000016003565b00ef", "results" : { + "Cancun" : { + "exception" : "undefined instrustion", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_19" : { - "code" : "0x386000600039600d3803600df3ef00010100040200010007030001000000000160016003575b00ef", + "code" : "0xef00010100040200010007030001000000000160016003575b00ef", "results" : { + "Cancun" : { + "exception" : "undefined instrustion", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_2" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000303000400000000013050000bad60a70bad", + "code" : "0xef0001010004020001000303000400000000013050000bad60a70bad", "results" : { + "Cancun" : { + "exception" : "invalid container size", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_20" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000403000100000000016001ff00ef", + "code" : "0xef0001010004020001000403000100000000016001ff00ef", "results" : { + "Cancun" : { + "exception" : "undefined instrustion", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_21" : { - "code" : "0x386000600039600d3803600df3ef000101000402000100040300010000000007", + "code" : "0xef000101000402000100040300010000000007", "results" : { + "Cancun" : { + "exception" : "invalid container size", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_22" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001001003000100000000016001600260036004600560066007f200ef", + "code" : "0xef0001010004020001001003000100000000016001600260036004600560066007f200ef", "results" : { + "Cancun" : { + "exception" : "undefined instrustion", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_23" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000503000100000000016003565b00ef", + "code" : "0xef0001010004020001000503000100000000016003565b00ef", "results" : { + "Cancun" : { + "exception" : "undefined instrustion", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_24" : { - "code" : "0x386000600039600d3803600df3ef0001010008020002000300030300040000000001010100013050005030000bad60a7", + "code" : "0xef0001010008020002000300030300040000000001010100013050005030000bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_25" : { - "code" : "0x386000600039600d3803600df3ef000101000802000200040002030004000000000100010001b000010030b10bad60a7", + "code" : "0xef000101000802000200040002030004000000000100010001b000010030b10bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_26" : { - "code" : "0x386000600039600d3803600df3ef000101000802000200030001030004000000000100010001b00001300bad60a7", + "code" : "0xef000101000802000200030001030004000000000100010001b00001300bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid code termination", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_27" : { - "code" : "0x386000600039600d3803600df3ef000101000802000200040002030004000000000101000001b000010050b10bad60a7", + "code" : "0xef000101000802000200040002030004000000000101000001b000010050b10bad60a7", "results" : { + "Cancun" : { + "exception" : "stack underflow", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_28" : { - "code" : "0x386000600039600d3803600df3ef000101000c0200030028000b001f03000400000003ff000a000a00640064b00002b00002b00002b00002b00002b00002b00002b00002b00002b00002b00001b000013030300030303030303030303030b1b00001b00001b00001b00001b00001b00001b00001b00001b00001b00001b10bad60a7", + "code" : "0xef000101000c0200030028000b001f03000400000003ff000a000a00640064b00002b00002b00002b00002b00002b00002b00002b00002b00002b00002b00001b000013030300030303030303030303030b1b00001b00001b00001b00001b00001b00001b00001b00001b00001b00001b10bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_29" : { - "code" : "0x386000600039600d3803600df3ef000101000c0200030029000b001f0300040000000400000a000a00640064b00002b00002b00002b00002b00002b00002b00002b00002b00002b00002b00001b00001303030300030303030303030303030b1b00001b00001b00001b00001b00001b00001b00001b00001b00001b00001b10bad60a7", + "code" : "0xef000101000c0200030029000b001f0300040000000400000a000a00640064b00002b00002b00002b00002b00002b00002b00002b00002b00002b00002b00001b00001303030300030303030303030303030b1b00001b00001b00001b00001b00001b00001b00001b00001b00001b00001b10bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid type content, max stack height exceeds limit", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_3" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000303000400000000013050000bad60a7", + "code" : "0xef0001010004020001000303000400000000013050000bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_30" : { - "code" : "0x386000600039600d3803600df3ef0001010010020004000300030003000303000400000000010101000100000001010100013050005030003050005030000bad60a7", + "code" : "0xef0001010010020004000300030003000303000400000000010101000100000001010100013050005030003050005030000bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_31" : { - "code" : "0x386000600039600d3803600df3ef000101001002000400030005000700070300040000000001000000020000000300000001305000303050500030303050505000305030503050000bad60a7", + "code" : "0xef000101001002000400030005000700070300040000000001000000020000000300000001305000303050500030303050505000305030503050000bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_32" : { - "code" : "0x610bad386000600039600d3803600df3ef000101001002000400030005000700070300040000000001000000000000000300000001305000b000020030303050505000305030503050000bad60a7", + "code" : "0xef000101001002000400030005000700070300040000000001000000000000000300000001305000b000020030303050505000305030503050000bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid container size", + "result" : false + }, "Shanghai" : { - "result" : true + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_33" : { - "code" : "0x386000600039600d3803600df3ef000101001002000400030005000700070300040000000001000000020000000300000001305000b0000f0030303050505000305030503050000bad60a7", + "code" : "0xef000101001002000400030005000700070300040000000001000000020000000300000001305000b0000f0030303050505000305030503050000bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid container size", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_34" : { - "code" : "0x386000600039600d3803600df3ef0001010008020002000300030300040000000001010000013050005050000bad60a7", + "code" : "0xef0001010008020002000300030300040000000001010000013050005050000bad60a7", "results" : { + "Cancun" : { + "exception" : "stack underflow", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_35" : { - "code" : "0x386000600039600d3803600df3ef0001010008020002000300030300040000000001000100013050003030000bad60a7", + "code" : "0xef0001010008020002000300030300040000000001000100013050003030000bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid max stack height", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_36" : { - "code" : "0x386000600039600d3803600df3ef0001010008020002000300030300040000000001010100013050003091000bad60a7", + "code" : "0xef0001010008020002000300030300040000000001010100013050003091000bad60a7", "results" : { + "Cancun" : { + "exception" : "stack underflow", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_37" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000303000400010000013050fe0bad60a7", + "code" : "0xef0001010004020001000303000400010000013050fe0bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid section 0 type", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_38" : { - "code" : "0x386000600039600d3803600df3ef0001010008020002000300030300040000000001020000023050005050000bad60a7", + "code" : "0xef0001010008020002000300030300040000000001020000023050005050000bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_39" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000303000400000100013050fe0bad60a7", + "code" : "0xef0001010004020001000303000400000100013050fe0bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid section 0 type", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_4" : { - "code" : "0x386000600039600d3803600df3ef00010100040200010003030004000000000130ef000bad60a7", + "code" : "0xef00010100040200010003030004000000000130ef000bad60a7", "results" : { + "Cancun" : { + "exception" : "undefined instrustion", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_40" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000303000400000000033050000bad60a7", + "code" : "0xef0001010004020001000303000400000000033050000bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid max stack height", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_41" : { - "code" : "0x386000600039600d3803600df3ef00010100040200010001030004000000000530503050000bad60a7", + "code" : "0xef00010100040200010001030004000000000530503050000bad60a7", "results" : { + "Cancun" : { + "exception" : "invalid container size", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_42" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000303000400000000013050620bad60a7", + "code" : "0xef0001010004020001000303000400000000013050620bad60a7", "results" : { + "Cancun" : { + "exception" : "truncated immediate", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_43" : { - "code" : "0x386000600039600d3803600df3ef00010100040200010003030001ff00000001305000ef", + "code" : "0xef00010100040200010003030001ff00000001305000ef", "results" : { + "Cancun" : { + "exception" : "missing header terminator", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_44" : { - "code" : "0x386000600039600d3803600df3ef020101000402000100030300010000000001305000ef", + "code" : "0xef020101000402000100030300010000000001305000ef", "results" : { + "Cancun" : { + "exception" : "invalid magic", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_45" : { - "code" : "0x386000600039600d3803600df3ef000001000402000100030300010000000001305000ef", + "code" : "0xef000001000402000100030300010000000001305000ef", "results" : { + "Cancun" : { + "exception" : "invalid version", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_46" : { - "code" : "0x386000600039600d3803600df3ef000201000402000100030300010000000001305000ef", + "code" : "0xef000201000402000100030300010000000001305000ef", "results" : { + "Cancun" : { + "exception" : "invalid version", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_47" : { - "code" : "0x386000600039600d3803600df3ef000102000100030100040300010000000001305000ef", + "code" : "0xef000102000100030100040300010000000001305000ef", "results" : { + "Cancun" : { + "exception" : "missing type header", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_48" : { - "code" : "0x386000600039600d3803600df3ef000102000100030300010100040000000001305000ef", + "code" : "0xef000102000100030300010100040000000001305000ef", "results" : { + "Cancun" : { + "exception" : "missing type header", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_49" : { - "code" : "0x386000600039600d3803600df3ef000102000100030300010000000001305000ef", + "code" : "0xef000102000100030300010000000001305000ef", "results" : { + "Cancun" : { + "exception" : "missing type header", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_5" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000303000400000000013050fe0bad60a7", + "code" : "0xef0001010004020001000303000400000000013050fe0bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_50" : { - "code" : "0x386000600039600d3803600df3ef00010100040300010000000001305000ef", + "code" : "0xef00010100040300010000000001305000ef", "results" : { + "Cancun" : { + "exception" : "missing code header", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_51" : { - "code" : "0x386000600039600d3803600df3ef000101000402000100030000000001305000ef", + "code" : "0xef000101000402000100030000000001305000ef", "results" : { + "Cancun" : { + "exception" : "missing data header", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } @@ -398,48 +627,75 @@ "validInvalid_52" : { "code" : "0xef0001010004020001000a030016000000000338600060003938601df3ef0001010004020001000303001d0000000001385000", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_53" : { "code" : "0x610badfe", "results" : { + "Cancun" : { + "exception" : "invalid magic", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_6" : { - "code" : "0x386000600039600d3803600df3ef00010100040200010003030001ff00000001305000ef", + "code" : "0xef00010100040200010003030001ff00000001305000ef", "results" : { + "Cancun" : { + "exception" : "missing header terminator", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_7" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000a03000400000000005c00035c00035cfffa000bad60a7", + "code" : "0xef0001010004020001000a03000400000000005c00035c00035cfffa000bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } }, "validInvalid_8" : { - "code" : "0x386000600039600d3803600df3ef0001010004020001000503000400000000005c00015b000bad60a7", + "code" : "0xef0001010004020001000503000400000000005c00015b000bad60a7", "results" : { + "Cancun" : { + "exception" : "unreachable code", + "result" : false + }, "Shanghai" : { + "exception" : "Invalid Code", "result" : false } } }, "validInvalid_9" : { - "code" : "0x386000600039600d3803600df3ef00010100040200010007030004000000000160015d00015b000bad60a7", + "code" : "0xef00010100040200010007030004000000000160015d00015b000bad60a7", "results" : { - "Shanghai" : { + "Cancun" : { "result" : true + }, + "Shanghai" : { + "exception" : "Invalid Code", + "result" : false } } } diff --git a/src/EOFTestsFiller/efExample/validInvalidFiller.yml b/src/EOFTestsFiller/efExample/validInvalidFiller.yml index 5ac7a8f919d..3fac539a35b 100644 --- a/src/EOFTestsFiller/efExample/validInvalidFiller.yml +++ b/src/EOFTestsFiller/efExample/validInvalidFiller.yml @@ -44,21 +44,15 @@ validInvalid: EOF1V0014 sections that end with a legit terminating opcode are OK EOF1V0015 data stack height of 1023 is valid - data: + forks: + - ">=Shanghai" + + vectors: + # Data 0 # EOF1V0001 check that simple EOF1 deploys - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0001 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -76,22 +70,14 @@ validInvalid: 00 # 3 STOP # Data segment ef + expectException: + "Shanghai" : "Invalid Code" # Data 1 # EOF1I0006 check that EOF1 with too many or too few bytes fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0006 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -109,21 +95,15 @@ validInvalid: 00 # 3 STOP # Data segment 0bad # 2 bytes instead of four + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid container size" + # Data 2 # EOF1I0006 check that EOF1 with too many or too few bytes fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0006 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -141,22 +121,14 @@ validInvalid: 00 # 3 STOP # Data segment 0bad60A70BAD # 6 bytes instead of four - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid container size" # Data 3 # EOF1V0001 Valid - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0001 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -174,22 +146,14 @@ validInvalid: 00 # 3 STOP # Data segment 0bad60A7 # 4 bytes (valid) + expectException: + "Shanghai" : "Invalid Code" # Data 4 # EOF1I0008 check that EOF1 with an illegal opcode fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0008 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -207,21 +171,15 @@ validInvalid: 00 # 3 STOP # Data segment 0bad60A7 # 4 bytes (valid) + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "undefined instrustion" + # Data 5 # EOF1V0004 check that valid EOF1 can include 0xFE, the designated invalid opcode - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0004 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -239,20 +197,13 @@ validInvalid: FE # 3 Designated invalid opcode # Data segment 0bad60A7 # 4 bytes (valid) + expectException: + "Shanghai" : "Invalid Code" + # EOF1I0005 check that EOF1 with a bad end of sections number fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0005 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -270,23 +221,14 @@ validInvalid: 00 # 3 STOP # Data segment ef - - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "missing header terminator" # EOF1V0008 check that code that uses a new style relative jump (5C) succeeds - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0008 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -305,21 +247,12 @@ validInvalid: 00 # 9 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" # EOF1I0023 sections with unreachable code fail - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0023 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -337,21 +270,13 @@ validInvalid: 00 # 9 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "unreachable code" # EOF1V0011 check that code that uses a new style conditional jump (5D) succeeds - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0011 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -370,22 +295,13 @@ validInvalid: 00 # 6 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" # EOF1V0014 sections that end with a legit terminating opcode are OK - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0014 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010014 # Four code segments @@ -433,22 +349,13 @@ validInvalid: B1 # RETF # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" # EOF1V0013 jump tables work - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0013 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -470,23 +377,14 @@ validInvalid: 00 # 12 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" # EOF1I0021 empty jump table - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0021 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -506,22 +404,14 @@ validInvalid: 00 # 8 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid number of branches in jump table" # EOF1I0019 check that jumps into the middle on an opcode are not allowed - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0019 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -543,24 +433,16 @@ validInvalid: 00 # 12 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid jump destination" # EOF1I0020 check that you can't get to the same opcode with two different stack heights - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0020 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -580,22 +462,15 @@ validInvalid: 00 # 7 STOP # Data segment 0bad60A7 # 4 bytes (valid) + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "conflicting stack height" # EOF1I0019 check that jumps into the middle on an opcode are not allowed - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0019 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -614,21 +489,13 @@ validInvalid: 00 # 9 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid jump destination" # EOF1I0019 check that jumps into the middle on an opcode are not allowed - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0019 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -650,25 +517,15 @@ validInvalid: 00 # 15 STOP # Data segment 0bad60A7 # 4 bytes (valid) - - - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid jump destination" # EOF1I0018 inconsistent number of code sections (between types and code) - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0018 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010008 # Two code segments @@ -686,21 +543,13 @@ validInvalid: 00 # 3 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid code size" # EOF1I0015 check that code that uses removed opcodes fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0015 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -719,21 +568,13 @@ validInvalid: 00 # 4 STOP # Data segment ef - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "undefined instrustion" # EOF1I0015 check that code that uses removed opcodes fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0015 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -753,21 +594,13 @@ validInvalid: 00 # 6 STOP # Data segment ef - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "undefined instrustion" # EOF1I0015 check that code that uses removed opcodes fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0015 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -785,21 +618,13 @@ validInvalid: 00 # 3 STOP # Data segment ef - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "undefined instrustion" # EOF1I0015 check that code that uses removed opcodes fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0015 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -812,19 +637,13 @@ validInvalid: 00 # Zero outputs 0007 # Max stack height 1 # Code segment 0 code + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid container size" + # EOF1I0015 check that code that uses removed opcodes fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0015 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -848,23 +667,13 @@ validInvalid: 00 # STOP # Data segment ef - - - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "undefined instrustion" # EOF1I0016 check that code that uses new relative jumps to outside the section fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0016 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -883,24 +692,15 @@ validInvalid: 00 # 4 STOP # Data segment ef - - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "undefined instrustion" # EOF1V0002 check that valid EOF1 with two code sections deploys # EOF1V0006 check that return values are allowed on code sections that aren't zero - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0002 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010008 # Two code segments @@ -927,21 +727,12 @@ validInvalid: 00 # 3 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" # EOF1V0012 return values on code sections affect maxStackHeight of the caller - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0012 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010008 # Two code segments @@ -966,20 +757,12 @@ validInvalid: B1 # 1 RETF # Data segment 0bad60A7 # 4 bytes (valid) + expectException: + "Shanghai" : "Invalid Code" # EOF1I0024 sections that end with a non-terminator opcode fail - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0024 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010008 # Two code segments @@ -1002,22 +785,14 @@ validInvalid: 30 # 0 ADDRESS # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid code termination" # EOF1I0022 stack underflow caused by a function call - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0022 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010008 # Two code segments @@ -1042,23 +817,14 @@ validInvalid: B1 # 1 RETF # Data segment 0bad60A7 # 4 bytes (valid) - - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "stack underflow" # EOF1V0015 data stack height of 1023 is valid - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0015 :raw 0x # EOF deployed code ef0001 # Magic followed by version 01000C # Three code segments @@ -1123,21 +889,12 @@ validInvalid: B1 # 1E RETF # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" # EOF1I0025 data stack height of 1024 is invalid - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0025 :raw 0x # EOF deployed code ef0001 # Magic followed by version 01000C # Three code segments @@ -1203,21 +960,13 @@ validInvalid: B1 # 1E RETF # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid type content, max stack height exceeds limit" # EOF1V0003 check that valid EOF1 with four code sections deploys - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0003 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010010 # Two code segments @@ -1262,22 +1011,14 @@ validInvalid: 00 # 3 STOP # Data segment 0bad60A7 # 4 bytes (valid) + expectException: + "Shanghai" : "Invalid Code" # EOF1V0005 check that EOF1 with the right maxStackDepth deploys - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0005 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010010 # Four code segments @@ -1332,22 +1073,13 @@ validInvalid: 00 # 7 STOP # Data segment 0bad60A7 # 4 bytes (valid) + expectException: + "Shanghai" : "Invalid Code" # EOF1V0007 check that function calls to code sections that exist are allowed - - | - :label good :raw 0x - # Legacy constructor - 610bad - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0007 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010010 # Four code segments @@ -1399,22 +1131,14 @@ validInvalid: 00 # 6 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid container size" # EOF1I0011 check that function calls to code sections that don't exist fail - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0011 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010010 # Four code segments @@ -1466,24 +1190,14 @@ validInvalid: 00 # 6 STOP # Data segment 0bad60A7 # 4 bytes (valid) - - - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid container size" # EOF1I0012 check that code sections that cause stack underflow fail - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0012 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010008 # Two code segments @@ -1510,22 +1224,14 @@ validInvalid: 00 # 3 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "stack underflow" # EOF1I0013 check that we can't return more values than we declare - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0013 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010008 # Two code segments @@ -1552,21 +1258,13 @@ validInvalid: 00 # 3 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid max stack height" # EOF1I0014 check that code that looks deeper in the stack than the parameters fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0014 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010008 # Two code segments @@ -1593,21 +1291,13 @@ validInvalid: 00 # 3 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "stack underflow" # EOF1I0010 check that return values are not allowed on section 0 - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0010 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -1625,22 +1315,14 @@ validInvalid: FE # 3 Designated invalid opcode # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid section 0 type" # EOF1V0009 check that parameters are allowed on code sections that aren't zero # EOF1V0010 parameters are part of the max stack height - - | - :label good :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1V0010 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010008 # Two code segments @@ -1667,21 +1349,12 @@ validInvalid: 00 # 3 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" # EOF1I0017 check that parameters are not allowed on section 0 - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0017 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -1699,22 +1372,14 @@ validInvalid: FE # 3 Designated invalid opcode # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid section 0 type" # EOF1I0009 check that EOF1 with the wrong maxStackDepth fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0009 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -1732,21 +1397,13 @@ validInvalid: 00 # 3 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid max stack height" # EOF1I0009 check that EOF1 with the wrong maxStackDepth fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0009 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -1766,21 +1423,13 @@ validInvalid: 00 # 5 STOP # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid container size" # EOF1I0007 check that EOF1 with a malformed code section fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0007 :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -1798,22 +1447,14 @@ validInvalid: 62 # 3 PUSH3 (without a value) # Data segment 0bad60A7 # 4 bytes (valid) - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "truncated immediate" # check that EOF1 with a bad end of sections number fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label badsectionnumber :raw 0x # EOF deployed code ef0001 # Magic followed by version 010004 # One code segment @@ -1831,22 +1472,14 @@ validInvalid: 00 # 3 STOP # Data segment ef - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "missing header terminator" # EOF1I0001 check that EOF1 with a bad magic number fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0001 :raw 0x # EOF deployed code ef0201 # Bad magic followed by version 010004 # One code segment @@ -1864,20 +1497,13 @@ validInvalid: 00 # 3 STOP # Data segment ef + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid magic" # EOF1I0002 check that EOF1 with a bad version number fails (ver 0) - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0002 :raw 0x # EOF deployed code ef0000 # Magic followed by bad version 010004 # One code segment @@ -1895,21 +1521,13 @@ validInvalid: 00 # 3 STOP # Data segment ef - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid version" # EOF1I0002 check that EOF1 with a bad version number fails (ver 2) - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0002 :raw 0x # EOF deployed code ef0002 # Magic followed by bad version 010004 # One code segment @@ -1927,21 +1545,13 @@ validInvalid: 00 # 3 STOP # Data segment ef - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid version" # EOF1I0003 check that EOF1 with a bad section order fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0003 :raw 0x # EOF deployed code ef0001 # Magic followed by bad version 020001 # One code segment @@ -1959,21 +1569,13 @@ validInvalid: 00 # 3 STOP # Data segment ef - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "missing type header" # EOF1I0003 check that EOF1 with a bad section order fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0003 :raw 0x # EOF deployed code ef0001 # Magic followed by bad version 020001 # One code segment @@ -1991,22 +1593,14 @@ validInvalid: 00 # 3 STOP # Data segment ef - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "missing type header" # EOF1I0004 check that EOF1 missing a section fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0004 :raw 0x # EOF deployed code ef0001 # Magic followed by bad version 020001 # One code segment @@ -2023,20 +1617,13 @@ validInvalid: 00 # 3 STOP # Data segment ef + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "missing type header" # EOF1I0004 check that EOF1 missing a section fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0004 :raw 0x # EOF deployed code ef0001 # Magic followed by bad version 010004 # One code segment @@ -2052,21 +1639,13 @@ validInvalid: 00 # 3 STOP # Data segment ef - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "missing code header" # EOF1I0004 check that EOF1 missing a section fails - - | - :label bad :raw 0x - # Legacy constructor - 38 # 0 CODESIZE - 6000 # 1 PUSH1 0 0, - 6000 # 3 PUSH1 0 0, 0, - 39 # 5 COPYCODE - 600D # 6 PUSH1 0x0D 13 - 38 # 8 CODESIZE , 13 - 03 # 10 SUB -13 - 600D # 11 PUSH1 0x0D 13 - F3 # 12 RETURN + - data: | + :label EOF1I0004 :raw 0x # EOF deployed code ef0001 # Magic followed by bad version 010004 # One code segment @@ -2083,14 +1662,14 @@ validInvalid: 00 # 3 STOP # Data segment ef - - - + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "missing data header" # EOF1 constructor returning an EOF1 contract - - | - :label good :raw + - data: | + :label eofreof1 :raw 0xEF0001 # Magic and version 010004 # One code segment 020001 # One code segment @@ -2130,25 +1709,12 @@ validInvalid: 38 # CODESIZE 50 # POP 00 # STOP + expectException: + "Shanghai" : "Invalid Code" # Init code which doesn't create a contract - - :label bad :raw 0x610BADFE - - - - expect: - - indexes: - data: - - :label good - network: - - '>=Shanghai' - result: !!bool true - - - - indexes: - data: - - :label bad - network: - - '>=Shanghai' - result: !!bool false + - data: :label bad :raw 0x610BADFE + expectException: + "Shanghai" : "Invalid Code" + ">=Cancun" : "invalid magic"