diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b7e879b86..94f55c8c26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * (testground)[1649](https://github.com/crypto-org-chain/cronos/pull/1649) Fix running single validator benchmark locally. * (cli)[#1647](https://github.com/crypto-org-chain/cronos/pull/1647) Fix node can't shutdown by signal. +* (testground)[#1652](https://github.com/crypto-org-chain/cronos/pull/1652) Remove unexpected conflicts in benchmark transactions. ### Improvements diff --git a/testground/benchmark/benchmark/transaction.py b/testground/benchmark/benchmark/transaction.py index 291fb84389..5ef86bedfc 100644 --- a/testground/benchmark/benchmark/transaction.py +++ b/testground/benchmark/benchmark/transaction.py @@ -20,12 +20,11 @@ CHAIN_ID = 777 CONNECTION_POOL_SIZE = 1024 TXS_DIR = "txs" -RECIPIENT = "0x1" + "0" * 39 -def simple_transfer_tx(nonce: int): +def simple_transfer_tx(sender: str, nonce: int): return { - "to": RECIPIENT, + "to": sender, "value": 1, "nonce": nonce, "gas": 21000, @@ -34,9 +33,9 @@ def simple_transfer_tx(nonce: int): } -def erc20_transfer_tx(nonce: int): +def erc20_transfer_tx(sender: str, nonce: int): # data is erc20 transfer function call - data = "0xa9059cbb" + eth_abi.encode(["address", "uint256"], [RECIPIENT, 1]).hex() + data = "0xa9059cbb" + eth_abi.encode(["address", "uint256"], [sender, 1]).hex() return { "to": CONTRACT_ADDRESS, "value": 0, @@ -68,7 +67,7 @@ def _do_job(job: Job): for acct in accounts: txs = [] for i in range(job.num_txs): - tx = job.create_tx(i) + tx = job.create_tx(acct.address, i) raw = acct.sign_transaction(tx).rawTransaction txs.append(EthTx(tx, raw, HexBytes(acct.address))) total += 1