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

Guilherme/proto 3082 fix actor score ema initialization #714

Merged
merged 19 commits into from
Dec 19, 2024

Conversation

kpeluso
Copy link
Collaborator

@kpeluso kpeluso commented Dec 18, 2024

Purpose of Changes and their Description

This PR introduces a new score initialization mechanism for new participants using the formula:
initialEmaScore = lowestEmaScoreInActiveSet - lambda * standardDeviationOfEmaScoresInActiveSet

This provides a reasonable starting point that requires consistent good performance to enter the active set.

The lambda parameter (lambda > 0) allows governance to adjust how challenging it is for new participants to enter the active set:

  • Higher lambda: More conservative, requiring longer consistent performance
  • Lower lambda: More lenient, allowing faster entry into the active set

We update the topic's initial EMA score for each actor (inferer, forecaster, and reputer) during reward distribution.

When an actor submits their payload, we check if they are a new actor. If they are, we initialize their score using the topic's initial EMA score, calculated using the active set's statistics.

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

https://linear.app/alloralabs/issue/PROTO-3082/fix-actor-score-ema-initialization

Are these changes tested and documented?

  • If tested, please describe how. If not, why tests are not needed.
  • If documented, please describe where. If not, describe why docs are not needed.
  • Added to Unreleased section of CHANGELOG.md?

Still Left Todo

Fill this out if this is a Draft PR so others can help.

Copy link

github-actions bot commented Dec 18, 2024

The latest Buf updates on your PR. Results from workflow Buf Linter / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed⏩ skippedDec 19, 2024, 1:42 AM

@kpeluso kpeluso force-pushed the guilherme/proto-3082-fix-actor-score-ema-initialization-2 branch from dd8c641 to 707af31 Compare December 18, 2024 07:25
@amimart amimart mentioned this pull request Dec 18, 2024
3 tasks
Copy link
Contributor

@amimart amimart left a comment

Choose a reason for hiding this comment

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

Well done! The init/export genesis func are missing the new stores, I've implemented it in #712 if you want

x/emissions/proto/emissions/v7/params.proto Outdated Show resolved Hide resolved
x/emissions/proto/emissions/v7/tx.proto Outdated Show resolved Hide resolved
x/emissions/migrations/v7/migrate.go Outdated Show resolved Hide resolved
x/emissions/keeper/keeper.go Show resolved Hide resolved
amimart
amimart previously approved these changes Dec 18, 2024
Copy link
Contributor

@amimart amimart 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 to me :)

x/emissions/module/rewards/scores.go Show resolved Hide resolved
x/emissions/module/rewards/scores_test.go Show resolved Hide resolved
x/emissions/keeper/keeper_test.go Show resolved Hide resolved
x/emissions/keeper/keeper_test.go Show resolved Hide resolved
x/emissions/keeper/keeper_test.go Show resolved Hide resolved
x/emissions/module/rewards/scores_test.go Show resolved Hide resolved
@kpeluso
Copy link
Collaborator Author

kpeluso commented Dec 19, 2024

Many of the conversations @spooktheducks incited will be resolved in #718 . Resolving for now, but not forgotten.

@kpeluso kpeluso merged commit 250da2b into dev Dec 19, 2024
10 checks passed
@kpeluso kpeluso deleted the guilherme/proto-3082-fix-actor-score-ema-initialization-2 branch December 19, 2024 07:20
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