-
Notifications
You must be signed in to change notification settings - Fork 7
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
Start submitting misbehavior reports #414
base: 01-15-add_loggingmisbehaviorservice
Are you sure you want to change the base?
Start submitting misbehavior reports #414
Conversation
Warning Rate limit exceeded@neekolas has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 2 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
68175fe
to
d8b159f
Compare
c5226fd
to
6443a91
Compare
d8b159f
to
d3f2f32
Compare
6443a91
to
7666a1b
Compare
d3f2f32
to
0319ff8
Compare
@@ -362,8 +365,19 @@ func (s *syncWorker) validateAndInsertEnvelope( | |||
lastNs = stream.lastEnvelope.OriginatorNs() | |||
} | |||
if env.OriginatorSequenceID() != lastSequenceID+1 || env.OriginatorNs() < lastNs { | |||
// TODO(rich) Submit misbehavior report and continue | |||
s.log.Error("Received out of order envelope") | |||
if report, err := misbehavior.NewSafetyFailureReport( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really struggle to read this inlined error handling. We generally don't use the format.
The explicit formatting is much more readable:
report, err := misbehavior.NewSafetyFailureReport(
stream.nodeID,
message_api.Misbehavior_MISBEHAVIOR_OUT_OF_ORDER,
true,
[]*envUtils.OriginatorEnvelope{stream.lastEnvelope, env},
)
if err != nil {
// Log the error if the report creation fails
s.log.Debug("Failed to create misbehavior report", zap.Error(err))
return // Exit early or handle it as appropriate
}
// Submit the misbehavior report
err = s.misbehaviorService.SafetyFailure(report)
if err != nil {
// Log the error if the report submission fails
s.log.Debug("Failed to submit misbehavior report", zap.Error(err))
}
TL;DR
Added misbehavior reporting for out-of-order envelopes in the sync worker.
What changed?
How to test?
Why make this change?
To improve network reliability by tracking and reporting out-of-order envelope submissions, which could indicate node misbehavior or network issues. This helps maintain the integrity of message ordering and enables better monitoring of node behavior.