Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Have an upgrade strategy for the network protocol #1518

Open
tomaka opened this issue Jan 22, 2019 · 6 comments
Open

Have an upgrade strategy for the network protocol #1518

tomaka opened this issue Jan 22, 2019 · 6 comments
Labels
J0-enhancement An additional feature request. U3-nice_to_have Issue is worth doing eventually.
Milestone

Comments

@tomaka
Copy link
Contributor

tomaka commented Jan 22, 2019

The network protocol (the data structures in network/src/message.rs) changes from time to time, but we don't have any upgrade strategy. If the networking changes, we will suddenly start dropping peers that don't use the same version.

There is a protocol_version variable in the source code, but modifying it makes us instantly incompatible with nodes having a different version.

Libp2p has a version negotiation system that makes it possible to support multiple version at the same time, but we don't benefit from it.

How to do that without bloating the code is however unclear.

@tomaka tomaka added this to the 1.0 (final) milestone Jan 22, 2019
@tomaka tomaka changed the title Have an upgrade strategy for the protocol versions Have an upgrade strategy for the network protocol Jan 22, 2019
@gavofyork gavofyork added the J0-enhancement An additional feature request. label Jan 22, 2019
@tomaka tomaka mentioned this issue Feb 5, 2019
12 tasks
@gavofyork gavofyork modified the milestones: 1.1, 1.0 Feb 6, 2019
@arkpar
Copy link
Member

arkpar commented Feb 20, 2019

Fixed in #1811

@tomaka
Copy link
Contributor Author

tomaka commented Feb 20, 2019

That's not really what I had in mind. If we modify the Message struct, we still break the network protocol. The source code should be organized in a way to make it easy to continue supporting old versions.

@arkpar
Copy link
Member

arkpar commented Feb 20, 2019

#1811 Adds min_supported_version to the Status packet and changes the version check. This allows nodes to declare that they support backwards compatibility.

@tomaka
Copy link
Contributor Author

tomaka commented Feb 20, 2019

Yeah, we have some networking mechanism, but there's no reasonable way in the source code to support two different versions. If someone wants to modify Message, having to maintain backwards compatibility is a daunting task.

@gavofyork
Copy link
Member

encoding Header with serde is not the answer. we could encode the non-runtime datastructures with codec and then use serde on the network-specific data structures that includes them, i guess.

@gavofyork gavofyork modified the milestones: 1.0, 1.1, 1.x series Mar 27, 2019
@tomaka
Copy link
Contributor Author

tomaka commented Mar 27, 2019

encoding Header with serde is not the answer. we could encode the non-runtime datastructures with codec and then use serde on the network-specific data structures that includes them, i guess.

That's exactly what I wanted to do in #2011

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request. U3-nice_to_have Issue is worth doing eventually.
Projects
Status: Backlog 🗒
Development

No branches or pull requests

4 participants