Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCIP-1147 - Cache last update #198

Merged
merged 9 commits into from
Oct 12, 2023

Conversation

jarnaud
Copy link
Contributor

@jarnaud jarnaud commented Oct 11, 2023

Motivation

In getLatestGasPriceUpdate, if no inflight is present (or if inflight is not used), destPriceRegistryReader is always called over the entire gas price heartbeat.
In many cases the same data are queried several time, and we could therefore keep the results previously retrieved.

Solution

This PR add a cache mechanism to keep the latest update in cache, and use its timestamp as the starting point from when to query the new price updates.

@jarnaud jarnaud marked this pull request as ready for review October 12, 2023 13:37
@jarnaud jarnaud requested a review from a team as a code owner October 12, 2023 13:37
@jarnaud jarnaud self-assigned this Oct 12, 2023
@jarnaud jarnaud requested a review from dimkouv October 12, 2023 13:46
@dimkouv dimkouv requested a review from connorwstein October 12, 2023 13:57
Copy link
Contributor

@dimkouv dimkouv left a comment

Choose a reason for hiding this comment

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

nice, let's change target branch to perf/ccip736-optimize-price-updates-fetch
so we can re-use the cache for token price updates and gas price update and merge both optimizations together

core/services/ocr2/plugins/ccip/commit_reporting_plugin.go Outdated Show resolved Hide resolved
@jarnaud jarnaud changed the base branch from ccip-develop to perf/ccip736-optimize-price-updates-fetch October 12, 2023 14:32
@jarnaud jarnaud merged commit 134da68 into perf/ccip736-optimize-price-updates-fetch Oct 12, 2023
@jarnaud jarnaud deleted the CCIP-1147 branch October 12, 2023 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants