Grin: cannot fully deploy "kernel first" tx broadcast without network split...

Created on 7 Nov 2018  路  6Comments  路  Source: mimblewimble/grin

  • We deployed the necessary changes to allow "kernel first" tx broadcast in #1929.
  • There is a new bit flag on capabilities to enable this on a per-node basis (currently not enabled by default).
  • But old nodes do not deserialize capabilities bitflags with the new flag set... (#1945).

    • This is fixed and made more robust in #1946 for future capability changes.

To be clear - this is not a problem specific to "kernel first" changes, it is an underlying issue with how we currently deserialize the peer capabilities bitflags on the Hand/Shake msgs.
We cannot add new capabilities (via currently unused bits) as old nodes will refuse to parse the new flags...

How do we roll this out across the network?
We want to enable the TX_KERNEL_HASH capability so nodes can advertise their support of this new style tx broadcast, but to do this we need _other_ nodes to upgrade to latest code (to safely support additional capabilities). Currently a node enabling this capability will be split off from the network as peers treat this as CorruptedData.

tl;dr New nodes that enable this new capability will not successfully connect to "legacy" nodes.

We just need a majority of nodes on the network with the updated capability handling code, the nodes do not need to have the TX_KERNEL_HASH capability enabled.

Q) Do we need to roll out a soft-fork (not at the consensus level, but at the networking level)?
i.e.

  • Deploy code so that this capability will be automatically enabled at a specific block height
  • Notify network participants via gitter/forum
  • keep nudging everyone to update and redeploy?
consensus breaking enhancement must-have question

Most helpful comment

Logs from a node with TX_KERNEL_HASH enabled-

20181114 11:27:30.812 DEBUG grin_p2p::protocol - handle_payload: received tx kernel: 2aa8520d, msg_len: 32
20181114 11:27:30.812 DEBUG grin_p2p::peer - Requesting tx (kernel hash) 2aa8520d from peer 217.182.192.59:13414.
20181114 11:27:30.841 DEBUG grin_p2p::protocol - handle_payload: received tx kernel: 2aa8520d, msg_len: 32
20181114 11:27:30.841 DEBUG grin_p2p::peer - Requesting tx (kernel hash) 2aa8520d from peer 167.99.87.54:13414.
20181114 11:27:30.848 DEBUG grin_p2p::protocol - handle_payload: received tx kernel: 2aa8520d, msg_len: 32
20181114 11:27:30.848 DEBUG grin_p2p::peer - Requesting tx (kernel hash) 2aa8520d from peer 144.76.158.135:13414.
20181114 11:27:30.848 DEBUG grin_p2p::protocol - handle_payload: received tx: msg_len: 1638
20181114 11:27:30.848 DEBUG grin_servers::common::adapters - Received tx d5296725, inputs: 1, outputs: 2, kernels: 1, going to process.
20181114 11:27:30.860 DEBUG grin_pool::pool - add_to_pool [txpool]: d5296725 (p2p), in/out/kern: 1/2/1, pool: 0 (at block 01a51de8)
20181114 11:27:30.861 DEBUG grin_p2p::peer - Send full tx d5296725 to 54.198.222.93:13414
20181114 11:27:30.861 DEBUG grin_p2p::peer - Not sending tx d5296725 to 217.182.192.59:13414 (already seen)
20181114 11:27:30.861 DEBUG grin_p2p::peer - Send full tx d5296725 to 51.15.219.12:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Send full tx d5296725 to 198.245.50.26:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Send full tx d5296725 to 52.23.180.2:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Send full tx d5296725 to 163.172.177.250:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Not sending tx kernel hash 2aa8520d to 144.76.158.135:13414 (already seen)
20181114 11:27:30.862 DEBUG grin_p2p::peer - Send full tx d5296725 to 54.38.70.127:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Send full tx d5296725 to 52.203.10.175:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Not sending tx kernel hash 2aa8520d to 167.99.87.54:13414 (already seen)
20181114 11:27:30.863 DEBUG grin_p2p::peer - Send tx kernel hash 2aa8520d to 167.99.53.226:13414
20181114 11:27:30.863 DEBUG grin_p2p::peer - Send full tx d5296725 to 185.53.158.12:13414
20181114 11:27:30.864 DEBUG grin_p2p::peers - broadcast_transaction: d5296725 to 9 peers, done.

