From d82015798c242c51c1ddb5270ef4b9e5dc6da200 Mon Sep 17 00:00:00 2001 From: "zero.qn" Date: Mon, 9 May 2022 11:19:04 +0800 Subject: [PATCH] refactor(withdrawal_unlocker): retry in case get unlock tx error Avoid "lock" withdrawal cell --- crates/block-producer/src/withdrawal_unlocker.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/block-producer/src/withdrawal_unlocker.rs b/crates/block-producer/src/withdrawal_unlocker.rs index 4a272c518..52c8afa8d 100644 --- a/crates/block-producer/src/withdrawal_unlocker.rs +++ b/crates/block-producer/src/withdrawal_unlocker.rs @@ -84,7 +84,9 @@ impl FinalizedWithdrawalUnlocker { for (tx_hash, withdrawal_to_unlock) in self.unlock_txs.iter() { match rpc_client.get_transaction_status(*tx_hash).await { Err(err) => { - log::debug!("[unlock withdrawal] get unlock tx failed {}", err); + // Always drop this unlock tx and retry to avoid "lock" withdrawal cell + log::info!("[unlock withdrawal] get unlock tx failed {}, drop it", err); + drop_txs.push(*tx_hash); } Ok(None) => { log::info!("[unlock withdrawal] dropped unlock tx {}", tx_hash.pack());