settleEpoch() is permissionless, but somebody still has to call it. Oorka removes that somebody with two small contracts on two chains.
OorkaReactive
Subscribes to a CRON topic. Every
ticksPerPoke ticks it asks Reactive Network to call the keeper with poke(address).OorkaKeeper
Accepts only the callback proxy and only our reactive contract. Settles if the epoch ended, otherwise emits
Idle.Design principles
- No special rights. The keeper calls the same public
settleEpoch()as anyone. If it stops, anyone can settle by hand. - Never wedge the schedule. A failed settle is caught and reported (
SettleFailed); the next tick retries. - Cheap filters.
react()returns quietly on unrelated logs instead of reverting, because reverted reactive transactions are still billed. - Off switch.
setPaused(true)unsubscribes from CRON so ticks stop billing. - Gas budget. A full takeover settle uses under 1.5M gas, half of the 3M callback limit (checked in tests).
Live configuration
Because a tick (about 17 min) is longer than an epoch (15 min), every tick finds an ended epoch and settles it.