Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

I'm online messages #2719

@cmichi

Description

@cmichi

This feature is intended to handle the case when validators go offline without malicious intent (i.e. without the intention of attacking the network). We don't want to slash them if there is no malicious intent.

Sending I'm online messages

  • Each validator gossips an I'm online heartbeat every n blocks session.
  • The heartbeat is a signed transaction, which was signed using the session key and includes the recent best block number of the local validators chain as well as the multiaddr (physical node address). It is sent as an Unsigned Transaction (no account nonce/signature/sender).
    • The multiaddr provides a secondary mechanism to look nodes up, since the DHT is flaky.

Interpreting I'm online messages

  • There will be a points system for the token mechanics, which we can also use for tracking if validators are online.
    • A validator is considered online if a threshold number of points is reached.
    • If a validator doesn't hit the threshold it is considered offline.
    • By using a points threshold we determine if a validator is online by taking anything into account which a validator contributed to the protocol (and not just I'm online messages).
    • The threshold is probably going to be 1 (i.e. any points at all signify the authority is online).
  • Create a new srml-im-online module which has a node_online hook.
  • Introduce a validate_transaction trait in the srml-im-online module which interprets and validates the unsigned transaction.
  • srml-im-online contains a map babe_session_key => Option<multiaddr>. Clear this map every time on_session_change() is called.
  • Validators may only produce a single im-online transaction for each session in each chain. Further im-omline messages are ignored once a valid message has been received in the current session for that validator. No slash is made.

Future stuff with the points system

  • Slash when a node is considered online according to the points system, but that node hasn't authored any blocks (or significantly less than expected) in a long time during which it should have authored blocks.
    • This "long time" is calculated by the likelihood that the node should have authored a block by now. If this threshold is below x then slash them. The further we get below this threshold the more we slash.
  • If a validator is considered offline it is ignored as a validator, but not slashed. Kinda like a protection mechanism.

Open questions

  • What of the above info is persisted on chain? Just the one map.
  • How often is the heartbeat sent? Every block? Once per session.
  • Where do we determine that a slash happens? In srml-im-online? Don't bother

Metadata

Metadata

Assignees

Labels

J0-enhancementAn additional feature request.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions