Adrian Sutton
    • 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
    # Validator API Events While there are a number of events it is useful to publish, validator clients only need a fairly small set of events in order to perform their functions successfully. ## Validator Client Operations These are the key functions a validator client needs to perform and the guarantees they need in terms of timing. ### Schedule Duties For either attestation or block creation, validator clients need to identify when their validators are scheduled to perform these duties. The key guarantee required, is that once the validator client loads the duties, it must receive a `reorg` event if there are any changes to the canonical chain that would affect them. The earliest point block duties can be scheduled is the earlier of: * Importing a block on the canonical chain for the last slot of the prior epoch * The beacon node advancing with an empty slot in the last slot of the prior epoch (assuming that if the slot is later filled, it will trigger a reorg event). https://www.symphonious.net/2020/07/06/exploring-ethereum-2-the-curious-case-of-the-invisible-fork/ has some more detail on why filling a previously empty slot needs to be considered a reorg. Additionally, the beacon node must either have already processed the epoch transition *or* process it when the request for duties is received. ### Create Blocks Occurs at the start of a slot and only requires that the beacon node is in sync. As such can be triggered based off the validator's system clock so long as the beacon node allows creating a block for a slot in the near future. This tolerance is required because the validator client may tick over to the new slot before the beacon node, either because of a small amount of clock skew or simple race condition. A single slot tolerance should be sufficient. ### Create Attestations Occurs at the earlier of when the block for the current slot is imported or 1/3rd through the slot. The beacon node should update its fork choice selection (potentially switching to a different chain) before attestations are created. With the definition of `head` events below, attestations would be created when a `head` event is received for the attestation's slot. ### Create Aggregates Occurs 2/3rds through the slot. The attestation for the slot must have previously been created. Since the validator client already has the attestation, this can be triggered completely independently by the validator client. ## Events There are then two events which are required for correct operation of a validator client. ### head Indicates that the chain the beacon node views as canonical has been updated, by being extended by a new block, extended by an empty slot or switching to a different chain. A `head` event is published when the beacon node's chain head is updated. This may occur by importing a new block that builds on the current chain head (ie the block for the current slot) or when the beacon node considers the slot to be empty because a block hasn't been received. Suggest considering a slot to be empty when 1/3rd of the slot period has elapsed without a block being received on the canonical chain. As a result a `head` event would be published every slot, even if there was no block in that slot. The beacon node guarantees that once a `head` event is published for a slot, a `chain_reorg` event will be published if the blockRoot for that slot on the canonical chain changes either because fork choice switches to a different chain, or because a previously empty slot is filled. ### chain_reorg Indicates that the beacon node has selected a different chain as the canonical chain. A `chain_reorg` event must be published anytime the canonical state root changes for a slot less than or equal to the slot published in the last `head` event. Importantly as noted in the description of the `head` event, this includes when a previously empty slot is filled, even if the parent of the new block is the previous chain head block. ## Why `head` must be published for empty slots This is essentially to avoid the issue described in https://www.symphonious.net/2020/07/06/exploring-ethereum-2-the-curious-case-of-the-invisible-fork/ Suppose we have a chain: Slot | 27 | 28 | 29 | 30 | 31 ------------|-------|------|-------|-------|----- Block Root | 0x01 | 0x02 | 0x03 | 0x04 | *empty* Parent Root | 0x00 | 0x01 | 0x02 | 0x03 | *empty* This is the end of epoch 0, so attestation production duties can be calculated for epoch 2. However, if later a block is imported at slot 31, the validator client must recalcuate those duties as the new block at slot 31 changes the randao mix which affects the scheduling. The validator client needs some guarantee from the beacon node that it's view of the chain head includes that empty slot (and thus that a `chain_reorg` will be published if it is later filled) before it can calculate duties safely. ### Alternative: `epoch` event A `head` event could be published only when a new block is imported which becomes the new chain head, and a separate `epoch` event could be published at the start of each epoch when epoch processing has completed. The beacon node guarantees that a `chain_reorg` event is published if any blocks are later added to the canonical chain which would affect that scheduling for that epoch (ie any block prior to the epoch start).

    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