mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-25 21:17:17 +00:00
spec: check ProposalSlashing epochs, not slots
As per v0.5.{0,1} of the spec, we only need to check that the epochs of two proposal slashings are equal, not their slots.
This commit is contained in:
parent
10a5d2657c
commit
8da8730dca
@ -271,10 +271,10 @@ pub enum ProposerSlashingValidationError {
|
||||
pub enum ProposerSlashingInvalid {
|
||||
/// The proposer index is not a known validator.
|
||||
ProposerUnknown(u64),
|
||||
/// The two proposal have different slots.
|
||||
/// The two proposal have different epochs.
|
||||
///
|
||||
/// (proposal_1_slot, proposal_2_slot)
|
||||
ProposalSlotMismatch(Slot, Slot),
|
||||
ProposalEpochMismatch(Slot, Slot),
|
||||
/// The proposals are identical and therefore not slashable.
|
||||
ProposalsIdentical,
|
||||
/// The specified proposer has already been slashed.
|
||||
|
@ -21,8 +21,9 @@ pub fn verify_proposer_slashing(
|
||||
})?;
|
||||
|
||||
verify!(
|
||||
proposer_slashing.header_1.slot == proposer_slashing.header_2.slot,
|
||||
Invalid::ProposalSlotMismatch(
|
||||
proposer_slashing.header_1.slot.epoch(spec.slots_per_epoch)
|
||||
== proposer_slashing.header_2.slot.epoch(spec.slots_per_epoch),
|
||||
Invalid::ProposalEpochMismatch(
|
||||
proposer_slashing.header_1.slot,
|
||||
proposer_slashing.header_2.slot
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user