Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

CCIP-1184 Reduce number of logs to be scanned when checking for cache staleness #287

Merged
mateusz-sekara merged 3 commits intoccip-developfrom
cache/speed-up-exec
Nov 21, 2023
Merged

CCIP-1184 Reduce number of logs to be scanned when checking for cache staleness #287
mateusz-sekara merged 3 commits intoccip-developfrom
cache/speed-up-exec

Conversation

@mateusz-sekara
Copy link
Contributor

Motivation

Solution

@mateusz-sekara mateusz-sekara requested a review from a team as a code owner November 15, 2023 12:12
Base automatically changed from logpoller/cherry-picks to ccip-develop November 16, 2023 06:35

currentBlockNumber, err := c.logPoller.LatestBlockByEventSigsAddrsWithConfs(lastChangeBlock, c.observedEvents, c.address, logpoller.Confirmations(c.optimisticConfirmations), pg.WithParentCtx(ctx))

// Ordering matters here, we need to fetch latestBlock, before we fetch logs.
Copy link
Collaborator

@connorwstein connorwstein Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm can you elabourate on the specific edge case? On a likely related note, I think it'd be much safer/easier to follow if we just use logpoller.Finalized instead of optimistic confs for LatestBlockByEventSigsAddrsWithConfs. Means we react a little slower to adding a new token but thats totally fine, then we dont have to think about reorgs at all here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the comment more specific explaining the edge case scenario I had in mind. Also, I got rid of optimisticUpdates, we rely on finality here

@mateusz-sekara mateusz-sekara merged commit 4526ceb into ccip-develop Nov 21, 2023
@mateusz-sekara mateusz-sekara deleted the cache/speed-up-exec branch November 21, 2023 07:56
asoliman92 pushed a commit that referenced this pull request Jul 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants