Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EIP-4750 test vectors #1094

Open
gumb0 opened this issue Nov 10, 2022 · 0 comments
Open

EIP-4750 test vectors #1094

gumb0 opened this issue Nov 10, 2022 · 0 comments

Comments

@gumb0
Copy link
Member

gumb0 commented Nov 10, 2022

Test vectors extracted from evmone implementation unit tests.

EOF validation

Valid cases

Bytecode Comment
EF0001 010001 00 FE implicit type section, no data section
EF0001 010001 020001 00 FE DA implicit type section, data section
EF0001 030002 01000100 0000 FE type section, no data section
EF0001 030002 010001 020001 00 0000 FE DA type section, data section
EF0001 030004 010001 010001 00 00000000 FE FE multiple code sections, no data section
EF0001 030004 010001 010001 020001 00 00000000 FE FE DA multiple code sections, data section
EF0001 030008 010001 010002 010002 010002 00 0000010000010203 FE 5000 3000 8000 non-void input and output types
ef000101000100fc RETF is terminating instruction
"EF0001 030800" + 1024 * "010001" + "00" + 1024 * "0000" + 1024 * "FE" max number of code sections

Invalid cases

Bytecode Validation error
EF0001 040001 00 FE unknown_section_id
EF0001 010001 010001 00 FE FE mandatory_type_section_missing
EF0001 030002 030002 010001 010001 00 0000 0000 FE FE multiple_type_sections
EF0001 030002 010001 010001 030002 00 0000 FE FE 0000 multiple_type_sections
EF0001 010001 030002 00 FE 0000 code_section_before_type_section
EF0001 010001 030002 010001 00 FE 0000 FE code_section_before_type_section
EF0001 010001 030002 020003 00 FE 0000 AABBCC code_section_before_type_section
EF0001 010001 020003 030002 00 FE AABBCC 0000 code_section_before_type_section
EF0001 030001 010001 00 00 FE invalid_type_section_size
EF00010004 010001 00 00000000 FE invalid_type_section_size
EF0001 030004 010001 010001 010001 00 00000000 FE FE FE invalid_type_section_size
EF0001 030008 010001 010001 010001 00 0000000000000000 FE FE FE invalid_type_section_size
EF0001 030002 010003 00 0001 60005C invalid_first_section_type
EF0001 030002 010002 00 0100 5000 invalid_first_section_type
EF0001 030002 010003 00 0203 60005C invalid_first_section_type
"EF0001 030801" + 1025 * "010001" + "00" + 1025 * "0000" + 1025 * "FE" too_many_code_sections

TODO add truncated CALLF test

Execution

Bytecode Calldata Result Comment
ef000103000401000f010002000000020160016008fb000160005260206000f303fc 0000000000000000000000000000000000000000000000000000000000000007
ef000103000601003b01001701001d0000000101010160043560003560e01c63c766526781145d001c63c6c2ea1781145d00065050600080fd50fb000260005260206000f350fb000160005260206000f3600181115d0004506001fc60018103fb000181029050fc600281115d0004506001fc60028103fb000260018203fb0002019050fc c76652670000000000000000000000000000000000000000000000000000000000000005 0000000000000000000000000000000000000000000000000000000000000078 Call fac(5)
ef000103000601003b01001701001d0000000101010160043560003560e01c63c766526781145d001c63c6c2ea1781145d00065050600080fd50fb000260005260206000f350fb000160005260206000f3600181115d0004506001fc60018103fb000181029050fc600281115d0004506001fc60028103fb000260018203fb0002019050fc c6c2ea17000000000000000000000000000000000000000000000000000000000000000f 0000000000000000000000000000000000000000000000000000000000000262 Call fib(15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant