Skip to content

Conversation

erwin-wee
Copy link
Collaborator

@erwin-wee erwin-wee commented Aug 8, 2025

Description

  • Add ref-url for fetching test data

Summary by CodeRabbit

  • New Features

    • Added a new --ref-url command-line option to specify a reference blockchain node URL for fetching test data before benchmarks begin. If not provided, the target URL is used by default.
  • Documentation

    • Updated the README to document the new --ref-url flag and its usage.
  • Style

    • Improved help text formatting for some CLI arguments.
  • Chores

    • Updated base Docker images to Debian "bookworm" variants for both build and runtime stages.
    • Upgraded the solders dependency version from ^0.22.0 to ^0.26.0.
    • Updated development dependencies including black, mypy, flake8, and isort.
    • Updated Poetry pre-commit hook version from 2.0.1 to 2.1.3.

@erwin-wee erwin-wee self-assigned this Aug 8, 2025
@erwin-wee erwin-wee added the enhancement New feature or request label Aug 8, 2025
Copy link

coderabbitai bot commented Aug 8, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

A new --ref-url command-line flag was introduced to allow specifying a reference blockchain node URL for fetching test data prior to benchmarking. This flag is now supported across the CLI, main entrypoint, and event initialization logic. Documentation and help strings were updated to reflect this addition, with minor improvements to argument descriptions and logic organization. Additionally, the base Docker images were updated from Debian "buster" to "bookworm" variants, and the solders dependency and development tool versions were bumped. The Poetry pre-commit hook version was also updated.

Changes

Cohort / File(s) Change Summary
Documentation Update
README.md
Added documentation for the new --ref-url flag in the parameters and flags section.
CLI Option Propagation
chainbench/main.py, chainbench/util/cli.py
Introduced the --ref-url option to the CLI, updated the start function and LocustOptions dataclass to accept and propagate the new parameter. Adjusted CLI option handling and argument passing accordingly. Fixed unpacking of load_locustfile return values in main.py.
Event Initialization & Argument Parsing
chainbench/util/event.py
Added --ref-url to CLI argument parser and event initialization logic. Updated help strings for --size and --method. Modified test data initialization to use ref_url if provided, otherwise fallback to target URL. Improved organization of conditional logic for initialization.
Docker Base Image Update
Dockerfile
Updated base Docker images from Debian "buster" to "bookworm" variants for both build and runtime stages.
Dependency Version Updates
pyproject.toml, .pre-commit-config.yaml
Updated solders dependency version from ^0.22.0 to ^0.26.0. Bumped versions of development dependencies black, mypy, flake8, and isort. Updated Poetry pre-commit hook version from 2.0.1 to 2.1.3.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI
    participant Main
    participant Event
    participant LocustOptions

    User->>CLI: Run with --ref-url (optional)
    CLI->>Main: Parse --ref-url and other options
    Main->>LocustOptions: Pass ref_url to LocustOptions
    Main->>Event: Start test with options (including ref_url)
    Event->>Event: On init, resolve ref_url or fallback to target URL
    Event->>BlockchainNode: Fetch test data from ref_url/target URL
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

In the warren of code, a new path unfurls,
A reference URL for blockchain pearls.
Now rabbits can fetch from a node of their choice,
With a hop and a flag, they quietly rejoice.
The docs are refreshed, the CLI’s more bright—
Test data flows swiftly, all through the night!
🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 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 e745c5f and afd72d8.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • .pre-commit-config.yaml (1 hunks)
  • chainbench/util/event.py (3 hunks)
  • pyproject.toml (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/ref_url

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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 (1)
chainbench/util/cli.py (1)

207-210: Minor formatting issue with extra blank line.

The logic for appending the --ref-url argument is correct. However, there's an extra blank line at Line 207 that should be removed to maintain consistent code formatting.

Apply this diff to fix the formatting:

         if self.batch_size is not None:
             command += f" --batch-size {self.batch_size}"
-
         if self.ref_url is not None:
             command += f" --ref-url {self.ref_url}"
         return command
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8967008 and af7aa92.

📒 Files selected for processing (4)
  • README.md (1 hunks)
  • chainbench/main.py (4 hunks)
  • chainbench/util/cli.py (2 hunks)
  • chainbench/util/event.py (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
chainbench/util/event.py (3)
chainbench/test_data/ethereum.py (1)
  • init_http_client (101-103)
chainbench/test_data/blockchain.py (1)
  • init_http_client (128-130)
chainbench/test_data/evm.py (4)
  • EvmTestData (435-521)
  • fetch_chain_id (459-460)
  • init_network (440-441)
  • network (444-447)
🪛 GitHub Actions: Checks
chainbench/util/event.py

[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black' to fix code style issues.

chainbench/main.py

[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black' to fix code style issues.

🔇 Additional comments (9)
chainbench/util/cli.py (1)

147-147: LGTM!

The ref_url attribute is properly added to the LocustOptions dataclass with appropriate typing.

README.md (1)

130-130: LGTM!

The documentation for the new --ref-url flag is clear, concise, and follows the established format of other parameter descriptions.

chainbench/util/event.py (3)

34-34: LGTM!

Adding the trailing period improves consistency in the help text formatting.


51-53: LGTM!

The help text improvements and inclusion in web UI are appropriate updates.


54-60: LGTM!

The --ref-url argument is properly configured with appropriate type, default value, help text, and web UI inclusion.

chainbench/main.py (4)

213-213: LGTM!

The --ref-url click option is properly configured with appropriate help text that matches the functionality.


247-247: LGTM!

The function signature is correctly updated to include the ref_url parameter with proper typing.


384-384: LGTM!

The ref_url parameter is correctly passed to the LocustOptions constructor, completing the integration of the new functionality.


285-285: Confirmed two-value return signature for load_locustfile
load_locustfile returns exactly two items—user_classes and shape_classes—so unpacking into two variables (and discarding the second with _) is correct. No further changes needed.

@erwin-wee erwin-wee merged commit 16dc35d into main Aug 8, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant