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

go/worker/p2p: Skip peer authentication for our own messages #3319

Merged
merged 1 commit into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changelog/3319.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
go/worker/p2p: Skip peer authentication for our own messages

In practice this fixes a bug in a setup where executor nodes are used to
submit runtime transactions. The executor nodes that are not part of the
active committee, would end up self-rejecting transaction messages.
15 changes: 9 additions & 6 deletions go/worker/common/p2p/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,15 @@ func (h *topicHandler) dispatchMessage(peerID core.PeerID, m *queuedMsg, isIniti
h.handlersLock.RLock()
defer h.handlersLock.RUnlock()

for _, handler := range h.handlers {
// Perhaps this should reject the message, but it is possible that
// the local node is just behind. This does result in stale messages
// getting retried though.
if err = handler.AuthenticatePeer(m.from, m.msg); err != nil {
return err
// Authenticate the peer if it's not us.
if m.peerID != h.p2p.host.ID() {
for _, handler := range h.handlers {
// Perhaps this should reject the message, but it is possible that
// the local node is just behind. This does result in stale messages
// getting retried though.
if err = handler.AuthenticatePeer(m.from, m.msg); err != nil {
return err
}
}
}

Expand Down