ethereum / hevm

symbolic EVM evaluator
https://hevm.dev
GNU Affero General Public License v3.0
225 stars 46 forks source link

Isolated SMT arrays for logically seperate storage #436

Closed d-xo closed 7 months ago

d-xo commented 8 months ago

Description

This pr adds an smt level optimization that generates a unique smt array for each logically seperate region in storage (i.e. each solidity level map / array will get it's own smt level array). This allows us to completely eliminate invocations of keccak from many of our smt queries, which gives a huge speedup on all storage related operations.

The code here is still somewhat primitive, and seems to choke on more complex cases involving multiple reads / writes from nested arrays, but already gives a very satisfying speedup on storage related benchmarks.

Notes

Checklist