Skip to content

Instantly share code, notes, and snippets.

@TobiWo
Last active December 16, 2024 06:55
Show Gist options
  • Save TobiWo/48cec03947805fe115a171ed27c98e84 to your computer and use it in GitHub Desktop.
Save TobiWo/48cec03947805fe115a171ed27c98e84 to your computer and use it in GitHub Desktop.
Gist for Ethereum stakers who want to test all staking related changes on mekong

Mekong validator gist

This gist is about all things stakers can do on the mekong public testnet. It comprises of different sections for different use cases and documents all the necessary commands and steps so that any staker can easily replicate my workflow.

If I missed anything, let me know. The list of actions might not be complete so I will extend it for sure.

The gist is based on the official pectra FAQ. Although this gist wraps up the most important actions etc. I recommend to read the full FAQ for edge cases etc.

NOTE: It is not adviced to set a wallets private key in a cli command as it will be persisted in the clis history. I'm doing this for convenienence reasons and since it is only a testnet there is no issue. I do not recommend to do it like that for mainnet operations.

Setup

This chapter holds information what you need to do in order to run the post pectra staking scenarios.

Tools

Prerequisites

  1. You need mekongETH

  2. Prepare your environment

    export EXECUTION_NODE=<EXECUTION_NODE_URL>

Register pre pectra validators

  1. Run the deposit-cli and create keys and deposit data for 4-5 pre-pectra validators (it is assumed that you create validators with 0x01 withdrawal credentials)

    • Note, you need the respective mekongETH in order to register these 4-5 validators

      ./deposit new-mnemonic --chain mekong --withdrawal_address <YOUR_WITHDRAWAL_ADDRESS> --num_validators 5 --keystore_password <VALIDATOR_KEYSTORE_PASSWORD>
  2. Put the keys and and keystore password to your validator client of choice (how to set up is not part of this documentation)

  3. Send the deposit data to the deposit contract

    • you can do so using either dora or send a cli command using ethereal:

      ./ethereal beacon deposit --connection ${EXECUTION_NODE} --data=<PATH_TO_deposit-data.json> --address=0x4242424242424242424242424242424242424242 --from=<WALLET_ADDRESS_WITH_ETH> --privatekey=<PRIVATE_KEY_OF_WALLET> --allow-unknown-contract --wait
  4. Validators should be registered in less than an our

Post pectra scenarios

Scenarios to add

  • Directly create compounding validator (with deposit-cli and ethstaker-deposit-cli)
  • Exit validator via execution layer message

Consolidate two validators to one

  1. Your validators need to have 0x01 or 0x02 withdrawal credantials
  2. Navigate to dora consolidation page
  3. Connect your wallet and follow the consolidation steps

Consolidate multiple validators to one

  1. Your validators need to have 0x01 or 0x02 withdrawal credantials
  2. Download or build the eth-validator-cli
  3. Follow the usage example

Switch from 0x01 to 0x02 credentials

  1. Simply use the dora consolidation page from above and set the source and target validator to the same validator pubkey
  2. You can also use the eth-validator-cli as an alternative. This is especially helpful if you want to switch the credential type for multiple validators

Top up a validator

  1. Requirement: The validator need to have 0x02 withdrawal credentials (see above)

  2. Create a partial deposit with the deposit-cli

    /deposit partial-deposit --chain mekong --keystore <PATH_TO_VALIDATOR_KEYSTORE_WHICH_YOU_WANT_TO_TOP_UP> --keystore_password <VALIDATOR_KEYSTORE_PASSWORD> --amount <AMOUNT_OF_ETH_FOR_TOP_UP> --withdrawal_address <VALIDATORS_WITHDRAWAL_ADDRESS>
  3. Send the deposit data to the deposit contract

    • you can do so using either dora or send a cli command using ethereal:

      ./ethereal beacon deposit --connection ${EXECUTION_NODE} --data=<PATH_TO_deposit-data.json> --address=0x4242424242424242424242424242424242424242 --from=<WALLET_ADDRESS_WITH_ETH> --privatekey=<PRIVATE_KEY_OF_WALLET> --allow-unknown-contract --wait

Partially withdraw ETH from validator

  1. Navigate to dora-explorer, connect your wallet and simply follow the steps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment