I was just auditing the code to check for how a peer could take down all it's peers in one take and I found a way. By broadcasting to all of them a Proposal of a blockstate with a Total <= -127 a malicious peer can take down all of it's peers because:
|
case DataChannel: |
|
if conR.FastSync() { |
|
conR.Logger.Info("Ignoring message received during fastSync", "msg", msg) |
|
return |
|
} |
|
switch msg := msg.(type) { |
|
case *ProposalMessage: |
|
ps.SetHasProposal(msg.Proposal) |
|
conR.conS.peerMsgQueue <- msgInfo{msg, src.ID()} |
|
ps.ProposalBlockParts = cmn.NewBitArray(proposal.BlockPartsHeader.Total) |
but then see the code in tendermint/tmlibs/common.NewBitArray https://github.com/tendermint/tmlibs/blob/1b9b5652a199ab0be2e781393fb275b66377309d/common/bit_array.go#L16-L25

and notice the line https://github.com/tendermint/tmlibs/blob/1b9b5652a199ab0be2e781393fb275b66377309d/common/bit_array.go#L18-L20

Which will then crash with
panic: runtime error: makeslice: len out of range [recovered]
panic: runtime error: makeslice: len out of range
goroutine 20 [running]:
testing.tRunner.func1(0xc0001560f0)