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

[WIP] stale-balance command: force-sync EigenPods with slashed validators #122

Closed
wants to merge 3 commits into from

Conversation

jbrower95
Copy link
Contributor

stale-balance

  • If an EigenPod has been slashed, you can use stale-balance to start a checkpoint against the EigenPod. We suggest avoiding doing this if the deviated amount is small (<5%), but it is a legal operation within the protocol at any time as a way to sync the beacon state with the execution state, when we know that a beacon slashing has occurred.

  • To use;

./cli stale-balance --podAddress $EIGENPOD_ADDRESS --execNode $NODE_ETH --beaconNode $NODE_BEACON --sender $EIGENPOD_PK --slashedValidatorIndex $SLASHED_VALIDATOR_INDEX

This will prompt to complete any in-flight checkpoints, and then call verifyStaleBalances.

@jbrower95 jbrower95 changed the title stale-balance command -- force-sync EigenPods with slashed validators stale-balance command: force-sync EigenPods with slashed validators Aug 7, 2024
@jbrower95 jbrower95 marked this pull request as ready for review August 7, 2024 20:02
{
Name: "stale-balance",
Args: true,
Usage: "If needed, calls `verifyStaleBalances` to correct the balance on a pod you don't own. This will attempt to (1) conclude any existing checkpoint on the pod, and then (2) invoke verifyStaleBalances() to start another, more up-to-date, checkpoint.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"calls verifyStaleBalances to correct the balance start a checkpoint on a pod you don't own"

Copy link
Contributor

@gpsanant gpsanant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good. Do we need a command for figuring out the slashed validator index though?

like, if another flag is set, it looks for a slashed validator and doesn't do anything if it doesn't find one, but proves if it does?

{
Name: "stale-balance",
Args: true,
Usage: "If needed, calls `verifyStaleBalances` to correct the balance on a pod you don't own. This will attempt to (1) conclude any existing checkpoint on the pod, and then (2) invoke verifyStaleBalances() to start another, more up-to-date, checkpoint.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that anything surrounded by backticks (eg `verifyStaleBalances` above) gets added as a "variable name"/"target" in the CLI help text. Would recommend not using these unless you're trying to change the help text

Run ./cli -h to see what i'm talking about

Comment on lines +188 to +202
if currentCheckpointTimestamp > 0 {
// TODO: complete current checkpoint
fmt.Printf("This eigenpod has an outstanding checkpoint (since %d). You must complete it before continuing.", currentCheckpointTimestamp)

proofs, err := core.GenerateCheckpointProof(ctx, eigenpodAddress, eth, chainId, beacon)
core.PanicOnError("failed to generate checkpoint proofs", err)

txns, err := core.SubmitCheckpointProof(ctx, sender, eigenpodAddress, chainId, proofs, eth, batchSize, noPrompt)
core.PanicOnError("failed to submit checkpoint proofs", err)

for i, txn := range txns {
fmt.Printf("sending txn[%d/%d]: %s (waiting)...", i, len(txns), txn.Hash())
bind.WaitMined(ctx, eth, txn)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be quite expensive - should we add a flag that signals that you want to complete an existing checkpoint if it's there?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like i'm picturing a worst-case scenario where we run the health checker on Renzo's pods and out of 8k validators one got slashed

and then we auto-complete a checkpoint for them

which, at 15 gwei, is ballpark ~6/7 ETH. Then, we start a checkpoint for them and complete a second one, for another 6/7 ETH 😓

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(i understand that that's what the health checker is for to an extent, but IMO in a case like this it should alert us rather than auto-completing the checkpoint, because there's a possibility here where we burn 14 ETH without thinking about it!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submitCheckpointProof has warning messages all over it (see how we pass noPrompt through). We should indicate ahead of time that starting the checkpoint could lead to finishing an expensive one though..

but that's sort of the same problem we face on checkpoints rn in the CLI -- we don't do any cost/gas estimation yet

@jbrower95 jbrower95 changed the title stale-balance command: force-sync EigenPods with slashed validators [WIP] stale-balance command: force-sync EigenPods with slashed validators Aug 9, 2024
@jbrower95
Copy link
Contributor Author

going to rebase / reopen this.

@jbrower95 jbrower95 closed this Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants