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

Add some logging when cbrs events after the cbrs disable time are dro… #960

Merged
merged 4 commits into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions ingest/src/server_mobile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,19 @@ where
request: Request<CellHeartbeatReqV1>,
) -> GrpcResult<CellHeartbeatRespV1> {
let timestamp = Utc::now();
let event = request.into_inner();

if timestamp >= self.cbrs_disable_time {
let pubkey = PublicKeyBinary::from(event.pub_key);
tracing::info!(
?pubkey,
"dropping CellHeartbeatReqV1 because cbrs disable time has passed"
);
return Ok(Response::new(CellHeartbeatRespV1 {
id: timestamp.to_string(),
}));
}

let event = request.into_inner();

custom_tracing::record_b58("pub_key", &event.pub_key);

let report = self
Expand Down Expand Up @@ -280,6 +284,16 @@ where
let event = request.into_inner();

if is_data_transfer_for_cbrs(&event) && timestamp > self.cbrs_disable_time {
let pubkey = event
.data_transfer_usage
.map(|usage| PublicKeyBinary::from(usage.pub_key))
.ok_or_else(|| anyhow::anyhow!("No pubkey available"));

tracing::info!(
?pubkey,
"dropping DataTransferSessionReqV1 because cbrs disable time has passed"
);

return Ok(Response::new(DataTransferSessionRespV1 {
id: timestamp.to_string(),
}));
Expand Down