Skip to content
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

Rethink the whole thing #6

Closed
freak12techno opened this issue May 23, 2022 · 0 comments
Closed

Rethink the whole thing #6

freak12techno opened this issue May 23, 2022 · 0 comments

Comments

@freak12techno
Copy link
Collaborator

How it works for now: checks every N seconds if there's a diff from the last state, reporting the diff. If some validator is going to jail, it'll report a lot of messages.

How it may work:

  1. store a state in a json file or so, reload it from disk on restart
  2. have a struct for each valcons (ValidatorState) that has the following: valcons, valoper, moniker, missed blocks, jailed
  3. have a set of groups (MissedBlocksGroup) in config, represented by a struct with the following fields: start value, end value, emoji when a validator's missed blocks counter enters/leaves this group, message for it
  4. have a struct (ReportMessage) that has the following fields: emoji, valoper, moniker, missed blocks, message
  5. have a function that maps previous and current ValidatorState using MissedBlocksGroup array and jailed param to an optional Message if a validator state was changed, either if validator is jailed/unjailed, or if a validator's missed blocks counter changes causing it to fall under a different MissedBlocksGroup (if validator either skips more blocks or signs and the window moves.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant