From f872d0be44b0368da78170cf97004eceeaf50b27 Mon Sep 17 00:00:00 2001 From: Leo Date: Thu, 22 Oct 2020 13:36:08 +0200 Subject: [PATCH] bridge: improve VAA submission logging --- bridge/cmd/guardiand/processor.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bridge/cmd/guardiand/processor.go b/bridge/cmd/guardiand/processor.go index b93db1e5..f9967648 100644 --- a/bridge/cmd/guardiand/processor.go +++ b/bridge/cmd/guardiand/processor.go @@ -6,6 +6,7 @@ import ( "encoding/hex" "fmt" "math" + "strings" "time" ethcommon "github.com/ethereum/go-ethereum/common" @@ -244,10 +245,16 @@ func vaaConsensusProcessor(lockC chan *common.ChainLock, setC chan *common.Guard tx, err := devnet.SubmitVAA(timeout, *ethRPC, signed) cancel() if err != nil { - logger.Error("failed to submit lockup to Ethereum", zap.Error(err)) + if strings.Contains(err.Error(), "VAA was already executed") { + logger.Info("lockup already submitted to Ethereum by another node, ignoring", + zap.Error(err), zap.String("digest", hash)) + } else { + logger.Error("failed to submit lockup to Ethereum", + zap.Error(err), zap.String("digest", hash)) + } break } - logger.Info("lockup submitted to Ethereum", zap.Any("tx", tx)) + logger.Info("lockup submitted to Ethereum", zap.Any("tx", tx), zap.String("digest", hash)) } // Cross-submit to Solana for data availability @@ -299,7 +306,7 @@ func checkDevModeGuardianSetUpdate(ctx context.Context, vaaC chan *vaa.VAA, gs * return fmt.Errorf("failed to submit devnet guardian set change: %v") } - logger.Info("devnet guardian set change submitted to Ethereum", zap.Any("tx", tx)) + logger.Info("devnet guardian set change submitted to Ethereum", zap.Any("tx", tx), zap.Any("vaa", v)) // Submit VAA to Solana as well. This is asynchronous and can fail, leading to inconsistent devnet state. vaaC <- v