From 6120e126ce804d5f43beb714216311897df31b62 Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Fri, 28 Mar 2025 14:52:09 +0100 Subject: [PATCH 1/2] fix(txm): heap out of memory --- packages/txm/lib/BlockMonitor.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/txm/lib/BlockMonitor.ts b/packages/txm/lib/BlockMonitor.ts index 542ce78eb2..5d37fa0890 100644 --- a/packages/txm/lib/BlockMonitor.ts +++ b/packages/txm/lib/BlockMonitor.ts @@ -56,9 +56,17 @@ export class BlockMonitor { private resetBlockSubscription() { TxmMetrics.getInstance().resetBlockMonitorCounter.add(1) this.txmgr.rpcLivenessMonitor.trackError() + + if (this.blockTimeout) { + clearTimeout(this.blockTimeout) + this.blockTimeout = undefined + } + if (this.unwatch) { this.unwatch() + this.unwatch = undefined } - this.start() + + setTimeout(() => this.start(), 1000) } } From d3a8679ef9819f1e36d40a0c84134de68ac26189 Mon Sep 17 00:00:00 2001 From: GabrielMartinezRodriguez Date: Fri, 28 Mar 2025 15:03:29 +0100 Subject: [PATCH 2/2] chore(txm): decreased time after retry connection --- packages/txm/lib/BlockMonitor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/txm/lib/BlockMonitor.ts b/packages/txm/lib/BlockMonitor.ts index 5d37fa0890..978f70aad7 100644 --- a/packages/txm/lib/BlockMonitor.ts +++ b/packages/txm/lib/BlockMonitor.ts @@ -67,6 +67,6 @@ export class BlockMonitor { this.unwatch = undefined } - setTimeout(() => this.start(), 1000) + setTimeout(() => this.start(), 500) } }