EIP-7833 Scheduled function calls

No call decision · EVM & execution · EIP status Stagnant · created 2024-12-06

Adds the OFFERCALL opcode, which lets a contract offer ETH so that its own function is automatically executed in the next block. Scheduled calls execute before ordinary transactions.

Why it is needed

Ethereum smart contracts let code manage funds, but they cannot act on their own. They only execute when someone outside sends a transaction to wake them up. This is a problem when timing matters. If there is network delay, or if the block producer building the block acts maliciously, as in an MEV attack, the contract may fail to execute at the exact moment it needs to. This proposal presents a way for a contract to reserve a function call to be executed in the next block, offering ETH in exchange. If a function schedules itself repeatedly, it behaves like a bot that runs every block without any human intervention. The idea is that if execution of scheduled calls is enforced as a condition for a block to be valid, block producers cannot refuse to execute bots that neutralize market manipulation, which could help mitigate MEV attacks.

What changes

Today

After EIP-7833

Who is affected

In depth

How the OFFERCALL opcode works

OFFERCALL is a new EVM opcode that asks the next block's block producer to call a specific function, offering ETH to be burned in exchange. Nodes aggregate incoming offers, rank them, keep only the top N, and discard the rest. Scheduled calls must execute before all user transactions, and the execution order is determined by rank in the sorted list. The source text does not specify concrete parameters such as the value of N or gas costs.

The bot pattern created through self-scheduling

In the Solidity example in the source text, the constructor ignites the bot by calling offercall(update, offerPerCall), and each time the update() function runs, it reschedules itself the same way. If a function recursively schedules the next block's call, it becomes a bot that runs every block without any external trigger. The example also includes a setOffer(_offer) function for adjusting the offer amount, letting the owner change the amount and revive the bot if it dies.

Failure conditions and restart

OFFERCALL fails in two cases: when the contract does not hold enough ETH to cover the offered amount, and when the offered amount does not rank within the top N. If OFFERCALL fails once inside a self-scheduling function, the bot becomes inactive. The only way to revive it is for the contract owner to manually call the function again, and the source text notes that this will likely require offering a higher amount.

Why the offered amount is burned

The offered ETH is not paid to the block producer; it is burned. This is to prevent the system from being abused, such as a block producer scheduling a call that pays the amount back to itself. The security considerations section also flags, as a major concern, that wealthy users could monopolize execution priority and lead to centralization, and explains that burning unfulfilled offers partially addresses this problem by preventing endless escalating offers.

Block validity requirements and MEV mitigation

This proposal suggests enforcing execution of scheduled calls as a requirement for block validity. Under this structure, if a block producer builds a block while omitting a scheduled call, the block itself becomes invalid. The source text explains that this would force block producers to always execute bots that neutralize market manipulation within the chain, which could help mitigate MEV attacks.

Backward compatibility and adoption requirements

OFFERCALL is a feature that does not exist in the current EVM, so introducing it requires a network upgrade (hard fork). It creates a new mechanism by which contracts schedule function calls and incentivize their execution, and block producers must change their behavior to accommodate it. There is no Reference Implementation yet.

Current status: Stagnant

This EIP is a Standards Track Core proposal, and its current status is Stagnant. Discussion has stalled, and it has not been finalized as a standard; if reactivated, its specification could change. There is also no record of a decision on fork inclusion from core developer calls.

Original EIP · ← EIPs