Skip to content

Commit

Permalink
Merging for collab: #96 from shyam-patel-kira/pbs
Browse files Browse the repository at this point in the history
Wiki Page for PBS
  • Loading branch information
raxhvl authored Mar 21, 2024
2 parents 7816ae5 + 300227d commit 1b73121
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- @format -->

- [Home](readme.md)
- **Study Group**
- [EPFsg overview](/eps/intro.md)
Expand Down Expand Up @@ -50,9 +52,11 @@
- Sharding
- Statelessness
- Purge
- MEV
- PBS
- Censorship
- [PBS](/wiki/research/PBS/pbs.md)
- [Current State](/wiki/research/PBS/current-state.md)
- [mev-boost](/wiki/research/PBS/mev-boost.md)
- [Challenges and Solutions](/wiki/research/PBS/research.md)
- Censorship
- Proof of Stake
- [Upgrades](/docs/wiki/research/Beacon%20Chain%20Upgrades.md)
- SSF
Expand Down
Binary file added docs/images/pbs/block-building.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions docs/wiki/research/PBS/current-state.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!-- @format -->

# Current State

Currently, PBS (Proposer Builder Separation) exists outside of the protocol by builders helping in block building through entities like relays. This design relies on small set of trusted relays and even builders which introduces centralisation risks and makes Ethereum more vulnerable to censorship.
PBS is not yet implemented in the Ethereum mainnet which means validators act as both proposers and builders. So each validator is responsible for:

1. **Selecting transactions:** Validators choose which transactions to include in a block based on factors like gas fees and transaction priority.
2. **Building the block:** Validators assemble the chosen transactions into a block and perform necessary computations like verifying signatures and updating the state.
3. **Proposing the block:** Validators propose the constructed block to the network for validation and inclusion in the blockchain.

However, some clients are actively developing and testing PBS implementations. These implementations aim to separate the builder and proposer roles, allowing validators to outsource block construction to specialized builders. This can lead to several potential benefits:

- **Increased validator rewards:** Builders can compete to create the most profitable block for the proposer, potentially leading to higher rewards for validators.
- **Improved network efficiency:** Specialized builders can optimize block construction, leading to more efficient block propagation and processing.
- **Reduced centralization:** By decoupling the roles, PBS can potentially reduce the influence of large mining pools or staking providers that currently dominate both block building and proposing.

## PBS and the Relationship Between Relays, Builders, and Validators

Proposer-Builder Separation (PBS) also introduces a more intricate relationship between different actors in the Ethereum network:

1. **Builders:**
- Builders are specialized entities that focus on constructing blocks with optimal transaction ordering and inclusion. They compete with each other to create the most profitable block for the proposer, taking into account factors like gas fees, transaction priority, and potential MEV (Maximal Extractable Value).
- Builders do not directly interact with the blockchain. Instead, they submit their constructed blocks to relays.
2. **Relays:**
- Relays act as intermediaries between builders and proposers. They receive blocks from builders and forward them to proposers.
- Relays can perform additional functions like block validation and filtering to ensure that only valid and high-quality blocks are sent to proposers.
- Some relays may specialize in specific types of blocks, such as those with high MEV potential.
3. **Validators (Proposers):**
- Under PBS, validators take on the role of proposers. They receive blocks from relays and choose the best one based on predefined criteria, typically the block that offers the highest reward.
- Once the proposer selects a block, they propose it to the network for validation and inclusion in the blockchain.
- Validators are still responsible for securing the network and ensuring consensus on the blockchain's state.

This separation of roles creates a more dynamic and specialized block-building process. Builders can focus on optimizing block construction and extracting MEV, while proposers can focus on selecting the best block and maintaining network security.

However, this new relationship also introduces new challenges:

- Security: Introducing new actors and dependencies can create new attack vectors and vulnerabilities.
- Centralization: If only a few powerful builders or relays dominate the ecosystem, it could lead to centralization and censorship concerns.
- Coordination: Effective communication and coordination between builders, relays, and proposers are crucial for the smooth functioning of PBS.

