Skip to content

Commit

Permalink
Merge pull request #427 from ethereum/gas-family
Browse files Browse the repository at this point in the history
Abstract gas v3
  • Loading branch information
d-xo authored Jan 16, 2024
2 parents 7f41208 + d56c8f6 commit 7a828a5
Show file tree
Hide file tree
Showing 17 changed files with 747 additions and 635 deletions.
11 changes: 5 additions & 6 deletions cli/cli.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ import EVM.Solvers
import EVM.Stepper qualified
import EVM.SymExec
import EVM.Transaction qualified
import EVM.Types hiding (word, Env)
import EVM.Types hiding (word, Env, Symbolic)
import EVM.Types qualified
import EVM.UnitTest
import EVM.Effects

Expand Down Expand Up @@ -408,7 +409,7 @@ launchExec cmd = do
internalError "no EVM result"

-- | Creates a (concrete) VM from command line options
vmFromCommand :: Command Options.Unwrapped -> IO (VM RealWorld)
vmFromCommand :: Command Options.Unwrapped -> IO (VM Concrete RealWorld)
vmFromCommand cmd = do
(miner,ts,baseFee,blockNum,prevRan) <- case cmd.rpc of
Nothing -> pure (LitAddr 0,Lit 0,0,0,0)
Expand Down Expand Up @@ -493,14 +494,13 @@ vmFromCommand cmd = do
, baseState = EmptyBase
, txAccessList = mempty -- TODO: support me soon
, allowFFI = False
, symbolic = False
}
word f def = fromMaybe def (f cmd)
word64 f def = fromMaybe def (f cmd)
addr f def = maybe def LitAddr (f cmd)
bytes f def = maybe def decipher (f cmd)

symvmFromCommand :: Command Options.Unwrapped -> (Expr Buf, [Prop]) -> IO (VM RealWorld)
symvmFromCommand :: Command Options.Unwrapped -> (Expr Buf, [Prop]) -> IO (VM EVM.Types.Symbolic RealWorld)
symvmFromCommand cmd calldata = do
(miner,blockNum,baseFee,prevRan) <- case cmd.rpc of
Nothing -> pure (SymAddr "miner",0,0,0)
Expand Down Expand Up @@ -558,7 +558,7 @@ symvmFromCommand cmd calldata = do
, address = address
, caller = caller
, origin = origin
, gas = word64 (.gas) 0xffffffffffffffff
, gas = ()
, gaslimit = word64 (.gaslimit) 0xffffffffffffffff
, baseFee = baseFee
, priorityFee = word (.priorityFee) 0
Expand All @@ -575,7 +575,6 @@ symvmFromCommand cmd calldata = do
, baseState = maybe AbstractBase parseInitialStorage (cmd.initialStorage)
, txAccessList = mempty
, allowFFI = False
, symbolic = True
}
word f def = fromMaybe def (f cmd)
word64 f def = fromMaybe def (f cmd)
Expand Down
2 changes: 2 additions & 0 deletions hevm.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ common shared
-Wno-orphans
-Wno-ambiguous-fields
-optc-Wno-ignored-attributes
-fspecialize-aggressively
-fexpose-all-unfoldings
default-language: GHC2021
default-extensions:
DuplicateRecordFields
Expand Down
Loading

0 comments on commit 7a828a5

Please sign in to comment.