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

SIMD 0195 - tpu vote using QUIC #195

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

lijunwangs
Copy link

Added SIMD for tpu vote using QUIC

@lijunwangs lijunwangs marked this pull request as draft November 14, 2024 20:48
@lijunwangs lijunwangs marked this pull request as ready for review November 14, 2024 20:48
transaction transportation. The client and server both uses their validator's
identity key to sign the certificate which is used to validate the validator's
identity especially on the server side for the purpose of provding QOS based on
the client's stakes by checking the client's Pubkey -- stake weighted QOS.
Copy link

@wen-coding wen-coding Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saying: validator id to vote account association and the stake distribution could change at the Epoch boundary. At Epoch boundary you probably need to accept if the validator has stake in either the old Epoch or the new Epoch.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stake info is periodically updated and is eventual consistent. It applies the QOS based on the latest info as it see it. I do not think we need to complicate it to look at potentially two sets of data.


Once a QUIC connection is established, the client can send vote transaction
using QUIC UNI streams. In this design, a stream is used to send one single Vote
transaction. After that the stream is closed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How fast is it to open and close a stream? The QUIC connection will be persistent I assume?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open and close stream is light-weight operation. Can be done in one shot: open stream, send and close

The following QOS mechanisms are employed:

* Connection Rate Limiting from all clients
* Connection Rate Limiting from a particular IpAddress

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the limits here? I thought in QUIC we rate limit by pubkey instead of IP? Because others can spoof your IP.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For stake validation we are validating the pub key. This is only for connection rate limiting before handshake completion


* Connection Rate Limiting from all clients
* Connection Rate Limiting from a particular IpAddress
* Total concurrent connections from all clients -- this is set to 2500

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it dangerous to increase this limit? What if we suddenly have >2500 clients?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is up to the implementation. And we have plan to make this configurable. 2500 is more than enough for votes in mb

* Total concurrent connections from all clients -- this is set to 2500
* Max concurrent connections from a client Pubkey -- this is set to 1 for votes.
* Max concurrent streams per connection -- this is allocated based on the ratio
of the validator's stake over the total stakes of the network.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reasoning here? Why does higher-staked validator need more concurrent streams per connection?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give them more bandwidth as reward and ensure they have better chance landing their votes?

@lijunwangs lijunwangs changed the title Added SIMD for tpu vote using QUIC SIMD 0195 - tpu vote using QUIC Nov 15, 2024
Comment on lines 69 to 77
The following QOS mechanisms are employed:

* Connection Rate Limiting from all clients
* Connection Rate Limiting from a particular IpAddress
* Total concurrent connections from all clients -- this is set to 2500
* Max concurrent connections from a client Pubkey -- this is set to 1 for votes.
* Max concurrent streams per connection -- this is allocated based on the ratio
of the validator's stake over the total stakes of the network.
* Maximum of vote transactions per unit time which is also stake weighted
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Firedancer won't enforce any of these limits server-side.
These should more like implementation-specific behavior, so I suggest removing them from the SIMD.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed specific numbers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants