0

I was willing to setup a private ethereum network with low difficulty. I can fix the difficulty of each block to 1 (or constant) to avoid problem of very high difficulty with increase in no of blocks.

But this has a downside of decreased block time and hence running out of disk space sooner.

Is there any way geth source code could be modified to remove miners reward and hence coinbase transactions? So a block is added to chain when there is some real transaction. This will save disk space to great extent and we can enjoy constant difficulty.

3 Answers 3

0

Ethereum doesn't have a coinbase transaction. Rewards are acredited automatically to the miner address in the block header (after processing all transactions). The miner address is only 20 bytes so you won't save much by eliminating it.

In a PoW chain the security is based on mined blocks, so generating less blocks is against the chain security. Perhaps you might want to switch to a PoA network or another alternative, like using a Plasma chain.

0

Is there any way geth source code could be modified to remove miners reward and hence coinbase transactions?

Ethereum will give mining reward for coinbase by adding to it's balance. Then if you don't want to give reward for coinbase, you only need to remove these below lines in consensus.

https://github.com/ethereum/go-ethereum/blob/a1f8549262567ddacac3d4180f8a6ca0826036a9/consensus/ethash/consensus.go#L567

https://github.com/ethereum/go-ethereum/blob/a1f8549262567ddacac3d4180f8a6ca0826036a9/consensus/ethash/consensus.go#L575

Hope this will help!

0

Just add the following option to geth command line:

--exec 'setInterval (() => txpool.status.pending > 0 ? miner.start () : miner.stop (), 100)'

It will automatically start mining when there is something to mine and stop mining in the opposite case.

See geth command line and management APIs documentation for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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