Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocket Pool Dashboard List #1161

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open

Conversation

manuelsc
Copy link
Contributor

No description provided.

Copy link

cloudflare-workers-and-pages bot commented Nov 25, 2024

Deploying beaconchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: ff633d8
Status: ✅  Deploy successful!
Preview URL: https://c1945044.beaconchain.pages.dev
Branch Preview URL: https://beds-981-rocketpool-dashboar.beaconchain.pages.dev

View logs

@manuelsc manuelsc force-pushed the BEDS-981/rocketpool-dashboard branch from 4358dae to b5b3ad7 Compare November 25, 2024 12:31
perf: use new validator index for rocket pool mobile queries instead of pubkey
@manuelsc manuelsc force-pushed the BEDS-981/rocketpool-dashboard branch from b5b3ad7 to ff633d8 Compare November 25, 2024 15:00
Copy link
Contributor

@remoterami remoterami left a comment

Choose a reason for hiding this comment

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

Some minor comments/thoughts, ptal

Comment on lines 400 to +407
status,
rn.smoothing_pool_opted_in
rn.smoothing_pool_opted_in,
validator_index
FROM rocketpool_minipools
LEFT JOIN rocketpool_nodes rn ON rocketpool_minipools.node_address = rn.address
WHERE pubkey = ANY($1)
WHERE validator_index = ANY($1)
`
err := d.alloyReader.SelectContext(ctx, &rocketPoolResults, validatorsQuery, pq.ByteaArray(pubKeys))
err := d.alloyReader.SelectContext(ctx, &rocketPoolResults, validatorsQuery, indices)
Copy link
Contributor

Choose a reason for hiding this comment

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

This query could probably be merged with the call to GetValidatorDashboardValidators, I'm not the biggest fan of passing (potentially large) validator arrays around via ANY().
But I can see how that's a lot of effort, so prob only worth doing once we hit perf issues

if cursor != "" {
currentCursor, err = utils.StringToCursor[t.RocketPoolCursor](cursor)
if err != nil {
return nil, &paging, fmt.Errorf("failed to parse passed cursor as ValidatorsCursor: %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return nil, &paging, fmt.Errorf("failed to parse passed cursor as ValidatorsCursor: %w", err)
return nil, &paging, fmt.Errorf("failed to parse passed cursor as RocketPoolCursor: %w", err)

goqu.L("COUNT(mp.address) as minipools_total"),
goqu.L("SUM(CASE WHEN mp.node_deposit_balance = 8e18 THEN 1 ELSE 0 END) AS minipools_leb8"),
goqu.L("SUM(CASE WHEN mp.node_deposit_balance = 16e18 THEN 1 ELSE 0 END) AS minipools_leb16"),
goqu.L("CASE WHEN COUNT(mp.address) > 0 THEN SUM(mp.node_fee) / COUNT(mp.address) ELSE 0 END AS avg_commission"),
Copy link
Contributor

Choose a reason for hiding this comment

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

check: Should the average commission only factor in Staking minipools? Depending on how the data is used. Also this could be weighted by the amount of borrowed ETH per MP, as the user is prob interested on the avg additional rewards.

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