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

feat: adds more debugging statements to the finalizer loop 3 #71

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions chain-events/src/block_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,16 @@ impl BlockEvents {
.number
.expect("last block always has a number; qed");

vlog::info!(
"Filtering logs from {} to {}",
from_block
.into()
.as_number()
.expect("always starting from a numbered block; qed")
.as_u64(),
latest_block.as_u64(),
);

let past_filter = Filter::new()
.from_block(from_block)
.to_block(latest_block)
Expand Down
12 changes: 12 additions & 0 deletions finalizer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,12 @@ where
// * erc20 has denied a tx for some internal reasons.
async fn process_unsuccessful(&mut self) -> Result<()> {
if self.unsuccessful.is_empty() {
vlog::debug!("no unsuccessful withdrawals");
return Ok(());
}

let predicted = std::mem::take(&mut self.unsuccessful);
vlog::debug!("requesting finalization status of withdrawals");
let are_finalized = self.get_finalized_withdrawals(&predicted).await?;

let mut already_finalized = vec![];
Expand All @@ -299,10 +301,20 @@ where
}
}

vlog::debug!(
"setting unsuccessful finalization attempts to {} withdrawals",
unsuccessful.len()
);

// Either finalization tx has failed for these, or they were
// predicted to fail.
storage::inc_unsuccessful_finalization_attempts(&self.pgpool, &unsuccessful).await?;

vlog::debug!(
"setting already finalized status to {} withdrawals",
already_finalized.len()
);

// if the withdrawal has already been finalized set its
// finalization transaction to zero which is signals exactly this
// it is known that withdrawal has been fianlized but not known
Expand Down
2 changes: 1 addition & 1 deletion storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ pub async fn get_withdrawals_with_no_data(
max_committed,
max_seen
WHERE
id >= coalesce(max_seen.max, 1)
id > coalesce(max_seen.max, 1)
AND l2_block_number <= max_committed.max
ORDER BY
l2_block_number
Expand Down
Loading