diff --git a/.changelog/3319.bugfix.md b/.changelog/3319.bugfix.md new file mode 100644 index 00000000000..26b0e33bcfc --- /dev/null +++ b/.changelog/3319.bugfix.md @@ -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. diff --git a/go/worker/common/p2p/dispatch.go b/go/worker/common/p2p/dispatch.go index be2c19ab1c6..9f5e05454f4 100644 --- a/go/worker/common/p2p/dispatch.go +++ b/go/worker/common/p2p/dispatch.go @@ -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 + } } }