Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Added option to turn on UDP for TPU transaction and make UDP based TPU off by default #27462

Merged
merged 13 commits into from
Sep 7, 2022

Conversation

lijunwangs
Copy link
Contributor

@lijunwangs lijunwangs commented Aug 30, 2022

Problem

Introduce a way to turn down UDP based TPU off by default and an option to turn on it.

Summary of Changes

--tpu-enable-udp is introduced. And when this is on, the transaction receive and transaction forward is enabled using udp.

Except for a few tests which was hard-coded sending transactions using udp, most tests are being done with udp based tpu disabled.

Fixes #

@lijunwangs lijunwangs marked this pull request as draft August 30, 2022 22:10
@lijunwangs lijunwangs changed the title Added option to turn off UDP for TPU transaction Added option to turn on UDP for TPU transaction and make UDP based TPU off by default Aug 30, 2022
@lijunwangs
Copy link
Contributor Author

Investigating local_cluster test failure with udp disabled.

@lijunwangs lijunwangs requested a review from carllin September 2, 2022 20:05
@lijunwangs lijunwangs force-pushed the turn_udp_tpu_by_default branch from 2bddf28 to 3ca337d Compare September 6, 2022 20:39
@lijunwangs lijunwangs requested a review from pgarg66 September 6, 2022 22:59
@pgarg66
Copy link
Contributor

pgarg66 commented Sep 6, 2022

It's passing DEFAULT_TPU_ENABLE_UDP at most places where TestValidator is being initialized. There are only a few tests that are passing true (e.g. test_rpc_subscriptions). So, instead of passing the flag, can we just use it directly inside TestValidator constructor functions. Maybe define a new constructor that enables the UDP for the test cases that really need UDP. It'll remove the code change from a lot of files, and also remove the Cargo dependency on tpu-client

@lijunwangs
Copy link
Contributor Author

It's passing DEFAULT_TPU_ENABLE_UDP at most places where TestValidator is being initialized. There are only a few tests that are passing true (e.g. test_rpc_subscriptions). So, instead of passing the flag, can we just use it directly inside TestValidator constructor functions. Maybe define a new constructor that enables the UDP for the test cases that really need UDP. It'll remove the code change from a lot of files, and also remove the Cargo dependency on tpu-client

Good idea. Let me look into it

@pgarg66
Copy link
Contributor

pgarg66 commented Sep 7, 2022

It's passing DEFAULT_TPU_ENABLE_UDP at most places where TestValidator is being initialized. There are only a few tests that are passing true (e.g. test_rpc_subscriptions). So, instead of passing the flag, can we just use it directly inside TestValidator constructor functions. Maybe define a new constructor that enables the UDP for the test cases that really need UDP. It'll remove the code change from a lot of files, and also remove the Cargo dependency on tpu-client

Good idea. Let me look into it

Thanks for addressing it. I had another minor nit. Please see if it makes sense.

You can add the flag (tpu_enable_udp) to TestValidatorGenesis and default it to DEFAULT_TPU_ENABLE_UDP (and, set it to true in with_no_fees_udp()). Pass the flag to TestValidator::start() in start_with_mint_address() reading from self.

This will reduce the changes in test-validator and some of the tests.

@lijunwangs
Copy link
Contributor Author

It's passing DEFAULT_TPU_ENABLE_UDP at most places where TestValidator is being initialized. There are only a few tests that are passing true (e.g. test_rpc_subscriptions). So, instead of passing the flag, can we just use it directly inside TestValidator constructor functions. Maybe define a new constructor that enables the UDP for the test cases that really need UDP. It'll remove the code change from a lot of files, and also remove the Cargo dependency on tpu-client

Good idea. Let me look into it

Thanks for addressing it. I had another minor nit. Please see if it makes sense.

You can add the flag (tpu_enable_udp) to TestValidatorGenesis and default it to DEFAULT_TPU_ENABLE_UDP (and, set it to true in with_no_fees_udp()). Pass the flag to TestValidator::start() in start_with_mint_address() reading from self.

This will reduce the changes in test-validator and some of the tests.

Done

Copy link
Contributor

@pgarg66 pgarg66 left a comment

Choose a reason for hiding this comment

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

LGTM

@lijunwangs lijunwangs marked this pull request as ready for review September 7, 2022 20:17
@lijunwangs lijunwangs merged commit 7f223dc into solana-labs:master Sep 7, 2022
mergify bot pushed a commit that referenced this pull request Sep 7, 2022
…U off by default (#27462)

--tpu-enable-udp is introduced. And when this is on, the transaction receive and transaction forward is enabled using udp.

Except for a few tests which was hard-coded sending transactions using udp, most tests are being done with udp based tpu disabled.

(cherry picked from commit 7f223dc)

# Conflicts:
#	cli/src/cli.rs
#	core/src/tpu.rs
#	core/src/validator.rs
#	local-cluster/src/local_cluster.rs
#	net/net.sh
#	net/remote/remote-node.sh
#	test-validator/src/lib.rs
#	validator/src/main.rs
mergify bot added a commit that referenced this pull request Sep 8, 2022
…U off by default (backport #27462) (#27658)

* Added option to turn on UDP for TPU transaction and make UDP based TPU off by default (#27462)

--tpu-enable-udp is introduced. And when this is on, the transaction receive and transaction forward is enabled using udp.

Except for a few tests which was hard-coded sending transactions using udp, most tests are being done with udp based tpu disabled.

(cherry picked from commit 7f223dc)

# Conflicts:
#	cli/src/cli.rs
#	core/src/tpu.rs
#	core/src/validator.rs
#	local-cluster/src/local_cluster.rs
#	net/net.sh
#	net/remote/remote-node.sh
#	test-validator/src/lib.rs
#	validator/src/main.rs

* Fixed merge conflicts

* Fixed another conflict

* Fixed a fmt

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
lijunwangs added a commit to lijunwangs/solana that referenced this pull request Sep 27, 2022
…U off by default (backport solana-labs#27462) (solana-labs#27658)

* Added option to turn on UDP for TPU transaction and make UDP based TPU off by default (solana-labs#27462)

--tpu-enable-udp is introduced. And when this is on, the transaction receive and transaction forward is enabled using udp.

Except for a few tests which was hard-coded sending transactions using udp, most tests are being done with udp based tpu disabled.

(cherry picked from commit 7f223dc)

* Fixed merge conflicts

* Fixed another conflict

* Fixed a fmt

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
lijunwangs added a commit that referenced this pull request Sep 27, 2022
…U off by default (backport #27462) (#27658)

* Added option to turn on UDP for TPU transaction and make UDP based TPU off by default (#27462)

--tpu-enable-udp is introduced. And when this is on, the transaction receive and transaction forward is enabled using udp.

Except for a few tests which was hard-coded sending transactions using udp, most tests are being done with udp based tpu disabled.

(cherry picked from commit 7f223dc)

* Fixed merge conflicts

* Fixed another conflict

* Fixed a fmt

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
lijunwangs added a commit to lijunwangs/solana that referenced this pull request Oct 2, 2022
lijunwangs added a commit that referenced this pull request Oct 3, 2022
…based TPU off by default (backport #27462) (#27658)"

This reverts commit 1bbace4.
lijunwangs added a commit to lijunwangs/solana that referenced this pull request Oct 19, 2022
…ake UDP based TPU off by default (backport solana-labs#27462) (solana-labs#27658)""

This reverts commit 411f0a3.
lijunwangs added a commit that referenced this pull request Oct 19, 2022
…ake UDP based TPU off by default (backport #27462) (#27658)""

This reverts commit 411f0a3.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants