Post
Topic
Board Development & Technical Discussion
Re: How do miners solve the knapsack problem?
by
mikeywith
on 20/07/2024, 00:32:31 UTC
It's very interesting question. Aside from fee rate, miner also need to ensure that total sigops cost of the block isn't above 80000[1]. Otherwise, they may accidentally create invalid block which happened to F2Pool on last year[2].

[1] https://github.com/bitcoin/bitcoin/blob/v27.1/src/consensus/consensus.h#L16-L17
[2] https://bitcoin.stackexchange.com/q/117837

F2pool probably doesn't use the default getblocktemplate from core, because BlockAssembler does indeed track the number of sigops for the transactions it includes in the block, more details could be found in validation.cpp

It's the first time I hear about this incident but I am not surprised because F2pool censorship transactions based on OFAC list, which means, they did alter the code that creates their blocks, so somewhere along the line their devs failed, and ended up screwing things massively, good for them -- they deserve it.