Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a mining-heartbeat INFO line at every epoch #6183

Merged
merged 3 commits into from
May 5, 2021

Conversation

ribasushi
Copy link
Collaborator

Make the mining round chattier ( it should be ok: one extra message per epoch )

@benjaminh83
Copy link

Extremely valuable for all miners.
Both for debugging, but also much easier to overview the block win process. Normally we have to recognize a block win by the computation of a winningpost. This is much more intuitive and should be the standard of log outputs.
Downside of additional log size is not really a problem with only 1 additional line per 30s.

Output like:
2021-05-04T20:13:06.410+0200 INFO miner miner/miner.go:434 completed mineOne: round:728187 baseHeight:728186 netPower:5646685342788157440 minerPower:258389351792640 isEligible:true isWinner:false

@ribasushi ribasushi marked this pull request as draft May 5, 2021 11:46
@ribasushi
Copy link
Collaborator Author

Withdrawing from review for a bit, logline needs to be adjusted, too confusing to folks as it is.

miner/miner.go Outdated Show resolved Hide resolved
@ribasushi ribasushi marked this pull request as ready for review May 5, 2021 18:04
@ribasushi
Copy link
Collaborator Author

Slightly modified and expanded, ready for review. Tested on nerpa with and without a win, the log looks like this:

tail -f /srv/efs/lotus_nerpa_miner/lotus-miner.log | grep -E 'mined new block|winAttemptVRF|mineOne'

2021-05-05T17:07:36.172Z        INFO    gen     gen/gen.go:638  completed winAttemptVRF {"VRFb64": "lRaGzH3UH6KAbdckvWwfmgzKN3QzW-yFipNpysSTVWI5EStbYKulDYXlbSGRnmnHGUaQhOgDa1-CeTYnzyvhE-7t64fekuwsRUusxyhuGCy7uaKHrhSx2vSxzeyO17ja", "winCount": 0}
2021-05-05T17:07:36.173Z        INFO    miner   miner/miner.go:382      completed mineOne       {"forRound": 139314, "baseEpoch": 139313, "lookbackEpochs": 900, "networkPowerAtLookback": "16492674416640", "minerPowerAtLookback": "7516192768", "isEligible": true, "isWinner": false}
2021-05-05T17:08:06.492Z        INFO    gen     gen/gen.go:638  completed winAttemptVRF {"VRFb64": "i0UY3q8_N6dNYtlCkyFBswk7NBM_Wh8XtdLx9U3cGPm5iigIl9cpORLZhJdg1FD1FUHLVcGt4AZ7bYWcWifpLMQE13BUIxTQJWxQNputO4kSjikyHttS7DYcn2Jb5YgT", "winCount": 0}
2021-05-05T17:08:06.492Z        INFO    miner   miner/miner.go:382      completed mineOne       {"forRound": 139315, "baseEpoch": 139314, "lookbackEpochs": 900, "networkPowerAtLookback": "16492674416640", "minerPowerAtLookback": "7516192768", "isEligible": true, "isWinner": false}
2021-05-05T17:08:36.377Z        INFO    gen     gen/gen.go:638  completed winAttemptVRF {"VRFb64": "uDYJ0bnhAxGx1V0U2eqLZzXzXuoxmc_L1rIPcnp_Dc6su0yEpfR-_Ri8yUAPyqIEBifntTvzuB863YFvwb3rmSzlinxhH7y8jOqTe6zA4iA8nCFtDq9gvb40oXGGVv6o", "winCount": 1}
2021-05-05T17:08:59.469Z        INFO    miner   miner/miner.go:472      mined new block {"cid": "bafy2bzaceajicralfar3fktgnpiymogbpxhqjnamuwx5mtqe7icczpsdpobjm", "height": 139316, "miner": "t01005", "parents": ["t01001","t01002"], "parentTipset": "{bafy2bzacea5hdeu2yh3fa7qulqws4mgnx76revj6visd4xtyvvar5wcfiqu4i,bafy2bzaceaonfi3oyiagjiqumdbjuoajdryuxg5bddfqnxiklnkoltkbjm2ii}", "took": 23.101306284}
2021-05-05T17:08:59.469Z        INFO    miner   miner/miner.go:382      completed mineOne       {"forRound": 139316, "baseEpoch": 139315, "lookbackEpochs": 900, "networkPowerAtLookback": "16492674416640", "minerPowerAtLookback": "7516192768", "isEligible": true, "isWinner": true}
2021-05-05T17:09:05.910Z        INFO    gen     gen/gen.go:638  completed winAttemptVRF {"VRFb64": "qgdrGhpTRrJNvoR6y36p1r5QtT8P2ArRAhN-kF1Ks8s-ZJoXNTdQuy5u4uDPaTymFA_W-LbwbLMrujRLkXMKnqdwwNU9Rq-KQrWNGeqlF5jng7Qt7_Jfy5etQJ1HnwKm", "winCount": 0}
2021-05-05T17:09:05.911Z        INFO    miner   miner/miner.go:382      completed mineOne       {"forRound": 139317, "baseEpoch": 139316, "lookbackEpochs": 900, "networkPowerAtLookback": "16492674416640", "minerPowerAtLookback": "7516192768", "isEligible": true, "isWinner": false}

@ribasushi
Copy link
Collaborator Author

A bit more verbose vrf line now

2021-05-05T18:40:36.063Z        INFO    gen     gen/gen.go:638  completed winAttemptVRF {"beaconRound": 826966, "beaconDataB64": "lJwA-Ya21Aw5bQ6TNJbIauaGdOnpsfjEfpUd97aryOEUzQmAC_JQ8eFITZpYdhs1Ga-xV3u8sLbK0IiIg04XEVn5IW1yBzzHGrMT-8a686ECa6DjGsLJnnZqS27hoAWR", "electionRandB64": "S5j2kc3G_1ArcQSAPYZcjJZ1arls4RRonwKs7dVe-28", "vrfB64": "mObHmXAHiJHoh-KQ_iTujqDKK-bMCLOx9dQHFyGWEVsoMemArugCqq-42n21X3pjELKFUyF80cTa4n5W0wCqKE4E7poE36233ZX__wwXPIjRhVwNdIK8ww1VOYMNAdaV", "winCount": 0}
2021-05-05T18:40:36.063Z        INFO    miner   miner/miner.go:387      completed mineOne       {"forRound": 139500, "baseEpoch": 139499, "lookbackEpochs": 900, "networkPowerAtLookback": "16492674416640", "minerPowerAtLookback": "7516192768", "isEligible": true, "isWinner": false}

chain/gen/gen.go Show resolved Hide resolved
miner/miner.go Outdated Show resolved Hide resolved
miner/miner.go Outdated Show resolved Hide resolved
@ribasushi ribasushi changed the base branch from master to release/v1.9.0 May 5, 2021 21:22
@ribasushi ribasushi requested a review from raulk as a code owner May 5, 2021 21:22
@jennijuju jennijuju merged commit 19da73d into release/v1.9.0 May 5, 2021
@jennijuju jennijuju deleted the feat/more_mining_log branch May 5, 2021 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants