Skip to content

fix(bitcoin-da): propagate get_block_info error in determine_tx_status instead of .unwrap_or(0)#3263

Open
amathxbt wants to merge 2 commits into
chainwayxyz:nightlyfrom
amathxbt:fix/monitoring-determine-tx-status-block-height-error
Open

fix(bitcoin-da): propagate get_block_info error in determine_tx_status instead of .unwrap_or(0)#3263
amathxbt wants to merge 2 commits into
chainwayxyz:nightlyfrom
amathxbt:fix/monitoring-determine-tx-status-block-height-error

Conversation

@amathxbt

@amathxbt amathxbt commented May 2, 2026

Copy link
Copy Markdown

Fixes #3262

Problem

.unwrap_or(0) on get_block_info in determine_tx_status silently uses block_height: 0 on RPC failures, corrupting finality calculations.

Fix

Replace with .await?.height as u64; to propagate the error.

…s instead of defaulting to 0

Using .unwrap_or(0) silently sets block_height to 0 when get_block_info
fails for a confirmed transaction, corrupting the monitored status with
a false genesis-block height. Propagate the error with ? instead.
@amathxbt amathxbt requested a review from a team as a code owner May 2, 2026 13:46
@auto-assign auto-assign Bot requested a review from ercecan May 2, 2026 13:46
jfldde
jfldde previously approved these changes May 5, 2026
eyusufatik
eyusufatik previously approved these changes May 5, 2026
@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.4%. Comparing base (0f40b48) to head (33790f1).
⚠️ Report is 2 commits behind head on nightly.

Additional details and impacted files
Files with missing lines Coverage Δ
crates/bitcoin-da/src/monitoring.rs 81.4% <100.0%> (-0.1%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amathxbt amathxbt requested review from eyusufatik and jfldde May 5, 2026 13:27
@eyusufatik

Copy link
Copy Markdown
Member

run lint-fix please

@amathxbt amathxbt dismissed stale reviews from eyusufatik and jfldde via f2acf78 May 6, 2026 13:39
@amathxbt

amathxbt commented May 6, 2026

Copy link
Copy Markdown
Author

Done! Ran cargo +nightly fmt --all

the method chain in determine_tx_status was collapsed to a single line as rustfmt prefers. Commit: f2acf78

@amathxbt

amathxbt commented May 6, 2026

Copy link
Copy Markdown
Author

@jfldde @eyusufatik lint-fix was applied in a previous commit. Ready for re-review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(bitcoin-da): determine_tx_status silently uses block_height=0 when get_block_info fails

3 participants