Skip to content

Refacor the msg-ack flow to facilitate future libp2p_stream or other streaming capabilities #6270

@tolbrino

Description

@tolbrino

Currently the entire msg + ack workflows are split into separate unidirectional subprotocols. This is in line with the expectations in the future to be able to streamify the node-to-node communication

No known requirements at this point would demand linking the msg and ack subprotocols, only the correlation of these protocols on the logical level is needed and the correlation can be achieved on the higher level.

Description

Some issues to be fixed while introducing the new stream like processing:

  • Always ack the msg request, even on msg failure, to increase the privacy
  • Simplify the packet processing pipeline to abstract away from the non-transport related behavior (e.g. tickets, chain ops...)
  • Update the code to use lazy initialization where possible and optimize background processes with parallelization (e.g. rayon).
  • Consider using expiring caches (https://docs.rs/cached/latest/cached/stores/struct.ExpiringValueCache.html)

Relevant issues

Definition of DONE

  • A new stream interface for the msg + ack protocol is defined in term of the libp2p agnostic behavior
  • The process pipeline is streamlined and simplified
  • The new abstractions are in place to allow removing non-transport related code from the transport layer and hide those behind a traita
  • Lazy initialization is used wherever possible
  • Packet processing pipeline uses a parallelization engine

Metadata

Metadata

Assignees

Labels

epicAn issue which tracks multiple issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions