-
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
[KS-55] Engine and Registry improvements #12115
Conversation
bolekk
commented
Feb 21, 2024
- Move registry operations into a separate goroutine launched at Start() and supporting re-tries, to avoid race conditions on node init.
- Move most of the hardcoded workflow into Engine constructor, for clarity.
- Add missing call to consensus.RegisterToWorkflow().
- Add logger to Registry.
I see that you haven't updated any README files. Would it make sense to do so? |
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
9db2faa
to
fd31ba0
Compare
core/services/workflows/engine.go
Outdated
engine.targetType = "write_polygon-testnet-mumbai" | ||
engine.targetConfig, err = values.NewMap(map[string]any{ | ||
"address": "0xaabbcc", | ||
"method": "updateFeedValues(report bytes)", |
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.
method
isn't actually required, we use the function name from the abi
parameter
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.
Right, thanks.
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.
I noticed that you also have ChainID in the config but that's already inferred from the target type right?
target, err := registry.GetTarget(ctx, "write_polygon_mainnet") | ||
|
||
// Target | ||
engine.targetType = "write_polygon-testnet-mumbai" |
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.
You caught the casing change here because of selectors 👍🏻 In the future I was thinking about replacing -
-> _
to make the string more uniform, wdyt?
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.
SGTM!
LOOP: | ||
for { |
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.
Rather than a retry loop, why not a oneshot channel we can close
to signal after all the registration is done?
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.
Who would signal that? Currently our registrations are done all over the place :( In the future we can improve that but even then we could have remote capabilities being registered at arbitrary times.
1. Move registry operations into a separate goroutine launched at Start() and supporting re-tries, to avoid race conditions on node init. 2. Move most of the hardcoded workflow into Engine constructor, for clarity. 3. Add missing call to consensus.RegisterToWorkflow(). 4. Add logger to Registry.
fd31ba0
to
c36e0b8
Compare
|