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

Message validation #1066

Merged
merged 615 commits into from
Oct 3, 2023
Merged

Message validation #1066

merged 615 commits into from
Oct 3, 2023

Conversation

nkryuchkov
Copy link
Contributor

No description provided.

- `Ignore` - message is invalid, ignored and not processed further, violation count is increased.
- `Reject` - message is rejected, ignored and not processed further, violation count is set to violation threshold, peer is banned for the current round.

## Semantic assertions
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a case when message for slot N is sent in multiple slots

- Generally, If violation happens by a large margin, the message is rejected.
- If an assertion has a rule for rejecting, the rule has higher priority than this one.
- If violation count reaches a certain threshold, all further messages from the validator for current round are rejected.
- Each round resets violation count to 0.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle case if node is a bit malicious (ignored) each round but does it repetitively: should it be punished?

- TODO: Need to check if upon reorg there can be more than one duty per epoch.
- First violation is ignored. Further ones are rejected.
- Message round is equal to estimated current round.
- Violation by [1; ceil(MAX_POSSIBLE_ROUND * 0.2)] rounds is ignored. Violations above that are rejected.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • future rounds should be punished
  • earlier ones are to be discussed
  • test if clock drift may cause any false positives (if so, consider checking Prysm code regarding clock drift)

moshe-blox
moshe-blox previously approved these changes Sep 28, 2023
y0sher
y0sher previously approved these changes Oct 1, 2023
Copy link
Contributor

@y0sher y0sher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added just some minor comments. This is a lot of code, lets get it merged soon.
Generally I'm not a big fan of this approach, we're replicating the consensus state in a way and keeping the messages twice. the code is pretty well organized though and functions as a "separate entity" which is good because one of my concerns was bloating the p2p layer with consensus logic.
anyway I hope one day we would just relay on the protocol to validate its own messages since it should already have all tools in place. there are some extra stuff we validate by tracking the messages but IMO eventually it should be splitted from consensus logic.

y0sher
y0sher previously approved these changes Oct 2, 2023
MatheusFranco99
MatheusFranco99 previously approved these changes Oct 3, 2023
moshe-blox
moshe-blox previously approved these changes Oct 3, 2023
@nkryuchkov nkryuchkov dismissed stale reviews from moshe-blox, MatheusFranco99, and y0sher via 81b2763 October 3, 2023 12:18
@nkryuchkov nkryuchkov merged commit 1bcd6bf into stage Oct 3, 2023
@nkryuchkov nkryuchkov deleted the msg-validation branch October 3, 2023 13:07
y0sher added a commit that referenced this pull request Oct 15, 2023
* Message validation (#1066)
---------

Co-authored-by: moshe-blox <[email protected]>
Co-authored-by: moshe-blox <[email protected]>

* e2e tests for eth execution layer package (#1143)

* New slot ticker (#1149)

---------

Co-authored-by: Matus Kysel <[email protected]>
Co-authored-by: moshe-blox <[email protected]>

---------

Co-authored-by: Nikita Kryuchkov <[email protected]>
Co-authored-by: moshe-blox <[email protected]>
Co-authored-by: moshe-blox <[email protected]>
Co-authored-by: Anton Korpusenko <[email protected]>
Co-authored-by: Matus Kysel <[email protected]>
Co-authored-by: Matus Kysel <[email protected]>
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

Successfully merging this pull request may close these issues.

7 participants