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

Change keepers to use the default contract transmitter #11308

Merged
merged 14 commits into from
Dec 12, 2023
Merged

Conversation

ferglor
Copy link
Collaborator

@ferglor ferglor commented Nov 15, 2023

As part of the LOOPP work, we discovered that the keepers service was using a different contract transmitter to the other services (the pipeline contract transmitter)

To enable the LOOPP work to progress for keepers, this PR switches the keeper service to using the default contract transmitter, and also removes the pipeline contract transmitter

The integration tests were failing on this PR initially due to the fact that the gas limit for the automation service is pulled from a different function vs other services. To fix this, the contract transmitter constructor now accepts a gas limit as a param.

Copy link
Contributor

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

Copy link
Contributor

@krehermann krehermann left a comment

Choose a reason for hiding this comment

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

seems like this is going in the right direction, but given all the integration test failures, it seems like there are some subtleties in the pipelineContractTransmitter that are being captured in the refactor.

@ferglor ferglor force-pushed the feature/AUTO-7289 branch 4 times, most recently from e0dd30f to 4d1a809 Compare December 1, 2023 14:05
@ferglor ferglor requested a review from krehermann December 4, 2023 14:23
@ferglor ferglor requested review from krehermann, jmank88 and cedric-cordenier and removed request for krehermann and jmank88 December 5, 2023 14:17
expectedPostRecover := runs + emits
waitPipelineRuns(t, nodes, expectedPostRecover, testutils.WaitTimeout(t), cltest.DBPollingInterval)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should find some other way to assert wanted expectations. Removing this is weakening this test

@@ -373,7 +371,7 @@ func newConfigProvider(lggr logger.Logger, chain legacyevm.Chain, opts *types.Re
return newConfigWatcher(lggr, aggregatorAddress, contractABI, offchainConfigDigester, cp, chain, relayConfig.FromBlock, opts.New), nil
}

func newContractTransmitter(lggr logger.Logger, rargs commontypes.RelayArgs, transmitterID string, configWatcher *configWatcher, ethKeystore keystore.Eth) (*contractTransmitter, error) {
func newContractTransmitter(lggr logger.Logger, rargs commontypes.RelayArgs, transmitterID string, configWatcher *configWatcher, ethKeystore keystore.Eth, gasLimit uint32) (*contractTransmitter, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

i'd rather this this implemented with a new opts struct than a explicit argument.

type configTransmitterOpts struct {
configWatcher *configWatcher
// override the gas limit default provided in the config watcher
gasLimit uint32
}

func newContractTransmitter (..., opts configTransmitterOpts) {
...
gasLimit := configWatcher.chain.Config().EVM().GasEstimator().LimitDefault()
if opts.gasLimit != 0 {
gasLimit = opt.gasLimit
}

}

all the call site need to be updated, but only the automation call site needs to explicitly set a gasLimit option.

this implementation seems more inline with the intention of passing a *configwatcher and deriving relevant options/configuration from it

@@ -229,8 +226,6 @@ func TestIntegration_KeeperPluginLogUpkeep(t *testing.T) {
g.Eventually(listener, testutils.WaitTimeout(t), cltest.DBPollingInterval).Should(gomega.BeTrue())
done()

runs := checkPipelineRuns(t, nodes, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we explored any alternate assertions for non pipeline transmitter? Or do we feel they are covered by existing assertions

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wasn't able to see how the other services assert their transmits, so I just assumed the existing assertions would be enough, but I can look into this further

Copy link
Contributor

Choose a reason for hiding this comment

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

Verifying the upkeeps are actually performed i think should give similar coverage but I'm not sure that's done everywhere (e.g. the other place where this is removed)

Copy link
Contributor

@infiloop2 infiloop2 left a comment

Choose a reason for hiding this comment

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

Added some inline comments. Major ones

  1. Change in override behaviour of gas limit config values
  2. Ensuring we are not weakening our test suite

@ferglor ferglor requested review from jmank88, krehermann and amirylm and removed request for krehermann December 11, 2023 14:03
krehermann
krehermann previously approved these changes Dec 11, 2023
@@ -390,6 +394,8 @@ func newContractTransmitter(lggr logger.Logger, rargs commontypes.RelayArgs, tra
return nil, pkgerrors.New("no sending keys provided")
}

configWatcher := opts.configWatcher
Copy link
Contributor

@infiloop2 infiloop2 Dec 11, 2023

Choose a reason for hiding this comment

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

nit. this seems like a required option (code below will fail if this is nil) so not sure if it made more sense as a parameter before (unlike pluginGasLimit)

infiloop2
infiloop2 previously approved these changes Dec 11, 2023
@ferglor ferglor dismissed stale reviews from infiloop2 and krehermann via 785faa6 December 11, 2023 21:46
@cl-sonarqube-production
Copy link

@ferglor ferglor enabled auto-merge December 12, 2023 21:34
@ferglor ferglor added this pull request to the merge queue Dec 12, 2023
Merged via the queue into develop with commit 00e1c55 Dec 12, 2023
75 of 76 checks passed
@ferglor ferglor deleted the feature/AUTO-7289 branch December 12, 2023 21:50
momentmaker added a commit that referenced this pull request Dec 13, 2023
* develop: (56 commits)
  [TT-367] [TT-745] Quick and Dirty OCRv2 Soak Test (#11487)
  [FUN-990] s4 observability improvements (#11512)
  fix health monitoring (#11558)
  Removes Optimism Goerli from Scheduled Tests (#11559)
  bump Foundry to the December release (#11540)
  Standardize LP filter logging (#11515)
  Change keepers to use the default contract transmitter (#11308)
  bump toml/v2 and prometheus to latest patch (#11541)
  Remove big from core utils (#11511)
  Handle edge case involving blocks not being found in the db (#11298)
  [DEPLOY-178]: Adds Scroll L2EP Contracts (#11405)
  disable kaniko fallback, increase deploy wait timeout (#11548)
  Use multiple EL clients with ocrv2 median smoke test (#11399)
  Remove core utils dependencies from common (#11425)
  [BCF-2760] Flakey test detection improvements (#11470)
  go.mods: rm libp2p; rm btcd replace (#11502)
  wrap devspace commands (#11530)
  small improvements based on comments (#11491)
  (test): Remove unnecessary fuzzing from Functions OnTokenTransfer tests (#11517)
  core/scripts/common: rm ava-labs/coreth; lint (#11451)
  ...
fbac pushed a commit that referenced this pull request Dec 14, 2023
* Switch keepers to use the default contract transmitter
Pass the gas limit into the transmitter constructor so we can specify the automation gas limit
Update tests

* Fix streams import

* Clean up function calls

* Remove pipeline runner dependency for automation

* Use contractTransmitterOpts to specify a pluginGasLimit

* Make the pluginGasLimit a pointer

* Clean up the pipeline transmitter

* Attempt to listen for transmits
Clean up linter
Extract function
Intentionally fail test
Rework transmit listen
Try filtering for transmits
Update test

* Revert "Attempt to listen for transmits"

This reverts commit 198e6669a6f64768c84acb82e01b2773c89426ce.

* Listen for performed events

* Goimports

* Add wrapper function that lets us specify a count of performed

* Update integration test

* Pass the configWatcher as a parameter to indicate that its required
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.

5 participants