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

Various improvements coming out of stress testing #29

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

shamsasari
Copy link
Contributor

@shamsasari shamsasari commented Jul 30, 2024

Created a simple stress testing tool which can submit a large number of vote requests across all active polls on the network. It takes a start and end derivation index, and uses a base mnemonic secret phrase to create a large number of accounts. The only manual process is assigning tokens with the faucet. The tool invokes the client via its command line interface. This required moving all of the client logic from its main.rs into lib.rs. The verification logic was moved into its own file.

The following improvements were made as a result:

  • Dealing with rate limiting from subscan by retrying after Retry-After seconds (if the header is present)
  • Returning 429 Too Many Requests status code on /vote and /remove-vote if the DynamoDB operation errors with ProvisionedThroughputExceededException or RequestLimitExceeded. The client has been updated with retry logic to deal with this.
  • Using subscan to retrieve extrinsic sender account when determining the voters for a poll (which is done to check for clients voting outside of Glove), instead of using the system BlockHash storage. Node endpoint services (or at least some of them) seem to be discarding blocks after a certain amount of time and can't be relied upon for this.
  • This extrinsic sender account information is cached globally to prevent it being retrieved repeatedly by the background thread (which runs every 60s)

The node_endpoint field from /info has also been removed. Some endpoint services require an API key, which would be part of the URL, and thus having the endpoint in /info would be leaking it. Clients can pick their own endpoint using the network_name field.

@shamsasari shamsasari force-pushed the shams-stress-test branch 2 times, most recently from e755ff6 to 7f14aea Compare July 30, 2024 13:22
@shamsasari shamsasari requested a review from noah-foltz July 30, 2024 13:25
@shamsasari shamsasari merged commit 35d4001 into main Jul 31, 2024
1 check passed
@shamsasari shamsasari deleted the shams-stress-test branch July 31, 2024 13:34
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