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

[Merged by Bors] - Change malfeasance streaming guarantees #6777

Closed
wants to merge 1 commit into from

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Mar 7, 2025

Motivation

The malfeasance stream (v2alpha1 and v2beta1) right now guarantees that every malfeasance event is streamed at most once, this changes the guarantee to at least once.

Description

When streaming proofs we read them from the DB and from the event bus. Without caching we can only guarantee that we stream every proof at most once or at least once. At the moment we have occasional systest fails because the proof we are looking for has not been streamed, due to the event being missed while reading from the DB.

To ensure the systests are not failing because of a missed event, I change the behavior to possibly stream the same proof twice. For the systest this doesn't matter, since we only check if we received the proof at all.

De-duplicating on the server side is costly: requires caching and deduplicating of proofs already sent for every connected client. So instead I think the best way is to put the de-duplication effort on the client.

Test Plan

n/a

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed
  • Update changelog as needed

@fasmat fasmat self-assigned this Mar 7, 2025
@fasmat
Copy link
Member Author

fasmat commented Mar 7, 2025

bors merge

Copy link

codecov bot commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 6 lines in your changes missing coverage. Please review.

Project coverage is 76.8%. Comparing base (3a1369e) to head (290c55f).
Report is 3 commits behind head on develop.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
api/grpcserver/v2alpha1/malfeasance.go 66.6% 2 Missing and 1 partial ⚠️
api/grpcserver/v2beta1/malfeasance.go 66.6% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #6777   +/-   ##
=======================================
  Coverage     76.8%   76.8%           
=======================================
  Files          369     369           
  Lines        50285   50291    +6     
=======================================
+ Hits         38635   38665   +30     
+ Misses        9435    9416   -19     
+ Partials      2215    2210    -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

spacemesh-bors bot pushed a commit that referenced this pull request Mar 7, 2025
## Motivation

The malfeasance stream (v2alpha1 and v2beta1) right now guarantees that every malfeasance event is streamed at most once, this changes the guarantee to at least once.
@spacemesh-bors
Copy link

spacemesh-bors bot commented Mar 7, 2025

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title Change malfeasance streaming guarantees [Merged by Bors] - Change malfeasance streaming guarantees Mar 7, 2025
@spacemesh-bors spacemesh-bors bot closed this Mar 7, 2025
@spacemesh-bors spacemesh-bors bot deleted the change-streaming-guarantees branch March 7, 2025 12:35
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.

2 participants