-
Notifications
You must be signed in to change notification settings - Fork 37
feat(campaign): add campaign meta-scenarios with stages, reporting an… #389
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
Conversation
17ed04c to
b28eccb
Compare
b28eccb to
d74709a
Compare
|
this is amazing! Thank you so much for putting this together. I made a handful of changes here -- simplified the CLI interfaces a bit, sharpened up the error handling, and then fixed some bugs related to the new PR in I set up my PR to target your branch so you can see the specific changes. Feel free to review it and make any changes you like, then when it's merged here I'll merge this PR into contender. Looking forward to adding this exciting feature! |
Hey @zeroXbrock - great to hear! |
* fix: nonce race condition When multiple transactions from the same address failed with nonce errors, each adjustment read stale nonce values from the map, causing incorrect calculations. Now accumulates all nonce adjustments per address (summing +1, -1, etc.) before applying the total adjustment once, ensuring correctness even with concurrent failures. * fix: panic-inducing calls Replaced panic-inducing .expect(from) calls with safe if let Some(from) pattern matching that logs warnings instead of crashing when a transaction's from field is missing. * fix: error handling Replaced silent let _ = sender.send(...) calls with error handling that logs warnings when channel sends fail, making debugging easier and exposing receiver drop issues. * improved stage rate validation Added validation in validate_stage_rates to check rate * duration >= spam_len, matching the runtime check in spam execution and catching configuration errors early with helpful error messages. * improved rate distribution Implemented three-pass rate distribution that ensures mixes with non-zero share_pct get at least rate 1 by redistributing from larger allocations, preventing unexpected zero rates due to rounding.
Feat/campaigns brock edits
Description
Motivation
We wish to run multiple scenarios in parallel without having to resort to hacks (such as running multiple contender instances simultaneously).
Solution
Summary
A campaign is a meta-scenario that sets up several existing scenarios once, then runs them in parallel across one or more stages with specified traffic shares. Each (stage, scenario) spam run gets its own run_id; all runs are grouped under a single campaign_id for reporting.
Components
Flow
Testing
Testing this is non-trivial and I encourage reviewers to double-check this all for themselves.
cargo testcargo clippy --all --all-targets --all-features -- -D warningscontender campaign ./campaigns/staged-example.toml -r $RPC_URL -p $PKEYcontender report --campaignCampaign Report HTML:
campaign-1cab16ed-1356-4000-a0e3-83012b20f15b.html
PR Checklist
cargo +nightly clippy --workspace --lib --examples --tests --benches --all-features --locked --fixcargo fmt --allCHANGELOG.mdin each affected crateMetadata
Closes #145