Immutable contracts that need to have a time system for handling their functions process are mostly based on block.number system. They assume there is about 15seconds between each block and thus calculate a number of block that amounts to the time they want. But with introduction of proof of stake Ethereum 2.0 will likely change the 15 seconds block time.
So does it mean most smart contracts will become obsolete when Ethereum 2.0 comes ? And how do you recommend one should deal with this issue to release a smart contract that will survive the 2.0 update ? Also is it even sure 2.0 will impact the 15s ?
P.S: For moment the best option I found is to have a function that can modify a a NUMBER_OF_BLOCKS state variable and increase it or decrease it when 2.0 comes. This function could be limited by only being able to call it once or twice in order to prevent abuse.
block.number. They usually use
block.timestamp, as they should.