Skip to content

overlay tech debt: flow control #3676

@marta-lokhova

Description

@marta-lokhova

Since we've been adding new features to overlay, we've accumulated quite a bit of tech debt that would be useful to address before we add new features. I think this is worth investing resources into as it's becoming harder to unit test and validate new features in overlay because we don't have proper abstractions and separation of responsibilities. Auditing the code, we have an opportunity to clean up flow control functionality:

  • Right now it's tightly coupled with the Peer class, making it hard to maintain and test. Ideally, we could extract flow control into its own module on top of peer. This way, Peer is solely responsible for the actual transport, authentication and forwarding network traffic to appropriate modules, while flow control ensures that we stop and resume reading/writing based on the throttling policy.
  • We should be able to unit test a narrow set of flow control policies without worrying about the actual internals of the Peer class and running the whole connection flow. This way we also don't need to duplicate test checks (e.g. peer must be authenticated, drop peer that doesn't respect the policy, etc)

Metadata

Metadata

Assignees

Labels

cleanuprefactoring or other internal improvements

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions