I was reading through the source code for Openzeppelin's CountersUpgradeable library v4.3.0 and realised that the arithmetic operation in the increment / decrement functions is wrapped by an unchecked block. As I understand it, the unchecked block would allow for overflow / underflow situations so isn't this a bad idea?
It's cheaper to use
unchecked blocks and check for overflows and underflows manually than let Solidity do it. Refer to Is the modulo operation cheaper in unchecked arithmetic? for more details.