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

Make Ethereum tests pass #56

Merged
merged 44 commits into from
Oct 20, 2022
Merged

Make Ethereum tests pass #56

merged 44 commits into from
Oct 20, 2022

Conversation

arcz
Copy link
Collaborator

@arcz arcz commented Oct 10, 2022

Description

Closes #9

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

@arcz arcz marked this pull request as ready for review October 15, 2022 19:01
Copy link
Collaborator

@zoep zoep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm somewhat worried about the changes in these unit tests. I haven't look at the entire changes yet, but will try to do soon.

src/hevm/test/test.hs Outdated Show resolved Hide resolved
src/hevm/test/test.hs Outdated Show resolved Hide resolved
src/hevm/test/test.hs Outdated Show resolved Hide resolved
@d-xo
Copy link
Collaborator

d-xo commented Oct 18, 2022

pushed a fix for an off by one error in copySlice that I think fixes the unit tests.

Copy link
Collaborator

@d-xo d-xo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Epic PR <3. Looks mostly very good, just a few comments & questions.

It would also be great to add a CI stage that runs these tests to make sure we don't merge regressions here.

src/hevm/src/EVM/Expr.hs Outdated Show resolved Hide resolved
src/hevm/src/EVM/Expr.hs Outdated Show resolved Hide resolved
src/hevm/src/EVM/Expr.hs Show resolved Hide resolved
src/hevm/src/EVM/Fetch.hs Outdated Show resolved Hide resolved
src/hevm/src/EVM/Fetch.hs Outdated Show resolved Hide resolved
Comment on lines +150 to +153
ConcreteStore s -> mempty -- clearZeroStorage $ fromMaybe mempty $ Map.lookup (num addr) s
EmptyStore -> mempty
AbstractStore -> mempty -- error "AbstractStore, should this be handled?"
SStore {} -> mempty -- error "SStore, should this be handled?"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what needs to be done here? I think we can safely error out on any symbolic storage expressions here since VMTests should always be concrete...

Comment on lines +155 to +158
{-
clearOrigStorage :: EVM.Contract -> EVM.Contract
clearOrigStorage = undefined
-}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still needed?

@@ -114,72 +116,77 @@ checkExpectation diff x vm = do
return okState

-- quotient account state by nullness
(~=) :: Map Addr EVM.Contract -> Map Addr EVM.Contract -> Bool
(~=) cs cs' =
(~=) :: Map Addr (EVM.Contract, Storage) -> Map Addr (EVM.Contract, Storage) -> Bool
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the ContractWithStorage type here?

clearOrigStorage :: EVM.Contract -> EVM.Contract
clearOrigStorage = undefined
-}

-- TODO: why is this needed?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question hehe, any ideas? I'm not super familiar with the VMTest format...

src/hevm/src/EVM.hs Outdated Show resolved Hide resolved
@d-xo d-xo mentioned this pull request Oct 19, 2022
@d-xo d-xo merged commit 63a9917 into ethereum:main Oct 20, 2022
@d-xo
Copy link
Collaborator

d-xo commented Oct 20, 2022

Thanks again @arcz

@arcz arcz deleted the ethereum-tests branch October 20, 2022 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make ethereum tests pass
3 participants