Skip to content

Conversation

@akegaviar
Copy link
Member

@akegaviar akegaviar commented Aug 21, 2025

Summary by CodeRabbit

  • Documentation
    • Added detailed development and testing guides, plus updates to the README with development links and shape-listing guidance.
  • Test Data
    • Test data tooling now accepts explicit start/end block overrides for Solana workflows.
  • RPC / Client Support
    • Expanded RPC surface and tooling to include many additional endpoints and broader support for the reth client; client version updated.
  • Version
    • Package/tooling version bumped to 0.8.7.

@coderabbitai
Copy link

coderabbitai bot commented Aug 21, 2025

Walkthrough

Adds a new AGENTS.md guide, updates README, adjusts Solana test-data start/end block override handling, expands discovery catalog (clients.json and large methods.json updates to add/augment reth and many RPC methods), and bumps project version in pyproject.toml.

Changes

Cohort / File(s) Summary
Documentation
AGENTS.md, README.md
AGENTS.md added: comprehensive Chainbench (Locust) development/testing guide (headless tests, Poetry, formatting/linting, type checks, pre-commit, testing workflows, profile/test-data guidance, safety notes). README.md updated with a shapes listing example, Development links to Contributing and Agents, and a note on test data reuse.
Solana test data logic
chainbench/test_data/solana.py
Honor explicit start_block and end_block parsed options by setting self.start_block_number / self.end_block_number when provided, before existing use_latest_blocks logic and subsequent bounds checks/warnings.
Discovery — clients
chainbench/tools/discovery/clients.json
Bumped reth client version from "0.1.0-alpha.13" to "1.8.2".
Discovery — methods catalog
chainbench/tools/discovery/methods.json (large additions/edits)
Massive additions and augmentations: add many RPC methods across namespaces (anvil, hardhat, mev, engine, ots, eth, trace, debug, miner, opp2p, etc.), add new reth associations and rename/redirect several method entries; adds numerous new client-method mappings.
Project metadata
pyproject.toml
Bumped package version from 0.8.5 to 0.8.7.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as CLI / ParsedOptions
    participant SolanaTD as SolanaTestData
    participant Blocks as BlockSource

    CLI->>SolanaTD: instantiate(with parsed_options)
    SolanaTD->>SolanaTD: check parsed_options.start_block?
    alt start_block provided
        SolanaTD->>SolanaTD: set self.start_block_number = parsed_options.start_block
    else
        SolanaTD->>Blocks: earliest_available_block_number
        Blocks-->>SolanaTD: earliest
        SolanaTD->>SolanaTD: set start to earliest
    end

    SolanaTD->>SolanaTD: check parsed_options.end_block?
    alt end_block provided
        SolanaTD->>SolanaTD: set self.end_block_number = parsed_options.end_block
    else
        SolanaTD->>Blocks: latest_block_number
        Blocks-->>SolanaTD: latest
        SolanaTD->>SolanaTD: set end to latest
    end

    SolanaTD->>SolanaTD: apply use_latest_blocks logic & bounds checks/warnings
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Rationale: Large, heterogeneous changes — small logic change in Solana code; extensive, high-volume edits to discovery/methods catalog (many new entries to validate); docs and version bump. Reviewing methods.json additions and client mappings will take most time.
  • Pay extra attention to:
    • chainbench/tools/discovery/methods.json for correctness of method names, namespaces, and client associations.
    • chainbench/test_data/solana.py for edge-case behavior when start/end overrides conflict with bounds or use_latest_blocks.
    • clients.json and pyproject.toml version consistency.

Possibly related PRs

Suggested labels

enhancement

Poem

I nibble docs beneath the moonlit key,
A guide for testers, tidy as can be.
Blocks get chosen, shapes are shown with care,
New methods sprout like whiskers in the air.
Hop light, run safe — carrot cheers to thee! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Add AGENTS.md' accurately describes the main change, but it is incomplete given the scope of the PR which includes version bumps, RPC method additions, and test data modifications. Update the title to reflect all significant changes, such as 'Add AGENTS.md, update reth client version, expand RPC methods, and enhance test data handling' or summarize the primary focus.
Description check ⚠️ Warning No pull request description was provided by the author, but the template requires sections for Description and Issues Resolved. Add a comprehensive description following the template: describe all changes (AGENTS.md, reth version bump, RPC methods, test data, documentation updates) and specify any issues resolved.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-agents-md

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23e5ce6 and 149729c.

