Repository navigation
eth/protocols/snap: list served versions in the ENR entry - #35944
Open
MysticRyuujin wants to merge 1 commit into
Open
MysticRyuujin wants to merge 1 commit into
MysticRyuujin wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
The
snapENR entry now lists the snap versions that the node serves.With snap/2 enabled, geth serves snap/1 and snap/2, but its ENR entry is the same empty list as a node that serves only snap/1. A node that looks for snap/2 servers in discovery or in an EIP-1459
snap.*tree cannot find them.The EIP-8189 update in ethereum/EIPs#12493 defines the entry value as a list of served versions, as discussed in ethereum/devp2p#286. The spec is in ethereum/devp2p#287:
[]: snap/1 only.[1, 2]: snap/1 and snap/2.[2]: snap/2 only.Changes:
enrEntryholds the versions as an RLP tail list.MakeProtocolsbuilds one entry for all registered versions, in ascending order.devp2p nodeset filter -snapaccepts any list value, so it still selects these nodes.Tests:
TestENREntryEncodingchecks the pair bytes:84736e6170c0without snap/2 and84736e6170c20102with it. It also checks that every protocol version carries the same entry.TestENREntryDecodingdecodes[],[2]and[1, 2, 3].