Skip to main content

Slashing Export

Running sedge slashing-export will export slashing protection data from the current validator client. The slashing protection data is a JSON file that meets with the EIP-3076 specification.

Help

$ sedge slashing-export --help

Export Slashing Protection Interchange Format (EIP-3076) data. This command assumes
that the validator client container exists, stopped or not and that its database
is already initialized. Take in mind that the validator client generates slashing
protection data after some time running, so for some clients export slashing protection
data just after start the client could produce some errors.

This command stops the validator client during the exporting process due to the
validator database being locked while it's running but leaves the validator client
in the same state in which it was found. That means if the validator is running/stopped
before the export, then the validator will be running/stopped after the command
is executed, regardless of whether the export fails or not. To force a different
behavior use --start-validator and --stop-validator flags.

The [validator] is a required argument used to specify which validator client, from
all supported by Sedge (lighthouse, lodestar, prysm or teku), is used to exporting
the Slashing Protection data. This is necessary because each client has its own way
to achieve the exportation.

Usage:
sedge slashing-export [flags] [validator]

Examples:

sedge slashing-export --out slashing-data.json prysm
sedge slashing-export --out slashing-data.json --stop-validator lodestar
sedge slashing-export --out slashing-data.json --start-validator lighthouse

Flags:
--container-tag string Container tag to use. If defined, sedge will add to each container and the network, a suffix with the tag. e.g. sedge-validator-client -> sedge-validator-client-<tag>.
-h, --help help for slashing-export
-n, --network string network (default "mainnet")
-o, --out string path to write the JSON file in the EIP-3076 format with the slashing protection data (default "<generation-dir>/slashing_export.json")
-p, --path string path to the generation directory (default "./docker-compose-scripts")
--start-validator starts the validator client after export, regardless of the state the validator was in before
--stop-validator stops the validator client after export, regardless of the state the validator was in before

Global Flags:
--logLevel string Set Log Level, e.g panic, fatal, error, warn, warning, info, debug, trace (default "info")

Execution Example

This is an example of exporting slashing protection data from a setup using sepolia network and lighthouse as validator client that is already stopped at the moment of the export.

$ sedge slashing-export lighthouse -n sepolia --out slashing-protection.json
2023-01-06 15:47:56 -- [INFO] [Logger Init] Log level: info
2023-01-06 15:47:57 -- [INFO] You are running the latest version of sedge. Version: v1.3.2
2023-01-06 15:47:57 -- [INFO] Exporting slashing data from client lighthouse
2023-01-06 15:47:57 -- [INFO] The slashing protection container is starting...
2023-01-06 15:47:57 -- [INFO] The slashing container ends successfully.

Notice in this case the validator client remains stopped because it has been stopped since before the export. If necessary the validator client could be started after the export using the --start-validator flag, for example:

$ sedge slashing-export lighthouse -n sepolia --out slashing-protection.json --start-validator
2023-01-06 15:51:11 -- [INFO] [Logger Init] Log level: info
2023-01-06 15:51:11 -- [INFO] You are running the latest version of sedge. Version: v1.3.2
2023-01-06 15:51:11 -- [INFO] Exporting slashing data from client lighthouse
2023-01-06 15:51:11 -- [INFO] The slashing protection container is starting...
2023-01-06 15:51:12 -- [INFO] The slashing container ends successfully.
2023-01-06 15:51:12 -- [INFO] The validator container is being restarted...
2023-01-06 15:51:12 -- [INFO] Validator started.

Another case may be exporting the slashing data protection when the validator is currently running, for example:

$ sedge slashing-export lighthouse -n sepolia --out slashing-protection.json                  
2023-01-06 15:51:46 -- [INFO] [Logger Init] Log level: info
2023-01-06 15:51:46 -- [INFO] You are running the latest version of sedge. Version: v1.3.2
2023-01-06 15:51:46 -- [INFO] Stopping validator client
2023-01-06 15:51:46 -- [INFO] stopping service: validator-client, currently on running status
2023-01-06 15:51:47 -- [INFO] Validator client stopped.
2023-01-06 15:51:47 -- [INFO] Exporting slashing data from client lighthouse
2023-01-06 15:51:47 -- [INFO] The slashing protection container is starting...
2023-01-06 15:51:47 -- [INFO] The slashing container ends successfully.
2023-01-06 15:51:47 -- [INFO] The validator container is being restarted...
2023-01-06 15:51:47 -- [INFO] Validator started.

In this case, the validator client is stopped before the export and started again afterward. If necessary validator could be stopped after the export using the --stop-validator flag. for example:

$ sedge slashing-export lighthouse -n sepolia --out slashing-protection.json --stop-validator
2023-01-06 15:52:07 -- [INFO] [Logger Init] Log level: info
2023-01-06 15:52:07 -- [INFO] You are running the latest version of sedge. Version: v1.3.2
2023-01-06 15:52:07 -- [INFO] Stopping validator client
2023-01-06 15:52:07 -- [INFO] stopping service: validator-client, currently on running status
2023-01-06 15:52:07 -- [INFO] Validator client stopped.
2023-01-06 15:52:07 -- [INFO] Exporting slashing data from client lighthouse
2023-01-06 15:52:08 -- [INFO] The slashing protection container is starting...
2023-01-06 15:52:08 -- [INFO] The slashing container ends successfully.

In this case, the validator client is stopped before the export but is not started again afterward.