caleb omoniyi
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee
  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # **Final Project Update: Enshrined Proposer-Builder Separation (ePBS) Implementation in Nimbus** ## **Project Abstract** **Project:** EIP-7732 Implementation - Enshrined Proposer-Builder Separation (ePBS) **Client:** Nimbus Consensus Client **GitHub Repository:** The initial [PR](https://github.com/status-im/nimbus-eth2/pull/6443/files) has been closed to accommodate further developments, and I am currently preparing an updated PR link. **EIP Reference:** [EIP-7732](https://eips.ethereum.org/EIPS/eip-7732) I set out to implement Enshrined Proposer-Builder Separation (ePBS) in the Nimbus Consensus Client because of the unique challenges it posed and the fact that it touches so many core aspects of the protocol. It was an exciting opportunity to dive deeper into Ethereum's inner workings and understand the protocol at a much more granular level. The goal was to decrease the reliance on external MEV-Boost relays and provide a trustless, protocol-native block construction marketplace. This would involve separating the beacon block and the execution payload, a significant shift that would reduce reliance on external builders while improving the efficiency of validators and the overall block propagation time. By introducing Payload Timeliness Committees (PTCs) and splitting the slot into separate execution and consensus validation phases, ePBS addresses critical issues of centralization, validator efficiency, and block propagation times. While the integration introduces significant breaking changes to the existing codebase, it offers a transformative path towards decentralizing Ethereum’s block construction and creating a transparent, equitable MEV market. --- ## **Technical Implementation Status** ### **Key Architectural Changes** The implementation modifies multiple components of the Consensus layer, incorporating the core principles of enshrined Proposer-builder separation into the consensus layer. Below are some key aspects of the implementation: 1. **Processing Withdrawals** This now takes only the state as a parameter, as withdrawals are deterministic based on the beacon state. Any execution payload with the corresponding block as the parent must honor these withdrawals in the execution layer. ```nim proc process_withdrawals*(state: var epbs.BeaconState): Result[void, cstring] = if not is_parent_block_full(state): return err("parent block is empty") let (withdrawals, partial_withdrawals_count) = get_expected_withdrawals_with_partial_count(state) state.pending_partial_withdrawals = HashList[PendingPartialWithdrawal, Limit PENDING_PARTIAL_WITHDRAWALS_LIMIT].init( state.pending_partial_withdrawals.asSeq[partial_withdrawals_count .. ^1] ) var withdrawals_list: List[Withdrawal, Limit MAX_WITHDRAWALS_PER_PAYLOAD] for i in 0 ..< min(len(withdrawals), MAX_WITHDRAWALS_PER_PAYLOAD): withdrawals_list[i] = withdrawals[i] state.latest_withdrawals_root = hash_tree_root(withdrawals_list) for i in 0 ..< len(withdrawals): let validator_index = ValidatorIndex.init(withdrawals[i].validator_index).valueOr: return err("process_withdrawals: invalid validator index") decrease_balance(state, validator_index, withdrawals[i].amount) ok() ``` 2. **Processing Execution Payload Headers** The process_execution_payload_header function validates the signed execution payload header within a beacon block. It ensures the header's signature is valid, verifies the builder has sufficient funds to cover the bid, and checks that the bid matches the current slot and parent block. Finally, it processes the fund transfer from the builder to the proposer. ```nim proc process_execution_payload_header*(state: var epbs.BeaconState, blck: epbs.BeaconBlock): Result[void, cstring] = let signed_header = blck.body.signed_execution_payload_header for vidx in state.validators.vindices: let pubkey = state.validators.item(vidx).pubkey() if not verify_execution_payload_header_signature( state.fork, state.genesis_validators_root, signed_header, state, pubkey, signed_header.signature): return err("payload_header: signature verification failure") let header = signed_header.message builder_index = header.builder_index amount = header.value if state.balances.item(builder_index) < amount: return err("insufficient balance") if header.slot != blck.slot: return err("slot mismatch") if header.parent_block_hash != state.latest_block_hash: return err("parent block hash mismatch") if header.parent_block_root != blck.parent_root: return err("parent block root mismatch") let proposer_index = ValidatorIndex.init(blck.proposer_index).valueOr: return err("process_execution_payload_header: proposer index out of range") let builder_idx = ValidatorIndex.init(builder_index).valueOr: return err("process_execution_payload_header: builder index out of range") decrease_balance(state, builder_idx, amount) increase_balance(state, proposer_index, amount) state.latest_execution_payload_header = header ok() ``` 3. **Processing Payload Attestations** Handles the validation of payload attestations, ensuring their signatures are valid and align with the expected state ```nim proc process_payload_attestation*(state: var epbs.BeaconState, blck: epbs.BeaconBlock, payload_attestation: PayloadAttestation, cache: var StateCache, base_reward_per_increment: Gwei): Result[void, cstring] = if not is_valid_indexed_payload_attestation(state, payload_attestation): return err("process_payload_attestation: signature verification failed") ok() ``` ### **Key Challenges** - **Breaking Changes:** Integrating ePBS requires replacing the `ExecutionPayload` field with `SignedExecutionPayloadHeader` and updating multiple processes, including state transitions and attestation handling. - **Cross Compatibility:** Adapting the implementation to the existing codebase introduced unique challenges due to its architectural changes. - **Testing:** The complexity of the new state transitions and cryptographic operations requires rigorous simulation and testing. ## **Project Status** ### **Challenges** While significant progress has been made, the transition to make it compatible with a specific hardfork required closing the initial PR and rebuilding portions of the implementation. This allows the project to align with other specifications but also introduced delays. Testing continues to be a primary focus to ensure robustness. ## **DevNet Goal (short term)** For DevNet testing, the following goals are currently being prioritized: - **Separation of Payload and Beacon Block:** Ensure the successful decoupling of the execution payload from the beacon block, and validate the correct handling of both by the network. - **No Bid Propagation Subscription:** Demonstrate that validators can successfully self-build blocks and that block builders are no longer necessary for block construction in the new ePBS model. - **Handling Empty Blocks (No Payload) for Fork Choice Purposes:** Ensure that empty blocks (i.e., blocks without an execution payload) are processed correctly within the fork choice logic. - **Valid PTC Committees and Attestations:** Verify that PTCs are functioning correctly, validating payload timeliness and availability, and that they continue to process attestation data. ## **Fork Choice Logic Update** Currently, there is ongoing work on a **new fork choice proposal** that incorporates the goals of ePBS, FOCIL, and PeerDAS. This proposal aims to better integrate the fork choice mechanism with the changes brought by ePBS and is essential for testing and validating the new structure. You can review the current design [here](https://hackmd.io/UX7Vhsv8RTy8I49Uxez3Ng?view). ## **Acknowledgment** I want to express my heartfelt gratitude to **Josh** and **Mario**, the coordinators of the Ethereum Protocol Fellowship (EPF), for their incredible support and leadership. Their guidance has been instrumental in shaping this project. I am equally thankful to my mentors, **Tersec**, **Potuz**, and **Terence**, who provided invaluable insights and encouraged me to think critically while tackling the technical challenges. This experience has been a transformative mental shift. Diving deep into Ethereum’s protocol and the **Nimbus architecture** has fundamentally expanded my understanding. The challenges have been immense, but they’ve also been worth it. I’ve learned so much—both about Ethereum and about pushing through complex technical problems. ## **Future Work** - **Testing and Optimization:** Finalizing and verifying the implementation to ensure all edge cases are handled. - **Updated PR:** An updated PR link will be shared soon, incorporating feedback and additional tests. - **Exploration:** Investigating further enhancements for ePBS, including performance optimizations and extended use cases. ## **Takeaways** Participating in EPF has been a privilege. It’s been challenging, rewarding, and filled with learning moments. This program has given me the opportunity to grow as a developer and to contribute meaningfully to Ethereum’s future. I’m excited to continue working on this project and others and to explore how ethereum and blockchain can contribute to a much more decentralised better world.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully