-
Notifications
You must be signed in to change notification settings - Fork 222
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
Simulator improvements #619
Conversation
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.
My review is a little overly critical; this is how I learn. Feel free to enlighten me on some of my comments, or you can even say, "I agree with your comment, but it's not worth the effort to make the change".
I also may have made comments on files that you moved and didn't change any of the logic... if that's the case, whoops...
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.
LGTM, some nits. Can approve after they are addressed.
cmd/simulator/load/workers.go
Outdated
) | ||
|
||
type WorkerGroup struct { | ||
Workers []*Worker |
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.
nit: should we use workers
instead?
cmd/simulator/load/loader.go
Outdated
// Ensure there are at least [config.Workers] config.Endpoints by creating | ||
// duplicates as needed. | ||
for i := 0; len(config.Endpoints) < config.Workers; i++ { | ||
config.Endpoints = append(config.Endpoints, config.Endpoints[i]) |
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.
could we avoid modifying the config
object so it always corresponds to the command line arguments as provided?
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.
Updated
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
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.
lgtm
Why this should be merged
This PR is intended to improve the load simulator. The original code included a lot of unnecessary error handling that complicated the logic. This code should simply:
How this works
This PR breaks the load simulator into:
eth_getTransactionByHash
How this was tested
CI and local testing. To verify, create a local network with the avalanche-network-runner and try running the simulator with the following commands to test different scenarios (note: if you run a large amount of volume through the network, then it may increase the base fee, such that previously issued transactions may be underpriced)
How is this documented
This PR updates
./cmd/simulator/README.md
with up to date documentation including flag options in the command output.To see the simulator options run (from the root of the repo):
go run cmd/simulator/main/*.go --help
Output: