Producing the optimal block-template to mine is a NP-hard problem.
The optimal block-template includes the highest sat/byte(or weight) transactions to maximise the miner reward. Assuming this computation and propagation of the perfect block-template took no time, it would make sense to update the block-template for each new transaction accepted to the memo-pool, as this new transaction could potentially increase the block reward. In this hypothetical scenario, the mining hardware is continuously working (hashing) and continuously updating the block header for a better block reward.
However, since producing the optimal block-template is NP-hard, it takes significant time/cost to compute the optimal block-template from the mempool at any point in time:
- Knapsack problem - maximise total fee value in block
- Maximum independent vertex set - ensure no two tx spend the same output.
Both problems scale exponentially and are expensive. This cost could have been invested in more hash-rate.
Therefore, there is a trade-off between block optimisation and mining utilization.
- Continuously optimising for a better block-template represents a cost in itself, which could be invested in more mining hash rate.
- There exists a financial optimum, where suboptimal blocks-templates are mined, whilst mining equipment is fully utilised.
- (One extreme could be mining empty blocks, maximising the number of hashes performed, whilst spending zero resources in block optimisation.)
- In practice, simplified heuristics are used to update new block-templates cost-effectively as mining is being performed.
One don't need to reset the nounce. One can choose any nounce in any order. – Osias Jota – 2019-10-02T18:46:14.697
So there is a possibilty to choose how many transactions is ok to start minning? Will the adding new transaction to potential block reset the minning (reset the nonce to zero)? – Konrad – 2019-01-27T11:58:06.800