feat(p2p): remaining p2p topic validators#10734
Merged
Conversation
This was referenced Dec 13, 2024
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
2c27b95 to
26c1ed8
Compare
74f2033 to
96a5400
Compare
26c1ed8 to
361753b
Compare
96a5400 to
f3587f0
Compare
f3587f0 to
546d6fa
Compare
Member
Author
|
post merge this has since broken, looking into it eidt: needed to do plumbing of the new date provider |
just-mitch
reviewed
Dec 18, 2024
| const { currentSlot, nextSlot } = await this.epochCache.getProposerInCurrentOrNextSlot(); | ||
|
|
||
| // Check that the attestation is for the current or next slot | ||
| const slotNumberBigInt = attestation.payload.header.globalVariables.slotNumber.toBigInt(); |
Collaborator
There was a problem hiding this comment.
I feel like the core validation logic for a BlockAttestation (and BlockProposal, EpochProofQuote, and ideally Tx) should all reside in their respective classes and just take as inputs the information they need.
So in this case we could call attestation.validate(epochCache) and it could return a PeerErrorSeverity.
That would make for easier reuse elsewhere, and easier testing (since it looks like none of these are tested?)
Member
Author
There was a problem hiding this comment.
Yeah agreed, I can write it as such
7737ab7 to
a0ef925
Compare
just-mitch
approved these changes
Dec 18, 2024
a0ef925 to
9f4f1e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Applies epoch and attestation validity checks into the gossip sub module