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

[KS-55] Engine and Registry improvements #12115

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Conversation

bolekk
Copy link
Contributor

@bolekk bolekk commented Feb 21, 2024

  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.

Copy link
Contributor

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

Copy link
Contributor

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

engine.targetType = "write_polygon-testnet-mumbai"
engine.targetConfig, err = values.NewMap(map[string]any{
"address": "0xaabbcc",
"method": "updateFeedValues(report bytes)",
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, thanks.

Copy link
Contributor Author

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"
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SGTM!

Comment on lines +56 to +57
LOOP:
for {
Copy link
Contributor

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?

Copy link
Contributor Author

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.
@bolekk bolekk force-pushed the bugfix/KS-55-engine branch from fd31ba0 to c36e0b8 Compare February 21, 2024 16:25
@bolekk bolekk requested a review from a team as a code owner February 21, 2024 16:25
@bolekk bolekk enabled auto-merge February 21, 2024 16:38
@bolekk bolekk added this pull request to the merge queue Feb 21, 2024
Merged via the queue into develop with commit 216efed Feb 21, 2024
95 checks passed
@bolekk bolekk deleted the bugfix/KS-55-engine branch February 21, 2024 17:12
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