chainlink icon indicating copy to clipboard operation
chainlink copied to clipboard

HeadTracker finalization support

Open dhaidashenko opened this issue 1 year ago • 3 comments

  • Mark block finalized based on FinalityTag or FinalityDepth
  • Add to Head function that returns LatestFinalizedHead in the chain
  • Previously, we've kept only historyDepth blocks in the cache. Such logic could have lead to redundant RPC calls on a chain with finalityTags if historyDepth was smaller than the actual finalityDepth. To address this issue, we only trim blocks that are older than latestFinalized - historyDepth

dhaidashenko avatar Feb 19 '24 16:02 dhaidashenko

I see that you haven't updated any README files. Would it make sense to do so?

github-actions[bot] avatar Feb 19 '24 17:02 github-actions[bot]

I see that you haven't updated any CHANGELOG files. Would it make sense to do so?

github-actions[bot] avatar Feb 19 '24 17:02 github-actions[bot]

The changes look great!

I have one question. Where do we regularly look for new Finalized Heads? Couldn't find that logic.

In the backfillLoop https://github.com/smartcontractkit/chainlink/blob/2f554038673dadf413a0f8f4ce1321a0678d904a/common/headtracker/head_tracker.go#L305

dhaidashenko avatar Feb 27 '24 13:02 dhaidashenko

Can you update the CHANGELOG stating that we've added Finality Tag support on the Head Tracker, but consumers will actually utilize it on a separate PR?

dimriou avatar Feb 28 '24 19:02 dimriou

Can you update the CHANGELOG stating that we've added Finality Tag support on the Head Tracker, but consumers will actually utilize it on a separate PR?

Is not it too internal to be mentioned in the CHANGELOG? I recall foundations asking me to remove similar entry. Also technically TXM uses FinalityTag feature right away, if it's enabled for the chain, as now we backfill heads up to tagged block instead of finality depth.
I agree that we need to somehow communicate the change. I'm not sure that CHANGELOG is suitable for it.

dhaidashenko avatar Feb 29 '24 18:02 dhaidashenko

Can you update the CHANGELOG stating that we've added Finality Tag support on the Head Tracker, but consumers will actually utilize it on a separate PR?

Is not it too internal to be mentioned in the CHANGELOG? I recall foundations asking me to remove similar entry. Also technically TXM uses FinalityTag feature right away, if it's enabled for the chain, as now we backfill heads up to tagged block instead of finality depth. I agree that we need to somehow communicate the change. I'm not sure that CHANGELOG is suitable for it.

This is a public PR so I don't see why this shouldn't be mentioned 😅 . Can you dm me the example? Regarding finality, TXM still uses FinalityDepth to mark transactions as finalized, so it doesn't fully utilize the finalized blocks even if they are stored in the HeadTracker.

dimriou avatar Mar 01 '24 16:03 dimriou