Ganache-cli: Ganache 6.3.0 -- EVM state changes after snapshot creation survive snapshot reversal

Created on 11 Feb 2019  路  5Comments  路  Source: trufflesuite/ganache-cli

Description

State changes made after a snapshot creation reappear after reversal.

This is similiar to closed issue #603, which was fixed in 6.2.4, still fixed in 6.2.5, reappeared in 6.3.0

Expected Behavior

After reverting a snapshot, the EVM should contain no state changes that were made after the snapshot creation.

Current Behavior

State changes survive snapshot reversal.

Steps to Reproduce

  1. Deploy a smart contract exposing a state variable uint x = 2 and a function inc() which will increase x by 1.
  2. Create a snapshot
  3. Call inc()
  4. Read x (will return 3)
  5. Revert the snapshot (so that x should become 2)
  6. Create a snapshot again
  7. Read x (will correctly return 2)
  8. Call inc()
  9. Read x: this will return 4 instead of the expected 3

One could repeat steps 5...8. After snapshet reversal everything seems fine, but after the inc() transaction the state seems to be as if no snapshot reverse ever happened.

My Environment

  • uname -srm

    FreeBSD 12.0-RELEASE amd64
    
  • node --version

    v11.8.0
    
  • npm --version

    6.7.0
    
  • truffle version

    Truffle v4.1.15 (core: 4.1.15)
    Solidity v0.4.25 (solc-js)
    
  • ganache-cli --version

    Ganache CLI v6.3.0 (ganache-core: 2.4.0)
    
  • Test repo: https://github.com/outofgas/ganache-snapshot-issue

needs validation priority-high

Most helpful comment

Problem is fixed in Ganache CLI v6.4.1

All 5 comments

Also dealing with this. 6.2.5 works fine

@angus-hamill Thanks for updating! Is it possible that you have a copy of your repo available somewhere? Or if you have a chance, could you post an MVT demonstrating the issue? I'm investigating this with @davidmurdoch and we think it would help to see another example.

Would it be possible to publish a new version with this fixed? Even a prerelease version would be helpful.

@olaf89 working on the release right now!

Problem is fixed in Ganache CLI v6.4.1

Was this page helpful?
0 / 5 - 0 ratings