Update attestation_validator for spec updates
This commit is contained in:
parent
96c2012434
commit
493a16ac18
@ -12,8 +12,9 @@ use super::{Error, Invalid, Outcome};
|
|||||||
pub fn validate_attestation_justified_slot(
|
pub fn validate_attestation_justified_slot(
|
||||||
data: &AttestationData,
|
data: &AttestationData,
|
||||||
state: &BeaconState,
|
state: &BeaconState,
|
||||||
|
epoch_length: u64,
|
||||||
) -> Result<Outcome, Error> {
|
) -> Result<Outcome, Error> {
|
||||||
let permissable_justified_slot = if data.slot >= state.latest_state_recalculation_slot {
|
let permissable_justified_slot = if data.slot >= state.slot - (state.slot % epoch_length) {
|
||||||
state.justified_slot
|
state.justified_slot
|
||||||
} else {
|
} else {
|
||||||
state.previous_justified_slot
|
state.previous_justified_slot
|
||||||
|
@ -19,7 +19,7 @@ where
|
|||||||
match state.latest_crosslinks.get(data.shard as usize) {
|
match state.latest_crosslinks.get(data.shard as usize) {
|
||||||
None => reject!(Invalid::UnknownShard),
|
None => reject!(Invalid::UnknownShard),
|
||||||
Some(crosslink) => {
|
Some(crosslink) => {
|
||||||
let local_shard_block_hash = crosslink.shard_block_hash;
|
let local_shard_block_hash = crosslink.shard_block_root;
|
||||||
let shard_block_hash_is_permissable = {
|
let shard_block_hash_is_permissable = {
|
||||||
(local_shard_block_hash == data.latest_crosslink_hash)
|
(local_shard_block_hash == data.latest_crosslink_hash)
|
||||||
|| (local_shard_block_hash == data.shard_block_hash)
|
|| (local_shard_block_hash == data.shard_block_hash)
|
||||||
|
Loading…
Reference in New Issue
Block a user