Skip to content

Commit

Permalink
Fixing log spam. (#1931)
Browse files Browse the repository at this point in the history
Co-authored-by: StefanIliev545 <[email protected]>
  • Loading branch information
StefanIliev545 and StefanIliev545 committed May 24, 2024
1 parent 51bbb84 commit edc6caf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion go/common/errutil/errors_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go/enclave/nodetype/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion go/host/enclave/guardian.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit edc6caf

Please sign in to comment.