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

hevm equivalence does not check log equivalence #586

Open
charles-cooper opened this issue Oct 7, 2024 · 2 comments
Open

hevm equivalence does not check log equivalence #586

charles-cooper opened this issue Oct 7, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@charles-cooper
Copy link

charles-cooper commented Oct 7, 2024

per title. an example

diff --git a/examples/tokens/ERC20.vy b/examples/tokens/ERC20.vy
index 2d70fd670..73065bcb4 100644
--- a/examples/tokens/ERC20.vy
+++ b/examples/tokens/ERC20.vy
@@ -120,7 +120,7 @@ def _burn(_to: address, _value: uint256):
     assert _to != empty(address)
     self.totalSupply -= _value
     self.balanceOf[_to] -= _value
-    log IERC20.Transfer(_to, empty(address), _value)
+    log IERC20.Transfer(empty(address), _to, _value)

(pulled from https://github.com/vyperlang/vyper/blob/c02d2d8c5ed8c904c31b7f3f937ab01781fc9891/examples/tokens/ERC20.vy)

results in hevm equivalence reporting

Found 3969 total pairs of endstates
Asking the SMT solver for 1120 pairs
Reuse of previous queries was Useful in 0 cases
No discrepancies found
@msooseth
Copy link
Collaborator

msooseth commented Oct 9, 2024

We are "fixing" this via #590 -- defining what it means to be "equivalent". Logs are explicitly excluded. However, maybe they should be included.... I'll keep this open, so we can discuss whether they should be included, instead.

@charles-cooper
Copy link
Author

i think it makes sense to add logs to the definition of equivalence (bandwidth permitting). they affect the state root (iirc), and applications depend on them for semantics. a non-equivalent log (like in the example) might not affect the smart contract semantics directly, but it can affect the behavior of downstream applications.

@msooseth msooseth added the enhancement New feature or request label Oct 24, 2024
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

2 participants