From 72241b86f7e89df149b76fd72c5e41eec2e49990 Mon Sep 17 00:00:00 2001 From: bingyuyap Date: Fri, 9 Feb 2024 21:25:46 -0800 Subject: [PATCH] dashboard: filter out governor enqueued vaas Signed-off-by: bingyuyap --- dashboard/src/components/Home.tsx | 2 +- dashboard/src/components/Monitor.tsx | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/dashboard/src/components/Home.tsx b/dashboard/src/components/Home.tsx index a1a619d9..b7857d80 100644 --- a/dashboard/src/components/Home.tsx +++ b/dashboard/src/components/Home.tsx @@ -41,7 +41,7 @@ function Home({ - + diff --git a/dashboard/src/components/Monitor.tsx b/dashboard/src/components/Monitor.tsx index b0a3d66c..615f64cc 100644 --- a/dashboard/src/components/Monitor.tsx +++ b/dashboard/src/components/Monitor.tsx @@ -25,6 +25,7 @@ import { explorerVaa, } from '@wormhole-foundation/wormhole-monitor-common'; import { Environment, useCurrentEnvironment, useNetworkContext } from '../contexts/NetworkContext'; +import { CloudGovernorInfo } from '../hooks/useCloudGovernorInfo'; type LastBlockByChain = { [chainId: string]: string }; type CountsByChain = { @@ -291,7 +292,7 @@ function ReobserveCode({ misses }: { misses: MissesByChain | null }) { ) : null; } -function Misses() { +function Misses({ governorInfo }: { governorInfo?: CloudGovernorInfo | null }) { const { currentNetwork } = useNetworkContext(); const { showAllMisses } = useSettings(); const [missesWrapper, setMissesWrapper] = useState>( @@ -329,7 +330,17 @@ function Misses() { .map(([chain, info]) => { const filteredMisses = showAllMisses ? info.messages - : info.messages.filter((message) => message.timestamp < twoHoursAgo); + : info.messages + .filter((message) => message.timestamp < twoHoursAgo) + .filter( + (message) => + !governorInfo?.enqueuedVAAs.some( + (enqueuedVAA) => + enqueuedVAA.emitterChain === message.chain && + enqueuedVAA.emitterAddress === message.emitter && + enqueuedVAA.sequence === message.seq + ) + ); return filteredMisses.length === 0 ? null : ( @@ -466,7 +477,7 @@ function Monitor() { - + Chains