-
Notifications
You must be signed in to change notification settings - Fork 235
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
Problem: configs are baked in testground #1561
Conversation
WalkthroughThe changes introduce a new command-line argument, Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Main
participant LoadGenerator
participant Params
User->>CLI: Run command with --num_max_workers
CLI->>Main: Pass num_max_workers
Main->>Params: Retrieve num_max_workers
Main->>LoadGenerator: Call generate_load with num_max_workers
LoadGenerator->>LoadGenerator: Execute load generation with specified workers
Possibly related PRs
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional context usedRuff
Additional comments not posted (4)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- testground/README.md (1 hunks)
- testground/benchmark/benchmark/main.py (1 hunks)
- testground/benchmark/benchmark/params.py (1 hunks)
- testground/benchmark/benchmark/sendtx.py (1 hunks)
- testground/benchmark/benchmark/stateless.py (3 hunks)
- testground/benchmark/compositions/local.toml (1 hunks)
Additional context used
LanguageTool
testground/README.md
[style] ~95-~95: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ccounts for each full node. *num_txs
is the number of test transactions to be s...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~96-~96: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... each test account. *num_max_workers
is the number of worker threads to use for...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Additional comments not posted (5)
testground/benchmark/compositions/local.toml (1)
19-20
: LGTM!The addition of the
num_max_workers
parameter is correctly implemented and provides flexibility for configuring the concurrency level.testground/benchmark/benchmark/main.py (1)
39-41
: LGTM!The modification correctly passes the
num_max_workers
parameter to thegenerate_load
function, enhancing the load generation process.testground/benchmark/benchmark/sendtx.py (1)
80-85
: LGTM!The modification correctly enhances the flexibility of the
generate_load
function by allowing the caller to specify the maximum number of workers.testground/benchmark/benchmark/stateless.py (2)
Line range hint
50-95
: LGTM! Verify the default value.The addition of the
num_max_workers
parameter is correctly implemented. Ensure that the default value of 3000 is appropriate for your use case.
157-162
: LGTM! Verify thegenerate_load
function.The addition of the
num_max_workers
parameter is correctly implemented. Ensure that thegenerate_load
function handles the parameter correctly.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1561 +/- ##
===========================================
- Coverage 36.12% 15.24% -20.89%
===========================================
Files 97 67 -30
Lines 7725 4874 -2851
===========================================
- Hits 2791 743 -2048
+ Misses 4585 4037 -548
+ Partials 349 94 -255 |
what is the meaning of the fields? |
|
what's the point of setting thread pool size larger than accounts, there's only one task for each account. |
2f23334
to
5d4aedf
Compare
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
testground/benchmark/benchmark/stateless.py (1)
317-327
: Add test cases fortruncate_fractional_seconds
function.The
truncate_fractional_seconds
function is used in timestamp processing but lacks test cases to verify its correctness. It is crucial to add test cases covering various timestamp formats and edge cases to ensure the function's reliability and accuracy in time-based operations.
- Consider adding test cases for different timestamp formats and edge cases.
Analysis chain
Approve the addition of
truncate_fractional_seconds
function.The
truncate_fractional_seconds
function has been correctly implemented to handle timestamp formatting by truncating fractional seconds. This addition enhances the consistency of timestamp handling across the system.Verify that the
truncate_fractional_seconds
function correctly handles various timestamp formats and does not introduce errors in timestamp processing.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness and impact of the `truncate_fractional_seconds` function on timestamp processing. # Test: Search for the function usage and test cases. Expect: Correct handling of various timestamp formats. rg --type py 'truncate_fractional_seconds' -A 10Length of output: 1704
Script:
#!/bin/bash # Description: Search for test cases or additional usage of the `truncate_fractional_seconds` function in the codebase. # Search for test cases in Python test files. rg --type py 'truncate_fractional_seconds' --glob '*test*.py' -A 10 # Search for additional usage of the function in the codebase. rg --type py 'truncate_fractional_seconds' -A 10Length of output: 1772
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- testground/benchmark/benchmark/peer.py (2 hunks)
- testground/benchmark/benchmark/stateless.py (6 hunks)
Additional comments not posted (4)
testground/benchmark/benchmark/peer.py (1)
Line range hint
119-139
: Approve the addition ofblock_stm_workers
parameter.The changes to the
patch_configs
function correctly introduce theblock_stm_workers
parameter and use it to set the"evm.block-stm-workers"
configuration. This aligns with the PR's objectives to manage concurrency.Ensure that the
"evm.block-stm-workers"
configuration key is supported and correctly utilized across the system. Consider running integration tests to verify its impact on the blockchain's performance and stability.testground/benchmark/benchmark/stateless.py (3)
Line range hint
52-95
: Approve the addition ofblock_stm_workers
parameter togen
function.The
gen
function has been correctly updated to include theblock_stm_workers
parameter, enhancing its configurability for concurrency management. This parameter is appropriately passed topatch_configs_local
.Verify that the
block_stm_workers
parameter is handled correctly inpatch_configs_local
and that it effectively influences the system's concurrency management.Verification successful
Verification Successful:
block_stm_workers
Parameter Handling inpatch_configs_local
The
block_stm_workers
parameter is correctly passed and utilized within thepatch_configs_local
function, specifically in the call topatch_configs
. This confirms its role in managing concurrency settings as intended.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling of the `block_stm_workers` parameter in `patch_configs_local`. # Test: Search for the function definition and usage. Expect: Correct handling of the parameter. rg --type py 'patch_configs_local' -A 10Length of output: 2281
Script:
#!/bin/bash # Description: Verify the usage of the `block_stm_workers` parameter within the `patch_configs_local` function. # Test: Search for the usage of `block_stm_workers` within the function body. rg --type py 'def patch_configs_local' -A 50 | rg 'block_stm_workers'Length of output: 262
330-346
: Approve the addition ofcalculate_tps
function.The
calculate_tps
function has been correctly implemented to calculate transactions per second based on block timestamps. This addition enhances the module's ability to analyze transaction performance metrics.Verify that the
calculate_tps
function correctly calculates TPS and handles edge cases such as zero time difference or invalid timestamps.
287-292
: Approve the modification ofpatch_configs_local
to includeblock_stm_workers
.The
patch_configs_local
function has been correctly updated to include theblock_stm_workers
parameter, ensuring that the concurrency management setting is propagated to thepatch_configs
function.Verify that the
block_stm_workers
parameter is correctly utilized in thepatch_configs
function and that it effectively influences the system's concurrency management.Verification successful
The
block_stm_workers
parameter is correctly utilized in thepatch_configs
function.The parameter is used to set the
"evm.block-stm-workers"
configuration in theapp.toml
file, ensuring that the concurrency management setting is effectively applied.
- Location:
testground/benchmark/benchmark/peer.py
in thepatch_configs
function.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the propagation and usage of the `block_stm_workers` parameter in the `patch_configs` function. # Test: Search for the function definition and usage. Expect: Correct handling of the parameter. rg --type py 'patch_configs' -A 10Length of output: 5372
Script:
#!/bin/bash # Description: Verify the usage of the `block_stm_workers` parameter within the `patch_configs` function. # Test: Search for the usage of `block_stm_workers` in the `patch_configs` function. rg --type py 'block_stm_workers' -A 10 -B 10 testground/benchmark/benchmark/peer.pyLength of output: 1359
allow overwrite config and app patch
5d4aedf
to
9eb91ed
Compare
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- testground/benchmark/benchmark/peer.py (1 hunks)
- testground/benchmark/benchmark/stateless.py (5 hunks)
Additional context used
Ruff
testground/benchmark/benchmark/stateless.py
51-58: Do not use mutable data structures for argument defaults
Replace with
None
; initialize within function(B006)
59-68: Do not use mutable data structures for argument defaults
Replace with
None
; initialize within function(B006)
Additional comments not posted (1)
testground/benchmark/benchmark/peer.py (1)
119-123
: LGTM!The changes to the
patch_configs
function look good. The modifications enhance the flexibility and customizability of the configuration management process by:
- Accepting
config_patch
andapp_patch
as parameters, allowing users to pass in their own configurations.- Removing the hardcoded configuration dictionaries, aligning with the goal of making the configuration more dynamic.
- Retaining the line that sets
"p2p.persistent_peers"
based on thepeers
argument, ensuring that this specific configuration is still being updated correctly.The changes are consistent with the AI-generated summary and do not introduce any apparent issues or code smells.
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.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- testground/benchmark/benchmark/stateless.py (5 hunks)
Additional context used
Ruff
testground/benchmark/benchmark/stateless.py
51-51: Do not use mutable data structures for argument defaults
Replace with
None
; initialize within function(B006)
52-52: Do not use mutable data structures for argument defaults
Replace with
None
; initialize within function(B006)
Additional comments not posted (5)
testground/benchmark/benchmark/stateless.py (5)
51-73
: LGTM, the changes to introduceconfig_patch
andapp_patch
parameters are approved.The modifications to the
gen
function that introduce theconfig_patch
andapp_patch
parameters are approved. These changes enhance the configurability and maintainability of the code by allowing users to specify detailed configuration options.Tools
Ruff
51-51: Do not use mutable data structures for argument defaults
Replace with
None
; initialize within function(B006)
52-52: Do not use mutable data structures for argument defaults
Replace with
None
; initialize within function(B006)
51-73
: The past review comment regarding the mutable default arguments issue is still valid and applicable to the current code segment. Please refer to the previous comment for the detailed explanation and proposed fix.Tools
Ruff
51-51: Do not use mutable data structures for argument defaults
Replace with
None
; initialize within function(B006)
52-52: Do not use mutable data structures for argument defaults
Replace with
None
; initialize within function(B006)
54-73
: LGTM!The changes to introduce
default_config_patch
anddefault_app_patch
constants for defining the default configuration patches are approved. This improves the readability and maintainability of the code.The use of the spread operator to merge the default patches with the user-provided
config_patch
andapp_patch
is also correct and gives precedence to the user-provided values.
Line range hint
97-107
: LGTM!The changes to pass the updated
config_patch
andapp_patch
arguments to thepatch_configs_local
function are approved. This change is consistent with the modifications made to thegen
function to introduce theconfig_patch
andapp_patch
parameters.
297-303
: LGTM!The changes to the
patch_configs_local
function to accept theconfig_patch
andapp_patch
arguments and pass them to thepatch_configs
function are approved. These changes are consistent with the modifications made to thegen
function and ensure that the configuration patches are applied properly.
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.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- testground/benchmark/benchmark/peer.py (2 hunks)
- testground/benchmark/benchmark/stateless.py (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- testground/benchmark/benchmark/peer.py
Additional comments not posted (3)
testground/benchmark/benchmark/stateless.py (3)
76-76
: LGTM!The changes to pass the
config_patch
andapp_patch
arguments to thepatch_configs_local
function are consistent with its signature and look good to me.Also applies to: 85-86
276-277
: LGTM!The addition of
config_patch
andapp_patch
parameters to thepatch_configs_local
function enhances its configurability and allows for more granular control over the configuration settings. These changes look good to me.
282-282
: LGTM!The change to pass the
config_patch
andapp_patch
arguments to thepatch_configs
function is consistent with its updated signature and looks good to me.
5c507d5
👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
PR Checklist:
make
)make test
)go fmt
)golangci-lint run
)go list -json -m all | nancy sleuth
)Thank you for your code, it's appreciated! :)
Summary by CodeRabbit
Summary by CodeRabbit
New Features
--num_max_workers
for enhanced control over concurrency during testing.num_max_workers
in the benchmark settings for improved transaction processing flexibility.gen
function for more granular control over node and application settings.Bug Fixes