Merge pull request #6430 from GFZRZK/GFZRZK/correct_message_size_check

Fix: correct the change of message size limit
This commit is contained in:
Łukasz Magiera 2021-06-09 18:10:34 +02:00 committed by GitHub
commit b746dc2af1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -243,7 +243,7 @@ func (mp *MessagePool) checkMessages(msgs []*types.Message, interned bool, flexi
},
}
if len(bytes) > 32*1024-128 { // 128 bytes to account for signature size
if len(bytes) > MaxMessageSize-128 { // 128 bytes to account for signature size
check.OK = false
check.Err = "message too big"
} else {

View File

@ -557,7 +557,7 @@ func (mv *MessageValidator) validateLocalMessage(ctx context.Context, msg *pubsu
return pubsub.ValidationIgnore
}
if m.Size() > 32*1024 {
if m.Size() > messagepool.MaxMessageSize {
log.Warnf("local message is too large! (%dB)", m.Size())
recordFailure(ctx, metrics.MessageValidationFailure, "oversize")
return pubsub.ValidationIgnore