when at tip we receive new block hashes and new block events
we had an if statement which checked if the canonical chain builder tip changed after connecting new headers to the tree
that if statement was used to determine whether we should call InsertBlocks for the blocks we've just connected and also to commitExecution (call UpdateForkChoice)
this meant that when at the tip, we would not insert new blocks which would not change the tip of the canonical chain builder
this is wrong because we should be inserting these blocks as they may end up being on the canonical path several blocks later in case the forks change in their favour based on the connected ancestors
fix is:
augment canonicalChainBuilder.Connect to return the newly connected headers to the tree
always insert newly connected headers (upon successful connection to the root)
fixes https://github.com/erigontech/erigon/issues/11818
issue was:
InsertBlocks
for the blocks we've just connected and also tocommitExecution
(callUpdateForkChoice
)fix is:
canonicalChainBuilder.Connect
to return the newly connected headers to the tree