mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-21 06:48:27 +00:00
fixing recursive calls with caching
This commit is contained in:
@@ -4845,22 +4845,21 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
// get_attestation_score(parent, parent_payload_status) where parent_payload_status
|
||||
// is determined by the head block's relationship to its parent.
|
||||
let head_weight = info.head_node.weight();
|
||||
let parent_weight =
|
||||
if let (Ok(head_payload_status), Ok(parent_v29)) = (
|
||||
info.head_node.parent_payload_status(),
|
||||
info.parent_node.as_v29(),
|
||||
) {
|
||||
// Post-GLOAS: use the payload-filtered weight matching how the head
|
||||
// extends from its parent.
|
||||
match head_payload_status {
|
||||
proto_array::PayloadStatus::Full => parent_v29.full_payload_weight,
|
||||
proto_array::PayloadStatus::Empty => parent_v29.empty_payload_weight,
|
||||
proto_array::PayloadStatus::Pending => info.parent_node.weight(),
|
||||
}
|
||||
} else {
|
||||
// Pre-GLOAS or fork boundary: use total weight.
|
||||
info.parent_node.weight()
|
||||
};
|
||||
let parent_weight = if let (Ok(head_payload_status), Ok(parent_v29)) = (
|
||||
info.head_node.parent_payload_status(),
|
||||
info.parent_node.as_v29(),
|
||||
) {
|
||||
// Post-GLOAS: use the payload-filtered weight matching how the head
|
||||
// extends from its parent.
|
||||
match head_payload_status {
|
||||
proto_array::PayloadStatus::Full => parent_v29.full_payload_weight,
|
||||
proto_array::PayloadStatus::Empty => parent_v29.empty_payload_weight,
|
||||
proto_array::PayloadStatus::Pending => info.parent_node.weight(),
|
||||
}
|
||||
} else {
|
||||
// Pre-GLOAS or fork boundary: use total weight.
|
||||
info.parent_node.weight()
|
||||
};
|
||||
|
||||
let (head_weak, parent_strong) = if fork_choice_slot == re_org_block_slot {
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user