Skip to content

Commit

Permalink
chore: add logs, increase amount of db connections
Browse files Browse the repository at this point in the history
  • Loading branch information
dimazhornyk committed Dec 18, 2024
1 parent 7fadc04 commit 2de78aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions core/node/da_dispatcher/src/da_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@ impl DataAvailabilityDispatcher {

/// Polls the data availability layer for inclusion data, and saves it in the database.
async fn poll_for_inclusion(&self) -> anyhow::Result<()> {
tracing::debug!("Polling for inclusion data");
let mut conn = self.pool.connection_tagged("da_dispatcher").await?;
let blob_info = conn
.data_availability_dal()
.get_first_da_blob_awaiting_inclusion()
.await?;
drop(conn);

tracing::debug!("Got blob_info: {:?}", blob_info);
let Some(blob_info) = blob_info else {
return Ok(());
};
Expand All @@ -152,6 +154,7 @@ impl DataAvailabilityDispatcher {
Some(InclusionData { data: vec![] })
};

tracing::debug!("inclusion_data.is_some(): {:?}", inclusion_data.is_some());
let Some(inclusion_data) = inclusion_data else {
return Ok(());
};
Expand All @@ -165,6 +168,10 @@ impl DataAvailabilityDispatcher {
.await?;
drop(conn);

tracing::debug!(
"Saved inclusion data for batch_number: {}",
blob_info.l1_batch_number
);
let inclusion_latency = Utc::now().signed_duration_since(blob_info.sent_at);
if let Ok(latency) = inclusion_latency.to_std() {
METRICS.inclusion_latency.observe(latency);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl WiringLayer for DataAvailabilityDispatcherLayer {

async fn wire(self, input: Self::Input) -> Result<Self::Output, WiringError> {
// A pool with size 2 is used here because there are 2 functions within a task that execute in parallel
let master_pool = input.master_pool.get_custom(2).await?;
let master_pool = input.master_pool.get_custom(4).await?;
let da_client = input.da_client.0;

if let Some(limit) = da_client.blob_size_limit() {
Expand Down

0 comments on commit 2de78aa

Please sign in to comment.