blockchain DAG and fork choice comment cleanup (#4070)

This commit is contained in:
tersec 2022-09-05 23:25:28 +00:00 committed by GitHub
parent 2da13c0b22
commit e183dccc7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View File

@ -1498,7 +1498,7 @@ proc pruneBlocksDAG(dag: ChainDAGRef) =
prunedHeads = hlen - dag.heads.len,
dagPruneDur = Moment.now() - startTick
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/sync/optimistic.md#helpers
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.3/sync/optimistic.md#helpers
template is_optimistic*(dag: ChainDAGRef, root: Eth2Digest): bool =
root in dag.optimisticRoots
@ -1508,15 +1508,15 @@ proc markBlockInvalid*(dag: ChainDAGRef, root: Eth2Digest) =
logScope: blck = shortLog(blck)
if not dag.is_optimistic(root):
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/sync/optimistic.md#transitioning-from-valid---invalidated-or-invalidated---valid
# "It is outside of the scope of the specification since it's only possible
# with a faulty EE. Such a scenario requires manual intervention."
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.3/sync/optimistic.md#transitioning-from-valid---invalidated-or-invalidated---valid
# "These operations are purposefully omitted. It is outside of the scope of
# the specification since it's only possible with a faulty EE."
warn "markBlockInvalid: attempt to invalidate valid block"
doAssert strictVerification notin dag.updateFlags
return
if root == dag.finalizedHead.blck.root:
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.1/sync/optimistic.md#re-orgs
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.3/sync/optimistic.md#re-orgs
# "If the justified checkpoint transitions from `NOT_VALIDATED` ->
# `INVALIDATED`, a consensus engine MAY choose to alert the user and force
# the application to exit."

View File

@ -88,8 +88,7 @@ type
ProtoNodes* = object
buf*: seq[ProtoNode]
offset*: int ##\
## Substracted from logical Index
## to get the physical index
## Subtracted from logical index to get the physical index
ProtoArray* = object
hasLowParticipation*: bool