Skip to content

fix(bitcoin-da): avoid monitored_txs write lock across RPC in monitor_transaction#3253

Open
amathxbt wants to merge 2 commits into
chainwayxyz:nightlyfrom
amathxbt:fix/monitoring-write-lock-rpc-monitor-transaction
Open

fix(bitcoin-da): avoid monitored_txs write lock across RPC in monitor_transaction#3253
amathxbt wants to merge 2 commits into
chainwayxyz:nightlyfrom
amathxbt:fix/monitoring-write-lock-rpc-monitor-transaction

Conversation

@amathxbt

@amathxbt amathxbt commented May 2, 2026

Copy link
Copy Markdown

Fixes #3252

Problem

monitor_transaction holds the monitored_txs write lock while calling get_block_count(), blocking all concurrent readers/writers for a full network round-trip — same pattern as #3234.

Fix

Move self.client.get_block_count().await? to before the write lock is acquired.

… monitor_transaction

The write lock on `monitored_txs` was acquired before a `get_block_count()`
RPC call, blocking all readers/writers for the duration of a network
round-trip. Move the RPC call before lock acquisition.
@amathxbt amathxbt requested a review from a team as a code owner May 2, 2026 13:46
Comment thread crates/bitcoin-da/src/monitoring.rs Outdated
jfldde
jfldde previously approved these changes May 5, 2026
@amathxbt amathxbt requested a review from jfldde May 5, 2026 09:46
@amathxbt

amathxbt commented May 6, 2026

Copy link
Copy Markdown
Author

Done @jfldde @eyusufatik removed the low-value comment at line 485 as requested. Commit: 760dffb

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): monitor_transaction holds monitored_txs write lock across async RPC call

2 participants