diff --git a/go/common/errutil/errors_util.go b/go/common/errutil/errors_util.go index 62823f6f46..2e72aeb154 100644 --- a/go/common/errutil/errors_util.go +++ b/go/common/errutil/errors_util.go @@ -23,7 +23,8 @@ var ( ErrBlockAncestorNotFound = errors.New("block ancestor not found") ErrBlockForBatchNotFound = errors.New("block for batch not found") ErrAncestorBatchNotFound = errors.New("parent for batch not found") - ErrCrossChainBundleRepublished = errors.New("Root already added to the message bus") + ErrCrossChainBundleRepublished = errors.New("root already added to the message bus") + ErrCrossChainBundleNoBatches = errors.New("no batches for cross chain bundle") ) // BlockRejectError is used as a standard format for error response from enclave for block submission errors diff --git a/go/enclave/nodetype/common.go b/go/enclave/nodetype/common.go index c9a28978b4..197fef08d1 100644 --- a/go/enclave/nodetype/common.go +++ b/go/enclave/nodetype/common.go @@ -2,11 +2,11 @@ package nodetype import ( "context" - "fmt" "math/big" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/ten-protocol/go-ten/go/common" + "github.com/ten-protocol/go-ten/go/common/errutil" "github.com/ten-protocol/go-ten/go/enclave/storage" ) @@ -17,7 +17,7 @@ func ExportCrossChainData(ctx context.Context, storage storage.Storage, fromSeqN } if len(canonicalBatches) == 0 { - return nil, fmt.Errorf("no batches found for export of cross chain data") + return nil, errutil.ErrCrossChainBundleNoBatches } blockHash := canonicalBatches[len(canonicalBatches)-1].Header.L1Proof diff --git a/go/host/enclave/guardian.go b/go/host/enclave/guardian.go index 7c472e2d94..2c6d6a6a36 100644 --- a/go/host/enclave/guardian.go +++ b/go/host/enclave/guardian.go @@ -651,7 +651,9 @@ func (g *Guardian) periodicBundleSubmission() { bundle, err := g.enclaveClient.ExportCrossChainData(context.Background(), fromSequenceNumber, to.Uint64()) if err != nil { - g.logger.Error("Unable to export cross chain bundle from enclave", log.ErrKey, err) + if !errors.Is(err, errutil.ErrCrossChainBundleNoBatches) { + g.logger.Error("Unable to export cross chain bundle from enclave", log.ErrKey, err) + } continue }