From 8f907b3a0c3f4f9b63d3c9798b337ba0abb19025 Mon Sep 17 00:00:00 2001 From: Xaroz Date: Thu, 12 Dec 2024 13:01:56 -0600 Subject: [PATCH] feat: add ignored chains for debugger --- src/consts/config.ts | 2 ++ src/features/debugger/debugMessage.ts | 11 +++++++++++ src/features/debugger/strings.ts | 1 + src/features/debugger/types.ts | 1 + 4 files changed, 15 insertions(+) diff --git a/src/consts/config.ts b/src/consts/config.ts index 4ba1eb3e..f3f9fda6 100644 --- a/src/consts/config.ts +++ b/src/consts/config.ts @@ -21,3 +21,5 @@ export const config: Config = Object.freeze({ // Based on https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/infra/config/environments/mainnet3/agent.ts // Based on https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/infra/config/environments/testnet4/agent.ts export const unscrapedChainsInDb = ['proteustestnet', 'viction']; + +export const debugIgnoredChains = ['treasure']; diff --git a/src/features/debugger/debugMessage.ts b/src/features/debugger/debugMessage.ts index 9d70dbdf..bea81c22 100644 --- a/src/features/debugger/debugMessage.ts +++ b/src/features/debugger/debugMessage.ts @@ -24,6 +24,7 @@ import { logger } from '../../utils/logger'; import { getMailboxAddress } from '../chains/utils'; import { isIcaMessage, tryDecodeIcaBody, tryFetchIcaAddress } from '../messages/ica'; +import { debugIgnoredChains } from '../../consts/config'; import { GasPayment, IsmModuleTypes, MessageDebugResult, MessageDebugStatus } from './types'; type Provider = providers.Provider; @@ -83,6 +84,7 @@ export async function debugMessage( recipient, senderBytes, body, + destName, ); if (deliveryResult.status && deliveryResult.description) return deliveryResult; else details.calldataDetails = deliveryResult.calldataDetails; @@ -144,6 +146,7 @@ async function debugMessageDelivery( recipient: Address, senderBytes: string, body: string, + destName: string, ) { const recipientContract = MessageRecipientFactory.connect(recipient, destProvider); const handleCalldata = recipientContract.interface.encodeFunctionData('handle', [ @@ -181,6 +184,14 @@ async function debugMessageDelivery( // }; // } + if (debugIgnoredChains.includes(destName)) { + return { + status: MessageDebugStatus.MessageNotDelivered, + description: 'Message not delivered, there may be an error', + calldataDetails, + }; + } + const icaCallErr = await tryDebugIcaMsg(sender, recipient, body, originDomain, destProvider); if (icaCallErr) { return { diff --git a/src/features/debugger/strings.ts b/src/features/debugger/strings.ts index 3e8b09d0..7a575c95 100644 --- a/src/features/debugger/strings.ts +++ b/src/features/debugger/strings.ts @@ -9,4 +9,5 @@ export const debugStatusToDesc: Record = { [MessageDebugStatus.HandleCallFailure]: 'Error calling handle on the recipient contract', [MessageDebugStatus.MultisigIsmEmpty]: 'ISM has no validators and/or no quorum threshold', [MessageDebugStatus.GasUnderfunded]: 'Insufficient interchain gas has been paid for delivery', + [MessageDebugStatus.MessageNotDelivered]: 'Message was not delivered', }; diff --git a/src/features/debugger/types.ts b/src/features/debugger/types.ts index a7a28fcf..07f14761 100644 --- a/src/features/debugger/types.ts +++ b/src/features/debugger/types.ts @@ -6,6 +6,7 @@ export enum MessageDebugStatus { HandleCallFailure = 'handleCallFailure', MultisigIsmEmpty = 'multisigIsmEmpty', GasUnderfunded = 'gasUnderfunded', + MessageNotDelivered = 'messageNotDelivered', } export interface MessageDebugResult {