Skip to content

Conversation

@arnetheduck
Copy link
Member

RpcChannel allows using a pair of async
channels
to communicate between threads as if they were connected over a socket or other transport.

This setup avoids having to copy the data onto the OS buffer and instead uses a ThreadSignalPtr to wake the target thread.

While it is not the most performant way to make cross-thread calls, it is quite convenient for services that already expose a JSON-RPC server - the choice of an internal channel then becomes a simple configuration option where the only thing that changes is the setup.

arnetheduck added a commit to status-im/nimbus-eth1 that referenced this pull request Dec 11, 2025
Instead of using a socket (and having to open a fake connection between
EL and CL), this pr switches to
status-im/nim-json-rpc#254 for internal
communication.

Eventually, one could make this more efficient by skipping the JSON
step, but like this, we at least no longer have to open an Engine API
port which makes this setup more secure and easy to deploy (fewer open
ports).

There's also fewer potential errors to contend with and payloads don't
have to travel across the OS buffers and instead stay internal to the
process.
arnetheduck added a commit to status-im/nimbus-eth1 that referenced this pull request Dec 11, 2025
Instead of using a socket (and having to open a fake connection between
EL and CL), this pr switches to
status-im/nim-json-rpc#254 for internal
communication.

Eventually, one could make this more efficient by skipping the JSON
step, but like this, we at least no longer have to open an Engine API
port which makes this setup more secure and easy to deploy (fewer open
ports).

There's also fewer potential errors to contend with and payloads don't
have to travel across the OS buffers and instead stay internal to the
process.
RpcChannel allows using a pair of [async
channels](https://github.com/status-im/nim-async-channels) to
communicate between threads as if they were connected over a socket or
other transport.

This setup avoids having to copy the data onto the OS buffer and instead
uses a ThreadSignalPtr to wake the target thread.

While it is not the most performant way to make cross-thread calls, it
is quite convenient for services that already expose a JSON-RPC server -
the choice of an internal channel then becomes a simple configuration
option where the only thing that changes is the setup.
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