File tree Expand file tree Collapse file tree
consensus/proto_array/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -978,6 +978,12 @@ impl ProtoArray {
978978 /// ## Notes
979979 ///
980980 /// Still returns `true` if `ancestor_root` is known and `ancestor_root == descendant_root`.
981+ ///
982+ /// ## Warning
983+ ///
984+ /// Do not use this function to check if a block is a descendant of the
985+ /// finalized checkpoint. Use `Self::is_finalized_checkpoint_or_descendant`
986+ /// instead.
981987 pub fn is_descendant ( & self , ancestor_root : Hash256 , descendant_root : Hash256 ) -> bool {
982988 self . indices
983989 . get ( & ancestor_root)
@@ -991,12 +997,11 @@ impl ProtoArray {
991997 . unwrap_or ( false )
992998 }
993999
994- /// Returns `true` if the `descendant_root` has an ancestor with `ancestor_root`. Always
995- /// returns `false` if either input root is unknown .
1000+ /// Returns `true` if `root` is equal to or a descendant of
1001+ /// `self.finalized_checkpoint` .
9961002 ///
997- /// ## Notes
998- ///
999- /// Still returns `true` if `ancestor_root` is known and `ancestor_root == descendant_root`.
1003+ /// Notably, this function is checking ancestory of the finalized
1004+ /// *checkpoint* not the finalized *block*.
10001005 pub fn is_finalized_checkpoint_or_descendant < E : EthSpec > ( & self , root : Hash256 ) -> bool {
10011006 let finalized_root = self . finalized_checkpoint . root ;
10021007 let finalized_slot = self
You can’t perform that action at this time.
0 commit comments