From 22629dee0b546968dfc2fdc975d15ab97c4aaf63 Mon Sep 17 00:00:00 2001 From: Alex Shorsher Date: Wed, 30 Oct 2024 11:55:35 -0400 Subject: [PATCH] don't retry operations that have conflict error If an operation receives a conflict error from the blockchain connector, currently it will continutally retry submitting that operation but it will never succeed. Instead, we shouldn't retry if we know the connector has received the submission. --- internal/batch/batch_processor.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/batch/batch_processor.go b/internal/batch/batch_processor.go index c4496f0ac..34076934d 100644 --- a/internal/batch/batch_processor.go +++ b/internal/batch/batch_processor.go @@ -633,6 +633,11 @@ func (bp *batchProcessor) dispatchBatch(payload *DispatchPayload) error { } } } + conflictErr, conflictTestOk := err.(operations.ConflictError) + if conflictTestOk && conflictErr.IsConflictError() { + // We know that the connector has received our batch, so we shouldn't need to retry + return true, nil + } } else { if core.IsPinned(payload.Batch.TX.Type) { payload.addMessageUpdate(payload.Messages, core.MessageStateReady, core.MessageStateSent)