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 {
|
pub enum ProposerSlashingInvalid {
|
||||||
/// The proposer index is not a known validator.
|
/// The proposer index is not a known validator.
|
||||||
ProposerUnknown(u64),
|
ProposerUnknown(u64),
|
||||||
/// The two proposal have different slots.
|
/// The two proposal have different epochs.
|
||||||
///
|
///
|
||||||
/// (proposal_1_slot, proposal_2_slot)
|
/// (proposal_1_slot, proposal_2_slot)
|
||||||
ProposalSlotMismatch(Slot, Slot),
|
ProposalEpochMismatch(Slot, Slot),
|
||||||
/// The proposals are identical and therefore not slashable.
|
/// The proposals are identical and therefore not slashable.
|
||||||
ProposalsIdentical,
|
ProposalsIdentical,
|
||||||
/// The specified proposer has already been slashed.
|
/// The specified proposer has already been slashed.
|
||||||
|
@ -21,8 +21,9 @@ pub fn verify_proposer_slashing(
|
|||||||
})?;
|
})?;
|
||||||
|
|
||||||
verify!(
|
verify!(
|
||||||
proposer_slashing.header_1.slot == proposer_slashing.header_2.slot,
|
proposer_slashing.header_1.slot.epoch(spec.slots_per_epoch)
|
||||||
Invalid::ProposalSlotMismatch(
|
== proposer_slashing.header_2.slot.epoch(spec.slots_per_epoch),
|
||||||
|
Invalid::ProposalEpochMismatch(
|
||||||
proposer_slashing.header_1.slot,
|
proposer_slashing.header_1.slot,
|
||||||
proposer_slashing.header_2.slot
|
proposer_slashing.header_2.slot
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user