DMDcoin / diamond-contracts-core

DMD v4 testnet on-chain logic
Other
6 stars 9 forks source link

Malice Reports #145

Open SurfingNerd opened 1 year ago

SurfingNerd commented 1 year ago

connected to implementation on open ethereum issue: https://github.com/DMDcoin/openethereum-3.x/issues/75

SurfingNerd commented 1 year ago

In the current implementation the malice reports are block based. since HBBFT is asyncrounous we need to think about if this is a valid way to go, since one Node can treat a bad node as "inactive" while it is still appears active for other validators.

SurfingNerd commented 1 month ago

removeMaliciousValidators() is a function prepared in he contracts, with permission to be called by system, but it seems to never get called.

axel-muller commented 2 weeks ago

Malicious reports and Connectivity tracker systems comparison

Malicious Reports Connectivity Tracker
Who can report/call functions 1. system account
2. not banned validator from current epoch set
3. not banned validator from previous epoch set within stakingFixedEpochDuration / 5 seconds (43200 / 5 = 2.4 hours) timeframe in current epoch.
Unflagged validator from current epoch set
Reports threshold 1. Current validators count > 3: more than 2/3 of validators reported about malicious validator for the same block
2.Current validators count <= 3: more than 1/2 of validators reported about malicious validator for the same block.
Node considered faulty if 2/3 + 1 of the not flagged validators reported it.
Punishments 1. Ban validator until the end of the current epoch and for the next 12 full epoch. Ban duration is configurable
2. Banned validator removed from current validator set
3. Banned validator will not receive epoch rewards
4. Banned validator staking pool removed from active pools and marked as inactive
5. New stakes cannot be places on banned validator
6. Stakes cannot be withdrawn from banned validator
no
Ban/Report reasons 1. "malicious" - reported by other validators as malicious
2. "spam" - validator spammed with reports
3. "inactive" - only a system account can ban validator with this reason.
Lost connection by node
Restrictions 1. Same validator cannot report someone twice for the same epoch
2. Cannot report for blocks older than 100
1. Reports are valid within current staking epoch
2. Same validator cannot report someone twice for the same epoch
3. Flagged validators cannot report other validators
SurfingNerd commented 2 weeks ago

Todo: Remove the Malice Report System