-
Notifications
You must be signed in to change notification settings - Fork 370
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
Adding slashing multiplier to validators.sol and reward calculation #2239
Conversation
260b8c4
to
24e8ab5
Compare
* @notice Halves the group's slashing multiplier. | ||
* @param account The group being slashed. | ||
*/ | ||
function halveSlashingMultiplier(address account) |
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.
Been thinking about this more, and wondering if it makes sense for different slashers to set their own multiplier between 0 and 1, let's discuss more offline
24e8ab5
to
fb01b11
Compare
Codecov Report
@@ Coverage Diff @@
## master #2239 +/- ##
========================================
Coverage 74.89% 74.89%
========================================
Files 274 274
Lines 7803 7803
Branches 701 985 +284
========================================
Hits 5844 5844
Misses 1846 1846
Partials 113 113
Continue to review full report at Codecov.
|
d58d406
to
e424be8
Compare
* master: Adding slashing multiplier to validators.sol and reward calculation (#2239) Update genesis value, show name in election:list, fix assertRevert (#2216) Audit fixes for Reserve (#1816) Adapting the script to the last documentation changes (#2241) Bump excon from 0.65.0 to 0.71.0 in /packages/mobile (#2274) Fix wrong type for comment key (#2250) Fix/block gas limit exceeded #2 (#2263) Stop running broken end-to-end mobile test (#2096) [Wallet] Fix non integer wei issue in exchange (#2277) Fix validatorgroup:list bug by not fetching unneeded info (#2257) [Wallet] New exchange trade screen and fix ts build in celotool (#2167) Update Role on About Page (#2271) # Conflicts: # packages/web/src/about/team/team-list.ts
Description
Added
setSlashingMultiplierResetPeriod
,resetSlashingMultiplier
,getValidatorGroupSlashingMultiplier
andhalveSlashingMultiplier
toValidators.sol
, as well as adding record keeping to faciliate this:GroupSlashInfo
struct which is stored within theValidatorGroup
struct and maintains the group'sslashingModifier
(M
in the docs) and thelastSlashedTimestamp
which tracks the last time a group was slashed to control when the multiplier can be reset yet.Tested
Added unit tests for each fn in Validators contract.
Other changes
Fixed a bug in
Validators.sol
where we were callingsignerToAccount
when we should have been callingvalidatorSignerToAccount
. Updated this in most functions that calledsignerToAccount
with a few exceptions:_updateValidatorScoreFromSigner
,_distributeEpochPaymentsFromSigner
,getValidatorBlsPublicKeyFromSigner
, andgetMembershipInLastEpochFromSigner
.Changed
Validators.sol
initialize
fn signature, IValidators contract, and the MockValidators contract. I also changed thegasLimit
within truffle config and the ganache config inrunTests
since it was running out of gas when I changed Validator.Related issues
Backwards compatibility
No, changes to initialize fn in Validator