Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
9d7a6bf
added composite scenarios - setting up multiple contracts
arpitkarnatak May 21, 2025
171b220
Added better documentation for compose command
arpitkarnatak May 21, 2025
7c91fdf
Merge branch 'main' into feat/composite-scenaris
arpitkarnatak May 21, 2025
bb62181
Clippy fixes
arpitkarnatak May 21, 2025
4b15167
Run setup for contracts parallely
arpitkarnatak May 23, 2025
cdf64f4
Added parsing for spam commands with multiple stages, parallel execut…
arpitkarnatak May 25, 2025
34c9dd3
Added new struct ComposeFile, moved compose file parsing into separat…
arpitkarnatak May 26, 2025
e4c262d
Added separate composefile container
arpitkarnatak May 26, 2025
52ba64c
Added readme for contender compose file
arpitkarnatak May 26, 2025
2a437b2
added deleted parameters for setup return type in composefile
arpitkarnatak May 26, 2025
b40f725
Changed composefile struct properties, moved util functions in separa…
arpitkarnatak May 27, 2025
92e08ec
Removed unwrap statements in multithreaded spam calls
arpitkarnatak May 27, 2025
6f9e430
Test coverage for composefile, reducing filesizes by splitting into m…
arpitkarnatak May 28, 2025
d264c62
Add readme for writing composefiles
arpitkarnatak May 29, 2025
bfbd5ea
Pattern matching for tx types in setup and spam commands
arpitkarnatak Sep 14, 2025
7629a88
Added parameter -p to add private keys, removed private keys from com…
arpitkarnatak Sep 14, 2025
ad913cc
Added method to have engine params in composefile
arpitkarnatak Sep 14, 2025
dd613f6
Removed from method
arpitkarnatak Sep 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions contender-compose.yml
Copy link
Member

Choose a reason for hiding this comment

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

Not sure this should be in the project root -- maybe it would fit better under scenarios/? Or we could have a new directory called composite-scenarios/ or something like that.
We should also use valid values, so that users with a simple node (e.g. anvil w/ default config) running on localhost:8545 can run the compose file without error. Any advanced examples we want to show off should go in a document under docs/.

Copy link
Member

Choose a reason for hiding this comment

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

maybe we should also enforce a .compose.toml filename restriction, so users don't accidentally try to run core scenario files as compose files

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
setup:
Copy link
Member

Choose a reason for hiding this comment

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

Would be cool if we didn't have to manually call setup. Feels like manually specifying rpc_urls for setup could get confusing in a large file (i.e. the user tries to spam on an alternate chain but forgets to run setup on that chain).

Instead, we could check if the scenario TOML file has any setup directives, then run TestScenario::estimate_setup_cost to find the required min_balance, then check the spam directives in the compose file to see which chains need to run which setup and run it automatically at the start.

simpler:
testfile: ./scenarios/simpler.toml
min_balance: 12.1

uniV2:
testfile: ./scenarios/uniV2.toml
rpc_url: http://localhost:8545 # Optional
min_balance: "11"
env:
- Key1=Valu1
- Key2=Valu2
private_keys: # Optional (these Private keys are from Anvil)
- 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
- 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
Copy link
Member

Choose a reason for hiding this comment

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

private keys should only be specified as a cli param -- we don't want people accidentally saving their keys into files that they might share with the world

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I think it would be best that way, will change it accordingly

tx_type: eip1559 # Optional

uniV3:
testfile: ./scenarios/simple.toml
rpc_url: http://localhost:8545 # Optional
min_balance: 0.01 # Optional
tx_type: eip1559 # Optional

1 change: 1 addition & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ serde_json = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
webbrowser = { workspace = true }
yaml-rust2 = "0.10.2"
Copy link
Member

Choose a reason for hiding this comment

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

I know I specified yaml when I wrote the issue but I wonder if toml would be better -- wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Toml can be nice, since we're using it for the other configurations too. For this case, I would prefer YAML solely because of the readability and syntax familiarity with Docker compose syntax.

op-alloy-network = { workspace = true }

[dev-dependencies]
Expand Down
Loading