(Discussion deadline: 2019-01-25)
Abstract
Even though tranport is logically a child of RaidenService, it receives RaidenService in start and uses it in a couple of places, tightly coupling both bi-directionally and making it harder to use transports for anything outside RaidenService (like MS and PFS).
Motivation
Transport role can be described as: given an own address and some configuration, it can listen to messages sent to its address, and send messages to a target address. This role doesn't strictly require raiden service, but it's used all over the place for specific things that aren't specific to RaidenService. We need to decouple this interface, and make transport not depend directly on RaidenService.
Specification
These are some of the uses by MatrixTransport and suggestions on how they could be abstracted away from service:
Backwards Compatibility
These changes should be completely backwards compatible, and not impact much the rest of the Raiden's architecture outside of transports.
(Discussion deadline: 2019-01-25)
Abstract
Even though tranport is logically a child of RaidenService, it receives RaidenService in
startand uses it in a couple of places, tightly coupling both bi-directionally and making it harder to use transports for anything outside RaidenService (like MS and PFS).Motivation
Transport role can be described as: given an own address and some configuration, it can listen to messages sent to its address, and send messages to a target address. This role doesn't strictly require raiden service, but it's used all over the place for specific things that aren't specific to RaidenService. We need to decouple this interface, and make transport not depend directly on RaidenService.
Specification
These are some of the uses by MatrixTransport and suggestions on how they could be abstracted away from service:
transport.startconfigon__init__orstarttransport.stop_retry(queue, message)(or other meaningful name) and called by user when transport should give up retrying a message (e.g. onProcessedor channel closed)handle_state_change, should be turned into a callback.signerhelper service/object, passed as parameter to init or start, able to sign string/bytes andMessages with key fromaddress. This abstraction will also allow easily implementing different signing backends/methods, like remote signing (Get rid of local signing #1402) (as we already implementedeth_sign/EIP191)Backwards Compatibility
These changes should be completely backwards compatible, and not impact much the rest of the Raiden's architecture outside of transports.