GithubHelp home page GithubHelp logo

Comments (6)

MrChico avatar MrChico commented on July 20, 2024

I'm pretty sure this error has to with the #badJumpDest? rule, specifically clauses like this:

    rule <k> #badJumpDest? [ JUMP ] => #end EVMC_BAD_JUMP_DESTINATION ... </k>
         <wordStack> DEST : WS </wordStack>
         <program> ... DEST |-> OP ... </program>
       requires OP =/=K JUMPDEST

seem to be comparing JUMPDEST (with sort NullStackOp) with a general OP (of sort K)

from evm-semantics.

ehildenb avatar ehildenb commented on July 20, 2024

Hmmmm, we could add extra operator ==OpCode and =/=OpCode which insert the additional sort-checks needed. I wonder if this would cut down on how many "missing SMTLIB translation" errors people get.

from evm-semantics.

ehildenb avatar ehildenb commented on July 20, 2024

@MrChico I'm trying some other optimizations on another branch (just local for now), but I'm running into a (potentially) similar issue. Can you try changing <program> ... DEST |-> OP ... </program> to <program> ... DEST |-> OP:OpCode ... </program> for both the JUMP and JUMPI cases of your semantics of #badJumpDest? and see if it changes the behavior on this example?

from evm-semantics.

MrChico avatar MrChico commented on July 20, 2024

Yes, @ehildenb , I did some experimentation with that before which did change the example.

After spending some time thinking about this, my hypothesis is that this mainly becomes an issue in trying to prove very general specs that end up having the jumpdestination as a symbolic value, forcing K to evaluate whether an OP-code at an arbitrary position is a JUMPDEST or not.

Another behavior I just noticed with #badjumpdest is that there is an unnecessary branching when checking #badJumpDest?[JUMPI ], see screenshots from @mhhf 's kdebugger (WIP)
screen shot 2018-05-03 at 15 16 42
screen shot 2018-05-03 at 15 16 50

from evm-semantics.

ehildenb avatar ehildenb commented on July 20, 2024

@yzhang90 has noticed the same. You can try out branch opcode-basic-blocks, which should remove this unnecessary branching. #badJumpDest? is removed altogether, and instead the semantics are given directly over JUMP and JUMPI. Be warned though, the tests do not pass yet on that branch. I'm working on getting these branches merged, but it's 3 PRs back.

from evm-semantics.

ehildenb avatar ehildenb commented on July 20, 2024

I believe this was solved by delaying checking for bad jump destinations until we semantic execution time (instead of a pre-check).

from evm-semantics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.