What is the actual process of validating transactions on the blockchain? For example checking that no double spend has occured?
I know PoW and PoS is more or less the mechanism used to select who get to write the next block. It also help prevent the sybil attack. But this does not do anything regarding the integrity of the block that is going to be added.
A validator or a minor haven been selected to write a block can still go ahead and put in inaccurate content. I know this is not happening, hence there is a process to check this. What exactly is the process? And how does it work? And how do nodes who are caught trying to do such get punished?