From 657350c47eba69bb1a51dd2422a62676dc49c663 Mon Sep 17 00:00:00 2001 From: Charlie Chen Date: Mon, 10 Feb 2025 11:29:25 -0600 Subject: [PATCH 1/2] schedule bitcoin TSS keysign on configured interval --- zetaclient/chains/bitcoin/bitcoin.go | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/zetaclient/chains/bitcoin/bitcoin.go b/zetaclient/chains/bitcoin/bitcoin.go index ff09782ba2..1cda749c64 100644 --- a/zetaclient/chains/bitcoin/bitcoin.go +++ b/zetaclient/chains/bitcoin/bitcoin.go @@ -133,6 +133,8 @@ func (b *Bitcoin) scheduleCCTX(ctx context.Context) error { chain := b.observer.Chain() chainID := chain.ChainId lookahead := b.observer.ChainParams().OutboundScheduleLookahead + // #nosec G115 positive + scheduleInterval := uint64(b.observer.ChainParams().OutboundScheduleInterval) cctxList, _, err := b.observer.ZetacoreClient().ListPendingCCTX(ctx, chain) if err != nil { @@ -178,13 +180,16 @@ func (b *Bitcoin) scheduleCCTX(ctx context.Context) error { continue } - go b.signer.TryProcessOutbound( - ctx, - cctx, - b.observer, - b.observer.ZetacoreClient(), - zetaHeight, - ) + // schedule TSS keysign if retry interval has arrived + if nonce%scheduleInterval == zetaHeight%scheduleInterval { + go b.signer.TryProcessOutbound( + ctx, + cctx, + b.observer, + b.observer.ZetacoreClient(), + zetaHeight, + ) + } } return nil From acac512d2e19567c94f033a87a554931f86fce49 Mon Sep 17 00:00:00 2001 From: Charlie Chen Date: Mon, 10 Feb 2025 11:40:20 -0600 Subject: [PATCH 2/2] add changelog entry --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 4a2a0da9f9..48ba0699f8 100644 --- a/changelog.md +++ b/changelog.md @@ -15,6 +15,7 @@ ### Fixes * [3501](https://github.com/zeta-chain/node/pull/3501) - fix E2E test failure caused by nil `ConfirmationParams` for Solana and TON +* [3509](https://github.com/zeta-chain/node/pull/3509) - schedule Bitcoin TSS keysign on interval to avoid TSS keysign spam ### Tests