Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

p2p/simulations: split Network GOD object #1225

Closed
frncmx opened this issue Feb 15, 2019 · 0 comments
Closed

p2p/simulations: split Network GOD object #1225

frncmx opened this issue Feb 15, 2019 · 0 comments
Labels
cleanup code completion, add comments and more network

Comments

@frncmx
Copy link
Contributor

frncmx commented Feb 15, 2019

The Network is a GOD object therefore must be split into smaller types.

  1. It has 34 public methods ( go doc ./p2p/simulations/.Network | grep func | wc -l) => split
  2. Most of the methods locks the whole Network. => refactor pessimistic locking

Example: If a Node is stopped or started the whole network is blocked as we acquire net.lock.

We should split up Network and introduce a more granular locking with smaller critical (lock protected) areas. Currently, Network is hard to modify and it's hard to see "the big picture".

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
cleanup code completion, add comments and more network
Projects
None yet
Development

No branches or pull requests

2 participants