Skip to content

Commit 2766a7c

Browse files
authored
fix(chain): address review feedback (#552)
1 parent 43bbf37 commit 2766a7c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tasks/message/watch_eth.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
const (
2626
// defaultEthCallTimeout is the timeout for sets of Ethereum client calls per transaction
2727
// (i.e. receipt and transaction data)
28-
defaultEthCallTimeout = time.Second
28+
defaultEthCallTimeout = 30 * time.Second
2929
)
3030

3131
// EthClient is an interface for the Ethereum client operations we need
@@ -129,6 +129,9 @@ func (mw *MessageWatcherEth) update() {
129129

130130
// Check if any of the transactions we have assigned are now confirmed
131131
for _, txHashStr := range txHashes {
132+
processed++
133+
processStart := time.Now()
134+
132135
txHash := common.HexToHash(txHashStr)
133136
log.Debugw("Checking transaction", "txHash", txHash.Hex())
134137

@@ -244,8 +247,14 @@ func (mw *MessageWatcherEth) update() {
244247
}
245248

246249
confirmed++
247-
processed++
248250
log.Infow("Successfully confirmed transaction", "txHash", txHash.Hex())
251+
252+
processDuration := time.Since(processStart)
253+
if processDuration > 5*time.Second {
254+
log.Warnw("Transaction processing took longer than expected",
255+
"txHash", txHash.Hex(),
256+
"duration", processDuration)
257+
}
249258
}
250259

251260
log.Infow("MessageWatcherEth update completed",

0 commit comments

Comments
 (0)