Closed mmsqe closed 2 months ago
[!WARNING]
Rate limit exceeded
@yihuang has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 38 seconds before requesting another review.
How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.Commits
Files that changed from the base of the PR and between 5ea96591d32e7c30ee685c1dc7a889134e61de0f and d99d6fe1c51e0e802539ea017217f419e744ec8b.
The changes enhance transaction handling and node initialization within the sendtx.py
and stateless.py
files. The sendtx.py
file introduces asynchronous transaction signing and writing, while stateless.py
adds new parameters and CLI commands for generating transactions. Additionally, the transition to a stateless-testcase
framework is reflected in the flake.nix
and overlay.nix
files, indicating a structural rebranding.
File Path | Change Summary |
---|---|
testground/benchmark/benchmark/stateless.py |
Enhanced transaction management with new parameters and functions for generating transactions. Introduced CLI commands for transaction generation. Modified do_run to load transactions from an output directory. |
testground/benchmark/benchmark/sendtx.py |
Improved transaction handling with asynchronous signing and writing. Refactored prepare_txs for concurrent processing and enhanced error handling. |
testground/benchmark/flake.nix |
Changed default package from pkgs.testground-testcase to pkgs.stateless-testcase , updating configurations accordingly. |
testground/benchmark/overlay.nix |
Renamed exported entities from testground-testcase to stateless-testcase , indicating a shift in architecture. |
nix/testground-image.nix |
Updated Docker image configuration to replace testground-testcase with stateless-testcase . |
Objective | Addressed | Explanation |
---|---|---|
Generate all test accounts and transactions in the gen phase. (#1573) |
✅ |
sendtx.py
regarding the generate_load
function and its parameters relate to transaction handling and asynchronous processing.stateless.py
enhance transaction generation and handling, sharing a focus on improving transaction management.validator-generate-load
option in stateless.py
aligns with enhancements in transaction handling and configurability.stateless.py
to improve block statistics and TPS calculations relate to the focus on enhancing transaction handling.sendtx.py
for multi-threading and transaction sending efficiency are directly relevant to changes in transaction handling and performance optimization.🐰 In the realm of code, where transactions play,
New features emerge, brightening the day.
With each hop and tweak, our benchmarks refine,
A stateless adventure, where all will align.
So gather your data, let the metrics unfold,
In this world of testing, new stories are told! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 15.24%. Comparing base (
3c8be96
) to head (d99d6fe
). Report is 1 commits behind head on main.
diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py
index 5e4db258..4fb54d0e 100644
--- a/testground/benchmark/benchmark/stateless.py
+++ b/testground/benchmark/benchmark/stateless.py
@@ -6,6 +6,7 @@ import socket
import subprocess
import tarfile
import tempfile
+import threading
import time
from pathlib import Path
from typing import List
@@ -220,12 +221,26 @@ def _gen_txs(
num_txs: int = 1000,
):
outdir = Path(outdir)
- for global_seq in range(nodes):
+
+ # create dir in advance to avoid conflict in parallel task
+ (outdir / transaction.TXS_DIR).mkdir(parents=True, exist_ok=True)
+
+ def job(global_seq: int):
print("generating", num_accounts * num_txs, "txs for node", global_seq)
txs = transaction.gen(global_seq, num_accounts, num_txs)
transaction.save(txs, outdir, global_seq)
print("saved", len(txs), "txs for node", global_seq)
+ threads = [
+ threading.Thread(target=job, args=(global_seq,)) for global_seq in range(nodes)
+ ]
+
+ for t in threads:
+ t.start()
+
+ for t in threads:
+ t.join()
+
def do_run(
datadir: Path, home: Path, cronosd: str, group: str, global_seq: int, cfg: dict
I actually tested this parallel implementation, CPU usage never pass 100%
, and there's zero speedup, even several seconds slower, the reason is eth-account
rely on pure python cryptographic implementation, so it's all protected by GIL. @mmsqe
Solution:
👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
Closes: #1573
and
diable validator_generate_load
to run
PR Checklist:
make
)make test
)go fmt
)golangci-lint run
)go list -json -m all | nancy sleuth
)Thank you for your code, it's appreciated! :)
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes