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

feat(p2p): remaining p2p topic validators #10734

Merged
merged 10 commits into from
Dec 18, 2024
Merged

Conversation

Maddiaa0
Copy link
Member

@Maddiaa0 Maddiaa0 commented Dec 13, 2024

Applies epoch and attestation validity checks into the gossip sub module

@Maddiaa0 Maddiaa0 added the e2e-p2p CI: Enables this CI job. label Dec 13, 2024
@Maddiaa0 Maddiaa0 force-pushed the md/p2p/topic-validatio branch from 2c27b95 to 26c1ed8 Compare December 16, 2024 21:07
@Maddiaa0 Maddiaa0 force-pushed the md/other-type-p2p-validators branch from 74f2033 to 96a5400 Compare December 16, 2024 21:07
@Maddiaa0 Maddiaa0 requested a review from spypsy December 16, 2024 21:08
@Maddiaa0 Maddiaa0 force-pushed the md/p2p/topic-validatio branch from 26c1ed8 to 361753b Compare December 17, 2024 13:02
@Maddiaa0 Maddiaa0 requested a review from just-mitch December 17, 2024 13:03
@Maddiaa0 Maddiaa0 force-pushed the md/other-type-p2p-validators branch from 96a5400 to f3587f0 Compare December 17, 2024 13:04
Base automatically changed from md/p2p/topic-validatio to master December 17, 2024 16:17
@Maddiaa0 Maddiaa0 force-pushed the md/other-type-p2p-validators branch from f3587f0 to 546d6fa Compare December 17, 2024 17:22
@Maddiaa0
Copy link
Member Author

Maddiaa0 commented Dec 17, 2024

post merge this has since broken, looking into it

eidt: needed to do plumbing of the new date provider

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();
Copy link
Collaborator

Choose a reason for hiding this comment

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

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?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah agreed, I can write it as such

@Maddiaa0 Maddiaa0 force-pushed the md/other-type-p2p-validators branch from 7737ab7 to a0ef925 Compare December 18, 2024 17:54
@Maddiaa0 Maddiaa0 merged commit a17d319 into master Dec 18, 2024
78 checks passed
@Maddiaa0 Maddiaa0 deleted the md/other-type-p2p-validators branch December 18, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e-p2p CI: Enables this CI job.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants