Anatomy of a Slot
Exploring Transaction Finality and Ethereum’s Consensus Layer
Chris Meisl | Twitter: @ChrisMeisl @Blocknative
Copyright 2023 Blocknative Corporation
Consensus Layer
Execution Layer
2
Consensus Layer consists of a lot of moving parts and entities
3
Source: https://www.bloxstaking.com/documents/eth2/
mev-boost
proposer
slot
epoch
finalized
justified
relay
builder
proposer
validator
attestation
committee
Let’s break this down
4
Transaction Finality
A transaction has "finality" on Ethereum when it's part of a block that can't change
5
Transaction Finality Under Proof-of-Work
There was always a potential for reorgs,
so dapps would often wait several blocks
before classifying a transaction as “confirmed”
(i.e. unlikely to be removed from the canonical chain)
6
Transaction Finality Under Proof-of-Stake
PoS introduced safe head (justified) blocks
and finalized blocks, which can be used
more reliably than "confirmed" PoW blocks
7
You can confidently say a block
has been finalized after 2 epochs
8
9
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
1 Epoch = 32 slots
(6.4 min)
1 slot
(12 sec)
Each slot has the potential to contain a block
Transaction Finality Under Proof-of-Stake
10
Source: https://mirror.xyz/danielrachi.eth/XGZmhaxs3Eoi42PMNAeqh03gaVKGjdTO-0ppYK2FO3E
Transaction Finality Under Proof-of-Stake
The first block in each epoch is a checkpoint.
11
Source: https://mirror.xyz/danielrachi.eth/XGZmhaxs3Eoi42PMNAeqh03gaVKGjdTO-0ppYK2FO3E
Transaction Finality Under Proof-of-Stake
Validators vote for pairs of checkpoints that it considers to be valid. If a pair attracts votes representing at least 2/3 of the total staked ETH, the checkpoints are upgraded.
12
Source: https://mirror.xyz/danielrachi.eth/XGZmhaxs3Eoi42PMNAeqh03gaVKGjdTO-0ppYK2FO3E
Transaction Finality Under Proof-of-Stake
If >2/3 of validators have attested to the block, it is “justified,” meaning under normal network conditions it is expect it to be included in the canonical chain and finalized.
13
Source: https://mirror.xyz/danielrachi.eth/XGZmhaxs3Eoi42PMNAeqh03gaVKGjdTO-0ppYK2FO3E
Transaction Finality Under Proof-of-Stake
A “finalized” block is a justified block that is 1 epoch behind the most recently justified block
14
Source: https://mirror.xyz/danielrachi.eth/XGZmhaxs3Eoi42PMNAeqh03gaVKGjdTO-0ppYK2FO3E
Transaction Finality Under Proof-of-Stake
To revert a finalized block, an attacker would have to burn at least 1/3 of the total staked ETH.
15
Source: https://mirror.xyz/danielrachi.eth/XGZmhaxs3Eoi42PMNAeqh03gaVKGjdTO-0ppYK2FO3E
How are proposers and attestors chosen?
16
RANDAO
Set of active validators
0 1 2 3 ... 31
Proposer:
Committee:
Epoch
At least 128 validators chosen for a committee. A validator can only be in one committee per epoch.
One validator is chosen from the committee to propose a block. The rest of the validators will be attestors for the slot.
So what happens inside a slot?
17
Slot has three distinct 4-second phases
18
Block propagation
Aggregation propagation
Attestation aggregation
Honest proposer broadcasts their block at the start of their slot
t = 0
t = 4
t = 8
t = 12
Attestation deadline, where attesters determine which block they will vote for based on the fork-choice rule.
A subset of validators broadcast an aggregate
The next proposer published their block
Source: paradigm, https://www.paradigm.xyz/2023/04/mev-boost-ethereum-consensus
What really happens during a slot with PBS?
19
start of slot
(0 sec)
Proposer requests bid (getHeader)
Proposer receives block
Proposer proposes block
Attestations begin
Block Builder starts building blocks
end of slot
(12 sec)
Block Builder continuously submits to MEV-Boost Relays
MEV-Boost sends Header w/ most profitable block to Proposer
MEV-Boost requests getHeader from Relays
Proposer commits to block (getPayload)
Selected Relay notified and sends payload to Proposer via MEV-Boost
What does the relay see?
20
21
Source: Metrika, https://blog.metrika.co/relays-are-a-latency-game-303aadb393ce
22
Bid Pool
23
Source: Metrica, https://blog.metrika.co/relays-are-a-latency-game-303aadb393ce
What could go wrong during a slot? A Reorg.
24
Slot 32
(Block 111)
Slot 1
(Block 112)
Slot 2
(Block 112)
Slot 3
(Block 113)
Current Epoch
Previous Epoch
Missed Slot
Missed Slot
State A
State B
What could go wrong during a slot? An Attack.
During a propagation attack, slashing is not enough of a deterrent
25
1: Honeypot transactions w/ unlimited slippage sent to mempool by a malicious validator to bait MEV bots during slot validator knew it would be the proposer.
3: When it came time to request a block from MEV-Boost, the malicious validator used invalid values in the signed header to get the payload. Relays did not check if these values were valid.
5: The malicious validator submitted a revised block that removed its honeypot transactions and included new transactions that frontrun the MEV bots.
6: The malicious validator drained $25 million from the MEV bots it baited.
2: MEV bots pounce to sandwich the honeypot transactions. To ensure maximum profit, MEV bots didn’t set upper bounds.
4: As a result, the MEV-Boost relay submitted an invalid block to the beacon chain, which does not propagate. The malicious validator now had access to all the transactions and signatures within that the block.
Certik incident report: https://www.certik.com/resources/blog/30h7lDtiv9pJiwloeTPXgW-mev-bot-incident-analysis
Issues with slots impact:
Trader transaction settlement
Validator proposer payouts
Builder profits
Relay Operations
26
Lessons learned to enhance proto-PBS system
27
Relays:
MEV-Boost:
Block Builders:
There is still a lot of work until ePBS
28
29
Future
Single Slot Finality
(Proto)Danksharing
Pre-confirmations
Block building delivers programmable and expressive payments flows
30
Web3 Onboard
+ Notify
Gas Fee
Prediction
Transaction Simulation
Wallet Integration
& Real-time Status
Pricing
Preview�Outcomes
Account
Abstraction
4337 Bundler
Transaction
Inclusion & Ordering
Block Builder
MEV-Boost Relay
Block Auction Delivery
Web3 Transaction Orchestration
helps users transact with confidence
Mempool Explorer & APIs
Pre-chain Monitoring
Anatomy of a Slot
Exploring Transaction Finality and Ethereum’s Consensus Layer
Chris Meisl | Twitter: @ChrisMeisl @Blocknative
Copyright 2023 Blocknative Corporation