Skip to content
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

Add uniswap-transfers Benchmark Script to zkevm-node #2408

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

Psykepro
Copy link
Contributor

@Psykepro Psykepro commented Aug 14, 2023

Closes #2355.

What does this PR do?

This pull request introduces the uniswap-transfers benchmark script, which is designed to streamline various operations related to Uniswap smart contracts. Specifically, it will allow us to deploy, mint, approve, add liquidity, and perform swap cycles for Uniswap and ERC-20 tokens. The script also incorporates timing functionalities for operations before the swap cycles, and it uses the NumberOfOperations parameter to decide the number of swap cycles to perform.

Changes

  1. Deployment of Uniswap Smart Contracts: The script facilitates the deployment of Uniswap smart contracts.

  2. Deployment of ERC-20 Tokens: Enables the deployment of ERC-20 tokens using the benchmark script.

  3. Minting of ERC-20 Tokens: Offers functionality to mint ERC-20 tokens.

  4. Approval of Amounts for Transactions: Allows users to approve specific amounts for transactions.

  5. Liquidity Addition to the Uniswap Pool: Provides a mechanism to add liquidity to the Uniswap pool.

  6. Performing Swap Cycles: The script leverages the NumberOfOperations parameter to ascertain the number of swap cycles to execute.

  7. End-to-end Testing: Moved all benchmark e2e tests under e2e directory. An end-to-end test has been added respectively to the new e2e directory as follows: zkevm-node/test/benchmarks/e2e/uniswap-transfers, which can be initiated using the make command: benchmark-sequencer-uniswap-transfers.

  8. Metrics Collection and Printing: Added collection of gasUsed metrics during transactions and printing of the following metrics: Average gas used per transaction, Total Gas, and Gas per second.

Objective:

By incorporating the uniswap-transfers benchmark script into our system, we enhance our ability to test, benchmark, and assess various operations associated with Uniswap and ERC-20 tokens.

Reviewers

@Psykepro Psykepro added this to the v0.3.0 milestone Aug 14, 2023
@Psykepro Psykepro self-assigned this Aug 14, 2023
@cla-bot cla-bot bot added the cla-signed label Aug 14, 2023
@Psykepro Psykepro merged commit c4d4904 into develop Aug 17, 2023
@Psykepro Psykepro deleted the test/uniswap-benchmark-script branch August 17, 2023 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create uniswap-transfers Benchmark Script
2 participants