-
Notifications
You must be signed in to change notification settings - Fork 375
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
Load test clients #1806
Load test clients #1806
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1806 +/- ##
=========================================
Coverage ? 74.45%
=========================================
Files ? 281
Lines ? 7817
Branches ? 973
=========================================
Hits ? 5820
Misses ? 1880
Partials ? 117
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor arrangement questions that could also be solved in a different PR, looks great overall, thanks for reviving it!
@@ -0,0 +1,3 @@ | |||
# common | |||
|
|||
This contains common helper templates to be used across different helm charts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
@@ -0,0 +1,30 @@ | |||
{{- define "common.init-genesis-container" -}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have the static nodes on GCP, should we just pull them into their own init container as well to share?
component: load-test | ||
spec: | ||
initContainers: | ||
- name: generate-keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we are at it, i feel like we could pull this into common
as well?
I know we talked about how these clients should be able to connect to full nodes that are not the specified static nodes, but if we could somehow verify that, that would be great |
Update: hoping to merge this today, e2e sync test is failing so I will have to figure that out |
Closing in favor of #2073, which included this PR |
Description
Load test clients!
This introduces two .env vars:
LOAD_TEST_CLIENTS
:The number of load test client accounts. These accounts (generated using the mnemonic) are given cGLD in the genesis & cUSD during contract migrations. This is the default number of load test clients that are deployed, but that can be overridden with a cmd flag
LOAD_TEST_TX_DELAY_MS
:The number of milliseconds a load test client will sleep between transaction sends.
Overview
Load test clients are ultralight clients that are deployed as a statefulset. Each pod has two containers that run simultaneously: an ultralight geth client, and a celotool container running the command
celotool geth simulate-client
. The client simulation uses contractkit to send transactions everyLOAD_TEST_TX_DELAY_MS
milliseconds (unless overridden). The currency and gas currency (cGLD/cUSD) for a transaction are chosen randomly. Transactions from a load test client at indexi
will be sent to the load test client at index(i + 1) % (total num of clients)
, so the funds will be circulated only amongst load-test accounts.Here's the help for deploying load-test
Tested
Ran my own testnet, ensured that the genesis & contract migration set the correct account balances. Spun up load-clients, upgraded them, destroyed them, etc. Made sure transactions were succeeding by looking at the logs & by looking at blockscout. You can see it in action right now at https://trevor3-blockscout.celo-networks-dev.org/ (if it doesn't seem like it's happening I probably took down the light clients).
Other changes
I wanted to use some helm templates from the
testnet
chart in theload-test
chart, so I created a common helm chart for shared templates calledcommon
.I also finally moved the bootnode address to be generated with the bootnode account type, and not the load test account type
Removed a duplicate of the sleep function
I also saw that contractkit was only aware of the public variable
gasPriceMinimum
(which corresponds to the cGLD gas price, link) inGasPriceMinimum.sol
, and notgetGasPriceMinimum(address tokenAddress)
(which will provide the gas price for any token, link), so I added that. I ended up not needing to use that function in this PR after all, but thought it'd be good to keep in.Related issues
Backwards compatibility
Requires new genesis & contract deployments so that load test accounts are fauceted