Skip to content

Conversation

dknopik
Copy link
Member

@dknopik dknopik commented Jul 23, 2025

Thiiiis one is a bit spicy:

Currently, the slashing database only exposes functions to atomically check slashability of an attestation/block and then insert the corresponding data into the database. As this is done atomically, we can fearlessly sign the thing as other threads will definitely see the inserted data.

In Anchor, we first decide with the SSV committee which attestation/block we should sign, and then create a partial signature and broadcast it. Until now, we did the slashing check-and-insert right before creating the partial signature, and will continue to do so. However, we want to be able to check whether a thing is slashable in the first step, in order to not decide on a invalid value and then sign nothing, as the the slashing check fails.

Basically, we want to move from:

flowchart LR
    A@{ shape: sm-circ, label: "Small start" } --> Z[Wait for block]
    Z --> B[Decide block]
    B --> C{Is safe?}
    C -->|Yes| D[Create partial sig]
    C -->|No| E[Sign nothing]
Loading

to

flowchart LR
    A@{ shape: sm-circ, label: "Small start" } --> Z[Wait for block]
    Z --> C{"Is safe?<br>(check only)"}
    C -->|Yes| B[Decide block]
    C -->|No| Z
    B --> D{"Is safe?<br>(check and insert)"}
    D -->|Yes| H[Create partial sig]
    D -->|No| I[Sign nothing]
Loading

For this, we need to expose check only functions in the slashing database. This introduces a way for the user of the slashing database to shoot themselves in the foot.

jimmygchen added a commit that referenced this pull request Jul 24, 2025
@michaelsproul michaelsproul added val-client Relates to the validator client binary code-quality security labels Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality security val-client Relates to the validator client binary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants