Repository navigation
beholder: inject emitter in remote executable ClientRequest (Phase 3) - #23972
Conversation
|
✅ No conflicts with other open PRs targeting |
|
I see you updated files related to
|
26e8029 to
78f1f43
Compare
78f1f43 to
da7b328
Compare
1cb610b to
c35bf35
Compare
c35bf35 to
8f92ac4
Compare
PR Triage · Risk Medium · Complexity LowSuggests 1 approval, including one from an owner. Suggested reviewers: @bolekk, @jmank88.
Start Review Here
VisualizationsScore mapflowchart LR
R["Risk: Medium"]
rs["1 signal → floor Medium"]
s0["hotspot core/services/cre/cre.go"] --> rs
rs --> R
C["Complexity: Low"]
cn["no rule or threshold applied"] --> C
RT["Suggests 1 approval · one from an owner"]
R --> RT
classDef low fill:#dafbe1,stroke:#1a7f37,color:#1f2328;
classDef medium fill:#fff8c5,stroke:#9a6700,color:#1f2328;
classDef high fill:#ffebe9,stroke:#cf222e,color:#1f2328;
class R medium;
class C low;
Change shapepie title Change shape
"Tests" : 558
"Source" : 572
— distributed across 6 files Files: 6 changed
Why these reviewers
Others who know this code: amit-momin 12%, dhaidashenko 10%, cedric-cordenier 6%. Ranked by commits to the changed files in the 360 days before the head commit; newer commits count more. Requested everyone with at least 20% of the score, up to 4. Added 1 reviewer below that to reach 2 reviewers. Excluded the PR author, @kalverra. Considered only current members of the repository's organization, excluding 1 candidate. Metrics and policy
Risk signals: pr-triage v0.0.0-20261022163026-983b86af43a2+dirty · policy |
8f92ac4 to
4d7402f
Compare
4d7402f to
eff98ea
Compare
eff98ea to
63d448e
Compare
63d448e to
b004eb5
Compare
- ClientRequest: emitter + durable fields; ClientRequestOption with WithEmitter/WithDurableEmit (symmetry with workflows/events); NewClientExecuteRequest takes options, defaults nil emitters to the late-bound globals before the transmission schedule event is emitted - client: emitter field + ClientOption/WithEmitter on NewClient (default global); Execute passes its emitter to each request; launcher unchanged - tests: 'Executes full schedule' uses a per-test recorder and t.Parallel; last NewObserver in core/ removed
Transmission schedule events still went through durableemitter.GlobalEmit because the client never accepted a durable func. - executable.ClientOption gains WithDurableEmit; Execute forwards it to request.WithDurableEmit - launcher.NewLauncher takes the func and gives it to every executable client it creates; cre passes the same Opts.DurableEmit used by the workflow event emitter - test asserts the schedule reaches the injected durable sink
b004eb5 to
50f2f68
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new forwarding test needs client lifecycle cleanup to prevent an outbound request goroutine from logging after test completion.
1 open issue
What changed in this PR
Extends the emitter-injection work from #23971 to remote executable requests, preserving late-bound global defaults while allowing transmission-schedule events to use the boot-configured durable emitter.
Changes:
- Adds emitter options to clients and requests, applied before schedule events are emitted.
- Threads the durable emitter from CRE through the launcher to remote clients.
- Uses an isolated recorder for the parallel schedule test and adds durable-forwarding coverage.
| File | Description |
|---|---|
| core/services/cre/cre.go | Passes the configured durable emitter to the launcher. |
| core/capabilities/remote/executable/request/client_request.go | Adds injectable event sinks with global defaults. |
| core/capabilities/remote/executable/request/client_request_test.go | Isolates schedule-event recording and enables parallel execution. |
| core/capabilities/remote/executable/client.go | Forwards client emitter options to requests. |
| core/capabilities/remote/executable/client_test.go | Adds durable-emitter forwarding coverage. |
| core/capabilities/launcher.go | Supplies the durable emitter to remote executable clients. |
| core/capabilities/launcher_test.go | Updates launcher construction for the new parameter. |
| core/capabilities/launcher_offchain_method_configs_test.go | Updates launcher construction while retaining default emission. |
Review effort: Balanced
|





Why
Remote executable
ClientRequestreadbeholder.GetEmitter()anddurableemitter.GlobalEmitdirectly when emitting its transmission-schedule event, serializing the test that asserts on it. This PR injects both sinks from boot config instead, so callers and tests can supply their own.Notes
beholder.GlobalEmitter()(which delegates at emit time) anddurableemitter.GlobalEmit, so production emission is unchanged.durableemitterinstanceSetupinstalls globally, so events are not emitted twice.NewLauncheris now variadic (opts ...LauncherOption) rather than taking another positional arg; boot passescapabilities.WithDurableEmit.Changes
Durable sink flow, request construction to emit:
ClientRequestOptiontargets a small config structclientRequestConfiginstead of a throwawayClientRequest; the struct flows intonewClientRequestandemitTransmissionScheduleEvent.NewClientExecuteRequestkeeps its existing call sites: options are variadic.“Executes full schedule” test now runs in parallel
beholdertest.NewObserverfor an injectedNewRecorder, so parallel siblings cannot cross-talk.Test_Client_Execute_InjectsDurableEmitasserts the client forwards its durable func, and starts the client viaservicetest.Runso cleanup joins the request goroutines.Requires
#23971 (workflows/events
Emitterpattern and chainlink-common bump)Supports
#23973 (meters layer)
Deployment Validation Steps
Run a node with remote capabilities and confirm transmission-schedule events still reach beholder; no schema or entity changes expected.