mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-10 22:36:01 +00:00
blockchain DAG and fork choice comment cleanup (#4070)
This commit is contained in:
parent
2da13c0b22
commit
e183dccc7f
@ -1498,7 +1498,7 @@ proc pruneBlocksDAG(dag: ChainDAGRef) =
|
|||||||
prunedHeads = hlen - dag.heads.len,
|
prunedHeads = hlen - dag.heads.len,
|
||||||
dagPruneDur = Moment.now() - startTick
|
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 =
|
template is_optimistic*(dag: ChainDAGRef, root: Eth2Digest): bool =
|
||||||
root in dag.optimisticRoots
|
root in dag.optimisticRoots
|
||||||
|
|
||||||
@ -1508,15 +1508,15 @@ proc markBlockInvalid*(dag: ChainDAGRef, root: Eth2Digest) =
|
|||||||
logScope: blck = shortLog(blck)
|
logScope: blck = shortLog(blck)
|
||||||
|
|
||||||
if not dag.is_optimistic(root):
|
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
|
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.3/sync/optimistic.md#transitioning-from-valid---invalidated-or-invalidated---valid
|
||||||
# "It is outside of the scope of the specification since it's only possible
|
# "These operations are purposefully omitted. It is outside of the scope of
|
||||||
# with a faulty EE. Such a scenario requires manual intervention."
|
# the specification since it's only possible with a faulty EE."
|
||||||
warn "markBlockInvalid: attempt to invalidate valid block"
|
warn "markBlockInvalid: attempt to invalidate valid block"
|
||||||
doAssert strictVerification notin dag.updateFlags
|
doAssert strictVerification notin dag.updateFlags
|
||||||
return
|
return
|
||||||
|
|
||||||
if root == dag.finalizedHead.blck.root:
|
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` ->
|
# "If the justified checkpoint transitions from `NOT_VALIDATED` ->
|
||||||
# `INVALIDATED`, a consensus engine MAY choose to alert the user and force
|
# `INVALIDATED`, a consensus engine MAY choose to alert the user and force
|
||||||
# the application to exit."
|
# the application to exit."
|
||||||
|
@ -88,8 +88,7 @@ type
|
|||||||
ProtoNodes* = object
|
ProtoNodes* = object
|
||||||
buf*: seq[ProtoNode]
|
buf*: seq[ProtoNode]
|
||||||
offset*: int ##\
|
offset*: int ##\
|
||||||
## Substracted from logical Index
|
## Subtracted from logical index to get the physical index
|
||||||
## to get the physical index
|
|
||||||
|
|
||||||
ProtoArray* = object
|
ProtoArray* = object
|
||||||
hasLowParticipation*: bool
|
hasLowParticipation*: bool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user