github.com/ethereumproject/go-ethereum@v5.5.2+incompatible/miner/mlog.go (about) 1 package miner 2 3 import "github.com/ethereumproject/go-ethereum/logger" 4 5 var mlogMiner = logger.MLogRegisterAvailable("miner", mlogMinerLines) 6 7 var mlogMinerLines = []*logger.MLogT{ 8 mlogMinerStart, 9 mlogMinerStop, 10 mlogMinerCommitWorkBlock, 11 mlogMinerCommitUncle, 12 mlogMinerCommitTx, 13 mlogMinerMineBlock, 14 mlogMinerConfirmMinedBlock, 15 mlogMinerSubmitWork, 16 } 17 18 var mlogMinerStart = &logger.MLogT{ 19 Description: `Called once when the miner starts.`, 20 Receiver: "MINER", 21 Verb: "START", 22 Subject: "COINBASE", 23 Details: []logger.MLogDetailT{ 24 {Owner: "COINBASE", Key: "ADDRESS", Value: "STRING"}, 25 {Owner: "MINER", Key: "THREADS", Value: "INT"}, 26 }, 27 } 28 29 var mlogMinerStop = &logger.MLogT{ 30 Description: `Called once when the miner stops.`, 31 Receiver: "MINER", 32 Verb: "STOP", 33 Subject: "COINBASE", 34 Details: []logger.MLogDetailT{ 35 {Owner: "COINBASE", Key: "ADDRESS", Value: "STRING"}, 36 {Owner: "MINER", Key: "THREADS", Value: "INT"}, 37 }, 38 } 39 40 var mlogMinerCommitWorkBlock = &logger.MLogT{ 41 Description: `Called when the miner commits new work on a block.`, 42 Receiver: "MINER", 43 Verb: "COMMIT_WORK", 44 Subject: "BLOCK", 45 Details: []logger.MLogDetailT{ 46 {Owner: "BLOCK", Key: "NUMBER", Value: "BIGINT"}, 47 {Owner: "COMMIT_WORK", Key: "TXS_COUNT", Value: "INT"}, 48 {Owner: "COMMIT_WORK", Key: "UNCLES_COUNT", Value: "INT"}, 49 {Owner: "COMMIT_WORK", Key: "TIME_ELAPSED", Value: "DURATION"}, 50 }, 51 } 52 53 var mlogMinerCommitUncle = &logger.MLogT{ 54 Description: `Called when the miner commits an uncle. 55 If $COMMIT_UNCLE is non-nil, uncle is not committed.`, 56 Receiver: "MINER", 57 Verb: "COMMIT", 58 Subject: "UNCLE", 59 Details: []logger.MLogDetailT{ 60 {Owner: "UNCLE", Key: "BLOCK_NUMBER", Value: "BIGINT"}, 61 {Owner: "UNCLE", Key: "HASH", Value: "STRING"}, 62 {Owner: "COMMIT", Key: "ERROR", Value: "STRING_OR_NULL"}, 63 }, 64 } 65 66 var mlogMinerCommitTx = &logger.MLogT{ 67 Description: `Called when the miner commits (or attempts to commit) a transaction. 68 If $COMMIT.ERROR is non-nil, the transaction is not committed.`, 69 Receiver: "MINER", 70 Verb: "COMMIT", 71 Subject: "TX", 72 Details: []logger.MLogDetailT{ 73 {Owner: "COMMIT", Key: "BLOCK_NUMBER", Value: "BIGINT"}, 74 {Owner: "TX", Key: "HASH", Value: "STRING"}, 75 {Owner: "COMMIT", Key: "ERROR", Value: "STRING"}, 76 }, 77 } 78 79 var mlogMinerMineBlock = &logger.MLogT{ 80 Description: `Called when the miner has mined a block. 81 $BLOCK.STATUS will be either 'stale' or 'wait_confirm'. $BLOCK.WAIT_CONFIRM is an integer 82 specifying _n_ blocks to wait for confirmation based on block depth, relevant only for when $BLOCK.STATUS is 'wait_confirm'.`, 83 Receiver: "MINER", 84 Verb: "MINE", 85 Subject: "BLOCK", 86 Details: []logger.MLogDetailT{ 87 {Owner: "BLOCK", Key: "NUMBER", Value: "BIGINT"}, 88 {Owner: "BLOCK", Key: "HASH", Value: "STRING"}, 89 {Owner: "BLOCK", Key: "STATUS", Value: "STRING"}, 90 {Owner: "BLOCK", Key: "WAIT_CONFIRM", Value: "INT"}, 91 }, 92 } 93 94 var mlogMinerConfirmMinedBlock = &logger.MLogT{ 95 Description: `Called once to confirm the miner has mined a block _n_ blocks back, 96 where _n_ refers to the $BLOCK.WAIT_CONFIRM value from MINER MINE BLOCK. 97 This is only a logging confirmation message, and is not related to work done.`, 98 Receiver: "MINER", 99 Verb: "CONFIRM_MINED", 100 Subject: "BLOCK", 101 Details: []logger.MLogDetailT{ 102 {Owner: "BLOCK", Key: "NUMBER", Value: "INT"}, 103 }, 104 } 105 106 var mlogMinerSubmitWork = &logger.MLogT{ 107 Description: `Called when a remote agent submits work to the miner. Note that this method only 108 acknowledges that work was indeed submitted, but does not confirm nor deny that the PoW was correct.`, 109 Receiver: "REMOTE_AGENT", 110 Verb: "SUBMIT", 111 Subject: "WORK", 112 Details: []logger.MLogDetailT{ 113 {Owner: "WORK", Key: "NONCE", Value: "INT"}, 114 {Owner: "WORK", Key: "MIX_DIGEST", Value: "STRING"}, 115 {Owner: "WORK", Key: "HASH", Value: "STRING"}, 116 {Owner: "WORK", Key: "EXISTS", Value: "BOOL"}, 117 }, 118 }