Jacek Sieka
    • 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
    • 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 No publishing access yet

      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.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      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
    • 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
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
  • 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 No publishing access yet

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    # Top-up sync For syncing the EL and CL together, assuming they both have a reasonably recent starting point (as by checkpoint/snap sync), one of the methods available today is the following: * CL starts two loops - Optimistic CL sync and EL top-up sync * The optimistic CL sync proceeds as usual, as when the CL is operating an optimistic sync with or without an EL * Allowing the CL to sync independently of the EL implies validating the block hash in the CL using an RLP-based hash computation, a technique employed by several consensus clients * Introducing RLP can be avoided via [EIP-8237](https://github.com/ethereum/consensus-specs/pull/5183) - EIP-8237 represents a _net complexity increase_ since we're computing additional hashes just for this purpose * A better option is to move the block to [SSZ (EIP-7807)](https://eips.ethereum.org/EIPS/eip-7807) * In parallel, it launches a top-up sync for the EL that: * queries the EL for its latest block number (BN) * if BN+1 has been synced by the CL, sends BN+1 via newPayload to the EL, together with fcU * repeats until el has reached CL head (at this point, the CL is fully and non-optimistically synced and can resume duties if close to the network consensus) Once both loops have finished, both the EL and the CL are in sync - in particular, assuming it has a state, the EL does not need to fetch blocks via devp2p. This method of syncing works throughout the maximum weak subjectivity period for which we require CL clients to retain history, ie ~5 months and has a number of advantages, specially for short topups: * it is easy to understand and explain to users since the CL is "driving" the sync * it is typically fast since the CL must download these blocks anyway and can do so efficiently - the blocks are processed in the same manner as when reacting to gossip and the EL can be treated as a simple and predictable state transition function with respect to block processing * it provides an upgrade path towards migrating away from devp2p (ie the EL no longer needs to support block transfers via devp2p, with snap sync and mempools remaining there) ## Edge cases ### Forks When switching forks, CL must make sure the fork is present on the EL - this means starting the topup loop on fork switch _or_ topping up any blocks in the new fork that the EL might not have observed ### Backfill / checkpoint sync When checkpoint-syncing, the checkpoint might be ahead of the EL head and a gap may ensure - this gap will be filled when the CL performs the (mandatory) backfill of 5 months of blocks, ie as the gap is backfilled, block `BN+1` will eventually reach the CL at which point it can proceed to sync the EL as usual ### Storage owner In current client architectures, both the CL and the EL have the opportunity to store the execution payload. ### No state The choreography of fcU vs newPayload needs to be made deterministic such that the EL has an opportunity to sync state - ie to differentiate the case where the EL cannot process a block at all vs the case where it needs a particular block to proceed. ## Gloas The infrastructure to implement top-up sync is already present in gloas: * All necessary execution data structures are known to the CL since they are part of the gossip layer * The by-root topup already provides the necessary cl-el execution api interface * [ExecutionPayloadEnvelopesByRange](https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.5/specs/gloas/p2p-interface.md#executionpayloadenvelopesbyrange-v1) fetches historical execution payloads, either loading them from the CL or EL depending on client architecture The process can potentially be simplified by including block number in [ExecutionPayloadBid](https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.5/specs/gloas/beacon-chain.md#executionpayloadbid) to simplify mapping of slot to block number. ## Future direction Possible upgrades to the above include: * SSZ-based execution API for fetching and uploading execution payloads * batched version of the above (ie send 1024 payloads together) * The exact sequencing of query bn/newPayload/fcU can be further simplified and streamlined to avoid unnecessary latency spikes * For finalized blocks, we can ask the EL to perform reduced verification - in particular, we can potentially delay state root execution until we're "close" to the network head, for some definition of "close". The above aligns with a vision to reduce the _overall_ complexity of ethereum node by removing duplicated functionality - ie network propagation of blocks which necessarily must exist in the CL due to it being the primary distribution point of current block information, but no longer is needed on the EL side. ### Meeting notes * https://hackmd.io/@nixorokish/ELCLsync --- **EDIT (Toni):** For summary, with top up sync we can deprecate the eth block-distribution messages (`NewBlockHashes`, `NewBlock`, `GetBlockHeaders`/`BlockHeaders`, `GetBlockBodies`/`BlockBodies`) since the CL becomes the canonical block source via newPayload while the mempool path (`Transactions`, `NewPooledTransactionHashes`, `GetPooledTransactions`/`PooledTransactions`) stays the same. `GetReceipts`/`Receipts` are TBD (not sure what best to do but might depend on node type). State sync using snap stays unchanged using snap/v1 or snap/v2 (account ranges, storage ranges, bytecodes, trie nodes and/or BALs), so a fresh sync looks like an EL snap sync followed by CL-driven top-up of blocks from pivot+1 onward, and a deep reorg is handled the same way (re-pivot, mark nodes as "dirty", re-top-up - at least for snap/2). Two open questions: 1) will archive nodes keep using GetReceipts/Receipts on devp2p or re-execute top-up-fed blocks locally to regenerate receipts (bandwidth vs CPU). 2) with snap/v2 + BAL fast-forward path (EL applies BAL state diff without re-executing) is fine but receipts wouldn't be generated if the block isn't executed. 3) snap/2 relies on getting the BALs over devp2p, not only for the final catching-up-to-head stage, but also when advancing the pivot. So, should we keep the `GetBlockAccessLists` message?

    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
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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