It's important to note that the specific roles and responsibilities of relays and builders may vary depending on the specific PBS implementation.
47 changes: 47 additions & 0 deletions docs/wiki/research/PBS/mev-boost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!-- @format -->

# Mev-boost: A Popular PBS Implementation

[comment]: <> (This is still unrefined)

Mev-boost is a widely recognized open-source implementation of Proposer-Builder Separation (PBS) for Ethereum. It allows validators to outsource block building to specialized builders, potentially leading to increased validator rewards and improved network efficiency.
Here's how mev-boost works:

<figure style="text-align: center;">
<img src="images/pbs/block-building.png" alt="PBS">
<figcaption style="text-align: center;">Current Block building. Source: <a href="https://barnabe.substack.com/p/pbs">Baranabé's article</a></figcaption>
</figure>

1. **Block Building:**
Specialized builders, known as "searchers" in mev-boost, compete to create the most profitable block for the proposer. They do this by optimizing transaction ordering and inclusion, taking into account factors like gas fees, transaction priority, and potential MEV (Maximal Extractable Value).
Searchers submit their constructed blocks to relays.
2. **Relay Network:**
Mev-boost operates a network of relays that act as intermediaries between searchers and proposers.
Relays receive blocks from searchers and perform various functions like block validation, filtering, and propagation.
Relays ensure that only valid and high-quality blocks are sent to proposers.
3. **Proposer Selection:**
Validators running mev-boost software act as proposers. They receive blocks from relays and choose the best one based on predefined criteria, typically the block that offers the highest reward.
The proposer then proposes the selected block to the network for validation and inclusion in the blockchain.

### Benefits of mev-boost:

- **Increased validator rewards:** By outsourcing block building to specialized searchers, validators can potentially earn higher rewards through optimized transaction ordering and MEV extraction.
- **Improved network efficiency:** Specialized searchers can optimize block construction, leading to more efficient block propagation and processing.
- **Reduced centralization:** Mev-boost promotes a more competitive block-building landscape, potentially reducing the influence of large mining pools or staking providers.

### Challenges and Considerations:

While mev-boost offers potential benefits, it also raises some concerns:

- **Security:** Introducing new actors and dependencies can create new attack vectors and vulnerabilities.
- **Centralization:** If only a few powerful searchers or relays dominate the ecosystem, it could lead to centralization and censorship concerns.
- **Coordination:** Effective communication and coordination between searchers, relays, and proposers are crucial for the smooth functioning of mev-boost.

Ongoing research and development are focused on addressing these challenges and ensuring that mev-boost can be implemented safely and effectively.

It's important to note that mev-boost is just one implementation of PBS. Other implementations with different designs and features are also being developed and explored.
Overall, mev-boost represents a significant step towards realizing the potential benefits of PBS in Ethereum. However, continuous research and development are crucial to address the challenges and ensure a secure, decentralized, and efficient implementation.

### Challenges and Solutions

PBS presents several challenges, including potential security vulnerabilities and the risk of centralization. Ongoing research focuses on addressing these concerns through innovations such as enhanced PBS (ePBS), inclusion lists, and the Proposal Eligibility Proposals Committee (PEPC).
4 changes: 4 additions & 0 deletions docs/wiki/research/PBS/mev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!-- @format -->

Maximal Extractable Value (MEV) refers to the profit miners or validators can earn by strategically ordering, including, or excluding transactions in a block. In Ethereum, MEV has gained greater attention as validators extract increasingly more value, especially in DeFi (Decentralized Finance) applications. This can lead to negative consequences, such as frontrunning, increased transaction fees, and unfair advantages for large-scale miners or validators.
Proposer-builder separation can change the dynamics of MEV extraction in that there could be a redistribution of MEV between the two roles, potentially changing the incentives and rewards associated with each. Since block builders are responsible for transaction ordering and inclusion, they may develop new strategies or promote increased competition that could result in more efficiency and fairer distribution of MEV across the network.
44 changes: 44 additions & 0 deletions docs/wiki/research/PBS/pbs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!-- @format -->

