Closed NicolasDorier closed 8 years ago
As an additional advantage it will make the BIP easier to explain.
Interesting idea.
Current rule about sig op can even be coded into GetBlockCost: (pseudocode)
size_t GetBlockCost(const CBlock& block)
{
// witness data is 4 times less costly than core data, because we can prune it
size_t coreCost = ::GetSerializeSize(block, SER_NETWORK, 0);
size_t witCost = ::GetSerializeSize(block, SER_NETWORK, SERIALIZE_TRANSACTION_WITNESS) - coreCost;
size_t sigCost = GetSigOpCount(block) > MAX_SIG_OPS ? MAX_BLOCK_COST + 1 : 0;
return witCost + 4 * coreCost + sigCost;
}
The concept of MAX_BLOCK_SIZE can be removed more easily for the next block size HF. Using MAX_BLOCK_COST make it easier to adapt HF proposals after segwit deployment, because the limited resources will not really be MAX_BLOCK_SIZE anymore.
This will have another advantages for later: The notion of "Block cost" can be later tweaked to include other parameters like SigOp cost.
We can imagine, in the next hardfork, to remove the limitation on the number of SigOps, and just include SigOps as an additional cost parameter in the "Block Cost".