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

STREAM-1500: throttle tx sending #167

Merged
merged 6 commits into from
Apr 22, 2024
Merged

STREAM-1500: throttle tx sending #167

merged 6 commits into from
Apr 22, 2024

Conversation

Yolley
Copy link
Collaborator

@Yolley Yolley commented Apr 22, 2024

  • add sendRate parameter to all methods in Solana clients - to control rate of spamming the RPC with send requests
  • use shared throttler in createMjultiple

@Yolley Yolley requested a review from RolginRoman April 22, 2024 02:35
Comment on lines 500 to 504
responses.push(
...(await Promise.allSettled([
sendAndConfirmStreamRawTransaction(this.connection, batchTx, { hash, context }),
executeTransaction(this.connection, batchTx.tx, { hash, context }, { sendRate }),
])),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

why not executeMultipleTransactions here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because we can't, please check comments right on top of this if.

packages/common/solana/utils.ts Outdated Show resolved Hide resolved
packages/common/solana/utils.ts Outdated Show resolved Hide resolved
packages/common/solana/utils.ts Outdated Show resolved Hide resolved
preflightCommitment: commitment,
skipPreflight: true,
});
await sendThrottler.add(async () =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it required for us to have global-like queue so we don't hit RPCs limit across several invocations of send... APi

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it should be handled on the client-side, like FE should have this throttler and pass it to methods. But not in the sdk I think.

@Yolley Yolley merged commit 254c8af into master Apr 22, 2024
2 checks passed
@Yolley Yolley deleted the oleg/feature/throttle_send branch April 22, 2024 15:51
Copy link

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.

2 participants