# Proposer Builder Separation (PBS) in Ethereum

[comment]: <> (Feel Free to propose changes)
[comment]: <> (Introduction)

In Ethereum's current system, validators both create and broadcast blocks. They bundle together transactions that they have discovered through the gossip network and package them into a block which is then sent out to peers on the Ethereum network. **Proposer-builder separation (PBS)** splits these tasks across multiple validators. Block builders become responsible for creating blocks and offering them to the block proposer in each slot. The block proposer cannot see the contents of the block, they simply choose the most profitable one, paying a fee to the block builder before sending the block to its peers.

This page will be covering details about PBS, roles of block proposers and block builders, current state - mev boost, relays, challenges and security issues, proposed solutions and further collection of resources related to the topic.

## Why is PBS important?

PBS is important to the decentralization of Ethereum because it minimizes the compute overhead that is required to become a validator. By doing this, the network lowers the barrier to entry for becoming a validator and incentives a more diverse group of participants. PBS also reflects an overall goal of The Merge to move Ethereum’s network towards a more modular future. Specifically, the transition to PoS is an aggressive move towards decentralization through modularity.

When you break apart the different pieces of block construction, you can decentralize them individually. This allows different actors with different specialties to focus on their particular strengths. The net result is a more capable network with fewer external dependencies and a lower threshold for participation.

## Understanding PBS and the Consensus layer

As explained in this [article](https://ethos.dev/beacon-chain), slots are the time frames allowed in the consensus layer for a block to be added to the chain, they last 12 seconds and there are 32 of them per epoch. Epochs are significant for the consensus mechanism, serving as checkpoints where the network can finalize blocks, update validator committees, etc. For each slot, a validator is chosen through [RANDAO](https://inevitableeth.com/home/ethereum/network/consensus/randao) to propose a block. Once proposed and added to the canonical chain, the validators chosen for that slot's committees attest to the validity of the block, which shall eventually reach finality. The consensus layer supports Ethereum's network security and integrity. PBS interacts with this layer by dividing/isolating the duties of proposing and building blocks, thereby streamlining the transaction validation process.

### The Role of the builder

**Block builders** gather, validate, and assemble transactions into a block body. They review the mempool, validate the transactions by ensuring that they meet requirements like gas limits and nonce, and create a data structure containing the transaction data. Block builders are also responsible for ordering the transactions to optimize block space and gas usage. They then make the block body available to block proposers.

### The Role of the proposer

**Block proposers** take the block bodies provided by the block builders and create a complete block by adding necessary metadata, such as the block header. The header includes details such as the parent block's hash, timestamp, and other data. They also ensure the validity of the blocks by checking the correctness of the block body provided by the builders.

## Current State and Solutions

See the [Next Section](/wiki/research/PBS/current-state.md).

Proposer-builder separation may also reduce the likelihood of frontrunning and other harmful practices, even though it may not eliminate MEV-related issues entirely. -->

### Further Reading and Resources

https://ethresear.ch/t/why-enshrine-proposer-builder-separation-a-viable-path-to-epbs/15710
https://notes.ethereum.org/@vbuterin/pbs_censorship_resistance
https://ethresear.ch/t/proposer-block-builder-separation-friendly-fee-market-designs/9725
https://ethresear.ch/t/two-slot-proposer-builder-separation/10980
[Payload timliness committee design for ePBS](https://ethresear.ch/t/payload-timeliness-committee-ptc-an-epbs-design/16054)
https://notes.ethereum.org/@fradamt/forward-inclusion-lists
https://notes.ethereum.org/@fradamt/H1TsYRfJc#Secondary-auctions
3 changes: 3 additions & 0 deletions docs/wiki/research/PBS/research.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- @format -->

# Challenges and Solutions

0 comments on commit 1b73121

Please sign in to comment.