7

I am running geth 1.8.0 I have been running the node for over 24 hours

> eth.syncing
false
> eth.getBlock("latest").number
0

Is this a valid state?

Why is the number 0 even though syncing is complete

Peers

> admin.peers
[{
    caps: ["eth/62", "eth/63", "les/1", "les/2"],
    id: "1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082",
    name: "Geth/v1.7.3-stable/linux-amd64/go1.7",
    network: {
      inbound: false,
      localAddress: "172.31.22.171:51030",
      remoteAddress: "52.74.57.123:30303",
      static: false,
      trusted: false
    },
    protocols: {
      eth: {
        difficulty: 2.562703311832198e+21,
        head: "0x447386c92b3d4658cc7764d82aaec83d6c4a7a18f6fe87dd558396327964ee39",
        version: 63
      }
    }
}, {
    caps: ["eth/62", "eth/63", "les/1", "les/2"],
    id: "138ec659b5ec02029c0c08d4a8f377174622c4d4f8684cf22bd6393a1e46e731ed1bf87249f4003f4c47f7a39611c39e0dc7004091604183d6e5781f1eaf81be",
    name: "Geth/v1.8.0-stable-5f540757/linux-amd64/go1.9.4",
    network: {
      inbound: false,
      localAddress: "172.31.22.171:45178",
      remoteAddress: "79.98.29.93:30303",
      static: false,
      trusted: false
    },
    protocols: {
      eth: {
        difficulty: 2.562703311832198e+21,
        head: "0x447386c92b3d4658cc7764d82aaec83d6c4a7a18f6fe87dd558396327964ee39",
        version: 63
      }
    }
}, {
    caps: ["eth/62", "eth/63"],
    id: "1bbae192d212e6d91748e72dfa0eb2f97b9dadcb7fdcb7f535dcde652ee91856e5db3f9a71b4a7a9252650acb8e150b7b401a600d131c108fa283bd017628370",
    name: "Geth/v1.7.3-stable-4bb3c89d/linux-amd64/go1.9.2",
    network: {
      inbound: false,
      localAddress: "172.31.22.171:54778",
      remoteAddress: "173.212.235.16:30303",
      static: false,
      trusted: false
    },
    protocols: {
      eth: {
        difficulty: 2.269417677247923e+21,
        head: "0xaf4818557d616ad6ed896aa8abf3be2c83a7e175c07ea7ae434d27ded196c959",
        version: 63
      }
    }
}, {
    caps: ["eth/62", "eth/63"],
    id: "209a2c2862760b2d63da23780507b373de397b39589ddf50a6bf11f828268d604b0ecfd06390d7f9d72c516d77b364ea573fe12d7c29d18342f0a6fa4ca3c260",
    name: "Geth/v1.7.2-stable-1db4ecdc/windows-amd64/go1.9",
    network: {
      inbound: false,
      localAddress: "172.31.22.171:42810",
      remoteAddress: "184.12.106.238:30303",
      static: false,
      trusted: false
    },
    protocols: {
      eth: {
        difficulty: 2.554069593289375e+21,
        head: "0x8856b4ede4ccfc4be4ed723b306ae8874b444a2a0aa44e86201192500ddafb90",
        version: 63
      }
    }
}, {
    caps: ["eth/62", "eth/63"],
    id: "318ed633acf08141bd9badc4b9c7983e58b64e06d9b957f8e80b385cbefe8b211594dec2e0a40b3f94ebeeb41383b22704841a4a99e9ffb0b7ad930fd2beecd7",
    name: "Geth/pubnode/v1.7.3-stable-4bb3c89d/linux-amd64/go1.9.2",
    network: {
      inbound: false,
      localAddress: "172.31.22.171:43452",
      remoteAddress: "52.192.57.242:30303",
      static: false,
      trusted: false
    },
    protocols: {
      eth: {
        difficulty: 2.5626594943418226e+21,
        head: "0x37ad0388509b48f6028c782a0f619b951de1ee50bcaaac5597a2062e48ab0e58",
        version: 63
      }
    }
}, {
    caps: ["eth/63"],
    id: "648aa55343ca96ff026c18990bfde40a80ab61090d99bb28f0ae60299cfa0c9478538e38919fb57e3ddf2e7ec3df2b778a15fcd2a4582ebdae020e1bf5ad6d78",
    name: "Geth/v1.7.3-stable-4bb3c89d/linux-amd64/go1.9",
    network: {
      inbound: false,
      localAddress: "172.31.22.171:56590",
      remoteAddress: "86.148.23.224:30303",
      static: false,
      trusted: false
    },
    protocols: {
      eth: {
        difficulty: 17179869184,
        head: "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3",
        version: 63
      }
    }
}, {
    caps: ["eth/62", "eth/63"],
    id: "7e3c72d20c40b6606f07e9cf726a223cf28c2a71e83354f72187fe64dc857791cde27210aac1074c818fe216d46f2e0933a392a2d3c035ed173b3467b1e3e6fb",
    name: "Geth/v1.7.3-stable/linux-amd64/go1.8.5",
    network: {
      inbound: false,
      localAddress: "172.31.22.171:39010",
      remoteAddress: "13.115.174.21:30303",
      static: false,
      trusted: false
    },
    protocols: {
      eth: {
        difficulty: 2.5627062218671076e+21,
        head: "0x51f16c3910cc604cc319978b619ed0d4147df67f77b4bbd16478d73e5103305e",
        version: 63
      }
    }
}, {
    caps: ["eth/63"],
    id: "a7f1a8a46cc2f6c7bbecc8d7d35647fe5480dbd82c04583ff35ef1cfcb045965e1d5dce5c112f6fdcb0d63e90a4bb7392daaf8adfa784ef0a77e320a7060f0aa",
    name: "Geth/v1.7.3-unstable-86f6568f/linux-amd64/go1.9",
    network: {
      inbound: false,
      localAddress: "172.31.22.171:60034",
      remoteAddress: "91.224.140.211:19300",
      static: false,
      trusted: false
    },
    protocols: {
      eth: {
        difficulty: 2.425191243091731e+21,
        head: "0xce35300c184f9e1b3d8d7a7b7d8c0839782b99d6e61a8fffab83304ede90c726",
        version: 63
      }
    }

}]

