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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: make max delay constant #75

Merged
merged 2 commits into from Aug 29, 2022
Merged

Conversation

0xsambugs
Copy link
Collaborator

Before this change, we were able to configure the max delay allowed for Chainlink feeds. The thing is that for all networks, the max delay was 24hs 馃槄

I went over most Chainlink feeds and in fact, the max delay is 24hs. But, at the same time, maxDelay was mutable, so we were reading storage once for each read feed. And we could potentially read 4 feeds per pair

So the idea is to simplify everything by just hardcoding the max 24hs delay. In an ideal world (alpha drop), we would use the actual feed heartbeat instead of a max delay that covers all feeds

@0xsambugs 0xsambugs self-assigned this Aug 28, 2022
@0xsambugs 0xsambugs requested a review from 0xged August 28, 2022 13:32
Copy link
Contributor

@0xged 0xged left a comment

Choose a reason for hiding this comment

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

Love this PR. Good improvement :)

/// @inheritdoc IStatefulChainlinkOracle
uint32 public maxDelay;
FeedRegistryInterface public immutable registry;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch!

@0xsambugs 0xsambugs merged commit 52a8874 into main Aug 29, 2022
@0xsambugs 0xsambugs deleted the refactor/make-max-delay-constant branch August 29, 2022 14:21
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.

None yet

2 participants