Skip to content

Commit 72241b8

Browse files
committed
dashboard: filter out governor enqueued vaas
Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
1 parent 77b0536 commit 72241b8

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

dashboard/src/components/Home.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function Home({
4141
<Divider />
4242
<MonitorSettingsProvider>
4343
<CollapsibleSection header="Monitor">
44-
<Monitor />
44+
<Monitor governorInfo={governorInfo} />
4545
</CollapsibleSection>
4646
</MonitorSettingsProvider>
4747
</>

dashboard/src/components/Monitor.tsx

+15-4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
explorerVaa,
2626
} from '@wormhole-foundation/wormhole-monitor-common';
2727
import { Environment, useCurrentEnvironment, useNetworkContext } from '../contexts/NetworkContext';
28+
import { CloudGovernorInfo } from '../hooks/useCloudGovernorInfo';
2829

2930
type LastBlockByChain = { [chainId: string]: string };
3031
type CountsByChain = {
@@ -291,7 +292,7 @@ function ReobserveCode({ misses }: { misses: MissesByChain | null }) {
291292
) : null;
292293
}
293294

294-
function Misses() {
295+
function Misses({ governorInfo }: { governorInfo?: CloudGovernorInfo | null }) {
295296
const { currentNetwork } = useNetworkContext();
296297
const { showAllMisses } = useSettings();
297298
const [missesWrapper, setMissesWrapper] = useState<DataWrapper<MissesByChain>>(
@@ -329,7 +330,17 @@ function Misses() {
329330
.map(([chain, info]) => {
330331
const filteredMisses = showAllMisses
331332
? info.messages
332-
: info.messages.filter((message) => message.timestamp < twoHoursAgo);
333+
: info.messages
334+
.filter((message) => message.timestamp < twoHoursAgo)
335+
.filter(
336+
(message) =>
337+
!governorInfo?.enqueuedVAAs.some(
338+
(enqueuedVAA) =>
339+
enqueuedVAA.emitterChain === message.chain &&
340+
enqueuedVAA.emitterAddress === message.emitter &&
341+
enqueuedVAA.sequence === message.seq
342+
)
343+
);
333344
return filteredMisses.length === 0 ? null : (
334345
<CollapsibleSection
335346
key={chain}
@@ -400,7 +411,7 @@ function SettingsButton() {
400411
);
401412
}
402413

403-
function Monitor() {
414+
function Monitor({ governorInfo }: { governorInfo?: CloudGovernorInfo | null }) {
404415
const { currentNetwork } = useNetworkContext();
405416
const [lastBlockByChainWrapper, setLastBlockByChainWrapper] = useState<
406417
DataWrapper<LastBlockByChain>
@@ -466,7 +477,7 @@ function Monitor() {
466477
<SettingsButton />
467478
</Box>
468479
<Box mb={2}>
469-
<Misses />
480+
<Misses governorInfo={governorInfo} />
470481
</Box>
471482
<Typography variant="h4">Chains</Typography>
472483
<Box pl={0.5}>

0 commit comments

Comments
 (0)