-
Notifications
You must be signed in to change notification settings - Fork 16
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 a SetConfig function to the LogEventProvider interface #367
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,10 +48,17 @@ type Encoder interface { | |
|
||
type LogEventProvider interface { | ||
GetLatestPayloads(context.Context) ([]UpkeepPayload, error) | ||
SetConfig(LogEventProviderConfig) | ||
Start(context.Context) error | ||
Close() error | ||
} | ||
|
||
type LogEventProviderConfig struct { | ||
NumLogUpkeeps uint32 | ||
FastExecLogsHigh uint32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i see this PR is merged but we might need changes based on comments on https://github.com/smartcontractkit/chainlink-automation/pull/314/files |
||
FastExecLogsLow uint32 | ||
} | ||
|
||
type RecoverableProvider interface { | ||
GetRecoveryProposals(context.Context) ([]UpkeepPayload, error) | ||
} | ||
|
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.
This is pretty unusual within our existing model. Is the point to be able to mutate the configuration along the way?
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.
@jmank88 Sorry, only seeing this now! So, we need a way to update the config of the
LogEventProvider
, based on the config stored in the on-chain automation registry. Within libocr, we have code that listens for changes to the config on the registry, and when a change is detected, a new instance of the automation plugin is started with that new config.Now, we want to be able to set configuration for the
LogEventProvider
on the registry, and have a way to pass that config change from the registry, into theLogEventProvider
. To achieve this, we're utilising the existing libocr/automation functionality that listens for/propagates config changes, and we're setting the config on the LogEventProvider from within the automation plugin.To facilitiate this, we're adding a SetConfig function to the
LogEventProvider
interface in common, which the automation plugin can call, and pass the config into using theLogEventProviderConfig
. So the flow will be:setConfig -> registry -> libocr -> chainlink-automation -> LogEventProvider.SetConfig(LogEventProviderConfig{})
Does that make sense?