All 6 comments

Actually this won't even work cleanly with a soft-fork as we only advertise capabilities during the initial Hand/Shake...

Edit: We basically need to get people to upgrade their nodes and then when we're happy that most nodes (or at least a large percentage of nodes) are upgraded we can start enabling this feature on _some_ nodes and see how connected they are on restart and roll it out gradually that way.

Once we're happy we can enable it by default for new nodes (via the default config file).

Sounds good. Maybe we can increment the minor version in the user agent to get an idea of how many nodes have upgraded? We should also allow for unknown capabilities so we don't have to go through those shenanigans anytime we want to deploy a new one.

Hadn't seen #1944, nice job!

breaking change -> major version increase, as per semver?

This is now deployed and enabled by default in config file, so new nodes will broadcast "kernel first" by default.
Existing nodes should update capabilities to 15 to enable this.

Logs from a node with TX_KERNEL_HASH enabled-

20181114 11:27:30.812 DEBUG grin_p2p::protocol - handle_payload: received tx kernel: 2aa8520d, msg_len: 32
20181114 11:27:30.812 DEBUG grin_p2p::peer - Requesting tx (kernel hash) 2aa8520d from peer 217.182.192.59:13414.
20181114 11:27:30.841 DEBUG grin_p2p::protocol - handle_payload: received tx kernel: 2aa8520d, msg_len: 32
20181114 11:27:30.841 DEBUG grin_p2p::peer - Requesting tx (kernel hash) 2aa8520d from peer 167.99.87.54:13414.
20181114 11:27:30.848 DEBUG grin_p2p::protocol - handle_payload: received tx kernel: 2aa8520d, msg_len: 32
20181114 11:27:30.848 DEBUG grin_p2p::peer - Requesting tx (kernel hash) 2aa8520d from peer 144.76.158.135:13414.
20181114 11:27:30.848 DEBUG grin_p2p::protocol - handle_payload: received tx: msg_len: 1638
20181114 11:27:30.848 DEBUG grin_servers::common::adapters - Received tx d5296725, inputs: 1, outputs: 2, kernels: 1, going to process.
20181114 11:27:30.860 DEBUG grin_pool::pool - add_to_pool [txpool]: d5296725 (p2p), in/out/kern: 1/2/1, pool: 0 (at block 01a51de8)
20181114 11:27:30.861 DEBUG grin_p2p::peer - Send full tx d5296725 to 54.198.222.93:13414
20181114 11:27:30.861 DEBUG grin_p2p::peer - Not sending tx d5296725 to 217.182.192.59:13414 (already seen)
20181114 11:27:30.861 DEBUG grin_p2p::peer - Send full tx d5296725 to 51.15.219.12:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Send full tx d5296725 to 198.245.50.26:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Send full tx d5296725 to 52.23.180.2:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Send full tx d5296725 to 163.172.177.250:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Not sending tx kernel hash 2aa8520d to 144.76.158.135:13414 (already seen)
20181114 11:27:30.862 DEBUG grin_p2p::peer - Send full tx d5296725 to 54.38.70.127:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Send full tx d5296725 to 52.203.10.175:13414
20181114 11:27:30.862 DEBUG grin_p2p::peer - Not sending tx kernel hash 2aa8520d to 167.99.87.54:13414 (already seen)
20181114 11:27:30.863 DEBUG grin_p2p::peer - Send tx kernel hash 2aa8520d to 167.99.53.226:13414
20181114 11:27:30.863 DEBUG grin_p2p::peer - Send full tx d5296725 to 185.53.158.12:13414
20181114 11:27:30.864 DEBUG grin_p2p::peers - broadcast_transaction: d5296725 to 9 peers, done.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

DavidBurkett picture DavidBurkett  路  6Comments

antiochp picture antiochp  路  3Comments

lehnberg picture lehnberg  路  4Comments

ignopeverell picture ignopeverell  路  3Comments

antiochp picture antiochp  路  7Comments