Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Use a pointer type on IpfsNode.Peering #8331

Merged
merged 1 commit into from
Aug 13, 2021

Conversation

TakashiMatsuda
Copy link
Contributor

@TakashiMatsuda TakashiMatsuda commented Aug 7, 2021

The problem

The current type of IpfsNode.Peering is PeeringService.
It is different from the type *PeeringService returned from node.Peering provided in core/node/groups.go:270 .
This difference prevents fx from injecting IpfsNode.Peering.
The current node.PeeringService on the daemon is a zero value.

I also cannot get the valid PeeringService on SwarmAddCommand in #8147 due to this problem.

Proposal

I propose to fix the type of IpfsNode.PeeringService from PeeringService to *PeeringService.

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

Ah, lol. So, peering works right now because we're passing PeerWith. This causes us to create a peering service even though the peering service on the main struct is empty.

I was really confused how our sharness tests were passing.

@Stebalien Stebalien merged commit 6e0f084 into ipfs:master Aug 13, 2021
@Stebalien
Copy link
Member

Thanks!

@TakashiMatsuda TakashiMatsuda deleted the fix/node-peering branch August 14, 2021 06:12
@TakashiMatsuda
Copy link
Contributor Author

Yes.

At the moment the setting of the peering service on daemon cannot be changed after startup, so I guess the sharness test did not reveal the problem.

@Stebalien
Copy link
Member

Yep. Thanks for the fix!

@aschmahmann aschmahmann mentioned this pull request Aug 23, 2021
62 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants