Skip to content

Commit

Permalink
Only invalidate post merge
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Jul 6, 2022
1 parent a73c8ee commit 7373342
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/fork-choice/src/protoArray/protoArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,12 @@ export class ProtoArray {
while (nodeIndex < this.nodes.length) {
const node = this.getNodeFromIndex(nodeIndex);
const parent = node.parent !== undefined ? this.getNodeByIndex(node.parent) : undefined;
if (invalidateAll || parent?.executionStatus === ExecutionStatus.Invalid) {
// Only invalidate if this is post merge, and either parent is invalid or the
// concensus has failed
if (
node.executionStatus !== ExecutionStatus.PreMerge &&
(invalidateAll || parent?.executionStatus === ExecutionStatus.Invalid)
) {
node.executionStatus = ExecutionStatus.Invalid;
node.bestChild = undefined;
node.bestDescendant = undefined;
Expand Down

0 comments on commit 7373342

Please sign in to comment.