devp2p icon indicating copy to clipboard operation
devp2p copied to clipboard

discv5: protocol version v5.2

Open fjl opened this issue 2 years ago • 6 comments

This is a tracking issue for the next discv5 protocol version.

Development of Discovery v5.2 will happen in the discv5-v5.2 branch. To contribute, please send PRs to that branch instead of the main branch.

Spec changes

Here is the list of spec changes expected for the new protocol version:

  • [x] Update the protocol version number.
  • [x] Remove description of topic index and related messages. These will be brought back later (likely in v5.3), but should be removed for now, since they are not part of the actively-used protocol.
  • [ ] Add spec text to define handling of protocol version upgrades.
    • It's not yet clear how the upgrade will work. The protocol version will increase, and some implementations might reject packets with a mismatching version even though the spec doesn't say they should.
    • We could add spec text to the effect that protocol versions higher than the local version should be dealt with by responding with the local version (unless the packet can't be decoded).
    • Might be best to handle this upgrade with an ENR key. I claim dibs on key d5.
  • [x] Add the NAT hole punching protocol messages. #225 #207
  • [ ] Notification packet type.
    • Specifically, for the NAT hole punching scheme, there is a need to introduce a new packet type that does not trigger a handshake in case the packet cannot be decrypted. The new type can also be used for response messages like NODES, TALKRESP, etc.
  • [ ] Define/explain the packet types (message packet, handshake packet, whoareyou packet etc.) better.
  • [ ] Add more text around attack countermeasures #161
    • The plan is to add this as an informational section, as a recommendation for implementers.
  • [ ] Change id-nonce handling in handshake packets. #164
  • [ ] Find a way to integrate Portal Network's use of the discv5 wire protocol in the spec. #192 #229
    • There might not be any spec changes resulting from this, I just want to make sure Portal Network can work with v5.2 as-is without depending on spec/implementation mods.
    • https://github.com/ethereum/devp2p/issues/261
  • [ ] Add a Changelog section to discv5.md.

Implementations

collect information about v5.2 implementation status here

Interop testing

  • [x] enable discv5 tests in hive devp2p simulator
    • [ ] ensure geth passes tests on there at least
    • [ ] probably should also work for portal clients
  • [ ] add tests for protocol version upgrade
  • [ ] add tests for NAT hole punching messages

fjl avatar Mar 31 '23 09:03 fjl

If implementers feel like it, we could also explore adding support for ed25519 node identities in v5.2. It'd be great to have an alternative identity system just to test the pipeline of shipping new ones, in case it has to be done quickly someday.

fjl avatar Mar 31 '23 09:03 fjl

Why not v5.1? Is the version number 5.1 used?

ppopth avatar Mar 31 '23 16:03 ppopth

Yes, v5.1 is the current protocol version.

fjl avatar Mar 31 '23 16:03 fjl

Hey @fjl, we are currently in the process of implementing Discv5 (v5.1) in C# and wanted to know if the components (advertisement, and message types) related to topics should be left out for now.

uink45 avatar May 23 '23 02:05 uink45

Yes, they should be left out. The topic advertisement mechanism is not ready yet and I have removed it in v5.2

fjl avatar May 23 '23 08:05 fjl

@fjl https://github.com/ethereum/devp2p/pull/231 should probably included in the task list

divagant-martian avatar May 27 '23 18:05 divagant-martian