ethereum / aleth

Aleth – Ethereum C++ client, tools and libraries
GNU General Public License v3.0
3.96k stars 2.17k forks source link

Logging when creating the DAG cache #1362

Closed jorisbontje closed 9 years ago

jorisbontje commented 9 years ago

When starting the eth process for the first time as a miner, the DAG cache creation process takes a long time; blocking all transactions from being mined.

To inform the user of what is happening there should be some kind of logging (on default loglevel) what is going on. For example from go-ethereum (even though using /tmp/dag is a poor choice):

2015/03/20 10:04:16 [POW] No DAG found. Generating new DAG in '/tmp/dag' (this takes a while)...
2015/03/20 10:04:21 [POW] ... still generating DAG (5.004618271) ...
2015/03/20 10:04:26 [POW] ... still generating DAG (10.001209874) ...
2015/03/20 10:04:31 [POW] ... still generating DAG (15.003634154) ...
simondlr commented 9 years ago

+1. This is probably why AlethZero also hangs when clicking mining. Progress bar is required in the GUI (or at least in the CLI too). The Go-Client worked fine when I created the DAG. It took 7minutes but it went smoothly. In Aleth however, after a while, my whole setup begins to freeze. It chomps all available memory. Not sure if this is related to GUI issues wrt dag creation (the combination of which causes total lockout). Unsure.

https://github.com/ethereum/cpp-ethereum/issues/1244, https://github.com/ethereum/cpp-ethereum/issues/1259

simondlr commented 9 years ago

Similar issue with Mix. Clicking "New Block" the first time takes (again on my MBP 2011, about 7 minutes).

EDIT:

To summarise.

Mist -> click mine. See in terminal that progress is happening. Wait 7 minutes to complete. Mining starts. Mix -> Click "new block". Wait 7 mintues, first block is mined. No progress bars. Aleth -> Click "Mine". After about 3 minutes all available computing starts being chomped up. After 15min, OS X freezes.

ethers commented 9 years ago

Agree with this enhancement. A mitigation for Alethzero users is once you have the dag built, do not delete it: if you need to reset, use menu Special->Kill Blockchain in AZ.

Similar suggestion for eth cmd line is #1367

debris commented 9 years ago

:+1: I was also going to propose it :)

subtly commented 9 years ago

This is an important issue for system testing as well -- we need a CLI parameter and logging for this. Handling this in AlethZero and CLI is different - after all, CLI doesn't have GUI and GUI isn't a text console. So logs can be: "DAG not found. Generating DAG at /path/to/eth.dag" "Finished generating DAG."

And for AlethZero the statusbar can be updated. Height/difficulty/etc can't be > 0 until DAG is created so that text can be replaced with "Generating DAG". Perhaps with a % indicator (if that's possible).

LefterisJP commented 9 years ago

Closing since we do have a log message with the DAG generation progress in place right now.