When Mining Ether on Ethereum Private Network, eth.blockNumber Stays at 0 Because DAG Generation Isn't Complete

Tadashi Shigeoka ·  Sun, August 12, 2018

I was troubled because eth.blockNumber remained at 0 even when trying to mine ether on an Ethereum private network, but it seems you need to wait about 10-30 minutes initially for DAG generation to complete.

Ethereum | イーサリアム

Ether Mining

Following etherを採掘する · Ethereum入門, I started mining ether on a private network.

For a while, the following state continued:

> eth.blockNumber
0

> eth.mining
true

> eth.hashrate
0

I thought “Mining isn’t working properly?” and researched it, only to find it was properly written in the footnote of Ethereum Introduction.

Mining speed varies depending on the environment. After starting the first mining session, DAG generation (see the "Ethereum Internals" chapter) occurs for the first 10-30 minutes, during which no blocks are mined. Once DAG generation is complete, block mining automatically begins. (「環境によって採掘の速度は異なります。最初の採掘開始後は、最初の10分~30分の間、DAGの生成(『Ethereumの内部』の章を参照)が行われ、その間はブロックは採掘されません。DAGの生成が完了次第、ブロックの採掘が自動的に開始されます。」)

After about 10 minutes, I was able to confirm that ether was being mined.

> eth.blockNumber
918

Confirming DAG Generation Completion

To be sure, I checked the time from DAG generation start to completion from the log file, and found it was 22:10 - 22:18, so it took about 8 minutes.

$ grep DAG geth_err.log
INFO [08-13|15:37:46.890] Disk storage enabled for ethash DAGs     dir=/Users/username/.ethash                           count=2
INFO [08-13|22:10:32.058] Generating DAG in progress               epoch=0 percentage=0 elapsed=1.499s
INFO [08-13|22:10:33.384] Generating DAG in progress               epoch=0 percentage=1 elapsed=2.824s

...

INFO [08-13|22:18:24.434] Generating DAG in progress               epoch=1 percentage=98 elapsed=4m39.704s
INFO [08-13|22:18:28.253] Generating DAG in progress               epoch=1 percentage=99 elapsed=4m43.523s

[Supplement] What is DAG?

For information about DAG, please read DAGとは? - イーサリアム wiki | イーサリアム・ジャパン.

That’s all from the Gemba where I was a bit troubled by eth.hashrate being 0 even when mining ether on an Ethereum private network.

Reference Information