Skip to content

Commit

Permalink
Merge branch 'main' into parallel-gen-tx
Browse files Browse the repository at this point in the history
Signed-off-by: yihuang <[email protected]>
  • Loading branch information
yihuang authored Oct 17, 2024
2 parents a4750a2 + 3b38bcc commit 8fd2ae7
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ result
integration_tests/configs/*.yaml

# direnv
/.envrc
/.direnv
.envrc
.direnv
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Improvements

* [#1645](https://github.com/crypto-org-chain/cronos/pull/1645) Gen test tx in parallel even in single node.
* (testground)[#1644](https://github.com/crypto-org-chain/cronos/pull/1644) load generator retry with backoff on error.

*Oct 14, 2024*

Expand Down
2 changes: 1 addition & 1 deletion testground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ nix run .#stateless-testcase -- gen /tmp/data/out \
--num-txs 20 \
--num-idle 20 \
--app-patch '{"mempool": {"max-txs": -1}}' \
--config-patch '{"mempool": {"size": 100000}}' \
--config-patch '{"mempool": {"size": 10000}}' \
--tx-type erc20-transfer \
--genesis-patch '{"consensus": {"params": {"block": {"max_gas": "263000000"}}}}'
```
Expand Down
7 changes: 6 additions & 1 deletion testground/benchmark/benchmark/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pathlib import Path

import aiohttp
import backoff
import eth_abi
import ujson

Expand Down Expand Up @@ -105,6 +106,8 @@ def load(datadir: Path, global_seq: int) -> [str]:
return ujson.load(f)


@backoff.on_predicate(backoff.expo, max_time=60, max_value=5)
@backoff.on_exception(backoff.expo, aiohttp.ClientError, max_time=60, max_value=5)
async def async_sendtx(session, raw):
async with session.post(
LOCAL_JSON_RPC,
Expand All @@ -117,7 +120,9 @@ async def async_sendtx(session, raw):
) as rsp:
data = await rsp.json()
if "error" in data:
print("send tx error", data["error"])
print("send tx error, will retry,", data["error"])
return False
return True


async def send(txs):
Expand Down
15 changes: 13 additions & 2 deletions testground/benchmark/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions testground/benchmark/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ click = "^8.1.7"
ujson = "^5.10.0"
jsonmerge = "^1.9.2"

backoff = "^2.2.1"
[tool.poetry.group.dev.dependencies]
pytest = "^8.2"
pytest-github-actions-annotate-failures = "^0.2.0"
Expand Down

0 comments on commit 8fd2ae7

Please sign in to comment.