Allow contracts to know the minimum interblock time
It may be useful for contracts to detect liveness failures or outages. One way to do that is to look at the time elapsed since a contract was called and compare it to the number of blocks elapsed. However, to get a meaningful comparison, one should know the typical block time. While a smart contract could measure this on its own, it may be useful to provide an opcode returning the constant minimal interblock time, e.g. MIN_BLOCK_TIME
. A more generic construct would be: MIN_BLOCK_TIME : (nat, nat) -> nat
which returns the minimum time in seconds expected between two different levels. The latter has the advantage of handling scenarios where the block time isn't constant, for example when straddling a protocol upgrade.