evm_revert regression #4093
Description
On the latest stable release: ganache v7.7.2 (@ganache/cli: 0.8.1, @ganache/core: 0.8.1)
The last version that doesn't have the issue is 7.6.0. 7.7.0 and 7.7.2 exhibit the issue detailed below.
I am having a hard time creating a self contained repro but the issue is reliably reproduced.
ganache is launched with: ganache-cli --chain.vmErrorsOnRPCResponse true --fork.url <LOCAL INSTANCE> --fork.blockNumber 16257210 --miner.blockTime 3600 --chain.chainId 1 -v --miner.timestampIncrement 12 --wallet.deterministic --logging.debug
The miner.blockTime is set very high so that I can manually mine using evm_mine
The gist of the application flow is:
send transactions
evm_mine
send transactions
evm_mine
evm_snapshot # SNAPSHOT1
send transactions
evm_mine
evm_snapshot # SNAPSHOT2
send transactions
evm_mine
evm_revert back to #SNAPSHOT2 (this succeeds)
send transactions
evm_mine
evm_revert back to #SNAPSHOT1 (this fails)
There are no logs in from ganache, only 'Reverting to snapshot #1'
But the json response from ganache is:
{'id': 101, 'jsonrpc': '2.0', 'error': {'message': '.for is not iterable', 'stack': 'TypeError: .for is not iterable\n at ForkTrie.revertMetaData (/usr/local/lib/node_modules/ganache/dist/node/1.js:2:143320)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async Blockchain.<anonymous> (/usr/local/lib/node_modules/ganache/dist/node/1.js:2:63016)\n at async Blockchain.revert (/usr/local/lib/node_modules/ganache/dist/node/1.js:2:70613)', 'code': -32700}}
And after querying for the current block, as expected the evm did not revert.
Activity