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-4200 test vectors #1093

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

EIP-4200 test vectors #1093

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 010004 00 5C000000 Valid RJUMP, offset = 0
EF0001 010007 00 5C000300000000 Valid RJUMP, offset = 3
EF0001 010005 00 005CFFFC00 Valid RJUMP, offset = -4
EF0001 010006 00 60005D000000 Valid RJUMPI, offset = 0
EF0001 010009 00 60005D000300000000 Valid RJUMPI, offset = 3
EF0001 010006 00 60005DFFFB00 Valid RJUMPI, offset = -5

Invalid cases

Bytecode Validation error
EF0001 010001 00 5C RJUMP truncated
EF0001 010002 00 5C00 RJUMP truncated
EF0001 010003 00 60005D RJUMPI truncated
EF0001 010004 00 60005D00 RJUMPI truncated
EF0001 010004 00 5CFFFB00 RJUMP into header (offset = -5)
EF0001 010004 00 5CFFF300 RJUMP to before code begin (offset = -13)
EF0001 010004 00 5C000200 RJUMP to after code end (offset = 2)
EF0001 010004 00 5C000100 RJUMP to code end (offset = 1)
EF0001 010004 00 5CFFFF00 RJUMP to the same RJUMP immediate (offset = -1)
EF0001 010006 00 60005CFFFC00 RJUMP to PUSH immediate (offset = -4)
EF0001 010006 00 60005DFFF900 RJUMPI into header (offset = -7)
EF0001 010006 00 60005DFFF100 RJUMPI to before code begin (offset = -15)
EF0001 010006 00 60005D000200 RJUMPI to after code end (offset = 2)
EF0001 010006 00 60005D000100 RJUMPI to code end (offset = 1)
EF0001 010006 00 60005DFFFF00 RJUMPI to the same RJUMPI immediate (offset = -1)
EF0001 010006 00 60005DFFFC00 RJUMPI to PUSH immediate (offset = -4)

Execution

Bytecode Calldata Result Comment
ef000101000e005c0001fe600160005360016000f3 01 RJUMP
ef000101000e020004005c0001fe600160005360016000f300deadbeef 01 RJUMP with data section
ef0001010012005c000bfe600160005360016000f35cfff300 01 RJUMP backward
ef0001010012020004005c000bfe600160005360016000f35cfff3deadbeef 01 RJUMP backward with data section
ef000101000d005c0000600160005360016000f3 01 RJUMP 0 offset
ef000101001a006000355d000a600260005360016000f3600160005360016000f3 01 01 RJUMPI condition is true
ef000101001a006000355d000a600260005360016000f3600160005360016000f3 00 02 RJUMPI condition is false
ef000101001e005c000bfe600160005360016000f36000355dfff0600260005360016000f3 01 01 RJUMPI backwards condition is true
ef000101001e005c000bfe600160005360016000f36000355dfff0600260005360016000f3 00 02 RJUMPI backwards condition is false
ef0001010010006000355d0000600160005360016000f3 01 01 RJUMPI 0 offset condition is true
ef0001010010006000355d0000600160005360016000f3 00 01 RJUMPI 0 offset condition is false
5c0001fe600160005360016000f3 exceptional abort RJUMP undefined in leacy
60015d000a600260005360016000f3600160005360016000f3 exceptional abort RJUMPI undefined in legacy
@hugo-dc hugo-dc mentioned this issue Dec 8, 2022
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