Skip to content

Commit

Permalink
Merge pull request #515 from ethereum/fix-fetching-rpc
Browse files Browse the repository at this point in the history
Fixing fetching RPC
  • Loading branch information
msooseth authored Oct 23, 2024
2 parents f4fcb11 + 0690f1d commit f0e19c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- PAnd props are now recursively flattened
- Double negation in Prop are removed
- Updated forge to modern version, thereby fixing JSON parsing of new forge JSONs
- Fixed RPC fetching of contract data
- Symbolic ABI encoding for tuples, fuzzer for encoder
- Printing `Addrs` when running `symbolic` for counterexamples and reachable end states
- Improved symbolic execution tutorial
Expand Down
8 changes: 4 additions & 4 deletions src/EVM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1426,13 +1426,13 @@ accessStorage addr slot continue = do
fetchAccount addr $ \_ ->
accessStorage addr slot continue
where
rpcCall c slotConc = if c.external
rpcCall c slotConc = fetchAccount addr $ \_ ->
if c.external
then forceConcreteAddr addr "cannot read storage from symbolic addresses via rpc" $ \addr' ->
forceConcrete slotConc "cannot read symbolic slots via RPC" $ \slot' -> do
-- check if the slot is cached
contract <- preuse (#cache % #fetched % ix addr')
case contract of
Nothing -> internalError "contract marked external not found in cache"
use (#env % #contracts % at (LitAddr addr')) >>= \case
Nothing -> internalError $ "contract addr " <> show addr' <> " marked external not found in cache"
Just fetched -> case readStorage (Lit slot') fetched.storage of
Nothing -> mkQuery addr' slot'
Just val -> continue val
Expand Down

0 comments on commit f0e19c6

Please sign in to comment.