-
Notifications
You must be signed in to change notification settings - Fork 339
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
feat: Gas consumption script #1029
Conversation
for i := 0; i < 300; i++ { | ||
accounts = append(accounts, tmrand.Str(9)) | ||
} |
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.
Append re-allocates memory. So it is more memory performant to initialize the slice and then fill it.
size := 300
accounts = make([]string, 0, size)
for i:=0; i<size; i++ {
accounts[i] = tmrand.Str(9)
}
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.
thx for the reminder, we actually have a linter for this but I'm not sure why it didn't get hit
testutil/testnode/sign.go
Outdated
// inside the client.Context, then broadcasts it synchronously. | ||
func SignAndBroadcastTx(encCfg encoding.Config, c Context, account string, msg ...sdk.Msg) (res *sdk.TxResponse, err error) { | ||
opts := []types.TxBuilderOption{ | ||
types.SetGasLimit(1000000000000000000), |
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.
probably worth a default const.
this is still a draft, and is not worth reviewing atm |
created a few plots using data collected using the test here |
## Overview We need to be able to modify the genesis state when using the testnode. This PR refactors the testnode to allow for that. It also includes a helper function that handles creation of this genesis state and simplify the process of starting an in process node. closes #1037 part of/blocking #658 spun out of and blocking #1029 ## Checklist - [x] New and updated code has appropriate documentation - [x] New and updated code has new and/or updated testing - [x] Required CI checks are passing - [x] Visual proof for any user facing features like CLI or documentation updates - [x] Linked issues closed with keywords Co-authored-by: Rootul P <[email protected]>
We very likely won't run this test to trace the gas consumption very often, and there is quite a bit of code, so we should just keep them in their own repo. The only thing this PR should do is enable the investigations to be ran by including the gas consumption monitoring logic imo |
closing this, as we don't have plans on merging |
Overview
This PR adds a test suite that we can use to measure the gas consumed by standard txs and modifies the network tests so that we can use custom genesis parameters. We still have to add more tx types and some visualization would be nice.
Checklist