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

network: move hive message handler from Peer type #1801

Merged
merged 1 commit into from
Oct 29, 2019
Merged

Conversation

acud
Copy link
Member

@acud acud commented Sep 24, 2019

This PR moves the Hive protocol's message handlers from the Peer type to the Hive type.

@acud acud added enhancement in progress stability cleanup code completion, add comments and more kademlia labels Sep 24, 2019
@acud acud added this to the 0.5.1 milestone Sep 24, 2019
@acud acud self-assigned this Sep 24, 2019
@acud acud added this to Backlog in Swarm Core - Sprint planning via automation Sep 24, 2019
@acud acud moved this from Backlog to In review (includes Documentation) in Swarm Core - Sprint planning Sep 24, 2019
Copy link
Contributor

@nolash nolash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the code just moved except weeding the kademlia member out? If its actually changed it's better if it is changed in place first then move blocks of code.

As a general comment I don't like the approach that the hive is a hybrid service which both manages the node's own connectivity and is a service for distributing peer information to others in the network. One is a network service, the other for internal consumption. I would have liked to see a SWIP and a discussion on how this separation of concerns can best be achieved. It was also in the pipeline for the outstanding kademlia tasks that were agreed with Epic Labs, but lower in priority.

network/hive.go Outdated Show resolved Hide resolved
network/hive.go Outdated Show resolved Hide resolved
@acud
Copy link
Member Author

acud commented Sep 26, 2019

As a general comment I don't like the approach that the hive is a hybrid service which both manages the node's own connectivity and is a service for distributing peer information to others in the network. One is a network service, the other for internal consumption. I would have liked to see a SWIP and a discussion on how this separation of concerns can best be achieved. It was also in the pipeline for the outstanding kademlia tasks that were agreed with Epic Labs, but lower in priority.

I was never a part of this discussion, then I guess it's safe to say I have no clue what you're talking about.

Is the code just moved except weeding the kademlia member out? If its actually changed it's better if it is changed in place first then move blocks of code.

I was assuming this comment will arrive sooner or later.
I'll pick moving it first, only then adding the kick functionality since it is nicer to implement when the handlers are on hive (because the current node needs to know if it is a bootnode, and I don't wanna pass this information to the Peer struct). That's why I did both in one go.

@acud acud changed the title network: cleanup hive, bootnode kick out peer after sending peersMsg network: move hive message handler from Peer struct Sep 26, 2019
@acud acud changed the title network: move hive message handler from Peer struct network: move hive message handler from Peer type Sep 26, 2019
@acud acud removed the stability label Sep 26, 2019
@acud acud force-pushed the bootnode-kicks-ass branch 2 times, most recently from 4743083 to dbe4ec2 Compare September 26, 2019 11:00
@acud acud requested review from nolash and janos September 26, 2019 11:03
@acud acud force-pushed the bootnode-kicks-ass branch 2 times, most recently from 680f79b to de5f598 Compare September 30, 2019 09:22
@skylenet skylenet modified the milestones: 0.5.1, 0.5.2 Oct 3, 2019
@skylenet skylenet modified the milestones: 0.5.2, 0.5.3 Oct 8, 2019
@acud
Copy link
Member Author

acud commented Oct 10, 2019

can we please approve this very simple PR so I can go ahead and implement the bootnode kicks after n nodes functionality? or do we want to scratch this completely? hand it over to epic lab guys? please clarify @nolash @zelig I don't like having PRs open for months

@janos
Copy link
Member

janos commented Oct 14, 2019

network/hive_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@nolash nolash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acud Can you please let me know how I should go about comparing the changes here? If these are very few actual changes then perhaps you could list them all in a bullet point list? I do not want to rubber-stamp a PR just because it is claimed to be simple, when I can't really evaluate what has changed because the changes have been buried in moves between files. Sorry if it's a pain in the ass <3

@acud
Copy link
Member Author

acud commented Oct 19, 2019

Señor @nolash, just for you:

  1. discovery.go has been renamed to peer.go (i used git move and i'm not sure why it's not showing up as a move instead of complete erase of discovery.go)
  2. discovery_test.go renamed to peer_test.go
  3. message handlers from peer.go have been moved to hive.go

I guess you could go about comparing bit by bit by checking out the branch then comparing with:

git checkout bootnote-kicks-ass
git checkout master -- network/discovery.go
diff network/discovery.go network/peer.go

then compare the output of the diff with what was added to hive.go in the PR diff.

Is this informative enough on how to go about reviewing this?

@acud acud requested review from janos and nolash October 19, 2019 08:06
@acud acud force-pushed the bootnode-kicks-ass branch 2 times, most recently from c788beb to b8619ac Compare October 19, 2019 08:08
@nolash
Copy link
Contributor

nolash commented Oct 21, 2019

@acud Thanks for clarifying. I see you forgot to include that you deleted the NotifyDepth function that didn't have a receiver. I also see that tests are failing, and that symbol is mentioned.

It's not that I don't believe you and trust you when you say this and this was done. But if we can rely on that we never do code moves with changes in the same commit, we can also have the extra security of being able to audit all changes. Otherwise there is always a chance something may have snuck in (especially when it comes to larger PRs).

For my part I don't mind if the moves are within a single PR, as long as the move itself without any changes is in a single commit, and that commit is referenced in the description. But in my opinion the best is a separate PR for code block moves.

Please fix the test, and I'll approve. Thanks.

@acud acud force-pushed the bootnode-kicks-ass branch 2 times, most recently from 1c64dbc to 75be37a Compare October 21, 2019 15:13
@acud
Copy link
Member Author

acud commented Oct 21, 2019

@nolash the PR is now in diminished state since the dreadful discovery tests started failing with the last handler changes (and i'd really be happy to not go into this rabbithole of debugging them for 2 months). and I think you can even review the changes without using any of your favorite command line utilities.
this code is still very fragile and the test vectors are impossible to debug (if you're a puny human, that is)

Copy link
Contributor

@nolash nolash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is now only moving code blocks, haven't looked for or checked code changes.

@zelig zelig merged commit befd91d into master Oct 29, 2019
Swarm Core - Sprint planning automation moved this from In review (includes Documentation) to Done Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants