EIP-6110 · Final · Core · 2022-12-09
EIP-6110: Supply validator deposits on chain
Validator deposits are read directly from deposit-contract logs in each execution block, replacing the slow, fragile Eth1Data voting and cutting deposit processing time from about 12 hours to about 13 minutes.
What problem does it solve?
To become a validator you send ETH to the deposit contract on the execution layer (EL). The consensus layer (CL) then has to learn about that deposit. Before this EIP it did so through Eth1Data voting: block proposers polled an EL node over JSON-RPC, voted on a recent EL block hash and deposit root, and deposits were only processed after a long follow distance and a voting period.
That design had several weaknesses:
- Slow: roughly 12 hours from deposit transaction to processing.
- Brittle: proposals depended on JSON-RPC polling, which broke on client inconsistencies or syncing issues.
- Weaker security: it relied on an honest majority of proposers voting correctly.
- Extra machinery: deposit contract snapshots (EIP-4881) had to be maintained for syncing.
How it works
Deposits become part of the execution block itself, delivered through the EIP-7685 general-purpose requests mechanism (request type 0x00).
Execution layer. After executing a block, the client scans every receipt for logs emitted by the deposit contract (0x00000000219ab540356cbb839cbe05303d7705fa on mainnet) whose first topic is the DepositEvent signature hash. Each log must have the exact expected ABI layout (576 bytes); otherwise the block is invalid. Each deposit is encoded as:
pubkey (48) | withdrawal_credentials (32) | amount (8, LE) | signature (96) | index (8, LE)
All deposits in the block are concatenated, in log order, into the deposit request data. The block is only valid if its requests match what the logs produce.
Consensus layer. The beacon block's ExecutionRequests gains deposit_requests, processed by a new process_deposit_request function. A deposit_requests_start_index field in the beacon state marks where the new mechanism takes over, so no deposit is applied twice. Once the old queue catches up to that index, clients can drop Eth1Data polling.
Sample code
Simplified pseudocode of how an EL client derives deposit requests (adapted from the spec):
DEPOSIT_CONTRACT_ADDRESS = "0x00000000219ab540356cbb839cbe05303d7705fa" # mainnet
DEPOSIT_EVENT_SIGNATURE_HASH = "0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5"
def get_deposit_request_data(receipts) -> bytes:
out = []
for receipt in receipts:
for log in receipt.logs:
if log.address == DEPOSIT_CONTRACT_ADDRESS and \
log.topics and log.topics[0] == DEPOSIT_EVENT_SIGNATURE_HASH:
assert is_valid_deposit_event_data(log.data) # exact 576-byte layout
pubkey, wc, amount, sig, index = parse_deposit_data(log.data)
out.append(pubkey + wc + amount + sig + index) # 192 bytes
return b"".join(out)
# requests entry for EIP-7685: b"\x00" + get_deposit_request_data(block.receipts)
Things to know
- Status: Final. It shipped as part of the Pectra upgrade (EIP-7600), alongside EIP-7002 (EL-triggered exits) and EIP-7251 (larger max effective balance), which use the same requests framework.
- Nothing changes for depositors: you still call the same deposit contract. The improvement is faster, safer processing.
- Validator indices become fork-dependent: the same pubkey may get different indices on different branches of the block tree, so CL clients had to adjust their pubkey-to-index caches.
- There is no explicit cap on deposits per block; the gas cost of each deposit bounds the number, and the spec argues the extra data and signature checks are cheap enough to be safe.