-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
…the highest supported version
# 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
There was a problem hiding this 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.
pkg/protocol/sybilprotection/sybilprotectionv1/performance/snapshot.go
Outdated
Show resolved
Hide resolved
pkg/protocol/sybilprotection/sybilprotectionv1/performance/performance.go
Outdated
Show resolved
Hide resolved
pkg/protocol/sybilprotection/sybilprotectionv1/performance/snapshot_test.go
Outdated
Show resolved
Hide resolved
pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go
Outdated
Show resolved
Hide resolved
pkg/protocol/sybilprotection/sybilprotectionv1/performance/performance.go
Outdated
Show resolved
Hide resolved
pkg/protocol/sybilprotection/sybilprotectionv1/performance/performance.go
Outdated
Show resolved
Hide resolved
pkg/protocol/sybilprotection/sybilprotectionv1/performance/performance.go
Outdated
Show resolved
Hide resolved
pkg/protocol/sybilprotection/sybilprotectionv1/performance/performance.go
Outdated
Show resolved
Hide resolved
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 :/
pkg/protocol/sybilprotection/sybilprotectionv1/performance/rewards.go
Outdated
Show resolved
Hide resolved
pkg/protocol/sybilprotection/sybilprotectionv1/performance/testsuite_test.go
Outdated
Show resolved
Hide resolved
# Conflicts: # go.mod # go.sum # tools/evil-spammer/go.sum # tools/gendoc/go.mod # tools/gendoc/go.sum # tools/genesis-snapshot/go.sum
Fixes #258 #155
model.ValidatorPerformance
ValidatorPerformance