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

Expose the peer that delivered the message #215

Closed
aschmahmann opened this issue Oct 18, 2019 · 3 comments
Closed

Expose the peer that delivered the message #215

aschmahmann opened this issue Oct 18, 2019 · 3 comments

Comments

@aschmahmann
Copy link
Contributor

It may be useful for peers that want to layer protocols on top of pubsub to know which peer actually delivered a message to them.

We already have this information available in the from field of the RPC:

go-libp2p-pubsub/pubsub.go

Lines 144 to 149 in 2247a54

type RPC struct {
pb.RPC
// unexported on purpose, not sending this over the wire
from peer.ID
}

so this would mean making the information publicly available in the Message struct:

go-libp2p-pubsub/pubsub.go

Lines 136 to 138 in 2247a54

type Message struct {
*pb.Message
}

@aschmahmann
Copy link
Contributor Author

@raulk @vyzo @ZenGround0

Do we think this is sufficiently reusable such that we're better off recommending this approach rather than the hackier, but already available, approach of using the validators? Note, that the validators take the peer that delivered the message as an input so we actually already have an avenue for getting the from into application space.

@vyzo
Copy link
Collaborator

vyzo commented Oct 18, 2019

Using the validators is just too hacky, let's expose from.

@raulk
Copy link
Member

raulk commented Oct 18, 2019

Closed in #218.

@raulk raulk closed this as completed Oct 18, 2019
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

No branches or pull requests

3 participants