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

WIP: abiFromBytecode backends #62

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

WIP: abiFromBytecode backends #62

wants to merge 11 commits into from

Conversation

shazow
Copy link
Owner

@shazow shazow commented Oct 13, 2023

Experimenting with more modular EVM disassembly backends.

@shazow shazow marked this pull request as draft October 13, 2023 18:18
@shazow shazow changed the title WIP: disasm backends WIP: abiFromBytecode backends Oct 17, 2023
@shazow
Copy link
Owner Author

shazow commented Oct 18, 2023

Notes for current results:

 BENCH  Summary

  disassemble with whatsabi - src/__tests__/sevm.bench.ts > bench: whatsabi vs sevm > decompile '0x7a250d5630b4cf539739df2c5dacb4c659f2488d' ('Uniswap v2')
    3.15x faster than disassemble with sevm

  disassemble with whatsabi - src/__tests__/sevm.bench.ts > bench: whatsabi vs sevm > decompile '0x00000000006c3852cbEf3e08E8dF289169EdE581' ('Seaport v1.1')
    25.82x faster than disassemble with sevm

  disassemble with whatsabi - src/__tests__/sevm.bench.ts > bench: whatsabi vs sevm > decompile '0x4A137FD5e7a256eF08A7De531A17D0BE0cc7B6b6' ('Random unverified')
    4.43x faster than disassemble with sevm

  disassemble with whatsabi - src/__tests__/sevm.bench.ts > bench: whatsabi vs sevm > decompile '0x000000000000Df8c944e775BDe7Af50300999283' ('Has 0x0 selector')
    590.52x faster than disassemble with sevm
 ❯ src/__tests__/sevm.test.ts (4) 339ms
   ❯ whatsabi vs sevm: abiFromBytecode (4) 339ms
     ✓ decompile '0x7a250d5630b4cf539739df2c5dacb4c659f2488d' ('Uniswap v2') (1)
       ✓ compare selectors
     ✓ decompile '0x00000000006c3852cbEf3e08E8dF289169EdE581' ('Seaport v1.1') (1)
       ✓ compare selectors
     ✓ decompile '0x4A137FD5e7a256eF08A7De531A17D0BE0cc7B6b6' ('Random unverified') (1)
       ✓ compare selectors
     ❯ decompile '0x000000000000Df8c944e775BDe7Af50300999283' ('Has 0x0 selector') (1)
       × compare selectors

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 FAIL  src/__tests__/sevm.test.ts > whatsabi vs sevm: abiFromBytecode > decompile '0x000000000000Df8c944e775BDe7Af50300999283' ('Has 0x0 selector') > compare selectors
AssertionError: expected [ '0x83197ef0', '0xcc066bb8', …(1) ] to strictly equal [ '0x00000000', '0xf04f2707' ]

- Expected
+ Received

  Array [
-   "0x00000000",
+   "0x83197ef0",
+   "0xcc066bb8",
    "0xf04f2707",
  ]

Seems sevm fails to find the zero selector, and finds two extraneous selectors for that one example?

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

Successfully merging this pull request may close these issues.

1 participant