-
Notifications
You must be signed in to change notification settings - Fork 97
feat: additional service tx fuzzer #192
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
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
4724788
Checkout transaction_spammer from ethereum-package
emhane b415c65
Plug in tx spammer to l2
emhane 522dc94
Merge branch 'main' into tx-spammer
barnabasbusa 4355e91
fix tx spammer
barnabasbusa fe856e5
Rename tx-spammer to tx-fuzzer
emhane 5e906b6
Merge branch 'main' into tx-spammer
emhane f313bb4
Merge branch 'main' into tx-spammer
emhane 16261cd
Merge branch 'main' into tx-spammer
emhane af5753f
fixup! Rename tx-spammer to tx-fuzzer
emhane c095667
Merge branch 'tx-spammer' of github.com:emhane/optimism-package into …
emhane 43ebf99
Add test for launch tx fuzzer
emhane 3e26002
Merge branch 'main' into tx-spammer
emhane a17fc1e
Merge branch 'main' into tx-spammer
emhane 8b85c3e
fix: Typo
janjakubnanista 0fdce06
fix: Tests
janjakubnanista 4511eb2
Merge branch 'main' into tx-spammer
emhane 3b8c091
fix: Lint
janjakubnanista 946674c
fix: Typo
janjakubnanista 0b10d5f
Merge pull request #1 from janjakubnanista/jan/tx-spammer
emhane 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
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,47 @@ | ||
| constants = import_module("../package_io/constants.star") | ||
|
|
||
| # The min/max CPU/memory that tx-fuzzer can use | ||
| MIN_CPU = 100 | ||
| MAX_CPU = 1000 | ||
| MIN_MEMORY = 20 | ||
| MAX_MEMORY = 300 | ||
|
|
||
|
|
||
| def launch( | ||
| plan, | ||
| service_name, | ||
| el_uri, | ||
| tx_fuzzer_params, | ||
| global_node_selectors, | ||
| ): | ||
| config = get_config( | ||
| el_uri, | ||
| tx_fuzzer_params, | ||
| global_node_selectors, | ||
| ) | ||
| plan.add_service(service_name, config) | ||
|
|
||
|
|
||
| def get_config( | ||
| el_uri, | ||
| tx_fuzzer_params, | ||
| node_selectors, | ||
| ): | ||
| cmd = [ | ||
| "spam", | ||
| "--rpc={}".format(el_uri), | ||
| "--sk={0}".format(constants.dev_accounts[0]["private_key"]), | ||
| ] | ||
|
|
||
| if len(tx_fuzzer_params.tx_fuzzer_extra_args) > 0: | ||
| cmd.extend([param for param in tx_fuzzer_params.tx_fuzzer_extra_args]) | ||
|
|
||
| return ServiceConfig( | ||
| image=tx_fuzzer_params.image, | ||
| cmd=cmd, | ||
| min_cpu=MIN_CPU, | ||
| max_cpu=MAX_CPU, | ||
| min_memory=MIN_MEMORY, | ||
| max_memory=MAX_MEMORY, | ||
| node_selectors=node_selectors, | ||
| ) |
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,63 @@ | ||
| transaction_fuzzer = import_module("/src/transaction_fuzzer/transaction_fuzzer.star") | ||
| input_parser = import_module("/src/package_io/input_parser.star") | ||
| observability = import_module("/src/observability/observability.star") | ||
| ethereum_package_constants = import_module( | ||
| "github.com/ethpandaops/ethereum-package/src/package_io/constants.star" | ||
| ) | ||
| constants = import_module("/src/package_io/constants.star") | ||
| util = import_module("/src/util.star") | ||
|
|
||
|
|
||
| def test_launch_with_defaults(plan): | ||
| parsed_input_args = input_parser.input_parser( | ||
| plan, | ||
| { | ||
| "chains": [ | ||
| { | ||
| "participants": [ | ||
| { | ||
| "el_type": "op-reth", | ||
| "el_image": "op-reth:latest", | ||
| "cl_type": "op-node", | ||
| "cl_image": "op-node:latest", | ||
| } | ||
| ], | ||
| "additional_services": [ | ||
| "tx_fuzzer", | ||
| ], | ||
| } | ||
| ] | ||
| }, | ||
| ) | ||
|
|
||
| fuzzer_image = input_parser.DEFAULT_TX_FUZZER_IMAGES["tx-fuzzer"] | ||
|
|
||
| chains = parsed_input_args.chains | ||
| chain = chains[0] | ||
| service_name = "op-transaction-fuzzer" | ||
|
|
||
| el_rpc_url = "http://rpc.el" | ||
| transaction_fuzzer.launch( | ||
| plan=plan, | ||
| service_name=service_name, | ||
| el_uri=el_rpc_url, | ||
| tx_fuzzer_params=chain.tx_fuzzer_params, | ||
| global_node_selectors=parsed_input_args.global_node_selectors, | ||
| ) | ||
|
|
||
| fuzzer_service_config = kurtosistest.get_service_config(service_name=service_name) | ||
| expect.ne(fuzzer_service_config, None) | ||
| expect.eq(fuzzer_service_config.image, fuzzer_image) | ||
| expect.eq(fuzzer_service_config.env_vars, {}) | ||
| expect.eq( | ||
| fuzzer_service_config.entrypoint, | ||
| [], | ||
| ) | ||
| expect.eq( | ||
| fuzzer_service_config.cmd, | ||
| [ | ||
| "spam", | ||
| "--rpc={}".format(el_rpc_url), | ||
| "--sk={0}".format(constants.dev_accounts[0]["private_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.