From 17b351b41a00ae3c3f4d502ce8dc5b4d1577c72e Mon Sep 17 00:00:00 2001 From: wolfderechter Date: Thu, 30 Mar 2023 16:39:02 +0200 Subject: [PATCH 1/3] feat(status-page): order the provers by count descending --- packages/status-page/src/utils/getNumProvers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/status-page/src/utils/getNumProvers.ts b/packages/status-page/src/utils/getNumProvers.ts index 2d220bda51b..dc891714195 100644 --- a/packages/status-page/src/utils/getNumProvers.ts +++ b/packages/status-page/src/utils/getNumProvers.ts @@ -14,5 +14,7 @@ export const getNumProvers = async ( const resp = await axios.get( `${eventIndexerApiUrl}/uniqueProvers` ); - return resp.data; + let uniqueProverRes = resp.data; + uniqueProverRes.provers.sort((a, b) => b.count - a.count); + return uniqueProverRes; }; From 040e25acf9563f5a044e57fcf0edf7a9e997b67a Mon Sep 17 00:00:00 2001 From: wolfderechter Date: Fri, 31 Mar 2023 16:20:22 +0200 Subject: [PATCH 2/3] cleanup --- packages/status-page/src/utils/getNumProvers.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/status-page/src/utils/getNumProvers.ts b/packages/status-page/src/utils/getNumProvers.ts index dc891714195..badec08b54c 100644 --- a/packages/status-page/src/utils/getNumProvers.ts +++ b/packages/status-page/src/utils/getNumProvers.ts @@ -11,10 +11,10 @@ export type UniqueProverResponse = { export const getNumProvers = async ( eventIndexerApiUrl: string ): Promise => { - const resp = await axios.get( + const uniqueProverResp = await axios.get( `${eventIndexerApiUrl}/uniqueProvers` ); - let uniqueProverRes = resp.data; - uniqueProverRes.provers.sort((a, b) => b.count - a.count); - return uniqueProverRes; + uniqueProverResp.data.provers.sort((a, b) => b.count - a.count); + + return uniqueProverResp.data; }; From 1cde9a4fbeb8ea3dc1deb149215c42c7380a7a1a Mon Sep 17 00:00:00 2001 From: wolfderechter Date: Sat, 1 Apr 2023 16:31:09 +0200 Subject: [PATCH 3/3] fix(status-page): add links to blockexplorer + filter out oracle prover --- .../status-page/src/pages/home/Home.svelte | 8 ++++++-- .../status-page/src/utils/getNumProvers.ts | 18 ++++++++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/status-page/src/pages/home/Home.svelte b/packages/status-page/src/pages/home/Home.svelte index c10d651d162..7b3ac22c833 100644 --- a/packages/status-page/src/pages/home/Home.svelte +++ b/packages/status-page/src/pages/home/Home.svelte @@ -365,9 +365,13 @@ > {#await getNumProvers(eventIndexerApiUrl) then provers} {#each provers.provers as prover} - +
{prover.count}
{/each} {:catch error} diff --git a/packages/status-page/src/utils/getNumProvers.ts b/packages/status-page/src/utils/getNumProvers.ts index badec08b54c..545b428aa40 100644 --- a/packages/status-page/src/utils/getNumProvers.ts +++ b/packages/status-page/src/utils/getNumProvers.ts @@ -11,10 +11,20 @@ export type UniqueProverResponse = { export const getNumProvers = async ( eventIndexerApiUrl: string ): Promise => { - const uniqueProverResp = await axios.get( + const uniqueProversResp = await axios.get( `${eventIndexerApiUrl}/uniqueProvers` ); - uniqueProverResp.data.provers.sort((a, b) => b.count - a.count); - - return uniqueProverResp.data; + if (uniqueProversResp.data) { + uniqueProversResp.data.provers.sort((a, b) => b.count - a.count); + // Filter out the oracle prover address since it doesn't submit the actual zk proof + const index = uniqueProversResp.data.provers.findIndex( + (uniqueProver) => + uniqueProver.address === "0x0000000000000000000000000000000000000000" + ); + if (index > -1) { + uniqueProversResp.data.provers.splice(index, 1); + uniqueProversResp.data.uniqueProvers--; + } + } + return uniqueProversResp.data || { uniqueProvers: 0, provers: [] }; };