embark/packages/stack
emizzle 173d53de2f fix(@embark/proxy): Fix contract event subscriptions
Fix the proxy’s handling of WebSocket connections when subscribing to contract events and node data using the `eth_subscribe` RPC request.

Previously, the client connection that the subscription data was sent to was often in a closed state. It was determined that this connection was the wrong connection to forward the data in the first place. The connection was in fact generally the connection created for the Ethereum service check which was then (correctly and subsequently) closed after it had finished its operation.

The flow of a proxy request handling a WebSocket “eth_subscribe” RPC request is now as follows:
1. A WebSocket RPC request `”eth_subscribe”` is sent from a client to the proxy.
2. Proxy forwards the request to the node by way of a new instance of `RequestManager`.
3. When the node receives an event matching the subscription, it sends the event data back to same socket connection it received the request on (ie the specific instance of `RequestManager`).
4. The `RequestManager` fires the `”data”` event containing the subscription data, and this event is picked up in the proxy.
5. The proxy then forwards the subscription data on to the originating WS client connection.

All other requests (ie non-WS or WS RPC requests that are not `eth_subscribe`) will be serviced to/from the node using a single `RequestManager` instance.

Co-authored-by: Pascal Precht <pascal.precht@gmail.com>
2019-10-28 13:00:18 -05:00
..
api build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
authenticator build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
blockchain build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
blockchain-client build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
communication build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
compiler build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
contracts-manager build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
deployment build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
embarkjs build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
library-manager build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
namesystem build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
pipeline build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
process-logs-api-manager build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
proxy fix(@embark/proxy): Fix contract event subscriptions 2019-10-28 13:00:18 -05:00
storage build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
test-runner build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
watcher build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00
webserver build(deps): add core-js@3 as a dep to all pkgs that have @babel/runtime-corejs3 dep 2019-10-28 11:40:48 -05:00