Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Benchmarking Tooling #399

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
c8b38eb
allow multikey unlock
araskachoi Jul 2, 2020
e9708f2
fix lint
araskachoi Jul 2, 2020
fd7ba83
Merge branch 'development' into keyring
araskachoi Jul 6, 2020
a87cb71
Merge branch 'development' into keyring
fedekunze Jul 6, 2020
ee5cf56
Update rpc/apis.go
fedekunze Jul 6, 2020
9c17d46
Merge branch 'development' of github.com:ChainSafe/ethermint into key…
araskachoi Jul 6, 2020
da5db2f
benchmarking into new branch
araskachoi Jul 6, 2020
32279f2
transactions working - receipt doesnt work
araskachoi Jul 7, 2020
b551d3b
works for <500 tx
araskachoi Jul 10, 2020
ad98544
bypass nonce in antehandler
araskachoi Jul 10, 2020
0a98995
clean up and write to file
araskachoi Jul 10, 2020
9bde2bf
wip analysis tooling
araskachoi Jul 13, 2020
668725a
adding analysis and additional scripts
araskachoi Jul 14, 2020
35e7b52
add tmux
araskachoi Jul 14, 2020
e618df5
add resource analyzer
araskachoi Jul 15, 2020
fc2b6cf
track and parse resource
araskachoi Jul 20, 2020
0a36c72
go.sum
araskachoi Jul 20, 2020
31cb53d
fix merge
araskachoi Jul 20, 2020
f9024f8
parser and calc
araskachoi Jul 21, 2020
ef24a09
fix some lint errs
araskachoi Jul 21, 2020
d7a4f61
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi Jul 22, 2020
62fb328
geth benchmarks (#417)
J-Thompson12 Jul 30, 2020
a2d693a
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi Jul 30, 2020
dbb442f
Merge branch 'benchmark' of github.com:ChainSafe/ethermint into bench…
araskachoi Jul 30, 2020
a287315
wip: emint works; geth network works; check geth tx
araskachoi Jul 30, 2020
e175359
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi Aug 4, 2020
719f66e
include ranged tps
araskachoi Aug 5, 2020
c841ce1
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi Aug 5, 2020
df97e18
WIP: transactions sent
araskachoi Aug 5, 2020
08ecf4e
make geth resource parser
araskachoi Aug 6, 2020
029fc6d
fix cwd
araskachoi Aug 6, 2020
73550b9
fix make build test
araskachoi Aug 7, 2020
89a995e
merge development + fix scripts
araskachoi Aug 12, 2020
1434136
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi Aug 17, 2020
159e133
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi Aug 25, 2020
58651c0
Merge branch 'development' into benchmark
fedekunze Sep 1, 2020
3fce491
Update docker/README.md
fedekunze Sep 1, 2020
3c9b285
Update docker/Dockerfile
araskachoi Sep 1, 2020
9b7015e
merge benchmark branch
araskachoi Oct 5, 2020
b5090f4
conform cmds to updated binaries
araskachoi Oct 5, 2020
3c70be0
Merge branch 'benchmark' of github.com:ChainSafe/ethermint into bench…
araskachoi Oct 5, 2020
db8730a
go mod tidy
araskachoi Oct 5, 2020
6a9a6dc
test: remove --mod=readonly
araskachoi Oct 5, 2020
cc5c99b
golint fix
araskachoi Oct 5, 2020
b3c5aea
fix more lint
araskachoi Oct 6, 2020
d4eed61
fix more lint
araskachoi Oct 6, 2020
9964973
Merge branch 'development' of github.com:ChainSafe/ethermint into ben…
araskachoi Oct 7, 2020
0427010
add some godoc descrp
araskachoi Oct 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ else
go build -mod=readonly $(BUILD_FLAGS) -o build/$(ETHERMINT_DAEMON_BINARY) ./cmd/$(ETHERMINT_DAEMON_BINARY)
go build -mod=readonly $(BUILD_FLAGS) -o build/$(ETHERMINT_CLI_BINARY) ./cmd/$(ETHERMINT_CLI_BINARY)
endif
go build -mod=readonly ./...
go build ./...

build-ethermint: go.sum
mkdir -p $(BUILDDIR)
Expand Down
2 changes: 1 addition & 1 deletion app/ante/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (nvd NonceVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim
}

seq := acc.GetSequence()
if msgEthTx.Data.AccountNonce != seq {
if msgEthTx.Data.AccountNonce < seq {
araskachoi marked this conversation as resolved.
Show resolved Hide resolved
return ctx, sdkerrors.Wrap(
sdkerrors.ErrInvalidSequence,
fmt.Sprintf("invalid nonce; got %d, expected %d", msgEthTx.Data.AccountNonce, seq),
Expand Down
13 changes: 13 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang:1.13
araskachoi marked this conversation as resolved.
Show resolved Hide resolved

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"]
8 changes: 8 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Docker Benchmarking

## Getting Started

Run the command in the root directory of this project
```
$ docker build -f ./docker/Dockerfile .
fedekunze marked this conversation as resolved.
Show resolved Hide resolved
```
121 changes: 121 additions & 0 deletions docker/benchmarking/benchmark/geth-genesis.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
package benchmark

import (
"encoding/json"
"io/ioutil"
"os"
"strconv"

"github.com/urfave/cli"
)

type Genesis struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit add godoc comment

Config struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move out of the struct and pass it as a field

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"`
} `json:"config"`
Difficulty string `json:"difficulty"`
GasLimit string `json:"gasLimit"`
ExtraData string `json:"extraData"`
Alloc interface{} `json:"alloc"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

}
type Balance struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto godoc

Balance string `json:"balance"`
}

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
json.Unmarshal(byteValue, &genesis)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check error

return genesis, nil
}

func writeGenesis(data Genesis) error {
file, err := json.MarshalIndent(data, " ", " ")
if err != nil {
return err
}

err = ioutil.WriteFile("genesis.json", file, 0644)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

address lint issue

if err != nil {
return err
}
return nil
}
Loading