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

Missing coverage in EOF container validation tests #672

Open
17 tasks
jochem-brouwer opened this issue Jul 4, 2024 · 0 comments
Open
17 tasks

Missing coverage in EOF container validation tests #672

jochem-brouwer opened this issue Jul 4, 2024 · 0 comments

Comments

@jochem-brouwer
Copy link
Member

jochem-brouwer commented Jul 4, 2024

In EthereumJS, in this commit ethereumjs/ethereumjs-monorepo@1e97ba1 we pass the 1.0.5 container validation tests of EOF, specifically this release: https://github.com/ethereum/execution-spec-tests/releases/tag/eip7692%40v1.0.5

I ran a coverage on it to see which lines were hit and which were not. I implemented most from the spec first, then ran these tests, and then fixed whatever tests were failing. These cases might of course be false positives (a certain error might be implemented twice, for instance, so the second error is never hit).

Header validation

  • Container section size 0
  • Container sections size > 0x0100
  • Container size of a container is 0
  • Containers in Tx Init Mode (remaining data is the calldata of the tx init per 7698)

Container code validation

  • Stack underflow of an arbitrary opcode (simple test: POP STOP)
  • A code section marked as non-returning (0x80 outputs) contains RETF
  • Code section contains an invalid opcode (for instance opcode 0xFD)
  • Code section ends with RJUMPV, but only the opcode (so no table size or table)
  • CALLF points to a code section which is marked as non-returning (0x80 outputs)
  • Stack underflow/overflow condition for CALLF (too low stack before calling the new code section / outputs - inputs might overflow current stack)
  • JUMPF stack overflow condition
  • RETF stack height does not match the amount of outputs of the code section
  • EOFCreate points to a subcontainer which does not exist (> num subcontainers)
  • Subcontainer is pointed to by both EOFCREATE and RETURNCONTRACT
  • The unstable stack condition (NOP PUSH1 RJUMPI[-4]) (backwards jump has different recorded stack heights)
  • Stack overflow condition in general (stack height exceeds the max stack height)
  • Container has subcontainers which are never targeted by any EOFCREATE / RETURNCONTRACT
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