-
Notifications
You must be signed in to change notification settings - Fork 7
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
base: staging
Are you sure you want to change the base?
Conversation
Deploying beaconchain with Cloudflare Pages
|
4358dae
to
b5b3ad7
Compare
perf: use new validator index for rocket pool mobile queries instead of pubkey
b5b3ad7
to
ff633d8
Compare
There was a problem hiding this 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
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"), |
There was a problem hiding this comment.
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.
No description provided.