Skip to content

Commit

Permalink
Add CALLF Stack Overflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-dc authored and winsvega committed May 5, 2023
1 parent 6fa8342 commit e89fcb0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
23 changes: 18 additions & 5 deletions EOFTests/EIP4750/validInvalid.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"validInvalid" : {
"_info" : {
"comment" : "Test various examples to see if they are valid or invalid.\nImplements\n EOF1V4750_0001 (Valid) EOF code containing single type section\n EOF1V4750_0002 (Valid) EOF code containing single type section and data section\n EOF1V4750_0003 (Valid) EOF code containing multiple type/code sections\n EOF1V4750_0004 (Valid) EOF code containing multiple type/code sections and data section\n EOF1V4750_0005 (Valid) EOF code containing multiple type/code sections, no void I/O types\n EOF1V4750_0006 (Valid) EOF code containing multiple type/code sections, no void I/O types, containing data section\n EOF1V4750_0007 (Valid) EOF code containing RETF as terminating instruction\n EOF1V4750_0008 (Valid) EOF code containing RETF as terminating instruction, containing data section\n EOF1V4750_0009 (Valid) EOF code containing the maximum number of code sections\n EOF1V4750_0010 (Valid) EOF code containing the maximum number of code sections and data section\n EOF1I4750_0001 (Invalid) EOF code missing mandatory type section\n EOF1I4750_0002 (Invalid) EOF code containing multiple type headers\n EOF1I4750_0003 (Invalid) EOF code containing type section size (Size 1)\n EOF1I4750_0004 (Invalid) EOF code containing type section size (Size 8 - 1 Code section)\n EOF1I4750_0005 (Invalid) EOF code containing type section size (Size 8 - 3 Code sections)\n EOF1I4750_0006 (Invalid) EOF code containing invalid section type (1,0) (First section having a type different than (0,0))\n EOF1I4750_0007 (Invalid) EOF code containing invalid section type (0,1) (First section having a type different than (0,0))\n EOF1I4750_0008 (Invalid) EOF code containing invalid section type (2,3) (First section having a type different than (0,0))\n EOF1V4750_0011 (Invalid) EOF code containing too many code sections\n EOF1I4750_0009 (Invalid) EOF code containing CALLF to a non existing code section\n EOF1I4750_0010 (Invalid) EOF code containing truncated CALLF\n EOF1I4750_0011 (Invalid) EOF code containing deprecated instruction (JUMP)\n EOF1I4750_0012 (Invalid) EOF code containing deprecated instruction (JUMPI)\n EOF1I4750_0013 (Invalid) EOF code containing deprecated instruction (PC)\n EOF1I4750_0014 (Invalid) EOF code containing call to functions without required stack specified in type section\n EOF1I4750_0015 (Invalid) EOF code containing call to functions without required stack NOT specified in type section\n EOF1I4750_0016 (Invalid) EOF code containing function trying to return more items than specified in type section\n EOF1I4750_0017 (Invalid) EOF code containing function exceeding max stack items\n",
"filling-rpc-server" : "evmone-t8n 0.10.0-dev",
"filling-tool-version" : "retesteth-0.3.1-shanghai+commit.e3504804.Linux.g++",
"generatedTestHash" : "ffdf01e7af68bf611297f74c71512a3c9cd818404ebb8c38295958fd52c32849",
"comment" : "EOF1V4750_0001 (Valid) EOF code containing single type section\nEOF1V4750_0002 (Valid) EOF code containing single type section and data section\nEOF1V4750_0003 (Valid) EOF code containing multiple type/code sections\nEOF1V4750_0004 (Valid) EOF code containing multiple type/code sections and data section\nEOF1V4750_0005 (Valid) EOF code containing multiple type/code sections, no void I/O types\nEOF1V4750_0006 (Valid) EOF code containing multiple type/code sections, no void I/O types, containing data section\nEOF1V4750_0007 (Valid) EOF code containing RETF as terminating instruction\nEOF1V4750_0008 (Valid) EOF code containing RETF as terminating instruction, containing data section\nEOF1V4750_0009 (Valid) EOF code containing the maximum number of code sections\nEOF1V4750_0010 (Valid) EOF code containing the maximum number of code sections and data section\nEOF1I4750_0001 (Invalid) EOF code missing mandatory type section\nEOF1I4750_0002 (Invalid) EOF code containing multiple type headers\nEOF1I4750_0003 (Invalid) EOF code containing type section size (Size 1)\nEOF1I4750_0004 (Invalid) EOF code containing type section size (Size 8 - 1 Code section)\nEOF1I4750_0005 (Invalid) EOF code containing type section size (Size 8 - 3 Code sections)\nEOF1I4750_0006 (Invalid) EOF code containing invalid section type (1,0) (First section having a type different than (0,0))\nEOF1I4750_0007 (Invalid) EOF code containing invalid section type (0,1) (First section having a type different than (0,0))\nEOF1I4750_0008 (Invalid) EOF code containing invalid section type (2,3) (First section having a type different than (0,0))\nEOF1V4750_0011 (Invalid) EOF code containing too many code sections\nEOF1I4750_0009 (Invalid) EOF code containing CALLF to a non existing code section\nEOF1I4750_0010 (Invalid) EOF code containing truncated CALLF\nEOF1I4750_0011 (Invalid) EOF code containing deprecated instruction (JUMP)\nEOF1I4750_0012 (Invalid) EOF code containing deprecated instruction (JUMPI)\nEOF1I4750_0013 (Invalid) EOF code containing deprecated instruction (PC)\nEOF1I4750_0014 (Invalid) EOF code containing call to functions without required stack specified in type section\nEOF1I4750_0015 (Invalid) EOF code containing call to functions without required stack NOT specified in type section\nEOF1I4750_0016 (Invalid) EOF code containing function trying to return more items than specified in type section\nEOF1I4750_0017 (Invalid) EOF code containing function exceeding max stack items\nEOF1I4750_0018 (Invalid) EOF code containing function which max stack height causes to exceed max stack items (stack overflow)\n",
"filling-rpc-server" : "evm version 1.11.0-unstable-83c1cc5b-20230504",
"filling-tool-version" : "retesteth-0.3.1-shanghai+commit.75cb580b.Linux.g++",
"generatedTestHash" : "04dc19885e706bc1e77e1d3314f0f8290b9bcd200e6953838d8f378d58b82a88",
"lllcversion" : "Version: 0.5.14-develop.2022.4.6+commit.401d5358.Linux.g++",
"solidity" : "Version: 0.8.18-develop.2023.1.16+commit.469d6d4d.Linux.g++",
"source" : "src/EOFTestsFiller/EIP4750/validInvalidFiller.yml",
"sourceHash" : "14a39d864b6e93b5ead683a44877f658154990a558d6daeff7632f71cc688787"
"sourceHash" : "23531d7ac9b4f8ff2427923a22f1cfa4445afe638140ac231cc482f4db608ff4"
},
"vectors" : {
"validInvalid_0" : {
Expand Down Expand Up @@ -281,6 +281,19 @@
}
}
},
"validInvalid_28" : {
"code" : "0xef00010100080200020404000a03000000000003ff0000000360018080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080b0000100600160016001505050b1",
"results" : {
"Cancun" : {
"exception" : "EOF_StackOverflow",
"result" : false
},
"Shanghai" : {
"exception" : "EOF_InvalidCode",
"result" : false
}
}
},
"validInvalid_3" : {
"code" : "0xef000101000802000200010001030001000000000000000000fefeda",
"results" : {
Expand Down
11 changes: 9 additions & 2 deletions src/EOFTestsFiller/EIP4750/validInvalidFiller.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
validInvalid:
_info:
comment: |
Test various examples to see if they are valid or invalid.
Implements
EOF1V4750_0001 (Valid) EOF code containing single type section
EOF1V4750_0002 (Valid) EOF code containing single type section and data section
EOF1V4750_0003 (Valid) EOF code containing multiple type/code sections
Expand Down Expand Up @@ -31,6 +29,7 @@ validInvalid:
EOF1I4750_0015 (Invalid) EOF code containing call to functions without required stack NOT specified in type section
EOF1I4750_0016 (Invalid) EOF code containing function trying to return more items than specified in type section
EOF1I4750_0017 (Invalid) EOF code containing function exceeding max stack items
EOF1I4750_0018 (Invalid) EOF code containing function which max stack height causes to exceed max stack items (stack overflow)
forks:
- ">=Shanghai"

Expand Down Expand Up @@ -573,3 +572,11 @@ validInvalid:
"Shanghai" : "EOF_InvalidCode"
">=Cancun" : "EOF_MaxStackHeightExceeded"
# EOF1I4750_0018 (Invalid) EOF code containing function which max stack height causes to exceed max stack items (stack overflow)
# Code[0](Types: 0:0): PUSH1(1) DUP*1022 CALLF(1) STOP
# Code[1](Types: 0:0): PUSH1(1) DUP DUP POP POP POP RETF
- data: |
:label EOF1I4750_0018 :raw 0xef00010100080200020404000a03000000000003ff0000000360018080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080b0000100600160016001505050b1
expectException:
"Shanghai" : "EOF_InvalidCode"
">=Cancun" : "EOF_StackOverflow"
1 change: 1 addition & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
- ID: **EOF1I4750_0015**: EOF code containing call to functions without required stack NOT specified in type section
- ID: **EOF1I4750_0016**: EOF code containing function trying to return more items than specified in type section
- ID: **EOF1I4750_0017**: EOF code containing function exceeding max stack items
- ID: **EOF1I4750_0018**: EOF code containing function which max stack height causes to exceed max stack items (stack overflow)
- ID: **EOF1I5450_0001** Stack height mismatch for different paths (a)
- ID: **EOF1I5450_0002** Stack height mismatch for different paths (b)
- ID: **EOF1I5450_0003** Calls returning different number of outputs
Expand Down

0 comments on commit e89fcb0

Please sign in to comment.