We have a snapshot from a previous version of Ganache (6.1.x). When loading this in Ganache CLI v6.2.3 (ganache-core: 2.3.1) I receive a JSON parse error.
SyntaxError: Unexpected token o in JSON at position 1
at Object.parse [as decode] (<anonymous>)
at Codec.decodeValue (/Users/jacob/projects/ethdev/0x/0x-starter-project/node_modules/level-codec/index.js:45:36)
at /Users/jacob/projects/ethdev/0x/0x-starter-project/node_modules/level-sublevel/nut.js:122:34
at /Users/jacob/projects/ethdev/0x/0x-starter-project/node_modules/encoding-down/index.js:57:5
at /Users/jacob/projects/ethdev/0x/0x-starter-project/node_modules/cachedown/index.js:61:5
at /Users/jacob/projects/ethdev/0x/0x-starter-project/node_modules/ganache-core/lib/database/filedown.js:28:5
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
Here is the tx printed prior to the throw at:
Codec.prototype.decodeValue = function (value, opts) {
console.log(value, opts);
return this._valueEncoding(opts).decode(value)
}
It appears that previous transaction was encoded correctly as JSON, but this is unmarshalled to an object and fails to be decoded as JSON. That is, there is one prior transaction which was successfully loaded and the second (not raw JSON) fails.
I believe this release should have no breaking changes when moving from 6.1.x to 6.2.x. It should be able to load previous snapshot versions.
1.
2.
3.
4.
@dekz, thanks for reporting this. We did not intend on having in breaking changes in this release. My hunch is that this is a regression caused by https://github.com/trufflesuite/ganache-core/commit/7f837abeb33ebee034849214aaa5c07e68c49de2. Most of the team is on holiday here in the US until Monday, so we'll be sure to look into it then.
Looping @nicholasjpaterno for his TX knowledge and @benjamincburns as well in case he can spot the issue easily.
I can confirm that something around snapshotting is broken since 6.2.0 or 6.2.1
A bit more details on builds created by bot https://github.com/PolymathNetwork/polymath-core/issues/417
After manually testing, it is confirmed that snapshotting feature is not working as expected. Something else might also have broke but snapshotting is definitely broken.
Edit: This is a bit different issue. We are using evm_snapshot and evm_revert in the same test and it's still misbehaving. nothing to do with migrating snapshots from 6.1.X.
This is a problem we're facing as well in @aragon/cli, which was using 6.1.x snapshots before and got silently updated to 6.2: https://github.com/aragon/aragon-cli/issues/274.
We're in the process of rebuilding our snapshots using 6.2.x but paused due to the above comment which suggests snapshots may not be working correctly in 6.2.x.
@dekz @maxsam4 @sohkai This should be fixed in the latest ganache release. Let us know if you're still experiencing any issues!
@nicholasjpaterno Confirmed this has been fixed for us with the new release :).
Most helpful comment
@nicholasjpaterno Confirmed this has been fixed for us with the new release :).