mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 19:02:42 +00:00
Most remove ffg_update_required
This commit is contained in:
@@ -22,9 +22,6 @@ pub struct ProtoArray {
|
||||
/// Do not attempt to prune the tree unless it has at least this many nodes. Small prunes
|
||||
/// simply waste time.
|
||||
pub prune_threshold: usize,
|
||||
/// Set to true when the Casper FFG justified/finalized epochs should be checked to ensure the
|
||||
/// tree is filtered as per eth2 specs.
|
||||
pub ffg_update_required: bool,
|
||||
pub justified_epoch: Epoch,
|
||||
pub finalized_epoch: Epoch,
|
||||
pub nodes: Vec<ProtoNode>,
|
||||
@@ -59,13 +56,7 @@ impl ProtoArray {
|
||||
});
|
||||
}
|
||||
|
||||
// The `self.ffg_update_required` flag indicates if it is necessary to check the
|
||||
// finalized/justified epoch of all nodes against the epochs in `self`.
|
||||
//
|
||||
// This behaviour is equivalent to the `filter_block_tree` function in the spec.
|
||||
self.ffg_update_required =
|
||||
justified_epoch != self.justified_epoch || finalized_epoch != self.finalized_epoch;
|
||||
if self.ffg_update_required {
|
||||
if justified_epoch != self.justified_epoch || finalized_epoch != self.finalized_epoch {
|
||||
self.justified_epoch = justified_epoch;
|
||||
self.finalized_epoch = finalized_epoch;
|
||||
}
|
||||
@@ -124,8 +115,6 @@ impl ProtoArray {
|
||||
}
|
||||
}
|
||||
|
||||
self.ffg_update_required = false;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -235,7 +224,6 @@ impl ProtoArray {
|
||||
});
|
||||
} else if finalized_epoch != self.finalized_epoch {
|
||||
self.finalized_epoch = finalized_epoch;
|
||||
self.ffg_update_required = true;
|
||||
}
|
||||
|
||||
let finalized_index = *self
|
||||
|
||||
Reference in New Issue
Block a user