From 73733421e6d105d205ba67c3613e1f5406db4580 Mon Sep 17 00:00:00 2001 From: harkamal Date: Wed, 6 Jul 2022 23:15:17 +0530 Subject: [PATCH] Only invalidate post merge --- packages/fork-choice/src/protoArray/protoArray.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/fork-choice/src/protoArray/protoArray.ts b/packages/fork-choice/src/protoArray/protoArray.ts index 5c501733fce1..570624433cb0 100644 --- a/packages/fork-choice/src/protoArray/protoArray.ts +++ b/packages/fork-choice/src/protoArray/protoArray.ts @@ -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;