Skip to content

Commit

Permalink
Drop messages that are no longer useful for GPBFT progression
Browse files Browse the repository at this point in the history
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
  • Loading branch information
masih committed Sep 21, 2024
1 parent b802002 commit 92b32f2
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 94 deletions.
3 changes: 3 additions & 0 deletions gpbft/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ var (
//
// See SupplementalData.
ErrValidationWrongSupplement = newValidationError("unexpected supplemental data")
// ErrValidationNotRelevant signals that a message is valid but not relevant at the current instance,
// and is not worth propagating to others.
ErrValidationNotRelevant = newValidationError("message is valid but not relevant")

// ErrReceivedWrongInstance signals that a message is received with mismatching instance ID.
ErrReceivedWrongInstance = errors.New("received message for wrong instance")
Expand Down
1 change: 1 addition & 0 deletions gpbft/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func TestValidationError_SentinelValues(t *testing.T) {
{name: "ErrValidationInvalid", subject: ErrValidationInvalid},
{name: "ErrValidationWrongBase", subject: ErrValidationWrongBase},
{name: "ErrValidationWrongSupplement", subject: ErrValidationWrongSupplement},
{name: "ErrValidationNotRelevant", subject: ErrValidationNotRelevant},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
Expand Down
Loading

0 comments on commit 92b32f2

Please sign in to comment.