fuseio / fuse-network

Fuse network engine; Contains instructions to connect as a node
MIT License
86 stars 44 forks source link

FIP11 Add jailing of validators who fail to validate #101

Closed Andrew-Pohl closed 2 years ago

Andrew-Pohl commented 3 years ago

added logic to count number of blocks done by a validator and added a new jail list

Andrew-Pohl commented 2 years ago

Added some new tests:

-Jailing

  1. Unjailing should only work for jailed validators (calls should fail for all but jailed validators)
  2. multiple calls to unjail should be rejected
  3. Check no jailing if validate all blocks
  4. Check jailing threshold (sets blocks mind to 1 block above productivity - node shouldn't be jailed, sets block counter 1 below productivity - node should be jailed)
  5. Check unjailing Checks that a node is released from jail when requested.
  6. Check strikes - this tests the logic of the strike counter and checks that the unjailing block scales correctly, it also makes sure that strikes are reset correctly on good behavior

-Maintenance

  1. Only validators can flag maintenance
  2. Should be able to flag being back online instantly
  3. Should reject if jailed

@leonprou think of any others?