1 of 31

Anatomy of a Slot

Exploring Transaction Finality and Ethereum’s Consensus Layer

Chris Meisl | Twitter: @ChrisMeisl @Blocknative

Copyright 2023 Blocknative Corporation

2 of 31

Consensus Layer

Execution Layer

2

3 of 31

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

4 of 31

Let’s break this down

4

5 of 31

Transaction Finality

A transaction has "finality" on Ethereum when it's part of a block that can't change

5

6 of 31

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

7 of 31

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

8 of 31

You can confidently say a block

has been finalized after 2 epochs

8

9 of 31

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

10 of 31

Transaction Finality Under Proof-of-Stake

10

Source: https://mirror.xyz/danielrachi.eth/XGZmhaxs3Eoi42PMNAeqh03gaVKGjdTO-0ppYK2FO3E

11 of 31

Transaction Finality Under Proof-of-Stake

The first block in each epoch is a checkpoint.

11

Source: https://mirror.xyz/danielrachi.eth/XGZmhaxs3Eoi42PMNAeqh03gaVKGjdTO-0ppYK2FO3E

12 of 31

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

13 of 31

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

14 of 31

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

15 of 31

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

16 of 31

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.

17 of 31

So what happens inside a slot?

17

18 of 31

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

19 of 31

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

20 of 31

What does the relay see?

20

21 of 31

21

22 of 31

22

Bid Pool

23 of 31

23

24 of 31

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

25 of 31

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.

26 of 31

Issues with slots impact:

Trader transaction settlement

Validator proposer payouts

Builder profits

Relay Operations

26

27 of 31

Lessons learned to enhance proto-PBS system

27

Relays:

  • Lots must happen with LARGE files in 12 seconds
    • ssz : helps with smaller files for lower latency
    • Co-locating with validators to improve latency
  • Submit blocks to nodes at the same time as proposing validators to help with reducing orphaned slots

MEV-Boost:

  • All relays with the same getHeader (ie same blocks) are asked to submit getPayload in case there is a latency issue
  • Mandatory 1 second delay in getHeader and getPayload so a proposing validator can’t “steal” the block

Block Builders:

  • Co-location with relays
  • Submit blocks with ssz

28 of 31

There is still a lot of work until ePBS

28

29 of 31

29

Future

Single Slot Finality

(Proto)Danksharing

Pre-confirmations

30 of 31

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

31 of 31

Anatomy of a Slot

Exploring Transaction Finality and Ethereum’s Consensus Layer

Chris Meisl | Twitter: @ChrisMeisl @Blocknative

Copyright 2023 Blocknative Corporation