From 94f75ff27b79b57ef1a2b05f3027fb9833cfdc12 Mon Sep 17 00:00:00 2001 From: Mahsa Moosavi Date: Wed, 3 Sep 2025 11:22:35 -0400 Subject: [PATCH 1/4] only send notion-based slack alerts when --writeToNotion is enabled --- packages/retryable-monitor/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/retryable-monitor/index.ts b/packages/retryable-monitor/index.ts index 3932aee..ae69c0b 100644 --- a/packages/retryable-monitor/index.ts +++ b/packages/retryable-monitor/index.ts @@ -96,9 +96,11 @@ const processChildChain = async ( enableAlerting, continuous, onFailedRetryableFound: async ticket => { + if (writeToNotion) return; // skip old alerts if writeToNotion is enabled await handleFailedRetryablesFound(ticket, writeToNotion) }, onRedeemedRetryableFound: async ticket => { + if (writeToNotion) return; // skip old alerts if writeToNotion is enabled await handleRedeemedRetryablesFound(ticket, writeToNotion) }, }) @@ -123,9 +125,11 @@ const processChildChain = async ( toBlock, enableAlerting, onFailedRetryableFound: async ticket => { + if (writeToNotion) return; // skip old alerts if writeToNotion is enabled await handleFailedRetryablesFound(ticket, writeToNotion) }, onRedeemedRetryableFound: async ticket => { + if (writeToNotion) return; // skip old alerts if writeToNotion is enabled await handleRedeemedRetryablesFound(ticket, writeToNotion) }, }) From d33f9b7296fc4d31c11092b2f40d56ec91db2590 Mon Sep 17 00:00:00 2001 From: Mahsa Moosavi Date: Wed, 3 Sep 2025 12:35:07 -0400 Subject: [PATCH 2/4] address review comments --- .../handlers/handleFailedRetryablesFound.ts | 11 ++++++----- packages/retryable-monitor/index.ts | 4 ---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts b/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts index b255f0d..d4911a2 100644 --- a/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts +++ b/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts @@ -13,10 +13,12 @@ export const handleFailedRetryablesFound = async ( ticket: OnFailedRetryableFoundParams, writeToNotion: boolean ) => { - // report the Retryable in Slack - await reportFailedRetryables(ticket) + // 1) Ops Slack alert: only when NOT writing to Notion + if (!writeToNotion) { + await reportFailedRetryables(ticket) + } - // sync the Retryable to Notion + // 2) Notion sync: only when writing to Notion (unchanged behavior) if (writeToNotion) { const { tokenDepositData, @@ -28,7 +30,6 @@ export const handleFailedRetryablesFound = async ( const childChainProvider = new providers.JsonRpcProvider( String(childChain.orbitRpcUrl) ) - const parentChainProvider = new providers.JsonRpcProvider( String(childChain.parentRpcUrl) ) @@ -38,7 +39,6 @@ export const handleFailedRetryablesFound = async ( childChain, parentChainProvider ) - const l2CallValueFormatted = formattedCallValueFull .replace('\n\t *Child chain callvalue:* ', '') .trim() @@ -58,6 +58,7 @@ export const handleFailedRetryablesFound = async ( 6 )} ${symbol} ($${usdValue.toFixed(2)}) (${address})` } + const { l2GasPrice, l2GasPriceAtCreation } = await getGasInfo( childChainRetryableReport.createdAtBlockNumber, childChainRetryableReport.id, diff --git a/packages/retryable-monitor/index.ts b/packages/retryable-monitor/index.ts index ae69c0b..3932aee 100644 --- a/packages/retryable-monitor/index.ts +++ b/packages/retryable-monitor/index.ts @@ -96,11 +96,9 @@ const processChildChain = async ( enableAlerting, continuous, onFailedRetryableFound: async ticket => { - if (writeToNotion) return; // skip old alerts if writeToNotion is enabled await handleFailedRetryablesFound(ticket, writeToNotion) }, onRedeemedRetryableFound: async ticket => { - if (writeToNotion) return; // skip old alerts if writeToNotion is enabled await handleRedeemedRetryablesFound(ticket, writeToNotion) }, }) @@ -125,11 +123,9 @@ const processChildChain = async ( toBlock, enableAlerting, onFailedRetryableFound: async ticket => { - if (writeToNotion) return; // skip old alerts if writeToNotion is enabled await handleFailedRetryablesFound(ticket, writeToNotion) }, onRedeemedRetryableFound: async ticket => { - if (writeToNotion) return; // skip old alerts if writeToNotion is enabled await handleRedeemedRetryablesFound(ticket, writeToNotion) }, }) From 740d6f4da150a3191f5bfdafee6060998068f0fe Mon Sep 17 00:00:00 2001 From: Mahsa Moosavi Date: Wed, 3 Sep 2025 12:42:59 -0400 Subject: [PATCH 3/4] tweak the comment --- .../retryable-monitor/handlers/handleFailedRetryablesFound.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts b/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts index d4911a2..e234c0d 100644 --- a/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts +++ b/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts @@ -13,12 +13,11 @@ export const handleFailedRetryablesFound = async ( ticket: OnFailedRetryableFoundParams, writeToNotion: boolean ) => { - // 1) Ops Slack alert: only when NOT writing to Notion + //old lack alert: only when not writing to Notion if (!writeToNotion) { await reportFailedRetryables(ticket) } - // 2) Notion sync: only when writing to Notion (unchanged behavior) if (writeToNotion) { const { tokenDepositData, From ac721e7e520b4e577da1d2901e3d1b8431e05af0 Mon Sep 17 00:00:00 2001 From: Mahsa Moosavi Date: Wed, 3 Sep 2025 12:53:43 -0400 Subject: [PATCH 4/4] fix typo --- .../retryable-monitor/handlers/handleFailedRetryablesFound.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts b/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts index e234c0d..94c7c37 100644 --- a/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts +++ b/packages/retryable-monitor/handlers/handleFailedRetryablesFound.ts @@ -13,7 +13,7 @@ export const handleFailedRetryablesFound = async ( ticket: OnFailedRetryableFoundParams, writeToNotion: boolean ) => { - //old lack alert: only when not writing to Notion + //old slack alert: only when not writing to Notion if (!writeToNotion) { await reportFailedRetryables(ticket) }