-
Notifications
You must be signed in to change notification settings - Fork 34
Asynchronous processing #31
Comments
btw, here's a bounty on this issue: https://www.bountysource.com/issues/66866776-asynchronous-processing |
Hi @tomtau
|
Hi @enginespot , thanks for your contribution! ad the first point -- Most of the message exchanges are synchronous: https://tendermint.com/docs/spec/abci/abci.html#messages so they need Flush to be called AFAIK. ad error handling -- #49 + feel free to open some more specific issues ad optimization -- I think relaxing that mutex could help; Mempool/info may not need to mutate the state ad test cases -- a bit vague issues are here #29 #36 @ebuchman @melekes @liamsi feel free to correct or clarify any of the synchronous / asynchronous assumptions between Tendermint and ABCI apps |
Hi @tomtau, thanks for your quick reply
hmm... can you help me to check what's wrong or give some tips? |
@enginespot Which ABCI application are you testing it against? ABCI applications need to be deterministic -- i.e. given the same messages (in the same order), they should return the same responses... AppHash is a compact representation of the ABCI app state (that was derived after applying actions corresponding to ABCI messages) -- often, it's the root of some Merkle tree, but it could be anything... e.g. in that "counter" example app, it's |
@tomtau I use "./tendermint node" and also "empty_app" for testing, hmm... what I do by now is only change all of the logic with Tokio framework, and change ABCI decode/encode logic, maybe it has no relationship with AppHash? |
for the first point, I tried to print the ResponseCommit data,
so I'm not sure if it's a problem here. |
@enginespot could you post the content of
|
|
|
and if you configure app_hash in genesis.json to something like:
|
hmm... the same error occurs.
to the follow method:
the empty_app will work well. |
@enginespot did you run |
@tomtau Great!
the error disappeared.:) |
Hi @tomtau |
@enginespot async I/O is a good start. the next part I mentioned above #31 (comment):
For example, in the original Tendermint implementation: there's a channel of responses, the request processing routine reads from the connection and writes to the response channel, the response writing routine pulls responses from the channel and writes them to the connection. So, ideally, Rust ABCI would work in a similar fashion. I'll let @ebuchman @melekes @liamsi comment if they have any thoughts about it. |
This splitting may actually be already done in the PR, with the ABCICodec: https://github.com/tendermint/rust-abci/pull/50/files#diff-8063a415c8305a1c847560858568db8fR11 |
we use "spawn" to process each request so it will do not block, I think currently it can receiving and responding data concurrently. https://tokio.rs/docs/futures/spawning/
|
It may be fine. There are two parts I haven't tested / verified: 1) is the order preserved? 2) the |
for the 1) is the order preserved?
so by now , it should non-blocking hmm... I have no simple code for the testing, so I think it also needs a test to confirm. |
@enginespot read through the code and left a comment in the corresponding PR #50 it'll be better to move the code-related discussion there |
As mentioned in: #21 (comment)
Currently, there's one mutex and synchronous IO, but not much reason for that. Mempool/info connections may not need to mutate the app state + The Tendermint ABCI specs say:
The text was updated successfully, but these errors were encountered: