hyperledger / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
432 stars 276 forks source link

Stateful communication protocol and initialization handshake #2112

Open mversic opened 2 years ago

mversic commented 2 years ago

We use enum versioning for many of our data structures (e.g. VersionedTransaction or VersionedQueryRequest). This has to be true for structures which are going to become part of the blockchain (like VersionedTransaction). However, for structures which are not going to become part of the blockchain (like VersionedQueryRequest) this is just an artifact of the communication protocol used. It should be possible to determine the version of the communication protocol used between client and server in the initialization handshake and store it for the duration of the session.

There are three major concerns:

  1. How long will the client session last
  2. How many of these structures are there that would make it worth it to make this kind of a change
  3. Are there other use cases for stateful communication

Could relate to #1788 or #2111

appetrosyan commented 1 year ago

Investigate:

  1. Upper bound based on scaling data of the queries, which are the longest things in a session (most transactions are fire and forget).
  2. Investigate the code base. Limited number of enums expected, so no more than 2-3.
  3. Investigate the use of hash-based versioning, to lock the client to the Executor version and potential to exchange a module containing the dynamically defined structures.
mversic commented 8 months ago

might not be worth doing. Let's revisit later. We should definitely check that websocket communication is being versioned