ethereum / devp2p

Ethereum peer-to-peer networking specifications
979 stars 275 forks source link

discv5: passive topic registration #144

Open decanus opened 4 years ago

decanus commented 4 years ago

So I am currently looking at the discv5 spec, and I notice that if a node wants to advertise a specific topic it needs to REGTOPIC on that specific node. I wonder if it makes sense to advertise topics in the ENR as an array of topics that MUST then be added to the topic table for a specific node. This would allow nodes to already add their peers to the topic table for the most important topics and allow for further adding other topics using the REGTOPIC command.

fjl commented 4 years ago

We decided early on that topics do not belong in ENRs. In the discv5 data model, ENRs are stored in the topic table. If we want to support some kind of pre-registration for topics without an explicit REGTOPIC, the topics would need to be sent alongside the ENR, or in PING.

decanus commented 4 years ago

@fjl I think something like this would make sense to reduce the amount of requests required from a client.