{"id":24130735,"url":"https://github.com/tsuberim/ganache-bug","last_synced_at":"2026-06-08T02:32:07.878Z","repository":{"id":135369812,"uuid":"159196832","full_name":"tsuberim/ganache-bug","owner":"tsuberim","description":"bug with ganache-cli","archived":false,"fork":false,"pushed_at":"2018-11-26T16:16:14.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T06:28:41.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsuberim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-26T16:08:18.000Z","updated_at":"2018-11-26T16:16:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"b032e6af-80cb-40eb-b065-7c2b41d1acb9","html_url":"https://github.com/tsuberim/ganache-bug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tsuberim/ganache-bug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsuberim%2Fganache-bug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsuberim%2Fganache-bug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsuberim%2Fganache-bug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsuberim%2Fganache-bug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsuberim","download_url":"https://codeload.github.com/tsuberim/ganache-bug/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsuberim%2Fganache-bug/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34046003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-11T20:36:06.719Z","updated_at":"2026-06-08T02:32:07.872Z","avatar_url":"https://github.com/tsuberim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ganache-bug\n\nbug with ganache-cli\n\n## Reproduce\n\n1. `git clone https://github.com/tsuberim/ganache-bug.git`\n2. `npm install`\n3. `npm run ganache` - start ganache command in one terminal tab for the first time (creating db directory `./asdf`)\n4. `node crash.js` - run a simple script in another tab sending 1 ether to an account.\n5. Stop ganache.\n6. `npm run ganache` - start ganache again (now using existing db).\n7. `node crash.js` - run simple script again.\n8. The script fails with:\n   ```\n   Error: Returned error: the tx doesn't have the correct nonce. account has nonce of: 0 tx has nonce of: 1\n   at Object.ErrorResponse (/home/tsuberim/projects/ganache-test/node_modules/web3-core-helpers/src/errors.js:29:16)\n   at /home/tsuberim/projects/ganache-test/node_modules/web3-core-requestmanager/src/index.js:140:36\n   at XMLHttpRequest.request.onreadystatechange (/home/tsuberim/projects/ganache-test/node_modules/web3-providers-http/src/index.js:91:13)\n   at XMLHttpRequestEventTarget.dispatchEvent (/home/tsuberim/projects/ganache-test/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)\n   at XMLHttpRequest._setReadyState (/home/tsuberim/projects/ganache-test/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)\n   at XMLHttpRequest._onHttpResponseEnd (/home/tsuberim/projects/ganache-test/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)\n   at IncomingMessage.\u003canonymous\u003e (/home/tsuberim/projects/ganache-test/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)\n   at IncomingMessage.emit (events.js:187:15)\n   at endReadableNT (_stream_readable.js:1094:12)\n   at process._tickCallback (internal/process/next_tick.js:63:19)\n   ```\n9. If using `nonce: 0`, ganache fails with:\n   ```\n   TypeError: Cannot read property 'pop' of undefined\n   at CheckpointTrie.Trie._updateNode (/home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/baseTrie.js:360:24)\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/baseTrie.js:107:16\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/baseTrie.js:461:14\n   at processNode (/home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/baseTrie.js:471:23)\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/baseTrie.js:457:5\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/baseTrie.js:180:7\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/util.js:75:7\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:52:16\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:269:32\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/node_modules/async/lib/async.js:44:16\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/util.js:71:7\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/merkle-patricia-tree/baseTrie.js:157:9\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/lib/database/levelupobjectadapter.js:41:16\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/level-sublevel/shell.js:101:15\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/level-sublevel/nut.js:121:19\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/encoding-down/index.js:51:21\n   at /home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/node_modules/cachedown/index.js:58:21\n   at ReadFileContext.callback (/home/tsuberim/projects/ganache-test/node_modules/ganache-cli/node_modules/ganache-core/lib/database/filedown.js:26:14)\n   at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:235:13)\n   ```\n\n**Note: The script succeeds when not restarting ganache midway.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsuberim%2Fganache-bug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsuberim%2Fganache-bug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsuberim%2Fganache-bug/lists"}