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

add tvu port binding info to docs #4948

Merged
merged 6 commits into from
Mar 12, 2025

Conversation

alexpyattaev
Copy link

Summary of Changes

  • Documenting how we get multiple bound TVU sockets published via gossip.

@alexpyattaev alexpyattaev added the noCI Suppress CI on this Pull Request label Feb 12, 2025
@alexpyattaev alexpyattaev removed the noCI Suppress CI on this Pull Request label Feb 12, 2025
@alexpyattaev
Copy link
Author

@gregcusack do you like this?

@alexpyattaev alexpyattaev marked this pull request as ready for review February 12, 2025 12:35
@alexpyattaev alexpyattaev added the CI Pull Request is ready to enter CI label Feb 12, 2025
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Feb 12, 2025
Copy link

@gregcusack gregcusack left a comment

Choose a reason for hiding this comment

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

thank you for putting this together! just a few thoughts. biggest thing is that we should probably differentiate TVU quic and udp sockets. And then somewhere add that TPU is setup somewhat similarly. Although TPU also uses bind_more_with_config which I believe just enables more connections and ability to distribute load better.


## TVU sockets

Externally, TVU appears to bind to one port, typically 8002 UDP. Internally, TVU is actually bound with multiple sockets

Choose a reason for hiding this comment

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

so we have both UDP and QUIC ports for TVU. Probably makes sense to differentiate these two somewhere. UDP multibind with reuseport works on OS level. For quic tvu, we only bind to one socket. and the multiplexing is done at the protocol level.

Copy link
Author

Choose a reason for hiding this comment

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

done

## TVU sockets

Externally, TVU appears to bind to one port, typically 8002 UDP. Internally, TVU is actually bound with multiple sockets
to improve kernel's handling of the packet queues. It is setup so that a node can advertise one external ip/port for TVU/TPU. We're binding multiple sockets to the same port using SO_REUSEPORT:

Choose a reason for hiding this comment

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

external ip/port for TVU/TPU.

would maybe leave out TPU inline here. Maybe we can add something right after or even at the top saying TPU runs on similar port management logic

Copy link
Author

Choose a reason for hiding this comment

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

added note about TPU

alexpyattaev and others added 2 commits February 12, 2025 20:22
Co-authored-by: Greg Cusack <greg.cusack@anza.xyz>
Comment on lines +24 to +25
| | Turbine | | | +--+---------+ | | +-+------------+ | |
+------------+ Forwards | +-------+ ^ | | | | |

Choose a reason for hiding this comment

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

what is Turbine Forwards?

Copy link
Author

Choose a reason for hiding this comment

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

Packets that are getting produced by the Forwarding stage.

Choose a reason for hiding this comment

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

maybe i don't understand the nomenclature but I've never heard of "turbine forwards". Are you sure this shouldn't remain "TVU Forwards"? Is turbine the one doing the forwarding in this case?

Copy link
Author

Choose a reason for hiding this comment

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

Well, we have 2 principal flows of shreds in TVU - one that lands in them in the blockstore, and another one that sends them to the retransmit stage. Those are the packets to be forwarded via turbine tree. I guess we can call them turbine retransmits, but that could imply some sort of ARQ which is not what is happening.

Choose a reason for hiding this comment

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

oh ya i see what you're saying. turbine forwards are just when a node receives a shred in the turbine tree and needs to forward it to the next layer/its neighbors. got it

Comment on lines 8 to +11
TVU (Transaction Validation Unit) is the logic of the validator
responsible for validating and propagating blocks and processing
those blocks' transactions through the runtime.
responsible for propagating blocks between validators and ensuring that
those blocks' transactions reach the replay stage. Its principal external
interface is the turbine protocol.

Choose a reason for hiding this comment

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

not sure i completely agree with this. TVU validates the transactions it has received from turbine. turbine's role is propagating blocks between valdiators. TVU's role is validating those blocks

Copy link
Author

Choose a reason for hiding this comment

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

Well in this case the picture is all wrong (and it predates this PR)

Choose a reason for hiding this comment

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

TVU is also responnsible for validator the blocks.

Choose a reason for hiding this comment

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

possible reword here:

Suggested change
TVU (Transaction Validation Unit) is the logic of the validator
responsible for validating and propagating blocks and processing
those blocks' transactions through the runtime.
responsible for propagating blocks between validators and ensuring that
those blocks' transactions reach the replay stage. Its principal external
interface is the turbine protocol.
TVU (Transaction Validation Unit) is the validator component responsible for receiving, verifying, and propagating blocks between validators. It ensures transactions from blocks reach the replay stage for execution. Its principal external interface for block propagation is the Turbine protocol, which distributes blocks efficiently across the network.

Co-authored-by: Greg Cusack <greg.cusack@anza.xyz>
@alexpyattaev alexpyattaev requested a review from gregcusack March 7, 2025 11:17
Copy link

@gregcusack gregcusack left a comment

Choose a reason for hiding this comment

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

lgtm!

@alexpyattaev alexpyattaev merged commit 14432a4 into anza-xyz:master Mar 12, 2025
10 checks passed
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.

None yet

3 participants