-
Notifications
You must be signed in to change notification settings - Fork 37
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
Conversation
stale-balance
command -- force-sync EigenPods with slashed validatorsstale-balance
command: force-sync EigenPods with slashed validators
{ | ||
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.", |
There was a problem hiding this comment.
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"
There was a problem hiding this 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.", |
There was a problem hiding this comment.
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
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) | ||
} | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 😓
There was a problem hiding this comment.
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!)
There was a problem hiding this comment.
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
stale-balance
command: force-sync EigenPods with slashed validatorsstale-balance
command: force-sync EigenPods with slashed validators
going to rebase / reopen this. |
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.