CometBFT PeerState JSON serialization deadlock
cometbft
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/cometbft/cometbft Go |
|
|
Original description
CometBFT is a Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine and replicates it on many machines. An internal modification made in versions 0.34.28 and 0.37.1 to the way struct `PeerState` is serialized to JSON introduced a deadlock when new function MarshallJSON is called. This function can be called from two places. The first is via logs, setting the `consensus` logging module to "debug" level (should not happen in production), and setting the log output format to JSON. The second is via RPC `dump_consensus_state`.