Skip to content

Conversation

@PatStiles
Copy link
Contributor

Closes #1113 and Closes #1015 .

Adds a task sender based on the previous make script for stress testing the network. It spawns infinite tokio tasks submitting groth16 proofs to aligned across n threads.

To Test

  • Run a local testnet
  • Start the task sender via
make batcher_send_infinite_burst
make batcher_send_infinite_stream
make batcher_connections NUM_SENDERS=<# connections>

@PatStiles PatStiles requested review from IAvecilla, JuArce and uri-99 and removed request for JuArce and uri-99 October 3, 2024 03:37

func GenerateIneqProof(x int) {
outputDir := "scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/"
outputDir := "../../scripts/test_files/gnark_groth16_bn254_infinite_script/infinite_proofs/"
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this should just be a parameter.


let chain_id = get_chain_id(&args.eth_rpc_url).await.map_err(|e| {
SubmitError::GenericError(format!(
"Failed to retrieve chain id, verify `eth_rpc_url` is cor/rect or local testnet is running on \"http://localhost:8545\": {}", e
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Failed to retrieve chain id, verify `eth_rpc_url` is cor/rect or local testnet is running on \"http://localhost:8545\": {}", e
"Failed to retrieve chain id, verify `eth_rpc_url` is correct or local testnet is running on \"http://localhost:8545\": {}", e

for t in threads {
if let Err(e) = t.join() {
error!("Thread panicked: {:?}", e);
return Ok(());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: don't return, just report the panic and wait for the other tasks.

);
let nonce = nonce.fetch_add(burst_size as u64, Ordering::Relaxed);
let batcher_url = batcher_url.clone();
let wallet = wallet.clone();
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if each thread could use a unique wallet. Using the same one might force serialization in the batcher if it represents the same operator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this we would need to programmatically create and fund accounts on anvil for each wallet. This is possible using via two methods:

  • The task sender initiates anvil with num_senders accounts pre-funded and extract the private keys and addresses.
  • Each thread generates an address and private key pair then calls anvil_setBalance https://book.getfoundry.sh/reference/anvil/ .

@PatStiles PatStiles self-assigned this Oct 7, 2024
@PatStiles PatStiles changed the base branch from testnet to staging October 7, 2024 15:12
@MarcosNicolau
Copy link
Member

Closing this one in favour of #1189

@JuArce JuArce deleted the 1015-rust-task-sender branch January 2, 2025 15:18
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.

Write a stress test for concurrent connections create rust program with the SDK to mimic infinite proof submission scripts

8 participants