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

Rule coverage and configuration well-formedness #2291

Open
PetarMax opened this issue Feb 9, 2024 · 1 comment
Open

Rule coverage and configuration well-formedness #2291

PetarMax opened this issue Feb 9, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@PetarMax
Copy link
Contributor

PetarMax commented Feb 9, 2024

The rules for checkBalanceUnderflow:

     rule <k> #checkBalanceUnderflow ACCT VALUE => #refund GCALL ~> #pushCallStack ~> #pushWorldState ~> #end EVMC_BALANCE_UNDERFLOW ... </k>
         <output> _ => .Bytes </output>
         <callGas> GCALL </callGas>
         <account>
           <acctID> ACCT </acctID>
           <balance> BAL </balance>
           ...
         </account>
      requires VALUE >Int BAL

    rule <k> #checkBalanceUnderflow ACCT VALUE => . ... </k>
         <account>
           <acctID> ACCT </acctID>
           <balance> BAL </balance>
           ...
         </account>
      requires VALUE <=Int BAL

only consider configurations in which the account with identifier ACCT is present.

Is this:

  • an omission, in the sense that there should be a third rule when the account is not present; or
  • a consequence of having a well-formed EVM configuration, in the sense that an account with identifier ACCT must always be present when there is an #checkBalanceUnderflow check?

Perhaps it would be a good idea if we went through the semantics to see if there are other sets of rules that are incomplete in this sense. Is there a way of understanding this automatically, perhaps on definition creation? @ehildenb @jberthold

@palinatolmach
Copy link
Contributor

As suggested by @PetarMax, one approach to solve this would be to introduce a third [owise] rule that would get executed if the configuration is not well-formed, which can result in some informative message to the user suggesting that ACCT should be present when #checkBalanceUnderflow is encountered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants