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 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