Skip to content

cre-7120: decode core defaults per call to avoid shared mutable state - #24052

Open
mchain0 wants to merge 1 commit into
developfrom
cre-7120
Open

mchain0 wants to merge 1 commit into
developfrom
cre-7120

Conversation

@mchain0

@mchain0 mchain0 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

cre-7120

Fixes failures like this one

@github-actions

Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs 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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@cl-sonarqube-production

Copy link
Copy Markdown

@trunk-io

trunk-io Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Static Badge   Static Badge   Static Badge

View Full Report ↗︎ ⋅ Docs

@mchain0
mchain0 marked this pull request as ready for review October 22, 2026 11:53
@mchain0
mchain0 requested review from a team as code owners October 22, 2026 11:53
@mchain0
mchain0 requested a review from jmank88 October 22, 2026 11:53

@Tofel Tofel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I hope the that overhead of parsing TOML isn't noticeable

}

func CoreDefaults() (c toml.Core) {
c.SetFrom(&defaults)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we fix this in SetFrom? That is already meant to be doing a deep clone.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like we just got sloppy with setting pointers instead of copying values? I think we want to fix that regardless

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suspect that it often hasn't mattered in the past since we would just point to a new place rather than update the value anyways.

This branch has not been deployed

No deployments
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