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

CCIP-4420 Merging back CCIP codebase (#15890) #15894

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

mateusz-sekara
Copy link
Collaborator

Please see this branch for details #15890

I needed to make it two step in order to squash everything before adding to the merge q

Copy link
Contributor

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@@ -145,4 +148,14 @@ func (rf *CommitReportingPluginFactory) NewReportingPluginFn(ctx context.Context

return reportingPluginAndInfo{plugin, pluginInfo}, nil
}

return func() (reportingPluginAndInfo, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks odd to me - can you sanity check this @mateusz-sekara

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just a wrapper to publish prometheus metrics, it was added to the CCIP repo some time ago by @rstout . Looks legit imo

Copy link
Contributor

Choose a reason for hiding this comment

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

Understood. I'd suggest refactoring, but not in scope for this

Copy link
Contributor

@RensR RensR left a comment

Choose a reason for hiding this comment

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

onchain ✅

@@ -159,4 +162,14 @@ func (rf *ExecutionReportingPluginFactory) NewReportingPluginFn(ctx context.Cont

return reportingPluginAndInfo{plugin, pluginInfo}, nil
}

return func() (reportingPluginAndInfo, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment here @mateusz-sekara can you sanity check this flow? does this somehow make testing easier?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we used that for tracking number of failures during boot, it's only a tiny wrapper layer, should be fine

@@ -468,21 +468,36 @@ func (r *ExecutionReportingPlugin) buildReport(ctx context.Context, lggr logger.
return encodedReport, nil
}

// Returns required number of observations to reach consensus
func (r *ExecutionReportingPlugin) getConsensusThreshold() int {
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be exported so that unit tests of the reporting plugin can override the consensus thresholds?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let's keep it as it is. It was introduced here and copy pasted right now during the merge. I'm assuming code is correct

@@ -63,7 +64,13 @@ func TypeAndVersion(addr common.Address, client bind.ContractBackend) (ContractT
return ContractType(contractType), *v, nil
}

// default version to use when TypeAndVersion is missing.
const defaultVersion = "1.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

not 0.0.1?

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a few CCIP contracts in v1.0.0 that don't have a typeAndVersion. This fixes it by assuming they are 1.0.0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For CCIP case it is 1.0.0. I think this code is dead, because all of the contracts are 1.5 right now. I think it was some sort of sanity check added by EngOps a long time ago. We can safely remove that, but it also doesn't harm

Copy link
Contributor

github-actions bot commented Jan 10, 2025

AER Report: CI Core ran successfully ✅

aer_workflow , commit

@@ -353,7 +355,8 @@ func (c *CommitStore) GetAcceptedCommitReportsGteTimestamp(ctx context.Context,
return nil, err
}

reportsQuery, err := logpoller.Where(
reportsQuery, err := query.Where(
c.address.String(),
Copy link
Contributor

Choose a reason for hiding this comment

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

/nit but should c.address not be common.address b/c we are doing chain specific stuff here anyways?

func (o *OnRamp) SourcePriceRegistryAddress(ctx context.Context) (cciptypes.Address, error) {
c, err := o.GetDynamicConfig(ctx)
if err != nil {
return "", err
Copy link
Contributor

Choose a reason for hiding this comment

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

/nit wrap this err?

offRampV150: offRamp,
feeEstimatorConfig: feeEstimatorConfig,
OffRamp: v120,
offRampV150: offRamp,
Copy link
Contributor

Choose a reason for hiding this comment

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

/nit naming - hard for me to sanity check that everything is wired properly

@@ -20,6 +20,10 @@ var (
Name: "ccip_sequence_number_counter",
Help: "Sequence number of the last message processed by the plugin",
}, []string{"plugin", "source", "dest", "ocrPhase"})
newReportingPluginErrorCounter = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "ccip_new_reporting_plugin_error_counter",
Copy link
Contributor

Choose a reason for hiding this comment

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

/nit does prefixing metrics with ccip add value in a metrics dashboard where you are separating out ccip specific nodes?

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 think it's easier to grep available metrics on our Prometheus engine so IMO it does add value (on prom you see all metrics reported by all nodes)

s.usdcReader,
attestationURI,
//nolint:gosec // integer overflow
int(s.usdcConfig.AttestationAPITimeoutSeconds),
Copy link
Contributor

Choose a reason for hiding this comment

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

/nit do we perform some type of sensible validation upstream? either when the job is received or in the delegate?

@mateusz-sekara mateusz-sekara added this pull request to the merge queue Jan 10, 2025
@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
24.8% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube

Merged via the queue into develop with commit 5156cfe Jan 10, 2025
185 of 186 checks passed
@mateusz-sekara mateusz-sekara deleted the ccip-merge-branch branch January 10, 2025 19:44
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