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

Change data feeds from default to fallback in FeeQuoter #1430

Merged
merged 10 commits into from
Sep 12, 2024

Conversation

RayXpub
Copy link
Collaborator

@RayXpub RayXpub commented Sep 11, 2024

Motivation

Due to the gas cost of reading from data feeds, it is unlikely to be the default option, we can therefore optimize the getTokenPrice() function by defaulting to state instead of data feeds.

Solution

Default to state reported prices and only fall back on data feed external call if the reported prices are stale.

Copy link
Contributor

github-actions bot commented Sep 11, 2024

LCOV of commit ae00e84 during Solidity Foundry #8106

Summary coverage rate:
  lines......: 97.7% (2179 of 2230 lines)
  functions..: 94.9% (409 of 431 functions)
  branches...: 93.5% (520 of 556 branches)

Files changed coverage rate: n/a

Copy link
Contributor

@RyanRHall RyanRHall left a comment

Choose a reason for hiding this comment

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

LGTM

@matYang
Copy link
Collaborator

matYang commented Sep 11, 2024

nit: add comment to explain the context, i.e DF is read 2nd because it is not expected to be the default option

@RayXpub
Copy link
Collaborator Author

RayXpub commented Sep 12, 2024

nit: add comment to explain the context, i.e DF is read 2nd because it is not expected to be the default option

@matYang Done

@RayXpub RayXpub enabled auto-merge (squash) September 12, 2024 04:58
@RayXpub RayXpub merged commit 7ba1e75 into ccip-develop Sep 12, 2024
124 checks passed
@RayXpub RayXpub deleted the chore/make-data-feeds-fallback branch September 12, 2024 05:09
@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

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.

3 participants