Skip to content

Commit

Permalink
No alert if reorg happens (#2371)
Browse files Browse the repository at this point in the history
# Description
Related to staging alert:
https://cowservices.slack.com/archives/C037PB929ME/p1707099846201309

Since `EventHandler` and `OnSettlementEventUpdater` are racing to update
on each new block, in case the reorg happens and
`OnSettlementEventUpdater` is faster, it will potentially catch an event
containing tx hash that was reorged.

This PR lowers the severity of this issue (we don't want slack alerts
for this). This is a temporary fix until we make event handling
pipelined.
  • Loading branch information
sunce86 authored and mfw78 committed Feb 8, 2024
1 parent 85ec9f6 commit 87c5ce2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/autopilot/src/on_settlement_event_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@ impl OnSettlementEventUpdater {
let hash = H256(event.tx_hash.0);
tracing::debug!("updating settlement details for tx {hash:?}");

let transaction = self
.eth
.transaction(hash)
.await?
.with_context(|| format!("no tx {hash:?}"))?;
let Some(transaction) = self.eth.transaction(hash).await? else {
tracing::warn!(?hash, "no tx found, reorg happened");
return Ok(false);
};

let (auction_id, auction_data) =
match Self::recover_auction_id_from_calldata(&mut ex, &transaction).await? {
Expand Down

0 comments on commit 87c5ce2

Please sign in to comment.