From 71a3c27757bd37c97b6e5e58301f3ee45b931b46 Mon Sep 17 00:00:00 2001 From: olegfomenko2002 Date: Thu, 21 Dec 2023 13:13:13 +0200 Subject: [PATCH] adding AllowResubmit config to chain --- internal/config/evm.go | 1 + internal/services/relayer/main.go | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/config/evm.go b/internal/config/evm.go index 651e70a..ed032be 100644 --- a/internal/config/evm.go +++ b/internal/config/evm.go @@ -38,6 +38,7 @@ type EVMChain struct { RPC *ethclient.Client `fig:"-"` RPCURL string `fig:"rpc,required"` ChainID *big.Int `fig:"chain_id,required"` + AllowResubmit bool `fig:"allow_resubmit"` } func NewEVMer(getter kv.Getter) EVMer { diff --git a/internal/services/relayer/main.go b/internal/services/relayer/main.go index b9d70c6..822f9e8 100644 --- a/internal/services/relayer/main.go +++ b/internal/services/relayer/main.go @@ -72,8 +72,10 @@ func (c *Service) StateRelay(ctx context.Context, state string, chainName string return "", ErrEntryNotFound } - if err := c.checkTransitionNotExist(ctx, state, chainName); err != nil { - return "", err + if !chain.AllowResubmit { + if err := c.checkTransitionNotExist(ctx, state, chainName); err != nil { + return "", err + } } return c.processIdentityStateTransfer(ctx, chain, entry, waitTxConfirm)