Skip to content

Add WithRPCClientDialer option to inject the execution node RPC client - #17334

Open
satushh wants to merge 2 commits into
developfrom
execution-client-injection
Open

Add WithRPCClientDialer option to inject the execution node RPC client#17334
satushh wants to merge 2 commits into
developfrom
execution-client-injection

Conversation

@satushh

@satushh satushh commented Aug 11, 2026

Copy link
Copy Markdown
Member

What type of PR is this?

Feature

What does this PR do? Why is it needed?

  • Today the execution service can only reach the execution client by dialing an address (HTTP URL or IPC path).
  • When the execution client runs inside the same process as Prysm (embedded / single-binary setups), there is no address to dial. The host has to create a unix socket purely so Prysm can dial it: an OS round-trip between two components that share memory.
  • This PR adds one option, execution.WithRPCClientDialer, that lets the host hand the service a function returning a ready *rpc.Client (e.g. from gethRPC.DialInProc) instead of an endpoint string.
  • It is a dialer (function), not a client object, on purpose: the service's reconnect loops close the old client and dial a fresh one. With a dialer, those loops keep working unchanged: they just call the function again.
  • If both a dialer and an endpoint are configured, the dialer wins. The CLI always fills in a default --execution-endpoint, so rejecting the combination would make the option unusable through the normal node startup path.
  • Everything after the dial is untouched: chain ID verification, deposit contract wiring, and all Engine API code work on the injected client exactly as before.
  • No behavior change for existing users: without the option, the service dials the configured endpoint exactly as it does today.
  • No node package changes: the option reaches the service through the existing node.WithExecutionChainOptions.
  • Usage from an embedding host: a single binary running geth and Prysm in one process enables this entirely at construction time, with no flags and no other Prysm changes:
    node.New(ctx, cancel, node.WithExecutionChainOptions([]execution.Option{execution.WithRPCClientDialer(func(ctx context.Context) (*gethRPC.Client, error) { return gethRPC.DialInProc(gethInProcHandler), nil })}), ...)
    (after which every Engine API call travels in-memory instead of over a socket).

Which issue(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have included a uniquely named changelog fragment file.
  • I have added a description with sufficient context for reviewers to understand this PR.
  • I have tested that my changes work as expected and I added a testing plan to the PR description (if applicable).

@satushh satushh changed the title cccccbvgnlfcjgtidddjicrjekhcrincbcitklglgdvdAdd WithRPCClientDialer option to inject the execution node RPC client Add WithRPCClientDialer option to inject the execution node RPC client Aug 11, 2026
@satushh
satushh marked this pull request as ready for review August 12, 2026 17:02
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.

1 participant