Validators (formerly miners) can still modify the block.timestamp
. Before miners could manipulate the block.timestamp
but if they were able to create the block. If they had 20 percent of hash power, they had a 20 percent of chance to create the block, so that their transaction will be confirmed. Even if they created the block, it is extra hard to pass the valid "timestamp". Let's say, in a contract, there is a gambling function that sends you the entire balance if you pass the correct "timestamp"
if(block.timestamp%11==0){
(bool sent, )=msg.sender.call{value:address(this).balance}("");
require(sent,"Failed to send Ether");
}
Now miner has to find such a "timestamp" that satisfies the "if" condition.
After ethereum merge:
For each slot, a validator is selected at random and is responsible
for creating the new block while a committee of validators is randomly
chosen to verify the work of the validator creating the new block. The
randomly selected validators receive a reward of Ether for their
efforts.
So, after the merge, the chance of creating the block for the validator is "1/numberOFNodes". It is not related to hash power anymore. currently, there are about 400.000 validators.