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

Correct Discrepancies with Whitepaper modified reward fractions vs plain EMA #704

Merged
merged 1 commit into from
Dec 15, 2024

Conversation

relyt29
Copy link
Contributor

@relyt29 relyt29 commented Dec 13, 2024

Purpose of Changes and their Description

Really all credit for this PR goes to @cal-hawk who did the hard work of finding the bug and tracing the actual lines of code related to it.

He found a discrepancy between the whitepaper and the allora-chain codebase where u-tilde (inferer, reputer, forecaster reward fractions) were being used for numberRatio calculations when it should be using f (the modifiedRewardFractions). And then also the reverse for setting the previous EMA score - we were using f instead of u-tilde in that case.

and in the other case it's:

f being used where it should be u-tilde

Link(s) to Ticket(s) or Issue(s) resolved by this PR

PROTO-3039, RES-579

Are these changes tested and documented?

To be quite honest I don't know of an easy way to test this in a unit test and show that the fixed code addresses issues other than just pointing to the whitepaper and saying read these formulas. The existing unit test suite at least will cover that directionally these changes do not break any major functionality of the chain.

cal-hawk
cal-hawk previously approved these changes Dec 13, 2024
Copy link

@cal-hawk cal-hawk left a comment

Choose a reason for hiding this comment

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

lgtm! thanks @relyt29 🙏

@relyt29 relyt29 dismissed stale reviews from fernandofcampos and cal-hawk via 1998475 December 14, 2024 16:15
@relyt29 relyt29 force-pushed the tyler/proto-3039-swap-use-of-f-for-u-tilde-x2 branch from a7e061f to 1998475 Compare December 14, 2024 16:15
@kpeluso kpeluso merged commit 80aaeaa into dev Dec 15, 2024
8 checks passed
@kpeluso kpeluso deleted the tyler/proto-3039-swap-use-of-f-for-u-tilde-x2 branch December 15, 2024 21:03
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.

5 participants