Skip to content

feat(p2p): override gossip topicValidators in gossipsub #10347

@Maddiaa0

Description

@Maddiaa0

Overview

We are not correctly overriding the topicValidator functionality in libp2p which means even if a node validates that a transaction is invalid, and alters the peer score accordingly, it will still propagate the message further to other peers.

Within libp2p topic validation logic is as so:
Image

Without the topic validator being set for a given topic Id, the MessageStatus will always be valid, even if we have separately validated that it is not.

This fix for this is trivial, for each p2p message we should set:
node.services.pubsub.topicValidators.set(topic, validator);

For each relevant topic.

For each topic:
Tx: use existing validation logic
Attestations: can the signature be recovered + is the proposal for the next slot and from the correct attester ( follow on from #10327)
Block Proposals: same as above
Epoch proof quotes: are they for the correct epoch

Metadata

Metadata

Assignees

Labels

C-nodeComponent: Aztec NodeC-p2pComponent: peer to peerP-high 🔥Priority: high. Do this task next.team-alphaPhil's team

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions