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

Update performance tracker and rewards #318

Merged
merged 73 commits into from
Sep 21, 2023
Merged

Update performance tracker and rewards #318

merged 73 commits into from
Sep 21, 2023

Conversation

daria305
Copy link
Contributor

Fixes #258 #155

  • updated rewards with current TIP version
  • properly define reward parameters
  • extended performance tracking to also consider subslot activity with model.ValidatorPerformance
  • included hash and version to ValidatorPerformance
  • implemented rewards test scenarios
  • use safmeth for rewards calculation
  • limited rewards import with pruning threshold

# Conflicts:
#	pkg/protocol/sybilprotection/sybilprotectionv1/performance/performance.go
#	pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go
#	pkg/storage/prunable/prunable.go
# Conflicts:
#	pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go
# Conflicts:
#	pkg/protocol/engine/upgrade/signalingupgradeorchestrator/orchestrator.go
#	pkg/protocol/engine/upgrade/signalingupgradeorchestrator/snapshot.go
#	pkg/protocol/sybilprotection/sybilprotectionv1/performance/performance.go
#	pkg/protocol/sybilprotection/sybilprotectionv1/performance/rewards.go
#	pkg/protocol/sybilprotection/sybilprotectionv1/performance/snapshot.go
#	pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go
#	pkg/storage/prunable/performancefactors.go
#	pkg/storage/prunable/prunable.go
#	tools/genesis-snapshot/presets/presets.go
@karimodm karimodm requested a review from oliviasaa September 6, 2023 10:50
Copy link
Contributor

@jonastheis jonastheis left a comment

Choose a reason for hiding this comment

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

The code in this whole component is a little bit too verbose at times (and at other times not enough) and hard to read imo. Also I didn't really check the calculations as I don't know what they should be.

decreaseAccuracy(increasedAccuracyComplement(poolStats.ProfitMargin, profitMarginExponent)*uint64(rewardsForAccountInEpoch.PoolRewards), profitMarginExponent)*
uint64(stakeAmount)/
uint64(rewardsForAccountInEpoch.PoolStake)
// all rewards go to delegators, as the fixed cost was too high
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this comment. isn't the fixed cost for the validator meaning that no rewards go to the delegators?

Copy link
Contributor

@oliviasaa oliviasaa Sep 11, 2023

Choose a reason for hiding this comment

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

this is a form of punishment for the validator that add an unreasonably high fixed cost. if fixed cost>pool reward, we "slash" the validator reward

Copy link
Contributor

Choose a reason for hiding this comment

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

however, the way it is now, the validator will get zero for the whole time period, not for the specific epochs where this happened. It's not an urgent matter, but I feel like this can be a problem in the future with the random committees

Copy link
Contributor

Choose a reason for hiding this comment

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

since the validator won't know in advance the order of magnitude of his reward for every single epoch, I think this could become a punishment for unlucky people in the future :/

@daria305 daria305 requested a review from jonastheis September 20, 2023 06:41
daria305 and others added 4 commits September 21, 2023 09:06
# Conflicts:
#	go.mod
#	go.sum
#	tools/evil-spammer/go.sum
#	tools/gendoc/go.mod
#	tools/gendoc/go.sum
#	tools/genesis-snapshot/go.sum
@karimodm karimodm merged commit 32eedbe into develop Sep 21, 2023
5 checks passed
@karimodm karimodm deleted the feat/rewards branch September 21, 2023 09:38
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.

Resolve performance TODOs Validate rewards calculations
5 participants