Skip to content

Conversation

@bolekk
Copy link
Contributor

@bolekk bolekk commented Oct 2, 2025

Follow up to #19404, which covers all remaining remote shims.

Move most config out of constructors and into setters.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

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.

@bolekk bolekk force-pushed the feature/CRE-941-dynamic-shim-updates branch 2 times, most recently from f35221b to 3f734c3 Compare October 3, 2025 01:16
@bolekk bolekk changed the title [CRE-941] Dynamic config update in TriggerPublisher [CRE-941] Dynamic config updates in TriggerPublisher + ExecutableClient/Server Oct 3, 2025
@bolekk bolekk force-pushed the feature/CRE-941-dynamic-shim-updates branch 3 times, most recently from 6060e0c to 190a3de Compare October 3, 2025 23:30
@bolekk bolekk marked this pull request as ready for review October 4, 2025 00:15
@bolekk bolekk requested review from a team as code owners October 4, 2025 00:15
@bolekk bolekk requested a review from a team October 4, 2025 00:15

func (c *client) Start(ctx context.Context) error {
return c.StartOnce(c.Name(), func() error {
cfg := c.cfg.Load()
Copy link
Contributor

Choose a reason for hiding this comment

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

i think this is non-recoverable.

if you pass a bad config, and call start, then call setConfig with a good config, and call start does it start?

i don't think it will. is there a test?

Copy link
Contributor

Choose a reason for hiding this comment

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

all make a typed error for the caller to check if you want them to handle it ~

var ErrConfigNotSet = errors.New(...)
...
return fmt.Errorf("%w: empty remote capabilty", ErrConfigNotSet)

++ caller ++
err : = x.Start()
if errors.Is(ErrConfigNotSet) {
x.SetConfig
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Launcher will cache the shim only when Start() succeeded. Otherwise it will be re-created on each iteration with fresh config. It wasn't implemented consistently for all 4 cases but I now fixed it and added comments to point it out. Thanks!

if errCfg := execCap.SetConfig(info, myDON.DON, defaultTargetRequestTimeout, nil); errCfg != nil {
return nil, fmt.Errorf("failed to set trigger config: %w", errCfg)
}
return execCap.(capabilityService), nil
Copy link
Contributor

@krehermann krehermann Oct 4, 2025

Choose a reason for hiding this comment

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

type check here? in prinicple can panic and kill the node

x, ok := exec.Cap.(capabilityService)
if !ok {
return nil, fmt.Errorf("failed to convert a into b...")
}
return x, nil

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Feels a bit excessive. Panic will be caught by unit tests, if the actual object is ever changed to not implement the interface any more.

@bolekk bolekk force-pushed the feature/CRE-941-dynamic-shim-updates branch from 190a3de to 43e8ccd Compare October 5, 2025 01:22
wg sync.WaitGroup
}

type dynamicConfig struct {
Copy link
Contributor

@mchain0 mchain0 Oct 6, 2025

Choose a reason for hiding this comment

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

maybe some sort of "version" tag field could make it easier in debugging and logs, knowing which config are we currently dealing with application wide?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't store any version onchain so it's not really possible to map it to anything sensible here.
Launcher calls SetConfig() on every iteration, even if values didn't change so an update timestamp also doesn't make too much sense...

return errors.New("requestTimeout must be positive")
}
// Use a sensible default if maxParallelRequests is not set or is 0
if maxParallelRequests <= 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Setting this will have no impact once the server is started, ie it is not dynamically settable. This is intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. Making it dynamic will be a PITA and it's also not very important... I added a warning log for now.

@bolekk bolekk force-pushed the feature/CRE-941-dynamic-shim-updates branch from 43e8ccd to cb82ba6 Compare October 7, 2025 03:53
@bolekk bolekk force-pushed the feature/CRE-941-dynamic-shim-updates branch 2 times, most recently from 4b7a76f to df4672f Compare October 7, 2025 05:18
@bolekk bolekk force-pushed the feature/CRE-941-dynamic-shim-updates branch from df4672f to 0ca8226 Compare October 7, 2025 05:32
@cl-sonarqube-production
Copy link

@bolekk bolekk added this pull request to the merge queue Oct 7, 2025
Merged via the queue into develop with commit 5950b6a Oct 7, 2025
192 of 193 checks passed
@bolekk bolekk deleted the feature/CRE-941-dynamic-shim-updates branch October 7, 2025 13:41
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