Open NikVolf opened 4 years ago
cc @bkchr @tomusdrw @tomaka
The change from /transactions/1
to /transactions/2
requires https://github.com/paritytech/substrate/issues/6605
Prior work which I think we should really consider: https://arxiv.org/pdf/1905.10518.pdf (mentioned by @burdges some time ago). Especially: "Low-fanout flooding":
To meet our scalability goal (R1), we limit the flooding done by public nodes to eight outbound connections even if the total number of these connections is higher. this way, increasing connectivity does not increase transaction dissemination cost proportionally. the decision to relay through outbound connections, but not the inbound ones, was made to defend against timing attacks
Having the set reconciliation protocol also allows to improve block propagation (separate issue), where instead of sending a full block with all transactions over the wire, we only send the header + transaction hashes (since we know the recipient has the full transactions). More: https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki#HeaderAndShortIDs or Arweave's Blockshadow
We discussed it few times with @burdges already, and (I think) came to conclusion that with our projected TPS and block time this won't work as well as in Bitcoin (due to a lot of large reconciliations needed) or require huge adaptation which research team must first do and experiment on.
Which part do you mean exactly? Limiting flooding to fixed number of peers (or at least putting an upper bound) seems reasonable to me (same as block shadows). With set reconciliation, I agree, we can simply use the hash-announce and request-by-hash thing proposed here (which is based on eth EIP afaict).
Which part do you mean exactly?
reconciliation stuff from paper, algorithm non-linear on number of mempool updates (which essentially is TPS)
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.
Hey, is anyone still working on this?
No, but would be cool to see someone working on this. Happy to help and guide.
Problem
Currently, network protocol does not allow us to announce new transaction hashes or query transactions by hash from the given peer. This leads to the problem where we just send all transactions to all peers using existing
/transactions/1
protocol and supplying transaction data with it. Due to possibility that substrate can be used in some degenerate network topologies we also can't choose some subset of peers to propagate transactions only to them (so that they do the same and eventually all peers get all transactions - this will work only on well-connected network with normal topology).Transferring all transaction data to all peers is very costly in terms of traffic, thus we need to alter the protocol to allow on-demand requests of transaction data and new transactions hashes announcement.
Required changes
/transactions/2
and add announce transaction hashes message to it. Announce is just a collection of hashes.How propagation works now
/transactions/1
protocol.How propagation should work with this change
max(5, sqrt(peer_count))
peers using/transactions/1
protocol./transactions/2
protocol.