Conversation
|
implements #819 |
types/priv_validator/socket.go
Outdated
| } | ||
|
|
||
| var n int | ||
| b = wire.ReadByteSlice(conn, 0, &n, &err) //XXX: no max |
There was a problem hiding this comment.
check for err before calling decodeMsg
types/priv_validator/socket.go
Outdated
| n := new(int) | ||
| r := bytes.NewReader(bz) | ||
| msgI := wire.ReadBinary(struct{ PrivValidatorSocketMsg }{}, r, 0, n, &err) | ||
| msg = msgI.(struct{ PrivValidatorSocketMsg }).PrivValidatorSocketMsg |
There was a problem hiding this comment.
is msgI guaranteed to be PrivValidatorSocketMsg in case of error?
types/priv_validator/socket.go
Outdated
| pvss.Logger.Info("Accepted a new connection") | ||
|
|
||
| // read/write | ||
| for { |
There was a problem hiding this comment.
only one connection at a time?
There was a problem hiding this comment.
@ebuchman Is one connection at a time by design, or should the server be able to hanlde multiple, if so are there any upper bounds we want to enforce, or any other limiting requirements?
types/priv_validator/socket.go
Outdated
| } | ||
|
|
||
| func (pvss *PrivValidatorSocketServer) OnStart() error { | ||
| if err := pvss.BaseService.OnStart(); err != nil { |
There was a problem hiding this comment.
BaseService#OnStart is empty. no need to call it.
types/priv_validator/socket.go
Outdated
| } | ||
|
|
||
| func (pvss *PrivValidatorSocketServer) OnStop() { | ||
| pvss.BaseService.OnStop() |
There was a problem hiding this comment.
BaseService#OnStop is empty. no need to call it.
types/priv_validator/socket.go
Outdated
| pvss.Logger.Error("Error closing listener", "err", err) | ||
| } | ||
|
|
||
| if err := pvss.conn.Close(); err != nil { |
* add comments to all public types * fix comments to adhere to comment standards
|
Thanks Alex. Couple notes here.
@tarcieri is working on the signer itself in Rust |
|
Thanks for follow-up.
Should the server exist as it's own binary under
Seems like a good first baseline, maybe worth having it configurable.
Going to sync with him to see if we can make each others work easier. |
No it should run in-process when
Sounds great |
|
Thanks Alex. I've moved this over to a fresh PR by rebasing on a fresh copy of the new validator code without integrating to the rest of the codebase. Let's take up review/discussion there |
Support a socket client and server for the priv validator.
Dead simple synchronous server.
@xla @ethanfrey want to work on this ?
see #1044 for more context