Manu NALEPA
    • 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

      This note has no invitees

    • 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
    • Note Insights New
    • Engagement control
    • Make a copy
    • 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 Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy 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

    This note has no invitees

  • 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Ethereum Protocol Fellowship - The Third Cohort - Final Update ## Project abstract The main purpose of this project was to **rewrite the Prysm validator client code to be compatible with the Beacon API instead of prysmaticlabs' internal API.** ## Context of the project When Prysm first started, Prysm team advocated strongly for gRPC to be used for validator <> beacon communication, but in the end the standard enshrined an OpenAPI spec known as the Beacon Node API ([here](https://ethereum.github.io/beacon-APIs/) and [here](https://github.com/ethereum/beacon-APIs/)). But the gRPC design remained deeply embedded in the Prysm validator code, and so to this day the validator uses a set of prysm-specific gRPC methods to communicate with the beacon node. This means that the validator is not interoperable with the other beacon node implementations. When they decided to fully support the standard Beacon Node API (to support other validator implementations, block explorer backends etc), they tried to use an open source project called [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) to generate stubs etc for an http/1.1 implementation that would be compatible with the OpenAPI specs. The problem is, gRPC and OpenAPI don't map cleanly, so Prysm developers wound up with a lot of middleware and hacks to bridge the gaps, and furthermore, some of the encoding requirements (eg hashes encoded as `0x` prefixed strings, hex-encoded numeric values) had a big mismatch with how [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) works out of the box. Prysm developers also needed to customize the generated code so that dependencies needed to import custom types from our [ssz encoding library](https://github.com/prysmaticlabs/fastssz) would be present, resulting in the need to maintain [a fork of grpc-gateway](https://github.com/prysmaticlabs/grpc-gateway). The [grpc-gateway](https://github.com/prysmaticlabs/grpc-gateway) communicates over a localhost port which has weird implementation details (like worrying about the size of transmitted values between gRPC <> OpenAPI), and introduces a lot of complexity that winds up being more of a maintenance burden than it's worth. So what we want to do is distill more generic handlers out of the gRPC stubs, and use those handlers to serve both gRPC and OpenAPI implementations. ## Master GitHub issue and design document The master GitHub issue can be found [here](https://github.com/prysmaticlabs/prysm/issues/11580), and the design document with all fellow updates can be found [here](https://hackmd.io/@pavignol/rJ0wVdtRj). ## Status report Before the fellowship, **Prysm validator client** was able to query Prysm beacon node as stated below: ![](https://i.imgur.com/Crwvkpk.png) **Other validator clients (eg. Teku, Lighthouse)** were able to query Prysm beacon node as stated below: ![](https://i.imgur.com/2ImuIfm.png) However, **Prysm validator client** was **NOT** able to query Prysm beacon node as stated below, because Prysm validator client was not Beacon API compaptible: ![](https://i.imgur.com/XhbyDXv.png) Also, **Prysm validator client** was **NOT** able to query **non-Prysm** beacon node: ![](https://i.imgur.com/priCF3I.png) After the fellowship, **Prysm validator client** is now able to query Prysm beacon node as stated below: ![](https://i.imgur.com/acjjb9j.png) **Prysm Validator client** is also able to query **Non Prysm Beacon node**, as stated below: ![](https://i.imgur.com/1sm5uxs.png) The detail of all implemented APIs can be found in the [Design Document](https://hackmd.io/@pavignol/rJ0wVdtRj). ## Future of the project Now, if the Prysm Validator Client (or other implementation) queries the Prysm Beacon Node using Beacon API, then the Prysm Beacon Node still has to convert HTTP queries into gRPC ones to be correctly handled. The natural next step is to completely remove gRPC related code in the beacon node, to end up with the following state: ![](https://i.imgur.com/bIrNiT5.png) ## Self evaluation Globally, I am very satisfied with what has been achieved during the fellowship. The promise of EPF was to let a "lambda" but motivated fellow to have a real impact on the core of Ethereum. To me, this goal is achieved. ([Here](https://github.com/prysmaticlabs/prysm/commits?author=nalepae) the list of my pull requests on Prysm). At the beginning, I (we) believed each gRPC endpoint will have 1:1 mapping with Beacon API endpoint. For [some endpoints](https://github.com/prysmaticlabs/prysm/pull/11827), it was the case. [For others](https://github.com/prysmaticlabs/prysm/pull/11835), I had to fully reimplement a feature in the validator client. Finally, for [some others](https://github.com/prysmaticlabs/prysm/pull/11991), no direct or indirect equivalent was found, so I had to modify the current behaviour of validator client. This fellowship also allowed me to [find](https://github.com/prysmaticlabs/prysm/issues/11948) and [solve](https://github.com/prysmaticlabs/prysm/pull/11970) some fancy bugs, which could lead, in certain circumstances, to simply... burn priority fees instead of sending them to the fee recipient address. Also, the fellowship was quite challenging for me on a software point of view, since I never coded in golang before, and I was not at all familiar with go ecosystem. I really want to thank my co-fellows who were really efficient and helpful: [0xDhruv](https://github.com/dB2510) & [Pavignol](https://github.com/PatriceVignola). Also, many thanks to the whole Prysm team and specially to [Radek](https://github.com/rkapka) and [James](https://github.com/james-prysm), for their great mentorship! And finally, many thanks to the Ethereum Fundation for this whole program, and specially to [Mario](https://github.com/taxmeifyoucan) & Josh!

    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