@@ -1899,8 +1899,9 @@ proc updateHead*(
1899
1899
dag.onFinHappened(dag, data)
1900
1900
1901
1901
proc getEarliestInvalidRoot* (
1902
- dag: ChainDAGRef, initialSearchRoot: Eth2Digest, lvh: Eth2Digest,
1903
- defaultEarliestInvalidRoot: Eth2Digest): Eth2Digest =
1902
+ dag: ChainDAGRef, initialSearchRoot: Eth2Digest,
1903
+ latestValidHash: Eth2Digest, defaultEarliestInvalidRoot: Eth2Digest):
1904
+ Eth2Digest =
1904
1905
# Earliest within a chain/fork in question, per LVH definition. Intended to
1905
1906
# be called with `initialRoot` as the parent of the block regarding which a
1906
1907
# newPayload or forkchoiceUpdated execution_status has been received as the
@@ -1918,18 +1919,19 @@ proc getEarliestInvalidRoot*(
1918
1919
# Only allow this special case outside loop; it's when the LVH is the direct
1919
1920
# parent of the reported invalid block
1920
1921
if curBlck.executionBlockRoot.isSome and
1921
- curBlck.executionBlockRoot.get == lvh :
1922
+ curBlck.executionBlockRoot.get == latestValidHash :
1922
1923
return defaultEarliestInvalidRoot
1923
1924
1924
1925
while true :
1925
1926
# This was supposed to have been either caught by the pre-loop check or the
1926
1927
# parent check.
1927
1928
if curBlck.executionBlockRoot.isSome and
1928
- curBlck.executionBlockRoot.get == lvh :
1929
+ curBlck.executionBlockRoot.get == latestValidHash :
1929
1930
doAssert false , " getEarliestInvalidRoot: unexpected LVH in loop body"
1930
1931
1931
1932
if (curBlck.parent.isNil) or
1932
- curBlck.parent.executionBlockRoot.get(lvh) == lvh:
1933
+ curBlck.parent.executionBlockRoot.get(latestValidHash) ==
1934
+ latestValidHash:
1933
1935
break
1934
1936
curBlck = curBlck.parent
1935
1937
0 commit comments