It is verifying all the txs in the block. Number of tx per block has increased over time (which is a good thing BTW).
Is that really the only reason? I see how more transactions per block would slow it down, but, not to the speed it's currently going. Isn't it a simple hash of the block, compare, and, 'done'?
EDIT:- Oh, it's verifying all the transactions
in the block, as in, verifying the transactions themselves, yeah, fair enough. I do see how that would slow it down. Fair enough.
Can I then ask what the difference is between the check levels (0, 1, 2, 3 and 4)?
-checklevel= How thorough the block verification is (0-4, default: 3)
https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_FileEDIT2:- Can answer my own question:-
https://github.com/bitcoin/bitcoin/blob/95e66247ebaac88dadd081f850ebf86c71831e61/src/main.cpp#L2767-L2807// check level 1: verify block validity
(Can I ask what 'undo validity' is?)
// check level 2: verify undo validity
(I also have no diea what this is)
// check level 3: check for inconsistencies during memory-only disconnect of tip blocks
// check level 4: try reconnecting blocks
EDIT3:-
It is verifying all the txs in the block. Number of tx per block has increased over time (which is a good thing BTW).
There is more to verify a block is valid than just hashing it.
First a block can't be valid if any tx is invalid.
For a tx to be valid the client needs to check that:
a) it has valid form & structure.
b) that the inputs are all valid and have not been spent in a prior tx (i.e. the inputs are in the UXTO at the time of the tx)
c) the signature is valid
d) that the pubkey when hashed produces the pubkey hash in the prior output
The coinbase tx needs to verified that it has the correct amount (coinbase < subsidy + tx fees).
Once all the tx are verified as valid the block header is verified.
The merkle tree (which represents an entire block of tx with a single hash) and merkle tree root need to be constructed.
The client needs to verify the merkle tree root produces matches the header of the block.
The client also needs to verify the other information in the header is valid (prior block hash, version, etc).
The client needs to verify the timestamp falls within the range allowed by the protocol.
Once the header is verified the client will hash the header and verify the the resulting hash is less than the target based on block difficulty.
Only THEN if the block considered valid and the client moves on to the next block.
The most time consuming step is the validating of the transactions (namely the validation of the ECDSA signature on each input).
Thanks for the more flushed out reply, fair enough. Thanks.