This PR introduces a refactor of the sidecar binary to streamline all components that go in the initialization and event loop phase of operating the sidecar.
In particular, this implementation differs from what attempted in #133 in not using a manual Future but instead still relying on tokio::select! to progress the loop. This simplifies things a lot, because of the following async tasks:
updating the consensus and execution head is an async operation (it requires fetching from both EL and CL)
validating the execution state of a request is an async operation (it requires fetching state from the EL)
This could be overcome in the future by transforming the ExecutionState and ConsensusState containers into actors with their own loops to respond to requests in channels instead of awaiting.
This PR introduces a refactor of the
sidecar
binary to streamline all components that go in the initialization and event loop phase of operating the sidecar.In particular, this implementation differs from what attempted in #133 in not using a manual
Future
but instead still relying ontokio::select!
to progress the loop. This simplifies things a lot, because of the following async tasks:This could be overcome in the future by transforming the
ExecutionState
andConsensusState
containers into actors with their own loops to respond to requests in channels instead of awaiting.