Skip to content

Commit

Permalink
reject non-canonical
Browse files Browse the repository at this point in the history
  • Loading branch information
cce committed Aug 8, 2024
1 parent 6a6f276 commit 8701866
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions data/txHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,17 +808,18 @@ func (handler *TxHandler) validateIncomingTxMessage(rawmsg network.IncomingMessa
if drop {
return network.OutgoingMessage{Action: network.Ignore}
}

if handler.incomingTxGroupAppRateLimit(unverifiedTxGroup, rawmsg.Sender) {
return network.OutgoingMessage{Action: network.Ignore}
}

if reencoded == nil {
reencoded = reencode(unverifiedTxGroup)
}

if !bytes.Equal(rawmsg.Data, reencoded) {
// ignore non-canonically encoded messages
return network.OutgoingMessage{Action: network.Ignore}
}

if handler.incomingTxGroupAppRateLimit(unverifiedTxGroup, rawmsg.Sender) {
return network.OutgoingMessage{Action: network.Ignore}
// reject non-canonically encoded messages
return network.OutgoingMessage{Action: network.Disconnect}
}

// apply backlog worker logic
Expand Down

0 comments on commit 8701866

Please sign in to comment.