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

Add extra sanity checks to config poller and contract transmitter #10593

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

bolekk
Copy link
Contributor

@bolekk bolekk commented Sep 11, 2023

No description provided.

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate failed

Failed condition 66.7% 66.7% Coverage on New Code (is less than 80%)
Failed condition 35.3% 35.29% Duplicated Lines (%) on New Code (is greater than 3%)

See analysis details on SonarQube

@@ -162,6 +162,9 @@ func (cp *configPoller) LatestConfig(ctx context.Context, changedInBlock uint64)
if err != nil {
return ocrtypes.ContractConfig{}, err
}
if len(lgs) == 0 {
return ocrtypes.ContractConfig{}, errors.New("no logs found")
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this always indicate an error or should we just warn here? For example, what if polling frequency is set to be more frequent than the rate of block production?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Polling frequency doesn't matter. This method is used to fetch the latest config, with a known block number retrieved from LatestConfigDetails(). In fact this check should never fail and it likely never did in prod, otherwise we would've seen panics about underflow from the line below.

This PR is just being extra safe and having explicit errors.

Copy link
Contributor

@KuphJr KuphJr left a comment

Choose a reason for hiding this comment

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

One consideration

@bolekk bolekk added this pull request to the merge queue Sep 12, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 12, 2023
@bolekk bolekk added this pull request to the merge queue Sep 12, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 12, 2023
@bolekk bolekk added this pull request to the merge queue Sep 12, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 12, 2023
@bolekk bolekk added this pull request to the merge queue Sep 12, 2023
Merged via the queue into develop with commit 7fa327e Sep 12, 2023
117 of 118 checks passed
@bolekk bolekk deleted the chore/FUN-905-transmitter-checks branch September 12, 2023 05:34
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