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

feat - validator redirects #5

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

olegshmuelov
Copy link

No description provided.

@olegshmuelov olegshmuelov marked this pull request as ready for review January 15, 2025 16:42
@olegshmuelov olegshmuelov self-assigned this Jan 15, 2025
pkg/rewards/plan.go Outdated Show resolved Hide resolved
Comment on lines 388 to 389
ownerRedirectsSupport := len(mechanics.OwnerRedirects) > 0
validatorRedirectsSupport := len(mechanics.ValidatorRedirects) > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

we're not populating the tables here like in recipientParticipations, so it seems that if you call this func before, the redirections will be missing

i wouldn't mind just copying the code from below over here, or maybe creating a function for prepareRedirections that returns both if they're enabled (bool, bool) and populates them ifn eeded

Choose a reason for hiding this comment

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

@olegshmuelov Moshe is out how can i recreate this? Do a validator redirect with no owner redirects?

Copy link
Author

@olegshmuelov olegshmuelov Jan 28, 2025

Choose a reason for hiding this comment

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

we're not populating the tables here like in recipientParticipations, so it seems that if you call this func before, the redirections will be missing

i wouldn't mind just copying the code from below over here, or maybe creating a function for prepareRedirections that returns both if they're enabled (bool, bool) and populates them ifn eeded

Good catch! I extracted the logic preparing the redirections into a new function called prepareRedirections.
This way, both validatorParticipations and recipientParticipations will have the same logic to fill in the redirection tables and thus cannot miss any redirections.
see e9192f0

Copy link
Contributor

@moshe-blox moshe-blox left a comment

Choose a reason for hiding this comment

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

Code and SQL looks really good & readable 👍

Left a few minor comments

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.

4 participants