-
Notifications
You must be signed in to change notification settings - Fork 535
[Feature] Adding loadbot ERC20 and ERC721 token transfer mode #425
Conversation
* Added new flag option for erc20 transfers * Added deployContract function * Added the option to pass parameters to smart contract constructor * Changed executeTxn method to support multiple transaction mods * Added Contract Deployment metrics to the output
* Added gasLimit metric * Added percentual gas usage metric * Increased receipt timeout * Added condition to show contract deploy metrics
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.
Can you add "erc20" in the description of mode
argument in loadbot
command?
* Remove unnessesary print line * Decrese the token transfer amount
* Moved SetContractAddress to TransactionGenerator * Moved contractAddress to BaseGenerator
* Removed/added comments * Renamed transactions.go to deploy_contract.go * Pleased linter gods
* Added max-wait flag for custom time to wait for receipts
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.
LGTM, apart from a few interfaces/structs which should be refactored (in a separate PR).
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.
I've left some comments that need to be addressed.
The PR looks good, but there are a few problematic parts that worry me, namely how we merged the Transaction generator and contract / token generator logic, and why we removed dynamic wait times for transactions.
Please review the comments and we can discuss 🙏
* set more detailed err output in initContractAndArgs method
* run this method only if any erc mode is set
…etrics * output contract block details only if any erc mode was selected
* added hasValidDeployParams
* added configurable receipt timeout max-wait
* moved contract metrics to dedicated struct
* deploy contract only if isTokenTransferMode is true
…ator * created new ContractTxnGenerator interface * prettyfied erc20abi json * created dedicated method for initializing blocks map * dynamicaly set txn or tokenTxn generator
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.
Looks good to me. I have one question. Please check it.
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.
Thank you for resolving the discussions 🙏
Looks good 💯
* added erc20 total token supply value description * lowered value for erc20 token transfers
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.
LGTM!
Description
This PR adds the ERC20 and ERC721 token transactions feature to the loadbot.
It will deploy a new ERC20 or ERC721 SC to the network and make ERC20 or ERC721 token or mint transactions.
New
--mode erc20
and--mode erc721
switches are implemented.The loadbot output now shows gas related metrics ( gasLimit and gasUsed) and the derived block utilization.
Fixes EDGE-452
Changes include
Checklist
Testing
Manual tests
Pull branch and run the loadbot with new mode switch. For example:
go run main.go loadbot --mode erc20 --jsonrpc http://127.0.0.1:40001 --grpc-address 127.0.0.1:30001 --sender 0x228466F2C715CbEC05dEAbfAc040ce3619d7CF0B --receiver 0xca48694ebcB2548dF5030372BE4dAad694ef174e --count 50 --value 0x101 --tps 200
Documentation update
Updated docs 0xPolygon/polygon-edge-docs#68
Additional comments
Before running the loadbot env vars with acc/keys need to be set:
export LOADBOT_<account address>=<account private key>