Console command to start geth

geth --mine --minerthreads=4
  • What is the geth launch command line used? Does the node have enough peers? Run admin.peers from the geth console. – Ismael Feb 15 '18 at 23:49
  • It does have peers. 8 of them. – Madhavan Malolan Feb 16 '18 at 3:51
  • What does eth.blockNumber return? It appears you are syncing against mainnet it is very unlikely you will be able to mine there using geth. Also try eth.getBlock(5099300) to obtain a recent block. – Ismael Feb 16 '18 at 7:07
  • eth.blockNumber also returns 0. eth.getBlock(5099300) does return me the block details. – Madhavan Malolan Feb 16 '18 at 8:08
  • The block number is correctly updated now. It just took a long while from the point syncing was false to eth.blockNumber reflecting the correct block. Is this expected? – Madhavan Malolan Feb 16 '18 at 12:30
0

Same issue with
Geth/v1.8.2-stable-b8b9f7f4/linux-amd64/go1.9.4
It took more than 12 hour in initial sync.

To fix it I did : a. created a address
(e.g. personal.newAccount("some-strong-password"))
b. Transferred 0.1 ETH to newly created address.

After that
eth.getBlock("latest").number started returning correct value.

| improve this answer | |
0

Syncing is false because you did not sync with any of the available network chain.

And latest block is 0 since you did not mine any block on your own.

Do any of the above to get a valid block

| improve this answer | |
0

According to https://github.com/ethereum/go-ethereum/issues/14338:

Geth uses fast sync by default. The block states are unavailable for intermediate blocks and are downloaded only for the recent state. As such, up to the point that sync completes, the latest complete block is zero, since all newer blocks are incomplete during sync. When fast sync finishes, it downloads the associated state for the head, so the head block becomes complete and the latest block can be bumped to the current head.

| improve this answer | |
-2

the eth.getBlock("latest").number returning 0 means no block was mined. maybe you just didn't deploy anything or make any transaction. you should check your nodejs server, i think.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.