Skip to content

Commit a0e155b

Browse files
committed
Drop messages that are no longer useful for GPBFT progression
As a GPBFT instance progresses some messages become irrelevant, in that they do not effectively aid the progress of the instance for participants. Instead, GPBFT offers other built-in mechanisms to aid progress of lagging participants such as selective rebroadcast, propagation of DECIDE messages from the previous instance and finality certificate exchange. The changes here introduce a dedicated error type returned as part of message validation to signal that although a message is valid it is no longer relevant. This error type is then checked by pubsub to avoid further propagation of those messages. This reduces the redundant pubsub traffic for the network participants. Fixes #583
1 parent b802002 commit a0e155b

9 files changed

+235
-111
lines changed

gpbft/errors.go

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ var (
2525
//
2626
// See SupplementalData.
2727
ErrValidationWrongSupplement = newValidationError("unexpected supplemental data")
28+
// ErrValidationNotRelevant signals that a message is valid but not relevant at the current instance,
29+
// and is not worth propagating to others.
30+
ErrValidationNotRelevant = newValidationError("message is valid but not relevant")
2831

2932
// ErrReceivedWrongInstance signals that a message is received with mismatching instance ID.
3033
ErrReceivedWrongInstance = errors.New("received message for wrong instance")

gpbft/errors_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func TestValidationError_SentinelValues(t *testing.T) {
1717
{name: "ErrValidationInvalid", subject: ErrValidationInvalid},
1818
{name: "ErrValidationWrongBase", subject: ErrValidationWrongBase},
1919
{name: "ErrValidationWrongSupplement", subject: ErrValidationWrongSupplement},
20+
{name: "ErrValidationNotRelevant", subject: ErrValidationNotRelevant},
2021
}
2122
for _, test := range tests {
2223
t.Run(test.name, func(t *testing.T) {

0 commit comments

Comments
 (0)