📒 Files selected for processing (6)
  • AGENTS.md (1 hunks)
  • README.md (2 hunks)
  • chainbench/test_data/solana.py (1 hunks)
  • chainbench/tools/discovery/clients.json (1 hunks)
  • chainbench/tools/discovery/methods.json (84 hunks)
  • pyproject.toml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • AGENTS.md
🧰 Additional context used
🧬 Code graph analysis (1)
chainbench/test_data/solana.py (1)
chainbench/test_data/blockchain.py (4)
  • start_block_number (216-217)
  • start_block_number (220-221)
  • end_block_number (224-225)
  • end_block_number (228-229)
🔇 Additional comments (10)
chainbench/test_data/solana.py (1)

107-114: LGTM! Override logic is correct.

The explicit handling of start_block and end_block overrides is implemented correctly. The logic appropriately falls back to computed defaults when overrides are not provided, and the subsequent validation step (lines 118-126) ensures out-of-bounds values are adjusted with appropriate warnings.

Note that use_latest_blocks (line 115) takes precedence over these explicit overrides by design, which is the expected behavior.

pyproject.toml (1)

3-3: Version bump aligns with broader release scope.

The version bump from 0.8.5 to 0.8.7 is appropriate given the documentation additions (AGENTS.md, README), reth client integration, and expanded method discovery catalog. All dependency versions remain stable.

chainbench/tools/discovery/clients.json (1)

47-47: Reth version update reflects broader client support expansion.

The reth version bump to 1.8.2 is a substantial upgrade from the alpha version and aligns well with the expanded method coverage across the discovery catalog. Verify that 1.8.2 is the intended reth release version for this integration.

README.md (3)

173-177: Added shape listing command and customization guidance.

The new section clearly documents how to discover available shapes and indicates that users can customize them by copying existing ones. The command example is practical and follows existing documentation patterns.


180-184: Test data reuse roadmap documented.

Adding context about future plans to reuse test data is helpful. Clarifies current behavior while setting expectations for future improvements.


262-264: Development section links verified—all files present.

Both CONTRIBUTING.md and AGENTS.md exist in the repository root. The links in the Development section (lines 262-264 of README.md) are valid and will resolve correctly.

chainbench/tools/discovery/methods.json (4)

55-394: Comprehensive reth RPC method coverage added across multiple namespaces.

The PR significantly expands reth support with 40+ new method entries spanning admin, anvil, debug, eth, engine, flashbots, hardhat, mev, miner, ots, reth, and trace namespaces. This aligns well with the reth client version upgrade to 1.8.2 and demonstrates thorough coverage of reth-specific and shared RPC functionality.


132-150: Augmentation of existing methods with reth support is consistent.

Many existing methods have been augmented to include "reth" in their client list (e.g., admin_peers, debug_accountRange, eth_chainId). This pattern is consistent throughout and properly expands support without breaking existing client references.

Also applies to: 744-1450


3518-3527: Both methods are valid Avalanche platform API methods.

The Platform (P‑Chain) RPC includes platform.getBlockchains (returns all blockchains) and platform.getBlockchainStatus (returns status of a specific blockchain). These serve distinct purposes and correctly coexist in the configuration.


1-100: JSON validation and structure verified.

JSON syntax is valid and 603 unique methods are present with no duplicates detected. ✓


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@akegaviar akegaviar requested a review from erwin-wee August 21, 2025 01:27
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (10)
AGENTS.md (10)

3-3: Neutralize vendor-specific reference and fix punctuation.

Avoid potentially outdated brand names and add the missing comma after “e.g.”.

-This repository contains Chainbench, a blockchain infrastructure benchmarking tool built on Locust. When working on the project interactively with an agent (e.g. the Codex CLI) please follow the guidelines below for efficient development and testing.
+This repository contains Chainbench, a blockchain infrastructure benchmarking tool built on Locust. When working on the project interactively with an agent (e.g., a CLI assistant), please follow the guidelines below for efficient development and testing.

21-25: Tighten Poetry workflow; avoid redundant lock step after poetry add.

poetry add updates the lock automatically. Reserve poetry lock for when you edit pyproject.toml manually or need to refresh the lock without changing constraints.

-1. Use Poetry to manage dependencies: `poetry add <package>` or `poetry add --group dev <package>`.
-2. Run `poetry lock --no-update` to update the lock file.
-3. Install updated dependencies with `poetry install`.
-4. Verify compatibility with Python 3.10+ as specified in the project.
+1. Use Poetry to manage dependencies: `poetry add <package>` or `poetry add --group dev <package>`.
+2. Install updated dependencies with `poetry install`.
+3. If you edited pyproject.toml manually, run `poetry lock` to regenerate the lock file.
+4. Verify compatibility with Python 3.10+ as specified in the project.

28-33: Minor style and linter alignment tweaks.

Add the hyphen in “120‑character” and note W503 alongside E203 for Black compatibility (common pairing).

-* Follow Black formatting (120 character line length).
+* Follow Black formatting (120-character line length).
 * Use isort for import sorting (Black-compatible profile).
-* Follow Flake8 linting rules (E203 ignored for Black compatibility).
+* Follow Flake8 linting rules (ignore E203 and W503 for Black compatibility).
 * Use type hints where appropriate.
 * Keep MyPy checks passing.

34-44: Keep wording consistent in the table.

Very minor: “Run type checks” reads more idiomatically.

-| `poetry run mypy .`      | Run type checking                         |
+| `poetry run mypy .`      | Run type checks                           |

46-48: Add pre-commit install to make hooks effective locally.

Without installation, hooks won’t run on commit.

 Or use pre-commit hooks:
 ```bash
+poetry run pre-commit install
 poetry run pre-commit run --all-files

---

`77-81`: **Add a quick note on monitoring method.**

Consider mentioning how to watch memory/CPU (e.g., `htop`, Docker stats, or built-in metrics) to make the advice immediately actionable.


```diff
-* Monitor memory usage with larger data sizes.
+* Monitor memory/CPU of both Chainbench workers and the target node (e.g., via `htop`, `docker stats`, or your cloud metrics) with larger data sizes.

91-101: Add start --help and --version to the recap for quick discovery.

 | `poetry install`                                  | Install all dependencies              |
 | `poetry run chainbench --help`                   | Show all available commands           |
+| `poetry run chainbench start --help`             | Show options for running a benchmark  |
+| `poetry run chainbench --version`                | Show CLI version                      |
 | `poetry run chainbench list methods`             | List supported RPC methods            |
 | `poetry run chainbench list profiles`            | List available profiles               |
 | `poetry run chainbench list shapes`              | List load pattern shapes              |
 | `poetry run chainbench discover <url>`           | Discover available methods            |

102-109: Add a short privacy/ToS reminder.

Helps prevent accidental leakage and policy violations during testing/reporting.

 * **Use appropriate rate limits** to avoid overwhelming nodes.
 * **Start with light profiles** before heavy ones.
 * **Keep test durations short** during development.
+* **Do not include private endpoints or credentials** in commands, logs, or bug reports.
+* **Respect your provider’s Terms of Service** and published rate limits.

69-74: Specify the canonical profiles directory

Please update AGENTS.md to point readers at the exact location where profiles live:

• File: AGENTS.md
Lines: 69–74

Short explanation: instead of “Place custom profiles in appropriate subdirectories,” name the root path explicitly so users don’t have to guess.

Suggested diff:

-* Place custom profiles in appropriate subdirectories.
+* Place custom profiles in the canonical directory: `chainbench/profile/<network>/…`

Optionally, you can list the top-level folders under chainbench/profile/ (e.g. evm, solana, starknet, etc.) to make it even clearer.


1-112: Add a link to AGENTS.md in README and consider moving it under docs/

I verified that:

  • README.md exists but does not reference AGENTS.md.
  • There is no CONTRIBUTING.md in the repo.
  • A docs/ directory is already present.

Recommendations:

  • In README.md, add a “Development” or “Contributing” section with a link to AGENTS.md.
  • Optionally, relocate AGENTS.md into docs/ for better organization and update the README link to point to docs/AGENTS.md.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 16dc35d and a865823.

📒 Files selected for processing (1)
  • AGENTS.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
AGENTS.md

[grammar] ~38-~38: There might be a mistake here.
Context: ...ose | | ------------------------ | -----------...

(QB_NEW_EN)


[grammar] ~39-~39: There might be a mistake here.
Context: ...-------------------------------------- | | poetry run black . | Format code...

(QB_NEW_EN)


[grammar] ~40-~40: There might be a mistake here.
Context: ...mat code to project standards | | poetry run isort . | Sort import...

(QB_NEW_EN)


[grammar] ~41-~41: There might be a mistake here.
Context: ... imports | | poetry run flake8 | Run linting...

(QB_NEW_EN)


[grammar] ~42-~42: There might be a mistake here.
Context: ... linting checks | | poetry run mypy . | Run type ch...

(QB_NEW_EN)


[grammar] ~77-~77: There might be a mistake here.
Context: ... ## 7. Working with Test Data * Start with smallest data size (--size XS) for de...

(QB_NEW_EN)


[grammar] ~77-~77: There might be a mistake here.
Context: ...data size (--size XS) for development. * Use --use-latest-blocks for nodes with...

(QB_NEW_EN)

🔇 Additional comments (3)
AGENTS.md (3)

1-112: Solid, actionable doc — nice addition.

Clear, practical guidelines with concrete commands. This will help keep local/dev testing safe and fast. No blocking issues from me; see a few targeted refinements below.


14-15: Align AGENTS.md example with the actual start subcommand flags and use a <NODE_URL> placeholder

  • Replace the hard-coded https://test-node with <NODE_URL> to avoid accidental copy-paste against a real node.
  • Verify that the flags in your example match those exposed by the start command in chainbench/main.py:
    • The current code defines at least:
      --profile
      --users
      --headless
      --autoquit
      --target
      --run-id
    • If --workers and --test-time are not supported in your PR branch, either add those options to the CLI or update the example to use the correct flags for concurrency and duration.
-poetry run chainbench start --profile evm.light --users 5 --workers 1 --test-time 30s --target https://test-node --headless --autoquit
+poetry run chainbench start --profile evm.light --users 5 --workers 1 --test-time 30s --target <NODE_URL> --headless --autoquit

54-64: Clarify valid --clients values in CLI docs

It’s not immediately obvious which client identifiers are supported by chainbench discover --clients. To ensure users pick valid values, please update the snippet (and surrounding text) to:

  • Show at least two real examples (e.g. --clients geth,erigon or --clients nethermind,openethereum)
  • Or link to the definitive source of truth (chainbench/tools/discovery/clients.json or call out RpcDiscovery.get_client_names())

For example:

- chainbench discover https://test-node --clients geth
+ chainbench discover https://test-node --clients geth,erigon
# (Valid values: geth, erigon, nethermind, openethereum, etc.; see chainbench/tools/discovery/clients.json)

See the validate_clients callback and RpcDiscovery.get_client_names() for how client names are loaded.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
AGENTS.md (1)

28-33: Align Flake8 guidance with Black: add W503 to ignores.

To be fully Black-compatible, recommend ignoring both E203 and W503 (the latter for line breaks around binary operators). Update the bullet to reflect this.

-* Follow Flake8 linting rules (E203 ignored for Black compatibility).
+* Follow Flake8 linting rules (ignore E203 and W503 for Black compatibility).
🧹 Nitpick comments (6)
AGENTS.md (6)

21-25: Tighten Poetry workflow phrasing.

poetry add already updates the lock; poetry lock --no-update is typically for metadata-only changes. Suggest clarifying when to use each.

-1. Use Poetry to manage dependencies: `poetry add <package>` or `poetry add --group dev <package>`.
-2. Run `poetry lock --no-update` to update the lock file.
+1. Use Poetry to manage dependencies: `poetry add <package>` (or `--group dev` for dev deps) — this updates the lock file.
+2. If you only change metadata (no version bumps), run `poetry lock --no-update` to refresh the lock deterministically.

45-49: Pre-commit: add install step so hooks run on commit.

