LiskArchive / wamp-socket-cluster

🔌 Wrapper for both WAMPClient and WAMPServer
GNU General Public License v3.0
14 stars 6 forks source link

Consider using the built-in response callback feature offered by SC for RPC responses #28

Closed jondubois closed 6 years ago

jondubois commented 6 years ago

Right now, the RPC request and its response are managed explicitly by wamp-socket-cluster (at a higher level in the protocol stack than necessary). This introduces a few issues:

  1. If a peer connection fails while an RPC is being processed, the node won't find out about it until the RPC response timeout/failure is triggered (which would take longer) - If we used SC's built-in response callback then we would find out immediately.
  2. It's difficult to differentiate a lost connection from other kinds of timeout inside the RPC callback.
  3. It requires additional client-side logic to handle RPC responses from the Lisk node (e.g. to track, invoke, timeout and cleanup response callbacks). Using SC's event response callback style will make it easier to integrate with other systems/sidechains in the future.

It would be better to have this implemented before 1.0 release (that way we only support a single response style) but since it's a relatively minor change, it should be possible to add support for it later (we could possibly support both response styles).

jondubois commented 6 years ago

This issue is related to https://github.com/LiskHQ/lisk/issues/2059