Skip to content

Instantly share code, notes, and snippets.

@ksale001
Last active October 25, 2024 02:11
Show Gist options
  • Save ksale001/67944f1078a359b57bdf59365d87533a to your computer and use it in GitHub Desktop.
Save ksale001/67944f1078a359b57bdf59365d87533a to your computer and use it in GitHub Desktop.
Squad Staking in CSM

Deploying an Obol DV on Lido CSM using Linux (Early Access)

To start, this guide makes a couple assumptions:

  1. You're running Linux and you've installed Git and Docker.
  2. You'll be delpoying on mainnet. Some screenshots in this guide are from Holesky, so please verify mainnet addresses.

Getting started

This guide will be broken down into 3 parts:

Part 1: Create cluster multi-sig + 0xSplits contract
Part 2: Use Obol Launchpad + CLI to create the cluster
Part 3: Deploy the validator to CSM

In this guide we'll be using CSM with extendedManagerPermissions where the managerAddress is set to the cluster multi-sig and the rewardAddress is set to the 0xSplits contract.



Part 1: Creating the Cluster multi-sig + 0xSplits Contract

Detailed instructions on how to create a Safe Wallet can be found here.

Squad leader should obtain the signer addresses from all the cluster members, then connect their signer wallet and create a new Safe.

chrome_ofxRcHQItb

After giving the Safe a name and selecting the appropriate network, continue by clicking the Next button.

chrome_0n8nPU5G5q

Add all the signer addresses of the cluster members, select a threshold, and proceed to the final step by clicking the Next button.

chrome_qvPajGtE0N

Finally, submit the transaction to create the Safe by clicking on the Create button.

chrome_BfjGLxjtYM

Creating the reward split contract

Squad leader should obtain the reward addresses from all the cluster members. Open https://app.splits.org and create a new contract. Make sure to select the appropriate network.

image

Select Split for the contract type.

image

Add the reward addresses of all cluster members. Choose whether the contract is immutable (recommended option), whether to sponsor the maintainers of splits.org, and whether there is a distribution bounty so that third parties can distribute the rewards in exchange for a small fee.

image

Finally, click the Create Split button, execute the transaction and share the created split contract with all cluster members for review.



Part 2: Use Obol Launchpad + CLI to create the cluster

Charon is the middleware client that enables validators to be run by a group of independent node operators - a cluster or squad. A complete multi-container Docker setup including execution client, consensus client, validator client, MEV-Boost and the Charon client can be found in this repository https://github.com/ObolNetwork/charon-distributed-validator-node.

Step 1: Clone the repo and add give $USER permissions

git clone https://github.com/ObolNetwork/charon-distributed-validator-node.git
sudo usermod -a -G docker $USER

If you're logged in via ssh, restart your session.

Step 2: Create ENR and Backup your Private Key

Change into the CDVN directory:

cd charon-distributed-validator-node

Use docker to create an ENR

docker run --rm -v "$(pwd):/opt/charon" obolnetwork/charon:v1.1.1 create enr

Back up the private key located in .charon/charon-enr-private-key

enrpic



Step 3: Create the DV cluster configuration using the Launchpad

Obol has inegrated a CSM configuration into the launchpad. Choosing this configuration allows you to create up to 12 validator keys (CSM EA Limit) with Lido's required withdrawal and fee recipient addresses.

To start, the squad leader opens the DV Launchpad, then connects their wallet and chooses Create a cluster with a group.

image

Then click Get Started.

chrome_WW8rTcaqeQ

Accept all the necessary advisories and sign to confirm.

chrome_rQIeibZpcj

Cluster configuration begins here. First, select the cluster name and size, then enter all cluster members signer addresses.

configurepic

  • Select the number of validators (up to 12 for CSM EA) to deploy.
  • Enter the complete Public ENR which was generated during step 2 above.
  • In the Withdrawal Configuration field, select LIDO CSM. This will automatically fill the required Withdrawal Address and Fee Recipient Addresss per Lido Documentation
  • Finally, click on the Create cluster configuration button.

configure2pic

Lastly, share the cluster configuration link with the other cluster members.

chrome_wHk3z8Tz9S

Step 4: Distributed Key Generation

All squad members need to open the cluster invite link, connect their wallet, accept all necessary advisories, and verify the cluster configuration with a signature. Each squad member will need to input their ENR, so see steps 1 and 2 above.

acceptpic

Once all members confirm the configuration they will see the continue button.

image

On the next page, they will find a CLI command which is used to begin the DKG.

dkgcommandpic

All members need to synchronously complete this step. Go back to terminal, make sure you're in the correct directory:

cd charon-distributed-validator-node

Paste the DKG command into your terminal and wait for all the other squad members to connect and complete the DKG ceremony.

dkgclipic

New files were generated: cluster-lock.json, deposit-data.json, validator_keys are all found in the .charon folder (hidden by default). This contains each operator's partial key signatures for the validators.

At this point, each operator must make a backup of the .charon folder and keep it safe, as validator keys can't be recreated.

Step 5: Edit .env file for Mainnet Adjustments

Copy and rename the .env.sample.mainnet file to .env

cp -n .env.sample.holesky .env

Open the .env file using you favorite editor:

sudo nano .env

Set the BUILDER_API_ENABLED=true
MEVBOOST_RELAYS= to the URL of at least one of Lido's approved MEV relays here. Multiple relays must be separated by a comma.

Screenshot 2024-10-18 at 11 13 15 PM

Step 6: Starting the Node

Each cluster member should start the node with the following command:

docker compose up -d

At this point, execution and consensus clients should start syncing, and Charon and the validator client should start waiting for the validator to be activated.



Part 3: Deploy the keys to Lido CSM

CSM is launching with a whitelisted set of approved operators (Early Access). The squad member with EA should be the one to create the node through the CSM widget.
EA member will head to CSM Extended Mode and connect their wallet. Note the mode=extended parameter. This allows the Lido CSM reward address to be set to the split contract created earlier.

image

EA member clicks on the Create Node Operator button...

image

  • EA member pastes the contents of the deposit-data.json file into the Upload deposit data field. EA member should have enough ETH/stETH/wstETH to cover the bond.

  • Expand the Specify custom addresses section...

  • Set the Reward Address field to the Split contract address and the Manager Address field to the Safe wallet address.

  • Verify that the Extended box is outlined. This ensures that the Safe address has the ability to change the reward address if necessary.

  • Check that the correct addresses are set and click the Create Node Operator button.

csmui

Sign the transaction, and the cluster is ready for deposit from Lido CSM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment