You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
sorry to open a new issue for this, this is based on my current understanding of the abci semantics and rust ecosystem, I see there was already lots of discussions on this topic, I confess I didn't finish reading them all, there are probably some overlapping ideas here.
abci design
server thread
Run a single thread async executor (I think single thread should be good enough here).
Only handle networking and protobuf messages encoding/decoding.
Send the parsed request to different SPSC channels for different connections:
consensus channel
info channel
mempool channel
get result
Send a oneshot channel together with the request to get the result, like this:
let(sender, receiver) = channel::oneshot();
req_chan.send((request, send));let result = receiver.recv().await;
inspect current connection role
Connection handler should peak the first message to decide the role of current connection, then it can choose which channel to send the message.
We can also enforce other restrictions based on this connection role information, like:
at most one connection at a time with each role
Some roles support re-connect, some don't (consensus connection?)
logic threads
app logic subscribe to the channels to process the requests, app logic is free to decide it's own internal threading policy(async vs sync, single thread vs multiple threads).
app states
abci library may or may not provide some abstraction to help app logic handle the state machine semantic or states separation.
abci design
server thread
Run a single thread async executor (I think single thread should be good enough here).
Only handle networking and protobuf messages encoding/decoding.
Send the parsed request to different SPSC channels for different connections:
get result
Send a oneshot channel together with the request to get the result, like this:
inspect current connection role
Connection handler should peak the first message to decide the role of current connection, then it can choose which channel to send the message.
We can also enforce other restrictions based on this connection role information, like:
logic threads
app logic subscribe to the channels to process the requests, app logic is free to decide it's own internal threading policy(async vs sync, single thread vs multiple threads).
app states
abci library may or may not provide some abstraction to help app logic handle the state machine semantic or states separation.
Example
The text was updated successfully, but these errors were encountered: