This repository was archived by the owner on Nov 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 160
Benchmarking Tooling #399
Closed
Closed
Benchmarking Tooling #399
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
c8b38eb
allow multikey unlock
araskachoi e9708f2
fix lint
araskachoi fd7ba83
Merge branch 'development' into keyring
araskachoi a87cb71
Merge branch 'development' into keyring
fedekunze ee5cf56
Update rpc/apis.go
fedekunze 9c17d46
Merge branch 'development' of github.com:ChainSafe/ethermint into key…
araskachoi da5db2f
benchmarking into new branch
araskachoi 32279f2
transactions working - receipt doesnt work
araskachoi b551d3b
works for <500 tx
araskachoi ad98544
bypass nonce in antehandler
araskachoi 0a98995
clean up and write to file
araskachoi 9bde2bf
wip analysis tooling
araskachoi 668725a
adding analysis and additional scripts
araskachoi 35e7b52
add tmux
araskachoi e618df5
add resource analyzer
araskachoi fc2b6cf
track and parse resource
araskachoi 0a36c72
go.sum
araskachoi 31cb53d
fix merge
araskachoi f9024f8
parser and calc
araskachoi ef24a09
fix some lint errs
araskachoi d7a4f61
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi 62fb328
geth benchmarks (#417)
J-Thompson12 a2d693a
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi dbb442f
Merge branch 'benchmark' of github.com:ChainSafe/ethermint into bench…
araskachoi a287315
wip: emint works; geth network works; check geth tx
araskachoi e175359
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi 719f66e
include ranged tps
araskachoi c841ce1
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi df97e18
WIP: transactions sent
araskachoi 08ecf4e
make geth resource parser
araskachoi 029fc6d
fix cwd
araskachoi 73550b9
fix make build test
araskachoi 89a995e
merge development + fix scripts
araskachoi 1434136
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi 159e133
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi 58651c0
Merge branch 'development' into benchmark
fedekunze 3fce491
Update docker/README.md
fedekunze 3c9b285
Update docker/Dockerfile
araskachoi 9b7015e
merge benchmark branch
araskachoi b5090f4
conform cmds to updated binaries
araskachoi 3c70be0
Merge branch 'benchmark' of github.com:ChainSafe/ethermint into bench…
araskachoi db8730a
go mod tidy
araskachoi 6a9a6dc
test: remove --mod=readonly
araskachoi cc5c99b
golint fix
araskachoi b3c5aea
fix more lint
araskachoi d4eed61
fix more lint
araskachoi 9964973
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi 0427010
add some godoc descrp
araskachoi 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| FROM golang:1.14 | ||
|
|
||
| RUN apt-get update && apt-get install -y \ | ||
| make curl jq tmux vim | ||
|
|
||
| COPY . /ethermint | ||
|
|
||
| WORKDIR /ethermint | ||
|
|
||
| RUN make install | ||
| RUN cd /ethermint/docker/benchmarking && go get && go build | ||
|
|
||
| ENTRYPOINT ["/bin/bash"] |
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,9 @@ | ||
| # Docker Benchmarking | ||
|
|
||
| ## Getting Started | ||
|
|
||
| Run the command in the root directory of this project | ||
|
|
||
| ```bash | ||
| docker build -f ./docker/Dockerfile . | ||
| ``` |
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,130 @@ | ||
| package benchmark | ||
|
|
||
| import ( | ||
| "encoding/json" | ||
| "io/ioutil" | ||
| "os" | ||
| "strconv" | ||
|
|
||
| "github.com/urfave/cli" | ||
| ) | ||
|
|
||
| // Genesis is the interface for the unmarshaling of the a Geth genesis file. | ||
| type Genesis struct { | ||
| Config Config `json:"config"` | ||
| Difficulty string `json:"difficulty"` | ||
| GasLimit string `json:"gasLimit"` | ||
| ExtraData string `json:"extraData"` | ||
| Alloc interface{} `json:"alloc"` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
| } | ||
|
|
||
| // Balance is the interface for the balance of prefunded accounts. | ||
| type Balance struct { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto godoc |
||
| Balance string `json:"balance"` | ||
| } | ||
|
|
||
| // Config defines the Ethereum Config parameters. | ||
| type Config struct { | ||
| ChainID int64 `json:"chainId"` | ||
| Eip150Block int64 `json:"eip150Block"` | ||
| Eip155Block int64 `json:"eip155Block"` | ||
| Eip158Block int64 `json:"eip158Block"` | ||
| HomesteadBlock int64 `json:"homesteadBlock"` | ||
| ByzantiumBlock int64 `json:"byzantiumBlock"` | ||
| ConstantinopleBlock int64 `json:"constantinopleBlock"` | ||
| PetersburgBlock int64 `json:"petersburgBlock"` | ||
| Consensus interface{} `json:"clique"` | ||
| } | ||
|
|
||
| var ( | ||
| AddAcctGenesis = cli.Command{ | ||
| Name: "geth-add-genesis-acct", | ||
| ShortName: "gaa", | ||
| Usage: "add geth account to genesis file and allocate funds", | ||
| Action: addAccountGeth, | ||
| Flags: []cli.Flag{ | ||
| cli.StringFlag{Name: "account, ac", Hidden: false, Usage: "add genesis account"}, | ||
| cli.IntFlag{Name: "amount, am", Hidden: false, Usage: "add balance to account"}, | ||
| }, | ||
| } | ||
| AddSignerGenesis = cli.Command{ | ||
| Name: "geth-add-genesis-signer", | ||
| ShortName: "gas", | ||
| Usage: "add geth account to genesis file as a signer", | ||
| Action: addSignerGeth, | ||
| Flags: []cli.Flag{ | ||
| cli.StringFlag{Name: "account, ac", Hidden: false, Usage: "add genesis account"}, | ||
| }, | ||
| } | ||
| ) | ||
|
|
||
| func addSignerGeth(ctx *cli.Context) error { | ||
| signer := ctx.String("account") | ||
|
|
||
| genesis, err := readGenesis() | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| genesis.ExtraData = "0x0000000000000000000000000000000000000000000000000000000000000000" + signer + "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" | ||
|
|
||
| err = writeGenesis(genesis) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| func addAccountGeth(ctx *cli.Context) error { | ||
| addr := ctx.String("account") | ||
|
|
||
| genesis, err := readGenesis() | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| alloc, ok := genesis.Alloc.(map[string]interface{}) | ||
| if ok { | ||
| alloc[addr] = Balance{strconv.Itoa(ctx.Int("amount"))} | ||
| } | ||
|
|
||
| genesis.Alloc = alloc | ||
| err = writeGenesis(genesis) | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| func readGenesis() (Genesis, error) { | ||
| jsonFile, err := os.Open("genesis.json") | ||
| if err != nil { | ||
| jsonFile, err = os.Open("templ-genesis.json") | ||
| if err != nil { | ||
| return Genesis{}, err | ||
| } | ||
| } | ||
| defer jsonFile.Close() | ||
| byteValue, _ := ioutil.ReadAll(jsonFile) | ||
| var genesis Genesis | ||
| err = json.Unmarshal(byteValue, &genesis) | ||
| if err != nil { | ||
| return Genesis{}, err | ||
| } | ||
| return genesis, nil | ||
| } | ||
|
|
||
| func writeGenesis(data Genesis) error { | ||
| file, err := json.MarshalIndent(data, " ", " ") | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| err = ioutil.WriteFile("genesis.json", file, 0600) | ||
| if err != nil { | ||
| return err | ||
| } | ||
| return nil | ||
| } | ||
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.
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 add godoc comment