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

support default config file overrides #14090

Merged
merged 16 commits into from
Aug 30, 2024
Merged

support default config file overrides #14090

merged 16 commits into from
Aug 30, 2024

Conversation

patrickhuie19
Copy link
Contributor

@patrickhuie19 patrickhuie19 commented Aug 9, 2024

The merge of the CCIP fork back into chainlink requires a feature to handle a difference in per chain defaults. Currently we have a directory of these defaults that is loaded through go:embed when the configuration for the application is created on node start or node validate. CCIP has differing fields in these chain defaults (like FinalityTagEnabled) that make it necessary to give an option to specify overrides on the current defaults.

There were multiple ways of accomplishing this:

  • Completely switch the defaults directory when specified either by env var, cli flag, or a TOML field
  • Apply overrides from a specified directory over the defaults when specified either by env var, cli flag, or a TOML field

This approach uses an env var, CL_CHAIN_DEFAULTS to specify when overrides should be applied, as I believed it most likely that the env (testcontainers, docker, k8s) the node is running in will be aware that the node needs to run CCIP jobs.

This change is backwards compatible and can be fully tested through testscripts.

Copy link
Contributor

github-actions bot commented Aug 9, 2024

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.

@patrickhuie19 patrickhuie19 requested a review from a team August 15, 2024 23:30
core/chains/evm/config/toml/defaults.go Outdated Show resolved Hide resolved
Chain
}{}

if err := cconfig.DecodeTOML(bytes.NewReader(b), &config); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct me if I'm wrong but these overrides are specified at runtime it seems? We're not statically embedding the overrides depending on a particular env var (seems hard / impossible now that I think about it since go:embed is on file level vars

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this imply that these defaults need to be manually shipped to nops separately if they're not embedded in the built binary?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes but only if not using the official docker release which can bundle them in.

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 agree w/ @jmank88 - The easiest CX I can imagine for the NOPs is including the overrides directory and the env var in the docker image. That way they won't have to think about this at all.

It will take some time before CCIP doesn't release its own image, so this approach seems the easiest from a release perspective as well to me.

makramkd
makramkd previously approved these changes Aug 16, 2024
core/config/env/env.go Outdated Show resolved Hide resolved
asoliman92
asoliman92 previously approved these changes Aug 22, 2024
makramkd
makramkd previously approved these changes Aug 23, 2024
@patrickhuie19 patrickhuie19 added this pull request to the merge queue Aug 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 23, 2024
@patrickhuie19 patrickhuie19 requested a review from jmank88 August 29, 2024 20:07
@patrickhuie19 patrickhuie19 added this pull request to the merge queue Aug 30, 2024
Merged via the queue into develop with commit 5bda8af Aug 30, 2024
133 of 134 checks passed
@patrickhuie19 patrickhuie19 deleted the feature/bcf-3351 branch August 30, 2024 06:27
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.

4 participants