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

fix(bridge-withdrawer): also set metric when value 0 #1771

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions crates/astria-bridge-withdrawer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Set `batch_total_settled_value` metric to 0 when no withdrawals are settled [#1778](https://github.com/astriaorg/astria/pull/1768)

## [1.0.0] - 2024-10-25

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,17 +380,16 @@ async fn get_and_forward_block_events(
if actions.is_empty() {
info!(
"no withdrawal actions found for block `{block_hash}` at rollup height \
`{rollup_height}; skipping"
`{rollup_height}"
);
} else {
submitter_handle
.send_batch(Batch {
actions,
rollup_height,
})
.await
.wrap_err("failed to send batched events; receiver dropped?")?;
}
submitter_handle
.send_batch(Batch {
actions,
rollup_height,
})
.await
.wrap_err("failed to send batched events; receiver dropped?")?;

Ok(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ impl Submitter {
metrics,
..
} = self;

if actions.is_empty() {
metrics.set_batch_total_settled_value(0);

return Ok(());
}

// get nonce and make unsigned transaction
let nonce = get_pending_nonce(
sequencer_grpc_client.clone(),
Expand Down
Loading