Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture broadcasted messages for re-broadcasting even at panic #627

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

masih
Copy link
Member

@masih masih commented Sep 4, 2024

Fix a bug where if Host.RequestBroadcast panics the requested message is never added to the re-broadcast state.

Fix an inconsistent behaviour where error at requested broadcasts via re-broadcast are returned instead of being silently logged.

Enhance emulator to allow pluggable signign logic with two additional signing implementation: erroneous and panic.

Implement tests that assert expected behaviour at signing error or panic.

Fixes #236

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 69.38776% with 15 lines in your changes missing coverage. Please review.

Project coverage is 79.37%. Comparing base (e912882) to head (fb9fe20).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
emulator/signing.go 44.44% 10 Missing ⚠️
emulator/driver.go 69.23% 2 Missing and 2 partials ⚠️
emulator/instance.go 80.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #627      +/-   ##
==========================================
- Coverage   79.73%   79.37%   -0.37%     
==========================================
  Files          52       52              
  Lines        4644     4674      +30     
==========================================
+ Hits         3703     3710       +7     
- Misses        584      604      +20     
- Partials      357      360       +3     
Files with missing lines Coverage Δ
emulator/driver_assertions.go 100.00% <100.00%> (ø)
emulator/host.go 78.94% <100.00%> (+3.94%) ⬆️
gpbft/gpbft.go 87.30% <100.00%> (+0.30%) ⬆️
emulator/instance.go 94.50% <80.00%> (-1.01%) ⬇️
emulator/driver.go 87.80% <69.23%> (-9.34%) ⬇️
emulator/signing.go 51.72% <44.44%> (-3.28%) ⬇️

... and 6 files with indirect coverage changes

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits

gpbft/gpbft.go Outdated Show resolved Hide resolved
return err
// Silently log the error and proceed. This is consistent with the behaviour of
// instance for regular broadcasts.
i.log("failed to request rebroadcast %s at round %d: %v", mb.Payload.Step, mb.Payload.Round, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... it would be nice to sleep and/or backoff a little. But I guess that's a bit difficult.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might be able to use a simple circuit breaker at higher level (e.g. f3) to cover this. Updated the issue description.

Fix a bug where if `Host.RequestBroadcast` panics the requested message
is never added to the re-broadcast state.

Fix an inconsistent behaviour where error at requested broadcasts via
re-broadcast are returned instead of being silently logged.

Enhance emulator to allow pluggable signign logic with two additional
signing implementation: erroneous and panic.

Implement tests that assert expected behaviour at signing error or
panic.

Fixes #236
@masih masih enabled auto-merge September 5, 2024 15:47
@masih masih added this pull request to the merge queue Sep 5, 2024
Merged via the queue into main with commit de3c18e Sep 5, 2024
12 of 13 checks passed
@masih masih deleted the masih/test-bad-signers branch September 5, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing misbehaving signer
2 participants