Git Product home page Git Product logo

zkevm-bench's Introduction

Benchmarks

OS Setup

Install python3 and pip3, in ubuntu that can be done by:

sudo apt-get install python3 python3-pip

Then install requirements:

pip3 install -r requirements.txt

Solc

For tests with SC you need to have solc installed on your system:

https://docs.soliditylang.org/en/latest/installing-solidity.html

Then install the required version to compile contracts:

python3 -c 'from solcx import install_solc; install_solc("0.5.16")'

Uniswap V2

To run Uniswap v2 deployment you need to update the submodule:

git submodule init
git submodule update

Profiles setup

Use default profiles.json to add your own network. You just need to set the RPC url and the path of a file containing the private key of the account that will be used to fund addresses for the test. Keys under keys/ are out of git scope, as well as private_profiles.json, which uses the same format as profiles.json

Execute test

Minimal test to check everything runs:

python3 bench.py --profile testnet --concurrency 1 --txs 1

That's the shortcut for the same:

python3 bench.py -p testnet -c 1 -t 1

Replace testnet with the desired profile, and be sure the file with the private key exists and has funds enough.

Bench options

Mandatory options:

  • -p <string> To set the profile
  • -c <int> For concurrent thread count
  • -t <int> Number of transactions per thread

Optional parameters (first one is the default):

  • --confirmed or --no-confirmed Flag to enable or disable confirmed txs tests
  • --unconfirmed or --no-unconfirmed Flag to enable or disable unconfirmed txs tests
  • --erc20create or --no-erc20create Flag to enable or disable ERC20 Token creation tests
  • --erc20txs or --no-erc20txs Flag to enable or disable ERC20 Token transfers, automatically disabled if --no-erc20create is set
  • --uniswap or --no-uniswap Flag to enable or disable deployment of Uniswap v2 smart contracts
  • --recover or --no-recover Attempt -or not- to recover remaining funds in created accounts -sent back the funded account-, may fail if there is not enough balance to pay fees.
  • --no-race or --race Specific test that sends many transactions starting with future nonce, and the last transaction is the missing nonce that makes them all execute at once.

Logging

Each execution is incrementally logged to bench.log file. You can find there all past results.

grep Results bench.log

You will also find on the log file all the transaction hashes for all the transactions sent.

zkevm-bench's People

Contributors

xavier-romero avatar rafael-genes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.