diff --git a/zetaclient/zetacore/client_monitor.go b/zetaclient/zetacore/client_monitor.go index 659ef2a77d..b19629add5 100644 --- a/zetaclient/zetacore/client_monitor.go +++ b/zetaclient/zetacore/client_monitor.go @@ -31,7 +31,7 @@ func (c *Client) MonitorVoteOutboundResult( }() call := func() error { - return c.monitorVoteOutboundResult(ctx, zetaTxHash, retryGasLimit, msg) + return retry.Retry(c.monitorVoteOutboundResult(ctx, zetaTxHash, retryGasLimit, msg)) } err := retryWithBackoff(call, monitorRetryCount, monitorInterval/2, monitorInterval) @@ -106,7 +106,7 @@ func (c *Client) MonitorVoteInboundResult( }() call := func() error { - return c.monitorVoteInboundResult(ctx, zetaTxHash, retryGasLimit, msg) + return retry.Retry(c.monitorVoteInboundResult(ctx, zetaTxHash, retryGasLimit, msg)) } err := retryWithBackoff(call, monitorRetryCount, monitorInterval/2, monitorInterval) diff --git a/zetaclient/zetacore/client_vote.go b/zetaclient/zetacore/client_vote.go index 189c6fd0d1..a6e0116297 100644 --- a/zetaclient/zetacore/client_vote.go +++ b/zetaclient/zetacore/client_vote.go @@ -11,6 +11,7 @@ import ( "github.com/zeta-chain/zetacore/pkg/retry" "github.com/zeta-chain/zetacore/x/crosschain/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" + zctx "github.com/zeta-chain/zetacore/zetaclient/context" ) // PostVoteBlockHeader posts a vote on an observed block header @@ -171,9 +172,12 @@ func (c *Client) PostVoteOutbound( } go func() { - // Ideally we need to bump go to v1.21+ and use context.WithoutCancel(...) - anotherCtx := context.Background() - _ = c.MonitorVoteOutboundResult(anotherCtx, zetaTxHash, retryGasLimit, msg) + ctxForWorker := zctx.Copy(ctx, context.Background()) + + errMonitor := c.MonitorVoteOutboundResult(ctxForWorker, zetaTxHash, retryGasLimit, msg) + if errMonitor != nil { + c.logger.Error().Err(err).Msg("PostVoteOutbound: failed to monitor vote outbound result") + } }() return zetaTxHash, ballotIndex, nil @@ -215,9 +219,12 @@ func (c *Client) PostVoteInbound( } go func() { - // Ideally we need to bump go to v1.21+ and use context.WithoutCancel(...) - anotherCtx := context.Background() - _ = c.MonitorVoteInboundResult(anotherCtx, zetaTxHash, retryGasLimit, msg) + ctxForWorker := zctx.Copy(ctx, context.Background()) + + errMonitor := c.MonitorVoteInboundResult(ctxForWorker, zetaTxHash, retryGasLimit, msg) + if errMonitor != nil { + c.logger.Error().Err(err).Msg("PostVoteInbound: failed to monitor vote inbound result") + } }() return zetaTxHash, ballotIndex, nil