Skip to content

Commit 62049c5

Browse files
committed
prepare 0.52.0
1 parent 90fabf0 commit 62049c5

File tree

2 files changed

+75
-34
lines changed

2 files changed

+75
-34
lines changed

CHANGELOG.md

Lines changed: 74 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,63 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## Unreleased
8+
## [0.52.0] - 2023-10-26
9+
10+
This is a major breaking release that removes several user facing features and includes non trivial
11+
breakage for library users. These changes mean the code is significantly simpler, more performant,
12+
and allow support for new features like fully symbolic addresses.
13+
14+
In addition to the changes below, this release includes significant work on performance
15+
optimization for symbolic execution.
916

1017
## Added
1118

12-
- `vm.prank` now handles symbolic addresses
13-
- added `vm.deal` cheatcode
14-
- added `vm.assume` cheatcode
19+
The major new user facing feature in this release is support for fully symbolic addresses (including
20+
fully symbolic addresses for deployed contracts). This allows tests to be writen that call
21+
`vm.prank` with a symbolic value, making some tests (e.g. access control, token transfer logic) much
22+
more comprehensive.
23+
24+
Some restrictions around reading balances from and transfering value between symbolic addresses are
25+
currently in place. Currently, if the address is symbolic, then you will only be able to read it's
26+
balance, or transfer value to/from it, if it is the address of a contract that is actually deployed.
27+
This is required to ensure soundness in the face of aliasing between symbolic addresses. We intend
28+
to lift this restriction in a future release.
29+
30+
### Other
31+
32+
- Support for `vm.deal`
33+
- Support for `vm.assume` (this is semantically identical to using `require`, but does simplify the
34+
process of porting exisitng fuzz tests to be symbolic)
35+
- the `check` prefix now recognized for symbolic tests
36+
- `hevm test` now takes a `--number` argument to specify which block should be used when making rpc queries
37+
38+
## Changed
39+
40+
### Revert Semantics in Solidity Tests
41+
42+
solidity tests no longer consider reverts to be a failure, and check only for the ds-test failed bit
43+
or user defined assertion failures (i.e. `Panic(0x01)`). This makes writing tests much easier as
44+
users no longer have to consider trivial reverts (e.g. arithmetic overflow).
45+
46+
A positive (i.e. `prove`/`check`) test with no rechable assertion violations that does not have any
47+
succesful branches will still be considered a failure.
48+
49+
## Removed
50+
51+
hevm has been around for a while, and over time has accumulated many features. We decided to remove
52+
some of these features in the interest of focusing our attention, increasing our iteration speed and
53+
simplifying maintainance. The following user facing features have been removed from this release:
54+
55+
- The visual debugger has been removed
56+
- All concrete ds-test executors have been removed (i.e. plain, fuzzer, invariant)
57+
- Rpc caching and state serialization has been removed (i.e. all `--cache` / `--state` flags)
58+
- The various `DAPP_TEST` variables are no longer observed
59+
- The `--initial-storage` flag no longer accepts a concrete prestore (valid values are now `Empty` or `Abstract`)
1560

1661
## Fixed
1762

63+
This release also includes many small bugfixes:
64+
1865
- CopySlice wraparound issue especially during CopyCallBytesToMemory
1966
- Contracts deployed during symbolic execution are created with an empty storage (instead of abstract in previous versions)
2067
- EVM.Solidity.toCode to include contractName in error string
@@ -26,24 +73,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2673
- `vm.prank` now works correctly when passed a symbolic address
2774
- storage layout information will now be parsed from the output of `forge build` if it is available
2875

29-
## Changed
76+
## API Changes
3077

31-
- Less noisy console output during tracing
78+
### Reworked Storage Model / Symbolic Addresses
3279

