From 6e1f6346a414e479519106d9715475566da2d0fd Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:01:21 +0200 Subject: [PATCH] fix(consensus): msg queue is too small for mainnet --- internal/consensus/state.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/consensus/state.go b/internal/consensus/state.go index 2e54f5a17..5ad252247 100644 --- a/internal/consensus/state.go +++ b/internal/consensus/state.go @@ -46,7 +46,13 @@ var ( ErrPrivValidatorNotSet = errors.New("priv-validator is not set") ) -var msgQueueSize = 1000 +// msgInfoQueue must fit info about all votes from all validators 100 for Dash Evo mainnet), +// multiplied by number of peers that can broadcast these votes (also assuming 100), +// multiplied by some factor (here 2) to address multiple rounds. +// +// Note this allows potential OOM condition if we put 20 000 proposal block of size +// types.BlockPartSizeBytes==64 kB, what gives us 1.2 GB of memory usage. +var msgQueueSize = 100 * 100 * 2 // msgs from the reactor which may update the state type msgInfo struct {