Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

reverting back to same snapshotId causes ganache-core to freeze #104

Closed
ewingrj opened this issue Apr 18, 2018 · 7 comments
Closed

reverting back to same snapshotId causes ganache-core to freeze #104

ewingrj opened this issue Apr 18, 2018 · 7 comments

Comments

@ewingrj
Copy link
Contributor

ewingrj commented Apr 18, 2018

Expected Behavior

I can call evm_revert with the same snaphostID multiple times

Current Behavior

It works correctly the first time, but will cause testrpc to freeze up if reverting to the same id a 2nd time

Possible Solution

Steps to Reproduce (for bugs)

  1. create a snapshot
  2. rollback to the snapshot you created
  3. optionally modify state
  4. rollback to the snapshot you created again
  5. ganache never returns a response and will not respond to any additional requests

Context

Your Environment

  • Version used: 7.0.0-beta.0
  • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1):
  • Server type and version:
  • Operating System and version: osx
  • Link to your project:
@mikeseese
Copy link
Contributor

Thanks for reporting this! We're going to try to verify this still happens, but I noticed that you're running 7.0.0-beta.0. This build was deprecated when we decided to not continue on the 7.x series yet. Please upgrade to the latest version (ganache-cli@6.1.8).

Thanks!

@konstantinzolotarev
Copy link

konstantinzolotarev commented Nov 19, 2018

Yep got same bug.
And also more details on this:

When you revert any snapshot using eth_revert after this you could kill ganache using another evm_revert with any parameter. Here is "advanced logs"

Logs in gist

This logs are from fresh ganache installation.

Tried on:

  • ganache-cli@6.1.8
  • ganache-cli@6.2.1
  • Ganache for Mac v1.2.2

And also in 6.2.1 response format for evm_snapshot changed from 0x01 to 0x1

@davidmurdoch
Copy link
Member

@konstantinzolotarev thanks for providing the additional info. As far as the evm_snapshot response change goes, we now (correctly) return an RPC Quantity hex encoded string instead of an RPC Unformatted Data hex encoded string.

@AlexanderPoschenrieder
Copy link

Still happening v6.2.5.

@mortimr
Copy link
Contributor

mortimr commented Jan 20, 2019

@AlexanderPoschenrieder, @tcoulter mentionned that this behavior is intended here
As snapshots are getting "consummed" after a revert, I just recreate a snapshot after each of my reverts and it's working fine (using this for contract testing)

@balexander4
Copy link

Documentation has been updated on this to clarify what is occurring. Just awaiting a the PR approval before closing this issue.

@honestbonsai
Copy link

honestbonsai commented Feb 10, 2021

@ewingrj Closing as we believe this has been fixed. If that's not the case, feel free to reopen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants