-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
Running downstream job at https://github.com/smartcontractkit/operator-ui/actions/runs/6152926407 |
@@ -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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One consideration
No description provided.