add some log data for fishy trusted attestations (#4049)

This commit is contained in:
Jacek Sieka 2022-08-30 04:59:42 +02:00 committed by GitHub
parent 574b84f96f
commit 59092e5b3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,28 +99,38 @@ iterator get_attesting_indices*(
let let
slot = slot =
check_attestation_slot_target(attestation.data).valueOr: check_attestation_slot_target(attestation.data).valueOr:
warn "Invalid attestation slot" warn "Invalid attestation slot in trusted attestation",
attestation = shortLog(attestation.data)
doAssert strictVerification notin dag.updateFlags doAssert strictVerification notin dag.updateFlags
break break
blck = blck =
dag.getBlockRef(attestation.data.beacon_block_root).valueOr: dag.getBlockRef(attestation.data.beacon_block_root).valueOr:
# Attestation block unknown # Attestation block unknown - this is fairly common because we
# discard alternative histories on restart
break break
target = target =
blck.atCheckpoint(attestation.data.target).valueOr: blck.atCheckpoint(attestation.data.target).valueOr:
warn "Invalid attestation target" warn "Unknown attestation target in trusted attestation",
blck = shortLog(blck),
attestation = shortLog(attestation.data)
doAssert strictVerification notin dag.updateFlags doAssert strictVerification notin dag.updateFlags
break break
shufflingRef = shufflingRef =
dag.getShufflingRef(target.blck, target.slot.epoch, false).valueOr: dag.getShufflingRef(target.blck, target.slot.epoch, false).valueOr:
warn "Attestation shuffling not found" warn "Attestation shuffling not found",
blck = shortLog(blck),
attestation = shortLog(attestation.data)
doAssert strictVerification notin dag.updateFlags doAssert strictVerification notin dag.updateFlags
break break
committeesPerSlot = get_committee_count_per_slot(shufflingRef) committeesPerSlot = get_committee_count_per_slot(shufflingRef)
committeeIndex = committeeIndex =
CommitteeIndex.init(attestation.data.index, committeesPerSlot).valueOr: CommitteeIndex.init(attestation.data.index, committeesPerSlot).valueOr:
warn "Unexpected committee index in block attestation" warn "Unexpected committee index in trusted attestation",
blck = shortLog(blck),
attestation = shortLog(attestation.data)
doAssert strictVerification notin dag.updateFlags doAssert strictVerification notin dag.updateFlags
break break