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

offchain - remove dependency on pg.qopts #629

Closed
wants to merge 6 commits into from

Conversation

dimkouv
Copy link
Contributor

@dimkouv dimkouv commented Mar 21, 2024

The core repo has removed the concept of pg.Opts for enabling EVM extraction into it’s own repo. CCIP was keep using pg.Opts, specifically when creating jobs.

This PR Updates CCIP to the new signatures that use ctx.

@dimkouv dimkouv requested a review from a team as a code owner March 21, 2024 09:21
@@ -332,13 +332,13 @@ func (d *Delegate) cleanupEVM(jb job.Job, q pg.Queryer, relayID relay.ID) error
d.lggr.Errorw("failed to derive ocr2keeper filter names from spec", "err", err, "spec", spec)
}
case types.CCIPCommit:
err = ccipcommit.UnregisterCommitPluginLpFilters(context.Background(), d.lggr, jb, d.legacyChains, pg.WithQueryer(q))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it important to preserve this Queryer? i.e. is it a transaction?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would be nice to have but I wouldn't say it's important internally in ccip.

That's part of the transaction opened at:

ocr2: OnDeleteJob(jb job.Job, q pg.Queryer)
delegate: cleanup EVM(jb job.Job, <<q pg.Queryer>>, relayID relay.ID) error

Is there a way to keep it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, the new helpers support the old QOpts behavior one way or another. This one may not be ready yet though. We have some PRs in progress.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After sync with @PiotrTrzpil seems that this is required by CLO to preserve it.
Do we already support this? How can I get a ctx instance.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you up to date with develop? You may have to wait for me to make more progress on https://smartcontract-it.atlassian.net/browse/BCF-2978, but it looks like the EVM side should be done? https://smartcontract-it.atlassian.net/browse/BCI-2644
I'm currently working on this PR: smartcontractkit/chainlink#12456

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No we haven't synced our fork with this updates, probably this task gets blocked until we do.

@dimkouv dimkouv requested a review from PiotrTrzpil March 22, 2024 15:11
@@ -242,8 +242,8 @@ func (c *CommitStore) ChangeConfig(onchainConfig []byte, offchainConfig []byte)
return cciptypes.Address(onchainConfigParsed.PriceRegistry.String()), nil
}

func (c *CommitStore) Close(qopts ...pg.QOpt) error {
return logpollerutil.UnregisterLpFilters(c.lp, c.filters, qopts...)
func (c *CommitStore) Close() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we okay with these changes considering all the past issues with CLO? Can we end up in some weird state in which some filters are registered and some not in case of failing to approve job spec?

How about something like this

  • Feeds tries to Approve the job spec
  • It starts with deleting existing job spec and unregistering LogPoller filters
  • It wants to create a new plugin instance but then something fails (e.g. flaky RPC in commit/exec init logic)

We end up with a job half-approved. Previous job definition will still be present in the database, because of db tx, but LogPoller filters are already gone because they are unregistered/registered separately.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We do not intend to change behavior when moving away from pg.QOpts. We have equivalent support for every feature.

@dimkouv
Copy link
Contributor Author

dimkouv commented Apr 15, 2024

will open a new PR

@dimkouv dimkouv closed this Apr 15, 2024
@mateusz-sekara mateusz-sekara deleted the dk/rm-pgqopts-dep branch September 3, 2024 13: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