Add uniswap-transfers
Benchmark Script to zkevm-node
#2408
Merged
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.
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 theNumberOfOperations
parameter to decide the number of swap cycles to perform.Changes
Deployment of Uniswap Smart Contracts: The script facilitates the deployment of Uniswap smart contracts.
Deployment of ERC-20 Tokens: Enables the deployment of ERC-20 tokens using the benchmark script.
Minting of ERC-20 Tokens: Offers functionality to mint ERC-20 tokens.
Approval of Amounts for Transactions: Allows users to approve specific amounts for transactions.
Liquidity Addition to the Uniswap Pool: Provides a mechanism to add liquidity to the Uniswap pool.
Performing Swap Cycles: The script leverages the
NumberOfOperations
parameter to ascertain the number of swap cycles to execute.End-to-end Testing: Moved all benchmark e2e tests under
e2e
directory. An end-to-end test has been added respectively to the newe2e
directory as follows:zkevm-node/test/benchmarks/e2e/uniswap-transfers
, which can be initiated using themake
command:benchmark-sequencer-uniswap-transfers
.Metrics Collection and Printing: Added collection of
gasUsed
metrics during transactions and printing of the following metrics:Average gas used per transaction
,Total Gas
, andGas 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