Skip to content

Unclear private validator accept connection logic #452

@corverroos

Description

@corverroos

Bug Report

version: 0.34.27

While diving into the privval package source code as part of an investigation into horcrux we discovered that the "accept connection logic" is unclear.

See source. Writing to the unbuffered channel sl.connectRequestCh after attempting to accept a connection in SignerListenerEndpoint.serviceLoop has no affect. This is because a single goroutine cannot read and write to the same unbuffered channel, it can only do that with buffered channels.

It would therefore be clearer to remove that select statement since it never actually writes to the channel.

If the reasoning behind the serviceLoop is to successfully accept one connection for each connectRequest then one could change connectRequestCh into a buffered channel with length 1 and only write to it when acceptNewConnection errored.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds-triageThis issue/PR has not yet been triaged by the team.

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions