-
Notifications
You must be signed in to change notification settings - Fork 758
chore(tests/load): C-chain load testing #3914
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
Merged
+2,476
−51
Merged
Changes from all commits
Commits
Show all changes
238 commits
Select commit
Hold shift + click to select a range
b713278
initial commit
qdm12 863adcc
Split listeners in poll and subscription depending if connection is w…
qdm12 c6030db
Always generate keys except for the prefunded key
qdm12 a560a94
Lower poll period from 1s to 50ms
qdm12 7942c76
Abort fund distribution if no key needs it
qdm12 f6e300c
Ginkgo setup
qdm12 a934818
Define client interfaces for poll and subscriber eth clients
qdm12 8224d4e
Observe block times working for both polling and websocket
qdm12 57ad33b
Use ginkgo context
qdm12 29502bd
Fail ginkgo properly using `ginkgo.GinkgoT().Error`
qdm12 a213610
Rely on ginkgo to handle OS signals
qdm12 2a859a2
Simplify unneeded run function
qdm12 2be38c1
Remove unneeded dependencies.go file
qdm12 8701f17
Unexport symbols
qdm12 e5f2f79
Use all prefunded keys instead of only one
qdm12 ee6132e
Thread safe tracker
qdm12 35450dc
CI setup
qdm12 5ea102a
Split issuer and listener
qdm12 3be8f03
Rename package names issuer and generator to issue and generate
qdm12 0251e6f
Mark remaining in flight transactions as failed when exiting listener
qdm12 8658ca0
Fix listener poll implementation
qdm12 66eb147
Use env network default nodes directly
qdm12 50095f6
Limit number of nodes to 1
qdm12 92616fc
Fix block production
michaelkaplan13 c2ebb6f
Fix listen subscription exit
qdm12 e323368
Minor comment fixes
qdm12 e13e3ae
Log out average duration per block at the end
qdm12 46b4e0d
Ignore load tests in unit tests
qdm12 b758aa5
Add load testing to readme
qdm12 f595e15
Fix double cancelation of listener subscription
qdm12 aed6ec4
Change metrics route to /ext/metrics
qdm12 1ce8f95
Fix distribution of funds
qdm12 b711dd0
Remove listener polling
qdm12 a7d46f7
Wait 3s after fund distribution to check for balances
qdm12 2514b3c
Do not track block durations
qdm12 20d972b
Merge branch 'master' into qdm12/tests/load
qdm12 3172d41
Tidy dependencies 🤷
qdm12 aa49787
Use initially created network
qdm12 15065c4
Replace in flight txs gauge with issued counter
qdm12 3cf8af8
Remove issuing detail metrics as likely unneeded
qdm12 8270efb
Unexport metrics fields
qdm12 55fdfdf
Change metrics to match hypersdk ones
qdm12 238dcff
Remove unneeded address field for issuer
qdm12 baabe22
Always set max tip cap to 1
qdm12 ea16ed3
Require largest balance address to remain with min funds
qdm12 ba4e377
Prevent new head subscriber race condition on exit
qdm12 db3010a
Fix minimum funds calculation
qdm12 f22abad
issue period configuration option
qdm12 77086f4
Final timeout config option
qdm12 c4fa76c
Add Prometheus and grafana instructions and configs
qdm12 435a0f1
Log tracker stats every 10s
qdm12 e2dd77f
Change counter tracker to noop tracker
qdm12 19d3b3a
Merge generator and issuer together
qdm12 b812419
Remove unneeded constant issuePeriod
qdm12 8aa1b53
init
RodrigoVillar f34d312
lint
RodrigoVillar 1155cd0
issue: add C chain opcode simulator issuer
qdm12 1f9b865
Generate contract using libevm abigen
qdm12 30961af
Merge branch 'master' into qdm12/tests/load
qdm12 4a4b7d7
migrate
RodrigoVillar 7497d56
Merge branch 'master' into add-load-framework
RodrigoVillar 98957e6
Pre-adapt to add-load-framework branch
qdm12 0faf824
Move issuers to c/issuers
qdm12 1f366f3
Move listener code to c/listener
qdm12 8ccb800
Update grafana dashboard
qdm12 a9e7e0f
Fix logging using avalanchego's logger
qdm12 97a154d
Fix gci linting
qdm12 ccaff10
relax generic type constraint
RodrigoVillar 855bfb9
remove unused logger from burst orchestrator
RodrigoVillar eed3292
MD => md
RodrigoVillar c2e2b01
Update tests/load/gradual_orchestrator.go
RodrigoVillar b5faf4f
nits
RodrigoVillar c33e894
Update tests/load/gradual_orchestrator.go
RodrigoVillar 480e4bc
remove named return parameters
RodrigoVillar 8e19faa
lint
RodrigoVillar 9385b6e
remove duplicate MD
RodrigoVillar 672f377
remove unnecessary errors from orchestrator constructors
RodrigoVillar 5ef5660
Update tests/load/gradual_orchestrator.go
RodrigoVillar 0595e31
make observerGroup a pointer
RodrigoVillar 3e2294f
default => new
RodrigoVillar 781bf60
convert tracker from interface to impl
RodrigoVillar b0ae321
single generic on gradual orchestrator
RodrigoVillar 4daa6b0
merge burst into gradual
RodrigoVillar 4232002
remove unnecessary orchestrator interface
RodrigoVillar 3ba6372
rm dependencies.go
RodrigoVillar a35ceef
rename gradual orchestrator to just orchestrator
RodrigoVillar 9f9eebd
add doc for NewOrchestratorConfig()
RodrigoVillar c1e5ace
use int64 throughout orchestrator
RodrigoVillar 8549ec2
use type constraint for txIDs
RodrigoVillar 3b1632a
Merge branch 'add-load-framework' into qdm12/tests/load
qdm12 d521e30
Unexport Distribute
qdm12 8113fd2
Update dashboard
qdm12 2963c89
Update dashboard
qdm12 ad060bb
Issuer implementation as config option
qdm12 ae437f3
Remove periodic log of tracker
qdm12 7064e1d
Lower tx rate multiplier to 1.05
qdm12 84c6ac1
Increase nodes count from 1 to 3
qdm12 f199d84
Reset sustained time to default 20s
qdm12 14c44f9
Remove unneeded logger from tracker
qdm12 a72032b
Fix copyright notices
qdm12 f2ddaf5
Fix ginkgo command for C chain tests
qdm12 be69a42
Add CI step to check contract bindings are up to date
qdm12 8217ce4
Ignore .bindings.go for copyright check
qdm12 2f05785
Run with 5 nodes at least
qdm12 e057026
Format solidity contract
qdm12 4f6ea60
Emit storage update for simulate call depth function
qdm12 7c32918
createAgent helper function
qdm12 a594234
createAgents helping function
qdm12 4cb0924
parallel agents creation
qdm12 8bfb800
Add intro to readme
qdm12 064c91e
Add contract creation testing
qdm12 4990e24
Add solhint to contract bindings generation script
qdm12 b86e904
Fix orchestrator bug
qdm12 0521a48
Add pure compute contract function
qdm12 1a6fab1
load/c/issuers/opcode: remove unused field lastIssue
qdm12 395676e
Large event emission simulation function
qdm12 7ba62b9
External contract call simulation function
qdm12 a100eb1
Remove unneeded ensureKey calls
qdm12 53e717a
Rename `config` to `loadConfig`
qdm12 4114688
Use max possible fee cap for simple txs
qdm12 201be41
Use coreth with high gas limit
qdm12 2a68455
Distribute uses the max fee cap (100 eth) to send its transactions
qdm12 41125d7
Set pre-funded keys to the number of agents
qdm12 564610a
Remove now unneeded distribution
qdm12 33b8146
Use secp256k1.PrivateKey to simplify code
qdm12 b778684
ci: load test monitoring (#3959)
Elvis339 559c39a
Bump rate multiplier to 1.1
qdm12 3aa0e99
Set config values that pass
qdm12 b24bf80
Try (fail) setting the gas limit without touching coreth
qdm12 26c8f3f
Remove unneeded EnsureKeys
qdm12 49ee4fe
ci: rename e2e_load to load_tests
qdm12 87faf42
taskfile: rename test-e2e-load to test-load
qdm12 8cc8864
Rename ginkgo_test.go to load_test.go
qdm12 a9b13cc
Use avalanche-monitoring grafana dashboard json
qdm12 9380693
Revert "Try (fail) setting the gas limit without touching coreth"
qdm12 3a6809d
Update readme for both remote and local visualization
qdm12 a657afc
Update readme for remote grafana
qdm12 c9cb787
fix(metrics): set server address for Prometheus scrape config
qdm12 35c13d1
Merge branch 'master' into qdm12/tests/load
qdm12 5aeb776
Import libevm instead of coreth for params package
qdm12 3de4dda
c/issuers/simple: remove unused lastIssue field
qdm12 7c0b301
c/readme: fix path to entrypoint as load_test.go
qdm12 d067e02
Use `task test-load`
qdm12 e2ecc1c
Fix CI workflow to run test-load task
qdm12 a60a5e8
ci: remove `filter_by_owner` field
qdm12 0a58664
Run generate-load-contract-bindings as part of load test task
qdm12 aa6e241
Remove load test command from e2e readme
qdm12 bb97a1e
ci: remove Contract bindings are up to date since it's already part o…
qdm12 9c79e06
Use abigen from go.mod libevm version
qdm12 de7dd40
Change ci artificat prefix to load
qdm12 93b5eef
Reduce flake.nix solc comment
qdm12 8d55364
Restrict contract bindings generation to c directory
qdm12 6f138ca
Restrict unit test exclusion from tests/load to tests/load/c
qdm12 b079371
`BuildMetricsURLForNetwork` -> `BuildMonitoringURLForNetwork`
qdm12 615eab7
Remove redundant comment on network_uuid presence
qdm12 daebfdc
Remove _test.go suffix from contract bindings generate file
qdm12 abd5354
Add --start-collectors flag to test-load task
qdm12 3a47e2d
Update load/c/readme to use nix and the test-load task
qdm12 26dc86a
Change wording to "CI monitoring stack"
qdm12 66fa3a4
Improve wording for step 1 of private remote instance
qdm12 fc1251b
readme: prometheus -> monitoring (prometheus+loki)
qdm12 69bb305
Replace --start-collectors with `--start-metrics-collector --start-lo…
qdm12 d8896cc
Export and use `tmpnet.GetServiceDiscoveryDir`
qdm12 da8b904
Shorten GenerateMonitoringConfig comment
qdm12 c7d2beb
Use github.com/ava-labs/avalanchego/utils/perms
qdm12 45d4f86
Use require.NoError in load_test.go
qdm12 2aba1cd
Remove unneeded network.Nodes[:nodesCount]
qdm12 d3d8661
Remove unneeded logger from metrics server
qdm12 d45e40b
Use test context logger
qdm12 e21dfbd
Use two DeferCleanup
qdm12 eeb7581
Remove unused fields in c/issuers/opcode
qdm12 4c00861
Remove unneeded maxTipCap
qdm12 fd97d80
Remove unneeded NonceAt method in client interface
qdm12 4f22990
Issuer picks a tx type according to a weight
qdm12 e742788
Merge both load types together
qdm12 4ce9359
chore: newTxOpts always set max tip cap to 1
qdm12 5736025
Max fee cap set per transaction type in issuer
qdm12 7e6af87
Adjust max fee cap for zero self transfers
qdm12 177cbbe
Adjust weights to lower contract deployment
qdm12 4d61ab1
Fix pinning of libevm/cmd/abigen
qdm12 75a659a
More conservative min and max TPS
qdm12 72c67d1
Add `test-load-local` task for local monitoring
qdm12 d9ea754
Move body of SynchronizedBeforeSuite to BeforeAll
qdm12 3952c3a
Revert unrelated auto-formatting diffs
qdm12 5c6221b
Update local monitoring instructions to not pollute the source tree
qdm12 c1bda80
Merge branch 'master' into qdm12/tests/load
qdm12 308e096
Fix pinning of abigen (again)
qdm12 3b5e69a
remove ginkgo from load tests
RodrigoVillar 3d211a7
single test-load task
RodrigoVillar ffad23f
remove network owner label
RodrigoVillar 0e1e388
lint
RodrigoVillar 9a9ef0f
clean func signatures
RodrigoVillar 9e3feb2
Merge branch 'master' into qdm12/tests/load
RodrigoVillar b73f387
clean up issuer
RodrigoVillar 2cfd882
fix go mod
RodrigoVillar a5dea94
simplify generateMetricsLink func header
RodrigoVillar ba5a4ab
remove default owner
RodrigoVillar fcfe214
remove interfaces in favor of impls
RodrigoVillar e547ac1
simplify createAgents
RodrigoVillar 3e54ce4
clean up issuer
RodrigoVillar 9332d24
switch from UTs to func main()
RodrigoVillar 7b36a45
listener nit
RodrigoVillar b3048d6
nit
RodrigoVillar 4ddce71
nit
RodrigoVillar 8fb6954
close channel upon exiting
RodrigoVillar 86e6128
lint
RodrigoVillar f1f472d
revert serviceDiscovery diff
RodrigoVillar 4c1cf15
update Taskfile
RodrigoVillar 988eef2
add ci check for up-to-date contract bindings
RodrigoVillar fa54feb
update GetNodeWebsocketURIs
RodrigoVillar d3db384
ci nit
RodrigoVillar 0993b0f
fix README
RodrigoVillar 9280c11
simplify prefunded keys
RodrigoVillar c945695
fix Taskfile
RodrigoVillar bc70bd3
add cleanup
RodrigoVillar e3d6645
remove metrics link
RodrigoVillar 68fd3e4
merge execute into main
RodrigoVillar a2e2c91
reduce load
RodrigoVillar 1888cf7
readme => README
RodrigoVillar d28d8d4
remove local monitoring
RodrigoVillar b2793ce
reduce diff
RodrigoVillar 5a6dc97
Merge branch 'master' into qdm12/tests/load
RodrigoVillar d71c4db
args nit
RodrigoVillar 3f8b97c
README nit
RodrigoVillar 0bbf887
add support for skipping bind generation
RodrigoVillar b825e8c
Merge branch 'master' into qdm12/tests/load
RodrigoVillar 8538f69
use network monitoring labels
RodrigoVillar 19052cb
defer => tc.DeferCleanup
RodrigoVillar b5ac0d8
README nix nit
RodrigoVillar 001b36d
ci nit
RodrigoVillar 24a6050
prometheus func nit
RodrigoVillar 1bcdfa3
lint
RodrigoVillar 24cc663
ci nit
RodrigoVillar 7bc4636
Merge branch 'master' into qdm12/tests/load
RodrigoVillar 275c9e4
del go mod diff
RodrigoVillar c94d8b0
revert go sum change
RodrigoVillar 1bc9f67
uri => URI
RodrigoVillar 0027884
standardize err messages
RodrigoVillar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ function test_golangci_lint { | |
_addlicense_flags=${ADDLICENSE_FLAGS:-"--verify --debug"} | ||
function test_license_header { | ||
local files=() | ||
while IFS= read -r line; do files+=("$line"); done < <(find . -type f -name '*.go' ! -name '*.pb.go' ! -name 'mock_*.go' ! -name 'mocks_*.go' ! -path './**/*mock/*.go' ! -name '*.canoto.go') | ||
while IFS= read -r line; do files+=("$line"); done < <(find . -type f -name '*.go' ! -name '*.pb.go' ! -name 'mock_*.go' ! -name 'mocks_*.go' ! -path './**/*mock/*.go' ! -name '*.canoto.go' ! -name '*.bindings.go') | ||
|
||
# shellcheck disable=SC2086 | ||
go run github.com/palantir/[email protected] \ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Load testing | ||
|
||
The C-chain load test entrypoint is in [main.go](main/main.go). | ||
|
||
It runs with 5 nodes and 5 "agents". | ||
|
||
Each "agent" runs a transaction issuer and a transaction listener asynchronously, | ||
and is assigned uniformly to the nodes available, via websocket connections. | ||
|
||
The load test picks at weighted random a transaction type to generate and issue, defined in [issuer.go](issuer.go). | ||
|
||
For some transaction types, [this contract](contracts/EVMLoadSimulator.sol) is deployed and transactions call functions of this contract. This contract has different functions, each testing a particular performance aspect of the EVM, for example memory writes. | ||
|
||
From the load test perspective, only the TPS (transactions per second) is logged out. Metrics available are: | ||
|
||
- total transactions issued `txs_issued` | ||
- total transactions confirmed `txs_confirmed` | ||
- total transactions failed `txs_failed` | ||
- transaction latency histogram `tx_latency` | ||
|
||
There are more interesting metrics available from the tmpnet nodes being load tested. | ||
|
||
Finally, to run the load test, run: | ||
|
||
```bash | ||
# Install nix (skip this step if nix is already installed) | ||
./scripts/run_task.sh install-nix | ||
# Start the dev shell | ||
maru-ava marked this conversation as resolved.
Show resolved
Hide resolved
|
||
nix develop | ||
# Start the load test | ||
task test-load | ||
``` | ||
|
||
## Visualize metrics in Grafana | ||
|
||
### Private remote instances | ||
|
||
If you have the credentials (internal to Ava Labs) for the CI monitoring stack, you can visualize the metrics following these steps: | ||
|
||
1. Start a dev shell to ensure `prometheus` and `promtail` binaries are available to the test runner so it can use them to collect metrics and logs: | ||
|
||
```bash | ||
nix develop | ||
``` | ||
|
||
2. Set your monitoring credentials using the credentials you can find in your password manager | ||
|
||
```bash | ||
export PROMETHEUS_USERNAME=<username> | ||
export PROMETHEUS_PASSWORD=<password> | ||
export LOKI_USERNAME=<username> | ||
export LOKI_PASSWORD=<password> | ||
``` | ||
|
||
3. Run the load test: | ||
|
||
```bash | ||
task test-load | ||
``` | ||
|
||
4. Prior to the test beginning, you will see the following log: | ||
|
||
```log | ||
INFO metrics and logs available via grafana (collectors must be running) {"uri": "https://grafana-poc.avax-dev.network/d/eabddd1d-0a06-4ba1-8e68-a44504e37535/C-Chain%20Load?from=1747817500582&to=1747817952631&var-filter=network_uuid%7C%3D%7C4f419e3a-dba5-4ccd-b2fd-bda15f9826ff"} | ||
``` | ||
|
||
5. Open the URL in your browser, and log in with the Grafana credentials which you can find in your password manager. | ||
|
||
For reference, see [the tmpnet monitoring section](../../fixture/tmpnet/README.md#monitoring) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.21; | ||
|
||
/// @notice Dummy is a contract used only for simulating the load | ||
/// of contract creation operations in the EVM. It has state variables, | ||
/// a constructor and simple functions to have a real-like deployed size. | ||
contract Dummy { | ||
uint256 public value; | ||
address public owner; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
mapping(uint256 => uint256) public data; | ||
|
||
event ValueUpdated(uint256 newValue); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This event is never used, is that intentional? |
||
event DataWritten(uint256 key, uint256 value); | ||
|
||
constructor() { | ||
value = 42; | ||
owner = msg.sender; | ||
} | ||
|
||
function updateValue(uint256 newValue) external { | ||
value = newValue; | ||
} | ||
|
||
function writeData(uint256 key, uint256 val) external { | ||
data[key] = val; | ||
emit DataWritten(key, val); | ||
} | ||
|
||
function readData(uint256 key) external view returns (uint256) { | ||
return data[key]; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.