How do you prevent block.timestamp manipulation in Solidity smart contracts for time-sensitive auctions?
I was asked an interview question about block.timestamp manipulation in Solidity auction contracts, and I realised my first answer was too simple.
My first thought was: “Don’t use block.timestamp; use block.number instead.” But that also does not feel fully correct, because block numbers are not a real-world clock either.
The part I understand is this: auction contracts often need start times, end times, and bidding windows. But on-chain time is approximate. A validator cannot set any timestamp they want, but a smart contract should still not assume that the last few seconds are a perfectly fair boundary.
So what is the better engineering answer here?
For time-sensitive Solidity auction contracts, do experienced engineers usually keep block.timestamp only for rough deadline checks and then add anti-sniping logic or a grace-period extension near the end?
Does commit–reveal mainly help with bid privacy and front-running rather than timestamp manipulation itself?
And when people mention OpenZeppelin TimelockController, is that actually relevant to auction design, or is it more of a governance-delay pattern?
I am looking for a clean way to explain this in Solidity interviews and production reviews without giving an outdated answer like “just use block.number.”