Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(sidecar/holesky): add preset for delegation, env docs #540

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions bolt-sidecar/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ pub struct Opts {
/// containing the hex-encoded secret.
#[clap(long, env = "BOLT_SIDECAR_ENGINE_JWT_HEX")]
pub engine_jwt_hex: JwtSecretConfig,
/// The fee recipient address for fallback blocks
/// The fee recipient address for locally-built fallback blocks. It should be the same as the
/// one set for your validators.
#[clap(long, env = "BOLT_SIDECAR_FEE_RECIPIENT")]
pub fee_recipient: Address,
/// Secret BLS key to sign fallback payloads with
#[clap(long, env = "BOLT_SIDECAR_BUILDER_PRIVATE_KEY")]
/// Secret BLS key to sign fallback payloads with. This can be any key, and by default a random
/// one is created. You can generate one with the `bolt` CLI tool, using `bolt generate bls`.
#[clap(long, env = "BOLT_SIDECAR_BUILDER_PRIVATE_KEY", default_value_t = BlsSecretKeyWrapper::random())]
pub builder_private_key: BlsSecretKeyWrapper,
/// Secret ECDSA key to sign commitment messages with. The public key associated to it must be
/// then used when registering the operator in the `BoltManager` contract.
/// Secret ECDSA key used to sign commitment messages on behalf of your validators.
/// This MUST be set to the private key of your operator address registered in a restaking protocol.
#[clap(long, env = "BOLT_SIDECAR_COMMITMENT_PRIVATE_KEY")]
pub commitment_private_key: EcdsaSecretKeyWrapper,
/// Unsafely disables consensus checks when validating commitments.
Expand Down
35 changes: 18 additions & 17 deletions testnets/holesky/QUICK_START.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,33 +343,32 @@ separate guide [here](./commit-boost/README.md) in detail.

### Docker mode

First, change directory to the `testnets/holesky` folder in the bolt repository you cloned in step 1:
First, change directory to the `testnets/holesky` folder in the bolt repository
you cloned in step 1:

```bash
cd testnets/holesky
```

In this directory you will find a `docker-compose.yml` file that you can use to start the Bolt-sidecar.
But before doing that, you will need to change the configuration file to match your setup.
In this directory you will find a `docker-compose.yml` file that you can use to
start the bolt sidecar. But before doing that, you will need to change the
configuration file to match your setup.

To get started with the configuration, copy the example file:
To get started with the configuration, copy the following preset file:

```bash
cp bolt-sidecar.env.example bolt-sidecar.env
cp ./presets/sidecar-delegations-preset.env.example bolt-sidecar.env
```

<details>
<summary>Here is a brief explanation of some of the less-obvious fields in the `bolt-sidecar.env` file:</summary>

- `BOLT_SIDECAR_COMMITMENT_PRIVATE_KEY`: this is the private key of the operator address that you registered in the
restaking protocol in the previous steps. This is the key that will be used to sign commitments for your validators.
- `BOLT_SIDECAR_BUILDER_PRIVATE_KEY`: this can be any valid BLS private key. You can generate one using the `bolt generate bls` command.
This preset file will run the bolt-sidecar in "delegation" mode, which is the
recommended way to set it up.

The section "signing options" is by far the most complex part of the configuration file.
It is used to configure how Bolt protocol understands and authenticates your validators.
Fill the configuration excluding the "Signing options"
section, which will be covered below. Remember to set the
`BOLT_SIDECAR_COMMITMENT_PRIVATE_KEY` to the operator private key registered in
the previous step.

Although this is a quick guide, delegation must be understood correctly in order to be setup properly.
Here is a quick rundown of how it works:
**Why delegation?**

The bolt-sidecar needs to know which validators it is controlling (aka, which validators it can sign commitments
on behalf of). Otherwise it may sign commitments for random validators which would get you slashed.
Expand All @@ -383,7 +382,7 @@ to sign a message that essentially says "I authorize this other key to sign comm

This way, operators don't need to use their validator secret keys in their online sidecar setup anymore.

This is by far the most recommended way to set up the bolt-sidecar.
**Creating delegations**

In order to create and use these delegations, you can follow these steps:

Expand All @@ -409,7 +408,7 @@ In order to create and use these delegations, you can follow these steps:

That's it! You can proceed to the next step.

</details>
**Configuring MEV-Boost**

After you've filled out the sidecar configuration, you can do the same with the `mev-boost` configuration:

Expand All @@ -422,6 +421,8 @@ And fill out the values in the `mev-boost.env` file as well.
- NOTE: the config file comes with relay URLs already set up for you. Feel free to change them if
you only want to use some specific relays.

**Start the docker compose**

Once the config files are in place, make sure you have Docker running and then start the docker compose:

```bash
Expand Down
54 changes: 54 additions & 0 deletions testnets/holesky/presets/sidecar-delegations-preset.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Ethereum Node Connections + PBS URLs

# Port to listen on for incoming JSON-RPC requests of the Commitments API. This
# port should be open on your firewall in order to receive external requests!
BOLT_SIDECAR_PORT=8017
# Execution client API URL
BOLT_SIDECAR_EXECUTION_API_URL="http://172.56.0.1:8545"
# URL for the beacon client
BOLT_SIDECAR_BEACON_API_URL="http://172.56.0.1:5052"
# Execution client Engine API URL. This is needed for fallback block building
# and must be a synced Geth node
BOLT_SIDECAR_ENGINE_API_URL="http://172.56.0.1:8551"
# The port from which the Bolt sidecar will receive Builder-API requests from the Beacon client
BOLT_SIDECAR_CONSTRAINTS_PROXY_PORT=18550
# URL to forward the constraints produced by the Bolt sidecar to a server
# supporting the Constraints API, such as an MEV-Boost fork
BOLT_SIDECAR_CONSTRAINTS_API_URL="http://bolt-mev-boost-holesky:18551"
# The JWT secret token to authenticate calls to the engine API. It can be
# either be a hex-encoded string or a file path to a file containing the
# hex-encoded secret.
BOLT_SIDECAR_ENGINE_JWT_HEX=
# The fee recipient address for locally-built fallback blocks. It should be the same as the
# one set for your validators.
BOLT_SIDECAR_FEE_RECIPIENT=
# Secret ECDSA key used to sign commitment messages on behalf of your validators.
# This MUST be set to the private key of your operator address registered in a restaking protocol.
BOLT_SIDECAR_COMMITMENT_PRIVATE_KEY=

# Commitments limits
# Max number of commitments to accept per block
BOLT_SIDECAR_MAX_COMMITMENTS_PER_SLOT=128
# Max committed gas per slot
BOLT_SIDECAR_MAX_COMMITTED_GAS_PER_SLOT=10_000_000
# Min priority fee to accept for a commitment
BOLT_SIDECAR_MIN_PRIORITY_FEE=4_000_000_000 # 4 Gwei = 4 * 10^9 wei

# Chain configuration
# Chain on which the sidecar is running
BOLT_SIDECAR_CHAIN="holesky"
# The deadline in the slot at which the sidecar will stop accepting new
# commitments for the next block (parsed as milliseconds)
BOLT_SIDECAR_COMMITMENT_DEADLINE=8000
# Enable a two-epoch lookahead by enabling unsafe lookahead option
BOLT_SIDECAR_ENABLE_UNSAFE_LOOKAHEAD=true

# Signing options.
# The path to the delegations file
BOLT_SIDECAR_DELEGATIONS_PATH=
# The private key of the account for which delegations have been made.
BOLT_SIDECAR_CONSTRAINT_PRIVATE_KEY=

# Telemetry and Metrics
BOLT_SIDECAR_METRICS_PORT=9091 # Changing this requires also changing the `target.json` file
BOLT_SIDECAR_DISABLE_METRICS=false
Loading