Repository navigation
Description
Bug Report
Setup
CometBFT version (use cometbft version or git rev-parse --verify HEAD if installed from source): v0.38.19
Have you tried the latest version: no (but doubtful anything has changed)
ABCI app (name for built-in, URL for self-written if it's publicly available): noble (but also neutron, pretty much every other chain)
Environment: N/A
Config
priv_validator_laddr = "<address of TMKMS>"
What happened?
See also: #850 (comment)
Often during chain upgrades there will be a need to roll back a validator node for whatever reason. When this happens, remote signers like TMKMS detect double signing, and return a RemoteSignerError proto. TMKMS sets the code field of this proto to 2.
When CometBFT receives such a response, it seemingly aborts the connection. This is what appears in logs:
This makes it extremely difficult for validators using remote signers to catch up when there are a large number of rounds or if they ever have to repeatedly restart, because validators in such a configuration are very slow to advance rounds as they're constantly re-establishing the privval conneciton.
What did you expect to happen?
CometBFT handles the error without dropping the entire privval connection.
How to reproduce it
This issue only comes up during chain upgrades where some other problem is occurring which causes the chain to halt and get into a state where there are a large number of rounds waiting for the chain to come to consensus. It's very difficult to reproduce, I'm sorry.
As a more minimal case, you could create a remote signer, proxy a remote signer, or modify a remote signer to occasionally emit RemoteSignerError and observe the behavior.
Logs
NOTE: I am confused by the Ping timeout? Perhaps there's something out-of-sequence between requests and responses.
{"level":"info","module":"server","module":"privval","time":"2025-10-14T16:35:59Z","message":"SignerListener: Listening for new connection"}
{"level":"error","module":"server","module":"privval","time":"2025-10-14T16:35:59Z","message":"SignerListener: Ping timeout"}
{"level":"info","module":"server","module":"privval","time":"2025-10-14T16:35:59Z","message":"SignerListener: Blocking for connection"}
{"level":"info","module":"server","module":"privval","time":"2025-10-14T16:36:00Z","message":"SignerListener: Connected"}
{"level":"info","module":"server","module":"privval","time":"2025-10-14T16:36:00Z","message":"SignerListener: Listening for new connection"}
{"level":"info","module":"server","module":"privval","time":"2025-10-14T16:36:01Z","message":"SignerListener: Blocking for connection"}
{"level":"info","module":"server","module":"privval","time":"2025-10-14T16:36:02Z","message":"SignerListener: Connected"}
{"level":"info","module":"server","module":"privval","time":"2025-10-14T16:36:02Z","message":"SignerListener: Listening for new connection"}dump_consensus_state output
Can provide if helpful but it's 275kB and not easy to post in this issue.
Anything else we need to know
Separately I had suggested in a hypothetical future gRPC interface that the remote signer be able to communicate the last known round height so the validator can automatically catch up in such cases:
Activity
linear commentedon Oct 14, 2025
COMET-320
pyoxa commentedon Oct 14, 2025
can you share more logs and the setup? in https://github.com/ChorusOne/nebula, when returning a
RemoteSignerError, e.g on step regression, the connection isn't dropped.fwiw, nebula sets
Codeto 1, but I would be surprised if the code was used anywhere but logstony-iqlusion commentedon Oct 14, 2025
I'm not sure what additional information would be helpful here regarding the logs and setup. This occurred on a production validator which makes it difficult to do things like adjust log levels or provide further investigation, as I'm waiting for it to catch up with the rest of the network.
The best I can do is try adjusting the error code that TMKMS sends back and see if that helps in some way the next time this happens.
pyoxa commentedon Oct 14, 2025
no, again, I doubt that (adjusting the error code) would be helpful. I asked for logs/setup because that would help checking for any differences between the signers.
See this one (1 signer-multiple validators setup):
no reconnection happened, the remote signer is connected via tcp on xpla, which is using cometbft v0.38.17
tony-iqlusion commentedon Oct 14, 2025
This is potentially pointing to some kind of TMKMS issue then, but I'm very confused because the error handling in TMKMS uses the exact same codepath it uses to write every other response as a protobuf, it simply writes a
RemoteSignerErrorin that case.On the CometBFT side, I am seeing a few loglines with
failed signing vote:{"level":"error","module":"server","module":"consensus","height":36887001,"round":3,"vote":"Vote{10:9814A41D7ADE 36887001/03/SIGNED_MSG_TYPE_PRECOMMIT(Precommit) 000000000000 000000000000 000000000000 @ 2025-10-14T16:03:51.456629748Z}","err":"exhausted all attempts to sign vote: write tcp [REDACTED]: write: broken pipe: endpoint write timed out","time":"2025-10-14T16:04:14Z","message":"failed signing vote"}{"level":"error","module":"server","module":"consensus","height":36887001,"round":4,"vote":"Vote{10:9814A41D7ADE 36887001/04/SIGNED_MSG_TYPE_PREVOTE(Prevote) BD0B9383FDAD 000000000000 000000000000 @ 2025-10-14T16:04:14.3968218Z}","err":"exhausted all attempts to sign vote: EOF","time":"2025-10-14T16:04:38Z","message":"failed signing vote"}pyoxa commentedon Oct 14, 2025
potentially yes, but this is a huge dissonance for me, because it would probably have to be on the transport level, rather than the response crafting.
I would have to dive deeper and make sure that my signer and your signer are put in the exact same situations -- will try to get back to this tomorrow eu time
pyoxa commentedon Oct 15, 2025
this indeed looks like some issue with the transport, when returning a
RemoteSignerError, you shouldn't even be getting into the codepath that logsexhausted all attempts to sign vote. It should return on the first non-nilresp.Error.Looking at the code on either side, I don't see anything obvious, but fortunately it should be pretty easy to reproduce
tony-iqlusion commentedon Oct 17, 2025
@tschuyebuhl is there anything about the framing of error responses which is different from other responses? TMKMS is just writing a
proto::privval::Messageregardless of success or failuretony-iqlusion commentedon Nov 21, 2025
I've seen reports these errors seem to be working correctly with TMKMS on the Celestia v6 upgrade, which uses CometBFT v0.38.17:
...so perhaps the issue was corrected at some point?I guess it needs to be confirmed this is still the case in the specific scenario of a chain failing to come to consensus and there being a round conflict.Edit: except the problem was occurring with CometBFT v0.38.19 with noble, so I guess it's working in some cases and not others?
pyoxa commentedon Nov 21, 2025
celestia is using a fork, right? and the v6 upgrade will come online only on monday
tony-iqlusion commentedon Nov 21, 2025
Yes, they're using a fork:
Though the upgrade isn't online yet, most validators are running the new binary which signals readiness for the upgrade.
pyoxa commentedon Nov 21, 2025
I forgot, but Celestia also had the multiplexer, didn't it? That would activate the "new" binary automatically? So currently they would still be on whatever was in v5, or does it not work like this?
tony-iqlusion commentedon Nov 21, 2025
Yeah, I'm a bit unclear how it all works, but it does indeed have a multiplexer.
That said, I think it's interesting to see that there are some cases where CometBFT is interpreting the error response correctly from TMKMS.