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

Bids 2369/total withdrawals stats #2581

Closed
wants to merge 9 commits into from

Conversation

LuccaBitfly
Copy link
Collaborator

@LuccaBitfly LuccaBitfly commented Sep 28, 2023

🤖 Generated by Copilot at 2711c31

This pull request adds support for tracking and exporting the cumulative totals of withdrawals for validators in the validator_stats table. It introduces a new export-stats-totals command to the misc tool, which populates the new columns withdrawals_total and withdrawals_amount_total in the table. It also improves the performance and accuracy of the apiValidator function and the db package functions that query the withdrawals totals. It includes a new SQL migration file, temp_add_total_withdrawals_stats.sql, to add and remove the new columns. It updates the ValidatorStatsTableDbRow type in the types package to match the new table schema.

@LuccaBitfly LuccaBitfly force-pushed the BIDS-2369/totalWithdrawalsStats branch 2 times, most recently from b7fd02a to 325f579 Compare September 28, 2023 11:09
@LuccaBitfly LuccaBitfly closed this Oct 2, 2023
@LuccaBitfly LuccaBitfly force-pushed the BIDS-2369/totalWithdrawalsStats branch from 325f579 to 2a5ba87 Compare October 2, 2023 08:39
@LuccaBitfly LuccaBitfly reopened this Oct 2, 2023
@LuccaBitfly LuccaBitfly marked this pull request as ready for review October 2, 2023 08:48
@@ -783,3 +787,117 @@ func exportHistoricPrices(dayStart uint64, dayEnd uint64) {

logrus.Info("historic price update run completed")
}

func exportStatsTotals(columns string, dayStart, dayEnd, concurrency uint64) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Example Usage:

go run cmd/misc/main.go --config __gitignore/config.yml --command export-stats-totals --columns withdrawals_total,withdrawals_amount_total --day-start 10 --day-end 12

Copy link
Collaborator

@Eisei24 Eisei24 left a comment

Choose a reason for hiding this comment

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

Please have a look at my comments.

db/migrations/temp_add_total_withdrawals_stats.sql Outdated Show resolved Hide resolved
cmd/misc/main.go Outdated Show resolved Hide resolved
cmd/misc/main.go Outdated Show resolved Hide resolved
cmd/misc/main.go Show resolved Hide resolved
db/db.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@Eisei24 Eisei24 left a comment

Choose a reason for hiding this comment

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

Looks good, please just update the error message.

Copy link
Collaborator

@Eisei24 Eisei24 left a comment

Choose a reason for hiding this comment

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

utACK

@LuccaBitfly LuccaBitfly force-pushed the BIDS-2369/totalWithdrawalsStats branch from d7c2964 to f339a4a Compare October 10, 2023 07:03
@LuccaBitfly
Copy link
Collaborator Author

Splitting this PR into two parts, see #2653

@LuccaBitfly
Copy link
Collaborator Author

See #2668

@recy21 recy21 deleted the BIDS-2369/totalWithdrawalsStats branch December 4, 2023 20:49
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.

3 participants