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

chore(adr-39): Refactor rewarding #360

Merged
merged 7 commits into from
Dec 20, 2024
Merged

chore(adr-39): Refactor rewarding #360

merged 7 commits into from
Dec 20, 2024

Conversation

gitferry
Copy link
Member

@gitferry gitferry commented Dec 19, 2024

Implements https://github.com/babylonlabs-io/pm/pull/145 including:

  • Rewards are calculated with a timeout finality_sig_timeout
  • Rewards should not be assigned to finality providers that have not voted for the block when calculating rewards.

@gitferry gitferry marked this pull request as ready for review December 19, 2024 08:13
@gitferry gitferry requested a review from a team as a code owner December 19, 2024 08:13
@gitferry gitferry requested review from KonradStaniec, Lazar955, SebastianElvis, RafilxTenfen and a team and removed request for a team December 19, 2024 08:13
Comment on lines 33 to 36
// skip if finality provider didn't vote
if _, ok := voters[fp.BtcPk.MarshalHex()]; !ok {
continue
}
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean that the reward for unvoted FPs remains in the feeCollector account? For example, assuming 4 FPs with equal voting power, 3 of them voted for a block, and 1 did not. Then 3/4 of the reward in the reward gauge is distributed to the 3 FPs, whereas the rest 1/3 remains.

Is this expected or we want to distribute the whole reward to voted FPs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I didn't think of that. I think we should split all the rewards to the voted FPs but what happens if the rewards remain in the feeCollector account?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should split all the rewards to the voted FPs

Agree with that. We should split the rewards between all fps that voted on finalized block.

@gitferry gitferry force-pushed the gai/adr-39-rewarding branch from cbb211e to f17d83e Compare December 20, 2024 12:00
@gitferry gitferry force-pushed the gai/adr-39-rewarding branch from f17d83e to 29c8150 Compare December 20, 2024 12:02
Copy link
Collaborator

@KonradStaniec KonradStaniec left a comment

Choose a reason for hiding this comment

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

lgtm!

@gitferry gitferry merged commit 40f890d into main Dec 20, 2024
21 checks passed
@gitferry gitferry deleted the gai/adr-39-rewarding branch December 20, 2024 13:04
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