Skip to content
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

UDP based transaction ingestion is too simple for current usage patterns #22726

Closed
jstarry opened this issue Jan 25, 2022 · 4 comments
Closed

Comments

@jstarry
Copy link
Member

jstarry commented Jan 25, 2022

Problems

Each transaction needs to be sent to the current leader over UDP to the leader's TPU port.

  • Because packet fragmentation is slow, transactions must be sent in a single small datagram (currently no more than 1232 byte payload).
  • Since UDP is unreliable, clients don't know if their sent transaction has been received and so they repeatedly send txs until they eventually observe their tx included in a block or the tx expires.
  • Due to IP spoofing, a leader cannot reliably enforce rate limiting for clients

Proposed Solution

Add support for the QUIC protocol for ingesting transactions to get

  1. Support for larger transactions
  2. Reliable transmission
  3. Enforceable rate limiting
  4. standardized flow control which can be potentially offloaded to something outside the validator
@riptl
Copy link
Contributor

riptl commented Jan 26, 2022

@jstarry @sakridge @ryleung-solana What is the proposed way to submit transactions using QUIC?

The PR seems to use both datagrams and streams.

Some additional context:

  • QUIC datagrams cannot be fragmented so they cannot support larger transactions.
  • QUIC datagrams are ACK-eliciting so senders can detect if the recipient has ingested their DATAGRAM.
  • Benchmarks have shown that each CPU core can handle about 10000 QUIC stream creations per second using the quinn server.
  • Rate-limiting for DATAGRAM can be enforced through bandwidth using MAX_DATA frames and rate limiting for stream creation and per-stream bandwidh through MAX_STREAMS and MAX_STREAM_DATA frames.

@jstarry
Copy link
Member Author

jstarry commented Jan 26, 2022

Streams seem well suited for intra-validator tx forwarding, RPC nodes, program deploys, oracles, and bots. But I'm not sure what the plan is for rate limiting unknown clients, I imagine we'd use datagrams for that and then maybe leaders could have both a global rate limiter and a rate limit per tx signer.

(Edited because I misunderstood that acks don't require bidirection streams)

@jstarry
Copy link
Member Author

jstarry commented Jun 17, 2022

This issue isn't valuable anymore because the migration to QUIC is well underway. There are other issues tracking migration progress.

@jstarry jstarry closed this as completed Jun 17, 2022
@solana-labs solana-labs locked as spam and limited conversation to collaborators Jul 8, 2022
@solana-labs solana-labs unlocked this conversation Jul 8, 2022
@solana-labs solana-labs locked as resolved and limited conversation to collaborators Jul 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@jstarry @riptl and others