From 1d61cc8dc259ecfa1fca9494f1a5d35b1da1dda5 Mon Sep 17 00:00:00 2001 From: Alexxxxxx <118710506+alexgao001@users.noreply.github.com> Date: Fri, 22 Sep 2023 10:37:53 +0800 Subject: [PATCH] fix tx already sent by inturn relayer but fail to udpate DB tx status (#88) --- assembler/bsc_assembler.go | 2 +- executor/greenfield_executor.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/assembler/bsc_assembler.go b/assembler/bsc_assembler.go index 79a7fc6..6cb4308 100644 --- a/assembler/bsc_assembler.go +++ b/assembler/bsc_assembler.go @@ -186,7 +186,7 @@ func (a *BSCAssembler) process(channelId types.ChannelId) error { // broadcast on Node2 will fail due to inconsistency of nonce and channel sequence. // Even the inturn relayer can resume crosschain delivery at next block(Because realyer would retry batch2 at block H+1). But it would // waste plenty of gas. In that case, pasue the relayer 1 block. calibrate inturn relayer nonce and sequence - if errors.IsOf(err, sdkErrors.ErrWrongSequence, oracletypes.ErrInvalidReceiveSequence) { + if errors.IsOf(err, sdkErrors.ErrWrongSequence, sdkErrors.ErrTxInMempoolCache, oracletypes.ErrInvalidReceiveSequence) { newNonce, nonceErr := a.greenfieldExecutor.GetNonceOnNextBlock() if nonceErr != nil { return nonceErr diff --git a/executor/greenfield_executor.go b/executor/greenfield_executor.go index 968bf6a..ac39a63 100644 --- a/executor/greenfield_executor.go +++ b/executor/greenfield_executor.go @@ -327,6 +327,10 @@ func (e *GreenfieldExecutor) ClaimPackages(client *GreenfieldClient, payloadBts return "", sdkErrors.ErrWrongSequence } + if txRes.Codespace == sdkErrors.RootCodespace && txRes.Code == sdkErrors.ErrTxInMempoolCache.ABCICode() { + return "", sdkErrors.ErrTxInMempoolCache + } + if txRes.Code != 0 { return "", fmt.Errorf("claim error, code=%d, log=%s", txRes.Code, txRes.RawLog) }