Conversation
Greptile OverviewGreptile SummaryThis PR relaxes the majority fork protection rules by only validating checkpoint epochs (not roots) when checking Key changes:
Issues found:
Security considerations: Confidence Score: 3/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Caller
participant BeaconVoteValueCheckF
participant BeaconVote
participant BeaconSigner
Caller->>BeaconVoteValueCheckF: call with (signer, slot, shareKeys, expectedSourceEpoch, expectedTargetEpoch)
BeaconVoteValueCheckF->>BeaconVote: Decode(data)
BeaconVote-->>BeaconVoteValueCheckF: decoded BeaconVote
BeaconVoteValueCheckF->>BeaconVoteValueCheckF: check source.epoch < target.epoch
alt source >= target
BeaconVoteValueCheckF-->>Caller: error: source >= target
end
BeaconVoteValueCheckF->>BeaconVoteValueCheckF: check source.epoch == expectedSourceEpoch
alt source epoch mismatch
BeaconVoteValueCheckF-->>Caller: error: checkpoint mismatch
end
BeaconVoteValueCheckF->>BeaconVoteValueCheckF: check target.epoch == expectedTargetEpoch
alt target epoch mismatch
BeaconVoteValueCheckF-->>Caller: error: checkpoint mismatch
end
Note over BeaconVoteValueCheckF: Root comparison removed in this PR
BeaconVoteValueCheckF->>BeaconVoteValueCheckF: construct AttestationData
loop for each share public key
BeaconVoteValueCheckF->>BeaconSigner: IsAttestationSlashable(shareKey, attestationData)
alt slashable
BeaconSigner-->>BeaconVoteValueCheckF: error: slashable
BeaconVoteValueCheckF-->>Caller: error: slashable
end
BeaconSigner-->>BeaconVoteValueCheckF: ok
end
BeaconVoteValueCheckF-->>Caller: success
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
|
I think it would help if the description explicitly stated the scope of this change (and the corresponding SIP). With this PR, “majority fork protection” is effectively slashing protection only in majority-fork scenarios: Concretely, in a Holesky-style fork: I’d suggest adding a short “Scope and limitations” section making it explicit that: |
|
@diegomrsantos From my perspective, this is what the SIP was always about, and we just got a bit confused :-) |
|
I believe "Majority-Fork Slashing Protection" would be a clearer name for the SIP. |
|
What do you guys think about the following idea: Proposal: Quorum-based fork protection with a single re-sample Motivation
Rule: checkpoint quorum + one re-sample
🎯 Specific advantages
|
MatheusFranco99
left a comment
There was a problem hiding this comment.
Looks good for me for now!
But really want to create a session in the future for a more robust solution.
Addresses liveness issues during reorgs caused by strict checkpoint validation, as discussed in the SSV spec: - ssvlabs/ssv-spec#555 - ssvlabs/ssv-spec#589 Modified `BeaconVoteValidator` to compare only checkpoint epochs instead of full checkpoints (epoch + root): - **Validation logic**: Now accepts attestations with matching epochs but different roots, allowing DVs to remain live during benign reorgs when operators' beacon nodes temporarily see different chain heads - **Error handling**: Renamed `CheckpointMismatch` to `EpochMismatch` and simplified to store only epoch values - **Test coverage**: Removed tests for same-epoch different-root failures, added test verifying this scenario now succeeds Co-Authored-By: diego <diego@sigmaprime.io> Co-Authored-By: Daniel Knopik <daniel@dknopik.de>
Description
We should relax majority protection rules to only checks the checkpoints epochs of a
BeaconVote(attestation) against the node's own local view of the chain.This will ensure that the DV will remain live in case of a fork. It will only fail the value check in the case the resulting
SignedAttestationwill make choosing the other fork a slashable offense.