33-
### UI
80+
Adding symbolic addresses required some fairly significant changes to the way that we model storage.
81+
We introduced a new address type to `Expr` (`Expr EAddr`), that allows us to model fully symbolic
82+
addresses. Instead of modelling storage as a global symbolic 2D map (`address -> word -> word`) in
83+
`vm.env`, each contract now has it's own symbolic 1D map (`word -> word`), that is stored in the
84+
`vm.contracts` mapping. `vm.contracts` is now keyed on `Expr EAddr` instead of `Addr`. Addresses
85+
that are keys to the `vm.contracts` mapping are asserted to be distinct in our smt encoding. This
86+
allows us to support symbolic addresses in a fully static manner (i.e. we do not currently need to
87+
make any extra smt queries when looking up storage for a symbolic address).
3488

35-
- `check` prefix now recognized for symbolic tests
36-
- solidity tests no longer consider reverts to be a failure, and check only for the ds-test failed bit or unser defined assertion failures (i.e. `Panic(0x01)`). A positive (i.e. non `proveFail`) test with no rechable assertion violations that does not have any succesful branches will still be considered a failure.
37-
- `test` now takes a `--number` argument to specify which block should be used when making rpc queries
38-
- The `--initial-storage` flag no longer accepts a concrete prestore (valid values are now `Empty` or `Abstract`)
39-
- The visual debugger has been removed
40-
- All concrete ds-test executors have been removed (i.e. plain, fuzzer, invariant)
41-
- Rpc caching and state serialization has been removed (i.e. all `--cache` / `--state` flags)
42-
- The various `DAPP_TEST` variables are no longer observed
89+
### Mutable Memory & ST
90+
91+
We now use a mutable representation of memory if it is currently completely concrete. This is a
92+
significant performance improvement, and fixed a particulary egregious memory leak. It does entail
93+
the use of the `ST` monad, and introduces a new type parameter to the `VM` type that tags a given
94+
instance with it's thread local state. Library users will now need to either use the ST moand and
95+
`runST` or `stToIO` to compose and sequence vm executions.
96+
97+
## GHC 9.4
4398

44-
### Internals
99+
Hevm is now built with ghc9.4. While earlier compiler versions may continue to work for now, they
100+
are no longer explicitly tested or supported.
101+
102+
### Other
45103

46-
- Contract addresses can now be fully symbolic
47104
- Contract balances can now be fully symbolic
48105
- Contract code can now be fully abstract. Calls into contracts with unknown code will fail with `UnexpectedSymbolicArg`.
49106
- Run expression simplification on branch conditions
@@ -55,22 +112,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
55112
- `evalProp` is renamed to `simplifyProp` for consistency
56113
- Mem explosion in `writeWord` function was possible in case `offset` was close to 2^256. Fixed.
57114
- BufLength was not simplified via bufLength function. Fixed.
58-
59-
## API Changes
60-
61-
Support for fully symbolic contract addresses required some very extensive changes to our storage model:
62-
63-
- A new type has been added to `Expr` that can represent concrete or symbolic addresses
64-
- The contracts mapping is now keyed on terms of type `Expr EAddr` (instead of `Addr`)
65-
- Storage has been moved from a global storage mapping in `vm.env` into a per contract one
66-
- Terms of type `Expr Storage` now model a per contract store (i.e. W256 -> W256)
67-
- A new type has been added to `Expr`: `EContract`. It has one constructor that
68-
is a simplified view of the full `Contract` typed used in the `VM` storage mapping.
69-
- `Success` nodes in `Expr End` now return a mapping from `Expr EAddr` to `Expr EContract` instead of an `Expr Storage`.
70-
- Nonces are now modeled as a `Maybe Word64` (where `Nothing` can be read as "symbolic").
71-
- `Expr Storage` no longer has an `EmptyStore` constructor (use `ConcreteStore mempty` instead)
72-
- Contract balances are now fully symbolic
73-
- Contract code can now be unknown. There is a new constructor for `ContractCode` to represent this (`UnknownCode`)
74115
- `VMOpts` no longer takes an initial store, and instead takes a `baseState`
75116
which can be either `EmptyBase` or `AbstractBase`. This controls whether
76117
storage should be inialized as empty or fully abstract. Regardless of this

hevm.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cabal-version: 3.0
22
name:
33
hevm
44
version:
5-
0.51.3
5+
0.52.0
66
synopsis:
77
Symbolic EVM Evaluator
88
homepage:

0 commit comments

Comments
 (0)