HackMD
  • Prime
    Prime  Full-text search on all paid plans
    Search anywhere and reach everything in a Workspace with Prime plan.
    Got it
      • Create new note
      • Create a note from template
    • Prime  Full-text search on all paid plans
      Prime  Full-text search on all paid plans
      Search anywhere and reach everything in a Workspace with Prime plan.
      Got it
      • Sharing Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • 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
      • More (Comment, Invitee)
      • Publishing
        Everyone on the web can find and read all notes of this public team.
        After the note is published, everyone on the web can find and read this note.
        See all published notes on profile page.
      • Commenting Enable
        Disabled Forbidden Owners Signed-in users Everyone
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Invitee
      • No invitee
      • Options
      • Versions and GitHub Sync
      • Transfer ownership
      • Delete this note
      • Template
      • Save as template
      • Insert from template
      • Export
      • Dropbox
      • Google Drive
      • Gist
      • Import
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
      • Download
      • Markdown
      • HTML
      • Raw HTML
    Menu Sharing Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Versions and GitHub Sync Transfer ownership Delete this note
    Export
    Dropbox Google Drive Gist
    Import
    Dropbox Google Drive Gist Clipboard
    Download
    Markdown HTML Raw HTML
    Back
    Sharing
    Sharing Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    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
    More (Comment, Invitee)
    Publishing
    Everyone on the web can find and read all notes of this public team.
    After the note is published, everyone on the web can find and read this note.
    See all published notes on profile page.
    More (Comment, Invitee)
    Commenting Enable
    Disabled Forbidden Owners Signed-in users Everyone
    Permission
    Owners
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Invitee
    No invitee
       owned this note    owned this note      
    Published Linked with GitHub
    Like2 BookmarkBookmarked
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # The Merge Test Plan ## Spec documents * [consensus-specs](https://github.com/ethereum/consensus-specs/tree/dev/specs/merge) * [EIP-3675](https://eips.ethereum.org/EIPS/eip-3675) * [EIP-4399](https://eips.ethereum.org/EIPS/eip-4399) * [Engine API](https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md) * Optimistic sync ## Standalone (Unit) ### consensus-specs * is_merge_transition_complete * is_merge_transition_block * is_execution_enabled * compute_timestamp_at_slot * get_inactivity_penalty_deltas * slash_validator * process_block * process_execution_payload * process_slashings * initialize_beacon_state_from_eth1 * is_valid_terminal_pow_block * validate_merge_block * upgrade_to_merge * get_pow_block_at_terminal_total_difficulty * get_terminal_pow_block * prepare_execution_payload * get_execution_payload ### EIP-3675 + EIP-4399 * Blockchain tests (client will have to switch to the PoS consensus engine to run these tests) * PoW block processing * decsendands of a terminal block are not processed * Block structure * blocks are discarded if the value of either of the following fields deviates from the corresponding constant: `ommersHash`, `difficulty`, `nonce`, `ommers` * `mixHash` can be set to a random value * `extraData` respects `MAX_EXTRA_DATA_BYTES` * other fields remain unchanged * Block validity * `difficulty` isn't verified against difficulty formula * `nonce` and `mixHash` aren't verified against Ethash rules * list of ommers and each ommer isn't verified (don't know how to check though as the list must be empty) * Transition block validity * a parent of `TRANSITION_BLOCK` satisfies terminal PoW block conditions * Other block validaty rules remain * Block and ommer rewards * `coinbase` account doesn't receive block rewards * `coinbase` account doesn't receive ommer rewards (seems infeasible to check) * transaction fees remain * EVM * `RANDOM` opcode returns expected value * Regression * check that 3675 and 4399 aren't taking effect before the `TRANSITION_BLOCK` * Fuzzing ## Integration (Hive) ### Engine API * CL mock + EL * `eth_` namespace is also exposed * EL respects the order of `forkchoiceUpdated` calls * `engine_executePayload` * `engine_forkchoiceUpdated` * `engine_getPayload` * CL + EL mock * CL respects the order of method calls while assigning JSON-RPC request IDs * CL + EL * CL implementation of Engine API methods * `engine_executePayload` * `engine_forkchoiceUpdated` * `engine_getPayload` ### EIP-3675 + EIP-4399 * CL mock + EL * switches the fork choice rule upon the first `POS_FORKCHOICE_UPDATED` event * `POS_FORKCHOICE_UPDATED` updates the head * `POS_FORKCHOICE_UPDATED` updates finalized block * head isn't changed until `POS_FORKCHOICE_UPDATED` is received, even if the new payload is imported * descendants of a terminal block are not propagated * any block is not propagated after the first block gets finalized * does not sync beyond terminal block * block with transaction using `RANDOM` opcode is executed as expected starting with `TRANSITION_BLOCK` * block with transaction using `DIFFICULTY` opcode is executed as expected before the `TRANSITION_BLOCK` * Transition * block structure, block validity, block rewards, and fork choice changes takes effect starting with `TRANSITION_BLOCK` * payload is successfully created upon request *before* the transition, i.e. the transition block * switch between several transition PoW blocks happens successfully ### consensus-specs + EIPs * CL + EL * consensus-specs * state transition happy case * state transition invalid payload wrt execution * fork choice (see the Transition below) * Transition * transition scenario with no overrides * payload is successfully created upon request *before* the transition, i.e. the transition block * CL passes transition block while syncing optimistically and must go back to verify TTD or TBH * list all other possible scenarios of the transition process * case when `TERMINAL_BLOCK_HASH` is set * `TRANSITION_BLOCK` must be a child of a block identified by `TERMINAL_BLOCK_HASH` * list all other possible scenarios of the transition process with `TERMINAL_BLOCK_HASH` override * block structure, block validity, block rewards, and fork choice changes takes effect starting with `TRANSITION_BLOCK` * PoS chain takes precedence * `TRANSITION_BLOCK` isn't a child of a terminal PoW block * in lock-step * after syncing optimistically * terminal PoW block is invalid wrt execution ruleset -- `TRANSITION_BLOCK` can't be verified at all * `TRANSITION_BLOCK` is invalid wrt execution ruleset * switch between several terminal PoW blocks happens successfully * switch between several transition blocks happens successfully * withheld transition PoW block is successfully processed -- network partitioning * transition block with the payload which parent is unavailable doesn't brick a node and it can proceed with building the chain and attesting, and can successfully complete the transition process ## System (Testnets) * general purpose * stress testnets * production sized ## Useful resources * Mergemock * https://github.com/protolambda/mergemock * Test cases for Merge * https://hackmd.io/z2h_RAJoTHWSRka-9MDEVg * Engine API test vectors for The Merge™ * https://notes.ethereum.org/rmVErCfCRPKGqGkUe89-Kg * EIP 4399 test vectors (Kintsugi) * https://notes.ethereum.org/dfVXr2h2TqWDKSXZaMwGTw * Kintzugi testing * https://github.com/marioevz/kintsugi_testing * Consensus spec tests * https://github.com/ethereum/consensus-spec-tests * Retesteth * https://github.com/ethereum/retesteth * EL tests * https://github.com/ethereum/tests * Hive * https://github.com/ethereum/hive * Eth2 Hive - take 2 * https://github.com/ethereum/hive/pull/481 * Prysmatic end-to-end testing tool * https://github.com/prysmaticlabs/prysm/tree/develop/testing/endtoend * EVM-fuzzing * https://github.com/MariusVanDerWijden/FuzzyVM * Engine-API fuzzing * https://github.com/MariusVanDerWijden/merge-fuzz * Transaction fuzzing * https://github.com/MariusVanDerWijden/tx-fuzz * EIP-3675 + EIP-4399 blockchain tests * https://docs.google.com/spreadsheets/d/1V8egI6VbtZR_sqUNCdX2QeRVb9fCJ3QmzCu8VZFs5pA/edit#gid=0 * FuzzyVM * https://github.com/MariusVanDerWijden/FuzzyVM

    Import from clipboard

    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 lost their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template is not available.


    Upgrade

    All
    • All
    • Team
    No template found.

    Create custom template


    Upgrade

    Delete template

    Do you really want to delete this template?

    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

    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

    Tutorials

    Book Mode Tutorial

    Slide Mode Tutorial

    YAML Metadata

    Contacts

    Facebook

    Twitter

    Feedback

    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

    Versions and GitHub Sync

    Sign in to link this note to GitHub Learn more
    This note is not linked with GitHub Learn more
     
    Add badge Pull Push GitHub Link Settings
    Upgrade now

    Version named by    

    More Less
    • Edit
    • Delete

    Note content is identical to the latest version.
    Compare with
      Choose a version
      No search result
      Version not found

    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. Learn more

         Sign in to GitHub

        HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.

        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
        Available push count

        Upgrade

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Upgrade

        Danger Zone

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

        Syncing

        Push failed

        Push successfully