Skip to content

Commit

Permalink
add some logs to see heartbeats
Browse files Browse the repository at this point in the history
  • Loading branch information
musitdev committed Jan 21, 2025
1 parent acfd786 commit 5f6de96
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ where
(blob.data, blob.timestamp, blob.blob_id, blob.height)
}
blob_response::BlobType::HeartbeatBlob(_) => {
tracing::info!("Receive heartbeat blob");
// Do nothing.
return Ok(());
}
Expand Down
6 changes: 6 additions & 0 deletions protocol-units/da/movement/protocol/da/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ pub trait DaOperations: Send + Sync {
&self,
start_height: u64,
) -> Pin<Box<dyn Future<Output = Result<DaBlobStream, DaError>> + Send + '_>> {
tracing::info!("TEST Da lib DaOperations stream_da_blobs_from_height start");
let fut = async move {
let certificate_stream = self.stream_certificates().await?;
let stream = try_stream! {
Expand All @@ -119,19 +120,22 @@ pub trait DaOperations: Send + Sync {

match certificate {
Ok(Certificate::Height(height)) if height > last_height => {
tracing::info!("TEST Da lib DaOperations stream_da_blobs_from_height got new accepted blob at height:{height}");
let blob_stream = self
.stream_da_blobs_between_heights(last_height, height)
.await?;
tokio::pin!(blob_stream);

while let Some(blob) = blob_stream.next().await {
tracing::info!("TEST Da lib DaOperations stream_da_blobs_from_height send new accepted blob at height:{height}");
yield blob?;
}

last_height = height;
}
// Already executed Height are use to send Heartbeat.
Ok(Certificate::Height(height)) => {
tracing::info!("TEST Da lib DaOperations stream_da_blobs_from_height got old height:{height}");
//old certificate, use to send Heartbeat block.
let blob_stream = self
.stream_da_blobs_between_heights(height, height)
Expand All @@ -143,10 +147,12 @@ pub trait DaOperations: Send + Sync {
// Ack use heigth zero to identify heart beat block.
// Should be changed to a type.
let heart_blob = (DaHeight(0u64), blob);
tracing::info!("TEST Da lib DaOperations stream_da_blobs_from_height got old height:{height} send heartbeat.");
yield heart_blob;
}
}
Ok(Certificate::Nolo) => {
tracing::info!("TEST Da lib DaOperations stream_da_blobs_from_height got Certificate::Nolo");
// Ignore Nolo
}
// Warn log non-fatal certificate errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ where
let response = StreamReadFromHeightResponse {
blob: Some(response_content)
};
tracing::info!("TEST passthrough LightNode stream_read_from_height send blob");
yield response;
}

Expand Down

0 comments on commit 5f6de96

Please sign in to comment.