Skip to content

[WIP] Staking dashboard#2353

Merged
Marketen merged 59 commits intodevelopfrom
mateu/staking-dashboard
Feb 24, 2026
Merged

[WIP] Staking dashboard#2353
Marketen merged 59 commits intodevelopfrom
mateu/staking-dashboard

Conversation

@mateumiralles
Copy link
Copy Markdown
Contributor

Staking dashboard

@github-actions github-actions bot temporarily deployed to commit January 27, 2026 09:12 Inactive
@github-actions github-actions bot temporarily deployed to commit February 11, 2026 11:26 Inactive

const slotStr = headJson?.data?.header?.message?.slot;
if (!slotStr) throw new Error(`Beacon API ${network} headers/head missing data.header.message.slot`);
fetchAttestingPubkeysForBatch;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this line do? seems weird

startingBlock = parseInt(syncing.startingBlock, 16);
currentBlock = parseInt(syncing.currentBlock, 16);
highestBlock = parseInt(syncing.highestBlock, 16);
progress = ((currentBlock - startingBlock) / (highestBlock - startingBlock)) * 100;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to do some sanity checks here

  • only do the division if all variables (current block, starting block, highest block...) exist and are numbres
  • if highestBlock === startingBlock, we would be dividing by 0.

Comment on lines +176 to +181
if (syncing.is_syncing === false) {
progress = 100;
} else {
// Calculate progress based on slots
progress = 100;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if else is redundant, its always 100. TODO calculate progress?

Comment on lines +225 to +235
export async function nodeStatusGetByNetwork({ networks }: { networks: DashboardSupportedNetwork[] }) {
const resultsByNetwork: NodeStatusByNetwork = {};

for (const network of networks) {
const ec = await getEcData(network);
const cc = await getCcData(network);
resultsByNetwork[network] = { ec, cc };
}

return resultsByNetwork;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these calls are done sequentially. Ideally should be done in parallel and print as soon as any CC/EC data starts being returned (use promise.all)

If returned data are errors, it should be treated to show the erros in the UI.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicated. one inside PWA folder, one outside it

Image


return { name: clientName };
} catch (e) {
console.error(`Error getting EC version: ${e}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use dappmanager's logger


return { isSynced, currentBlock, progress };
} catch (e) {
console.error(`Error getting EC data: ${e}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use dappmanager's logger

const peersData = await peersResponse.json();
return peersData.result ? parseInt(peersData.result, 16) : 0;
} catch (error) {
console.error(`Error getting EC peers: ${error}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use dappmanager's logger


return { name: clientName };
} catch (e) {
console.error(`Error getting CC data: ${e}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use dappmanager's logger

const peersData = await peersResponse.json();
return peersData.data.connected;
} catch (error) {
console.error(`Error getting CC peers: ${error}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use dappmanager's logger

@github-actions github-actions bot temporarily deployed to commit February 24, 2026 08:52 Inactive
@github-actions github-actions bot temporarily deployed to commit February 24, 2026 12:18 Inactive
@github-actions github-actions bot temporarily deployed to commit February 24, 2026 16:25 Inactive
@github-actions github-actions bot temporarily deployed to commit February 24, 2026 16:31 Inactive
@Marketen Marketen merged commit e53d497 into develop Feb 24, 2026
9 checks passed
@Marketen Marketen deleted the mateu/staking-dashboard branch February 24, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants