Timekeeping
openOracle can be run inblock.timestamp mode or block.number mode. On OP stack chains, timestamps follow the derivation rules:
max_sequencer_drift is 1800 seconds (post-Fjord, previously 600), meaning the sequencer clock can be up to 1800 seconds ahead of the L1 block timestamp. The first rule implies an L2 block every l2_block_time seconds, unless L1 blocks are produced too quickly, which shouldn’t be much of an issue with PoS. Outside drift, block times should be relatively well behaved.
Applications can implement mitigations for different kinds of sequencer timestamp and block number behavior:
Chain halt
Applications can optionally ignore reportIds whose settlement timestamp was greater than 60 seconds past eligibility. On OP stack, the L2 timestamp in which user transactions are first included after a restart is still bound below by the L1 block time + max drift. An additional filter of settle block optimality can be applied — if the settle did not come in the optimal block, the price is ignored. In a recent Base outage, empty blocks were posted between the outage timestamp and the restart timestamp, so this increment in block number would be handled by the optimal settle block check and the settled price would not be used.Implied blocks per second
On OP stack chains like Base, block times and block numbers are relatively well behaved, but for edge case handling applications can calculate an implied blocks per second from the block number and timestamp difference between oracle instance creation and settlement. If this is too far outside the bounds of 0.5 blocks per second (current Base production block rate), the application ignores the settled price.FOCIL and skipped blocks
Depending on implementation, if a block proposer on L1 censors transactions and their block is skipped, the block number does not increment but the timestamp still does. This creates a divergence betweenblock.number and block.timestamp based settlement. Oracle games using block.number mode would not advance toward settlement during skipped blocks, while block.timestamp mode would. This is another consideration when choosing between the two modes.
General considerations
Timekeeping is an issue that impacts openOracle. There is a high level of complexity to the timekeeping rules on L2 and it is possible edge case handling does not cover every edge case. To the extent the edge cases are not predictable, this does not impact oracle performance too much. If they are predictable, internal oracle participants are not at risk to the same extent external notionals are because of state hash validation. As with any technology, timekeeping will improve.Max slippage
Applications consuming an oracle price may enforce a tolerance band around the expected price. The user passes apriceTolerated and a toleranceRange (percentage) at the time of the price request. On settlement, the consuming contract checks whether the settled oracle price falls within the band: