Executors and coordination
Automation in EES comes from incentivicing external parties to perform on-chain transactions at the right time in exchange for a fee. These parties are called executors and are typically automated programs scanning for jobs which are profitable to execute. Participation as an executor is permissionless, but requires registering via the Coordinator
contract by staking an amount of tokens. The Coordinator
contract keeps track of all executors but more importantly coordinates who can execute jobs at what time as well as regulating incentivization.
ARCADE
EES uses a new coordination mechanism named ARCADE (Alternating Round-based Competitive And Designated Decentralized Execution). As the name suggests, ARCADE alternates between phases of open competition and designation.
Open competition
During open competition, any executor can execute any job which is executable in that period. However, executing during open competition costs a flat tax which covers both executor tax and protocol tax. Thus, for the job to be profitable to execute, the associated fee must be sufficient to cover both the tax and gas fee for performing the on-chain transaction.
Designated round
During a designated round, one of the executors are randomly selected to have the exclusive ability to execute jobs for the whole duration of that period. However, the designated executor is slashed some of their stake if they fail to check-in via the executeBatch
of the Coordinator
contract at some point during the round. If they check-in, they are rewarded with the accumulated executor tax from the last open competition. Furthermore, designated executors do not have to pay executor tax, only protocol tax.
Properties
The ARCADE mechanism has a set of properties making it suitable for a smart ocntract automation system:
Anyone can participate given they have the resources to stake.
Coordination happens exclusively on-chain - there are no dependencies on external mechanisms. Executors can run their own software completely independant of other executors.
Single honest actor - even if one or more bad actors try to stall the system by not executing any jobs during designated rounds, a single honest actor can always take the reward and execute those jobs during open competition. This makes the system censorship resistant.
Fair incentivization - while open competition can lead to low profit margin, the executor tax ensures stable profit for designated executors, incentivizing non competitive executors to participate and execute as many jobs as they can during their designated round.
Harsh punishment - Being offline incurs slashing of the executor's stake and eventually deactivates them. This makes the current number of staked executors a good proxy for measuring honest participants.
Implementation in EES
The ARCADE model is implemented in the EES Coordinator
contract. However, picking an executor for each round requires a state change which cannot be completely time-based automated since this would be self referencing the problem. Thus in EES, alternation rounds of designation and open competition are packed together in epochs. Each epoch contains a fixed number of rounds and has to be initiated. Anyone, even non-executors, can initiate a new epoch if the last one has passed by calling the initiateEpoch
function on the Coordinator
contract. There is open competition in-between epochs.
Last updated