-
Notifications
You must be signed in to change notification settings - Fork 152
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
Fix allowing of selecting protocol versions after merge of 1.10.x #373
Fix allowing of selecting protocol versions after merge of 1.10.x #373
Conversation
@@ -51,6 +51,10 @@ var ( | |||
syncChallengeTimeout = 15 * time.Second // Time allowance for a node to reply to the sync progress challenge | |||
) | |||
|
|||
// DefaultProtocolVersions are the supported versions of the `eth` protocol (first | |||
// is primary). | |||
var DefaultProtocolVersions = []uint{eth.ETH66, eth.ETH65, eth.ETH64} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This had to be set in the eth package as the protocol has nested packages logic for (eth|snap) protocols.
@@ -543,7 +543,7 @@ func (s *Ethereum) BloomIndexer() *core.ChainIndexer { return s.bloomIndexer } | |||
// Protocols returns all the currently configured | |||
// network protocols to start. | |||
func (s *Ethereum) Protocols() []p2p.Protocol { | |||
protos := eth.MakeProtocols((*ethHandler)(s.handler), s.networkID, s.ethDialCandidates) | |||
protos := eth.MakeProtocols((*ethHandler)(s.handler), s.networkID, s.config.ProtocolVersions, s.ethDialCandidates) | |||
if s.config.SnapshotCache > 0 { | |||
protos = append(protos, snap.MakeProtocols((*snapHandler)(s.handler), s.snapDialCandidates)...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment we only have a flag for the eth protocols (66|65|64) and not for the snap protocols. I am not sure if we prefer handling the snap protocol version now or leave them out, as it's just one at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, thanks for noticing this. SGTM to leave as-is (no flag), then think about adding one when there's more than one to choose from.
So the This patch fixes that flag to be effectual again, and to support the 66,65,64 set. Just making sure I understand the motivation and context here. |
Yes, you recall correctly. This has been added on core-geth only for this exact reason. |
Note that I've created #375 in response to the failing tests here; it's just an impatient timeout issue. |
Keep in mind that Eth protocol version 63 has been dropped.
EDIT(meowsbits) (And 62 was dropped a long time ago.)
Ref #365