Firstly, correct me if I’m wrong.
When a miner finds a solution for the block and broadcasts it to the other node, all the other nodes verify if it is a correct solution or not.
It’s very trivial to validate the PoW, just hash the block header and then count how many “leading zeros” that hash contains (note that such description is theoretical. The actual implementation allowing “fractional leading zeros” is somewhat complex or even weird).
Validating the whole block is much more complex and “costy” than validating the header only. The CVE-2018-17144 inflation/DoS vulnerability was actually caused by improper optimization of the validation code in order to further improve block propagation.
However, theoretically no matter how many miners are in a pool, they are just one single full node (as the identity of the pool) in the Bitcoin P2P network.
It’s the pool who constructs the block to be mined. Pooled miners using the stratum protocol don’t download the full block data at all. They only download minimal data required (like the block header, coinbase transaction etc) to do the SHA256d mining. They therefore don’t validate the block because it’s not even downloaded at all.
So we can see, currently pooled miners (who do not run their own full nodes) blindly follows the pool, so that it’s possible for an evil pool operator to abuse the hashpower provided by miners in that pool. Actually some miners are even happy with such situation, because some pools promotes features like “automated switching for maximum profit”. We may see improvement/relief on this issue in the future if BetterHash/StratumV2 protocol could be widely adopted.
Besides, pooled miners can indeedly attack the pool (or other miners) by withholding the solution, albeit it’s very trivial for the pool to validate the solution (PoW).
Can we check if a miner has validated the solution?
To my knowledge it’s currently not possible to know whether a miner (mining pool) had validated the whole block. It’s just the miners’ own interest to fully validate the previous block once again on their own, so that they would be completely confident that they won’t waste their hashpower/electricity costs on an invalid branch of blockchain.
I read somewhere that if mining pools find a solution, then peer miners in that pool don’t verify the solution and straight away go for the mining of next block on top of it. This is kinda unfair for the other miners. Do we have any system to check if a miner has validated the solution or not?
You seem to describe a kind of validationless mining called “SPV mining”.
However, it’s not “peer miners in that pool”, but other pools (or solo miners) can possibly do that.
It indeedly once caused problems, like the 2015 chain-fork incident related to BIP66.
Theoretically there’s also a variant of selfish mining attack called “Blockchain Denial-of-Service (BDoS)”, which aims to push victim miners under profitable line.
There’s also a controversial argument that SegWit also has an issue similar to BDoS, because developers had once pointed out that SegWit allows the miner to mine atop previous block without downloading & validating the witness data (mostly digital signatures, only SegWit transactions have such data), so that that miner could then collect transaction fees with higher confidence (because, with the non-witness part of the previous block it’s already enough to update the UTXO set, which is the “global account balance database” of Bitcoin maintained by each full node on its own).
On the other side of it, not sure how often does this happen on the network but a pool of miners can share wrong solutions to keep the other miners busy and get an advantage.
In selfish mining, it’s not really a “wrong” solution to be shared, but stale branch of the blockchain which the victim “honest” miners have no choice but to mine atop it, because the longer branch is withheld by “selfish” miners.