Running hooks manually is fine, but most folks expect automatic checks on commit.

 Or use pre-commit hooks:
 ```bash
+poetry run pre-commit install
 poetry run pre-commit run --all-files

---

`77-81`: **Grammar and repeatability nits; clarify when to use latest blocks.**


```diff
-* Start with smallest data size (`--size XS`) for development.
+* Start with the smallest data size (`--size XS`) for development.
 * Use `--use-latest-blocks` for nodes with limited history.
-* Consider using `--ref-url` for test data generation from a reference node.
+* Consider using `--ref-url` for test data generation from a reference node.
+* For repeatable benchmarks across runs, prefer pinning a block range over `--use-latest-blocks`.

83-90: Add a quick test step to the workflow.

If the repo has tests, include a minimal test invocation so contributors don’t skip it.

 2. Run formatting: `poetry run black . && poetry run isort .`
 3. Run linting: `poetry run flake8`
 4. Run type checking: `poetry run mypy .`
-5. Test with minimal profile first
+5. Run tests: `poetry run pytest -q`  # or project-specific test runner
+6. Test with minimal profile first
-6. Gradually increase complexity and load
+7. Gradually increase complexity and load

If the project doesn’t use pytest, I can tailor this to your test runner.


26-33: Optional: link to the authoritative configs so the doc stays in sync.

A small “See also” tying to pyproject.toml sections for Black/isort/Flake8/MyPy helps readers map guidelines to enforcement.

 * Use type hints where appropriate.
 * Keep MyPy checks passing.
+
+See also: the `[tool.black]`, `[tool.isort]`, `[tool.flake8]`, and `[tool.mypy]` sections in `pyproject.toml` (and `mypy.ini` if present).

12-15: Docs: Confirm CLI flags and add spawn‐rate in example

Verified that the example flags in AGENTS.md match the current Chainbench CLI (all options below exist in chainbench/main.py, with --test-time as the correct flag and no --run-time alias). Since the --spawn-rate option is supported and helps ensure a predictable ramp-up, please update the example command to include it:

• File: AGENTS.md (around lines 12–15)
Update the example invocation to:

- poetry run chainbench start --profile evm.light --users 5 --workers 1 --test-time 30s --target https://test-node --headless --autoquit
+ poetry run chainbench start --profile evm.light --users 5 --spawn-rate 1 --workers 1 --test-time 30s --target https://test-node --headless --autoquit
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a865823 and 23e5ce6.

📒 Files selected for processing (1)
  • AGENTS.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
AGENTS.md

[grammar] ~38-~38: There might be a mistake here.
Context: ...ose | | ------------------------ | -----------...

(QB_NEW_EN)


[grammar] ~39-~39: There might be a mistake here.
Context: ...-------------------------------------- | | poetry run black . | Format code...

(QB_NEW_EN)


[grammar] ~40-~40: There might be a mistake here.
Context: ...mat code to project standards | | poetry run isort . | Sort import...

(QB_NEW_EN)


[grammar] ~41-~41: There might be a mistake here.
Context: ... imports | | poetry run flake8 | Run linting...

(QB_NEW_EN)


[grammar] ~42-~42: There might be a mistake here.
Context: ... linting checks | | poetry run mypy . | Run type ch...

(QB_NEW_EN)


[grammar] ~77-~77: There might be a mistake here.
Context: ... ## 7. Working with Test Data * Start with smallest data size (--size XS) for de...

(QB_NEW_EN)


[grammar] ~77-~77: There might be a mistake here.
Context: ...data size (--size XS) for development. * Use --use-latest-blocks for nodes with...

(QB_NEW_EN)

🔇 Additional comments (2)
AGENTS.md (2)

1-112: Overall: solid, practical doc.

Well-structured and actionable. Clear guidance for safe, short, headless development runs and a tidy QA loop (format → lint → typecheck → smoke). Nice.


91-101: Useful commands list verified

I’ve confirmed that all of the commands in the “Useful Commands Recap” section map directly to registered click subcommands in chainbench/main.py:

  • chainbench list methods
  • chainbench list profiles
  • chainbench list shapes
  • chainbench discover <endpoint>

(The list group and its four subcommands—methods, profiles, shapes, and the client‐options listing—are all defined via @_list.command decorators.) No drift detected, so no updates are required here.

@erwin-wee erwin-wee merged commit 64ae24f into main Nov 5, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants