{"action":"created","issue":{"url":"https://api.github.com/repos/trufflesuite/truffle/issues/1235","repository_url":"https://api.github.com/repos/trufflesuite/truffle","labels_url":"https://api.github.com/repos/trufflesuite/truffle/issues/1235/labels{/name}","comments_url":"https://api.github.com/repos/trufflesuite/truffle/issues/1235/comments","events_url":"https://api.github.com/repos/trufflesuite/truffle/issues/1235/events","html_url":"https://github.com/trufflesuite/truffle/issues/1235","id":354503190,"node_id":"MDU6SXNzdWUzNTQ1MDMxOTA=","number":1235,"title":"Cannot run migration with fresh init using Geth (v5)","user":{"login":"kdelwat","id":1031518,"node_id":"MDQ6VXNlcjEwMzE1MTg=","avatar_url":"https://avatars3.githubusercontent.com/u/1031518?v=4","gravatar_id":"","url":"https://api.github.com/users/kdelwat","html_url":"https://github.com/kdelwat","followers_url":"https://api.github.com/users/kdelwat/followers","following_url":"https://api.github.com/users/kdelwat/following{/other_user}","gists_url":"https://api.github.com/users/kdelwat/gists{/gist_id}","starred_url":"https://api.github.com/users/kdelwat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdelwat/subscriptions","organizations_url":"https://api.github.com/users/kdelwat/orgs","repos_url":"https://api.github.com/users/kdelwat/repos","events_url":"https://api.github.com/users/kdelwat/events{/privacy}","received_events_url":"https://api.github.com/users/kdelwat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-27T22:35:52Z","updated_at":"2018-08-29T04:44:55Z","closed_at":null,"author_association":"NONE","body":"## Issue\r\n\r\nAfter initialising a new Truffle project, migration fails when deploying to a local geth testnet, even though it works with Ganache.\r\n\r\nI suspect this is due to not using HDWalletProvider, but a clearer error message could be a good idea.\r\n\r\n## Steps to Reproduce\r\n\r\n1. Install Truffle 5.0.0 beta\r\n2. Run `truffle init` in an empty directory\r\n3. Edit `truffle-config.js` to add a development network:\r\n    \r\n```\r\n  networks: {\r\n    // Useful for testing. The `development` name is special - truffle uses it by default\r\n    // if it's defined here and no other network is specified at the command line.\r\n    // You should run a client (like ganache-cli, geth or parity) in a separate terminal\r\n    // tab if you use this network and you must also set the `host`, `port` and `network_id`\r\n    // options below to some value.\r\n    //\r\n    development: {\r\n     host: \"localhost\",     // Localhost (default: none)\r\n     port: 8545,            // Standard Ethereum port (default: none)\r\n     network_id: \"*\",       // Any network (default: none)\r\n    },\r\n```\r\n4. Start a local geth node.\r\n5. Run `truffle migrate`\r\n\r\n## Expected Behavior\r\n\r\nThe migration should complete successfully.\r\n\r\n## Actual Results\r\n\r\nThe migration failed with the following error:\r\n\r\n```\r\nError: Number can only safely store up to 53 bits\r\n    at assert (/home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/number-to-bn/~/bn.js/lib/bn.js:6:1)\r\n    at BN.toNumber (/home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/number-to-bn/~/bn.js/lib/bn.js:506:1)\r\n    at Object.hexToNumber (/home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/web3-utils/src/utils.js:234:1)\r\n    at Method.outputBlockFormatter [as outputFormatter] (/home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/web3-eth/~/web3-core-helpers/src/formatters.js:236:1)\r\n    at Method.formatOutput (/home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/web3-eth/~/web3-core-method/src/index.js:163:1)\r\n    at sendTxCallback (/home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/web3-eth/~/web3-core-method/src/index.js:476:1)\r\n    at /home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/web3-eth/~/web3-core-requestmanager/src/index.js:147:1\r\n    at /home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:101:1\r\n    at XMLHttpRequest.request.onreadystatechange (/home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/web3/~/web3-providers-http/src/index.js:79:1)\r\n    at XMLHttpRequestEventTarget.dispatchEvent (/home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request-event-target.js:34:1)\r\n    at XMLHttpRequest._setReadyState (/home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:208:1)\r\n    at XMLHttpRequest._onHttpResponseEnd (/home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:318:1)\r\n    at IncomingMessage.<anonymous> (/home/cadel/.nvm/versions/node/v9.11.1/lib/node_modules/truffle/build/webpack:/~/xhr2-cookies/dist/xml-http-request.js:289:47)\r\n    at IncomingMessage.emit (events.js:185:15)\r\n    at endReadableNT (_stream_readable.js:1106:12)\r\n    at process._tickCallback (internal/process/next_tick.js:178:19)\r\n```\r\n\r\n## Environment\r\n\r\n* Operating System: Ubuntu (Windows Subsystem for Linux)\r\n* Ethereum client: geth 1.8.13\r\n* Truffle version: Truffle v5.0.0-beta.0 (core: 5.0.0-beta.0)\r\n* Solidity version: Solidity v0.4.24 (solc-js)\r\n* node version: v9.11.1\r\n* npm version: 5.6.0\r\n"},"comment":{"url":"https://api.github.com/repos/trufflesuite/truffle/issues/comments/416822581","html_url":"https://github.com/trufflesuite/truffle/issues/1235#issuecomment-416822581","issue_url":"https://api.github.com/repos/trufflesuite/truffle/issues/1235","id":416822581,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjgyMjU4MQ==","user":{"login":"kdelwat","id":1031518,"node_id":"MDQ6VXNlcjEwMzE1MTg=","avatar_url":"https://avatars3.githubusercontent.com/u/1031518?v=4","gravatar_id":"","url":"https://api.github.com/users/kdelwat","html_url":"https://github.com/kdelwat","followers_url":"https://api.github.com/users/kdelwat/followers","following_url":"https://api.github.com/users/kdelwat/following{/other_user}","gists_url":"https://api.github.com/users/kdelwat/gists{/gist_id}","starred_url":"https://api.github.com/users/kdelwat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kdelwat/subscriptions","organizations_url":"https://api.github.com/users/kdelwat/orgs","repos_url":"https://api.github.com/users/kdelwat/repos","events_url":"https://api.github.com/users/kdelwat/events{/privacy}","received_events_url":"https://api.github.com/users/kdelwat/received_events","type":"User","site_admin":false},"created_at":"2018-08-29T04:44:55Z","updated_at":"2018-08-29T04:44:55Z","author_association":"NONE","body":"@cgewecke Thanks for the help, I've done some digging and think it stems from something in the Geth genesis block.\r\n\r\nThese are my geth options:\r\n```bash\r\ngeth\r\n--port 38545 \\\r\n--mine \\\r\n--minerthreads=1 \\\r\n--rpc \\\r\n--rpcport 8545 \\\r\n--rpccorsdomain \"*\" \\\r\n--datadir ~/.testnet/data/ \\\r\n--port 30303 \\\r\n--nodiscover \\\r\n--rpcapi web3,eth,net,debug \\\r\n--networkid 99 \\\r\n--unlock 0x1ccb322887b44f43f2775965b3397c180d2b3275 \\\r\nconsole\r\n```\r\n\r\nUsing the following genesis block (from [here](https://medium.com/@chim/ethereum-how-to-setup-a-local-test-node-with-initial-ether-balance-using-geth-974511ce712)) works perfectly:\r\n```json\r\n{\r\n  \"config\": {\r\n    \"chainId\": 15,\r\n    \"homesteadBlock\": 0,\r\n    \"eip155Block\": 0,\r\n    \"eip158Block\": 0\r\n  },\r\n  \"nonce\": \"0x0000000000000042\",\r\n  \"timestamp\": \"0x0\",\r\n  \"parentHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\r\n  \"gasLimit\": \"0x8000000\",\r\n  \"difficulty\": \"0x400\",\r\n  \"mixhash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\r\n  \"coinbase\": \"0x3333333333333333333333333333333333333333\",\r\n  \"alloc\": {\r\n    \"0x1ccb322887b44f43f2775965b3397c180d2b3275\": {\r\n      \"balance\": \"0x5337000000000000000000\"\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nHowever, the Geth node I was using was created with [dapptools](https://github.com/dapphub/dapptools), which generated this genesis:\r\n\r\n```json\r\n{\r\n  \"alloc\": {\r\n    \"0x1ccb322887b44f43f2775965b3397c180d2b3275\": {\r\n      \"balance\": \"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"\r\n    }\r\n  },\r\n  \"config\": {\r\n    \"byzantiumBlock\": 0,\r\n    \"chainId\": 99,\r\n    \"clique\": { \"epoch\": 3000, \"period\": 0 },\r\n    \"eip155Block\": 0,\r\n    \"eip158Block\": 0,\r\n    \"homesteadBlock\": 0\r\n  },\r\n  \"difficulty\": \"0x1\",\r\n  \"extraData\": \"0x3132333400000000000000000000000000000000000000000000000000000000ca38c3972e3e6c0c09f9baceeeebefb92a00f7410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\r\n  \"gaslimit\": \"0xffffffffffffffff\"\r\n}\r\n```\r\n\r\nI've confirmed directly with Geth that the second genesis block ends in the issue described above, whereas the first doesn't. I can't pin down the issue unfortunately 😞 \r\n\r\nSince this appears to be an issue with Geth rather than Truffle, this issue can probably be closed."}}
{"actor":{"display_login":"kdelwat"}}