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

Initial implementations of the TPU Vortexor #3258

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

lijunwangs
Copy link

@lijunwangs lijunwangs commented Oct 22, 2024

Problem

Framework for Solana TPU vortexor which allows core validator to offload TPU receiving, sigverify and deduplications.

Summary of Changes

This is the first installment of the change. This is the framework part. It starts the TPU and forward stream based on the CLI configurations. In future PRs we will have the sigverify, forwarder, subscription management. The code has no impact to the existing validator.

Added a unit test for starting the vortexor, send some transactions and stops it.

Fixes #

.help("IP address to bind the validator ports"),
)
.arg(
Arg::with_name("dynamic_port_range")
Copy link

Choose a reason for hiding this comment

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

why does it need dynamic port range?

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 similar to how it is done in the validator side which allows the user to specify the range for the tpu addresses.

solana-logger = { workspace = true }

[lib]
crate-type = ["lib"]
Copy link

Choose a reason for hiding this comment

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

crate should be a bin right?

Copy link
Author

Choose a reason for hiding this comment

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

Yes. The crate generate a bin solana-vortexor. It can also support generating a library which can be used by other crates to develop. For example, I see these

ls target/debug | grep vortex
libsolana_vortexor.d
libsolana_vortexor.rlib
solana-vortexor
solana-vortexor.d

@@ -239,3 +245,46 @@ pub async fn make_client_endpoint(
.await
.expect("Test server should be already listening on 'localhost'")
}

pub async fn check_multiple_streams(
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 moved from nonblocking::quic::test to here to be reused for other testing

@behzadnouri
Copy link

Is there a design document or anything for this?
like what is the motivation and end goal here? how is the validator going to talk with this new binary? how does the binary obtain stakes to do stake-based QoS etc? does the binary need access to the private key of the validator? etc ...

@lijunwangs
Copy link
Author

lijunwangs commented Dec 2, 2024

Is there a design document or anything for this? like what is the motivation and end goal here? how is the validator going to talk with this new binary? how does the binary obtain stakes to do stake-based QoS etc? does the binary need access to the private key of the validator? etc ...

The motivation is to make TPU streaming, sig verification more scalable. The readme captures this: https://raw.githubusercontent.com/anza-xyz/agave/11908fbbcfab7194f954177c2da0646249ee308a/vortexor/Readme.md. I have set up a review meeting to go over this to give more context. The vortexor will retrieve the stake map via regular RPC service from configured validator -- the RPC can be either pairing validator or any other trusted RPC validator in the network supporting the RPC pub/sub service. The Vortexor does not need the private key to the validator.

@behzadnouri
Copy link

The Vortexor does not need the private key to the validator.

don't we need the private key for QUIC handshake ?

@lijunwangs
Copy link
Author

The Vortexor does not need the private key to the validator.

don't we need the private key for QUIC handshake ?

A private key is used to sign the TLS certificate. But the client does not care about if the key is the same as the one of the validator advertising the TPU address (The vortexor address). The client code does not check that and we have no use case to enforce that check -- this is the same currently using --public-tpu-address. Without requiring using the same private key making it more secure and simplify deployment.

@behzadnouri
Copy link

A private key is used to sign the TLS certificate. But the client does not care about if the key is the same as the one of the validator advertising the TPU address (The vortexor address). The client code does not check that and we have no use case to enforce that check

How does the client prune its connection cache when it becomes too big?
Isn't that by pubkey => stake mapping? and isn't the pubkey from QUIC handshake?

@lijunwangs
Copy link
Author

A private key is used to sign the TLS certificate. But the client does not care about if the key is the same as the one of the validator advertising the TPU address (The vortexor address). The client code does not check that and we have no use case to enforce that check

How does the client prune its connection cache when it becomes too big? Isn't that by pubkey => stake mapping? and isn't the pubkey from QUIC handshake?

We randomly select a connection to prune -- the current connection cache is agnostic of the stake map.

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