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.

network/p2p/ATTESTER.md Outdated Show resolved Hide resolved
network/p2p/ATTESTER.md Outdated Show resolved Hide resolved
network/p2p/ATTESTER.md Outdated Show resolved Hide resolved
network/p2p/ATTESTER.md Outdated Show resolved Hide resolved
network/p2p/ATTESTER.md Outdated Show resolved Hide resolved
network/p2p/GENERAL_RULES.md Outdated Show resolved Hide resolved
- `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

network/p2p/GENERAL_RULES.md Outdated Show resolved Hide resolved
- 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)

cli/operator/node.go Outdated Show resolved Hide resolved
moshe-blox
moshe-blox previously approved these changes Sep 28, 2023
protocol/v2/types/crypto.go Outdated Show resolved Hide resolved
protocol/v2/types/crypto.go Outdated Show resolved Hide resolved
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 merged commit 1bcd6bf into stage Oct 3, 2023
5 checks passed
@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 <moshe@blox.io>
Co-authored-by: moshe-blox <89339422+moshe-blox@users.noreply.github.com>

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

* New slot ticker (#1149)

---------

Co-authored-by: Matus Kysel <matus@Matuss-MacBook-Air.local>
Co-authored-by: moshe-blox <moshe@blox.io>

---------

Co-authored-by: Nikita Kryuchkov <nkryuchkov10@gmail.com>
Co-authored-by: moshe-blox <moshe@blox.io>
Co-authored-by: moshe-blox <89339422+moshe-blox@users.noreply.github.com>
Co-authored-by: Anton Korpusenko <antokorp@gmail.com>
Co-authored-by: Matus Kysel <MatusKysel@users.noreply.github.com>
Co-authored-by: Matus Kysel <matus@Matuss-MacBook-Air.local>
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.

None yet

7 participants