-
Notifications
You must be signed in to change notification settings - Fork 250
Comments
Conversation
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
Summary of ChangesHello @alpe, I'm Gemini Code Assist1 ! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the performance of EVM contract benchmarks. By reducing the EVM node's block time and refining the transaction receipt polling mechanism, the changes aim to achieve faster and more efficient test runs, thereby improving the overall development and testing workflow. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Claude finished @alpe's task in 1m 29s —— View job
Code Review
- Gather context and read changed files
- Analyze changes and provide review feedback
The PR spans two commits:
d7823ae— removeswaitForReceipthelper, adds 10ms block time, inlines polling at 10ms20cc9d0— extractsconst blockTime = 5 * time.Millisecond, ties polling interval toblockTime/2
Overall: A clean, focused improvement. The changes reduce benchmark variance and remove dead code. A few minor points worth noting:
PR Description Mismatch
The PR description says "Test with 10ms block time" but the actual committed code sets blockTime = 5 * time.Millisecond. The description is stale from the first commit. Worth updating to reflect the final value.
Polling Interval
blockTime/2 = 2.5ms is aggressive polling. The previous waitForReceipt polled at 50ms; the first commit dropped that to 10ms, and the second commit brought it to 2.5ms. For a local benchmark against a single node this is fine, but the comment "avoiding RPC overload" is somewhat ironic at 2.5ms intervals. The logic of polling at half the block time makes sense for minimizing measurement latency — just worth being aware of the load implications if block time is ever configured shorter.
Gemini's Constant Suggestion — Already Addressed
The inline review comment from Gemini suggesting a constant is already implemented in 20cc9d0. No action needed.
waitForReceipt Removal
The old helper returned *types.Receipt which wasn't used at the call site in the benchmark. Inlining is appropriate here. The signature removal also cleans up the unused ethclient import correctly.
Minor: require.Eventually timeout vs block time ratio
With a 5ms block time and a 2-second timeout, the caller gets ~400 block intervals before failure. This is a generous headroom for CI environments where timing can be unpredictable, which is reasonable.
Summary: The changes are correct and improve benchmark quality. Only actionable item is updating the PR description to say 5ms instead of 10ms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request speeds up the BenchmarkEvmContractRoundtrip test by reducing the block time to 10ms and adjusting the transaction receipt polling interval accordingly. The changes are effective and include removing a now-unused helper function. I've added one suggestion to improve maintainability by using a constant for the new block time and polling interval.
test/e2e/evm_contract_bench_test.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded value 10ms is also used for the polling interval on line 109. To improve maintainability and prevent these values from diverging in the future, consider defining a constant for it.
For example, you could add const fastBlockTime = 10 * time.Millisecond at the start of the function and use it here ("--evnode.node.block_time=" + fastBlockTime.String()) and for the polling interval (fastBlockTime).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #3094 +/- ## ========================================== - Coverage 60.97% 60.95% -0.03% ========================================== Files 113 113 Lines 11617 11617 ========================================== - Hits 7084 7081 -3 - Misses 3734 3737 +3 Partials 799 799
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📝 WalkthroughWalkthroughThis change refactors a benchmark test by replacing a custom Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/e2e/evm_contract_bench_test.go`:
- Line 46: The comment notes a mismatch between the PR description ("10ms") and
the test constant blockTime; update either the PR description or the constant in
evm_contract_bench_test.go so they match—specifically change the constant named
blockTime from 5 * time.Millisecond to 10 * time.Millisecond if the test is
intended to run at 10ms, or revise the PR text to state 5ms if that is intended;
ensure the symbol blockTime is the one you modify so the code and description
remain consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description says "10ms" but blockTime is set to 5ms.
The PR description states "Test with 10ms block time," but the constant is 5 * time.Millisecond. Please align the description (or the constant) to avoid confusion.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@test/e2e/evm_contract_bench_test.go` at line 46, The comment notes a mismatch
between the PR description ("10ms") and the test constant blockTime; update
either the PR description or the constant in evm_contract_bench_test.go so they
match—specifically change the constant named blockTime from 5 * time.Millisecond
to 10 * time.Millisecond if the test is intended to run at 10ms, or revise the
PR text to state 5ms if that is intended; ensure the symbol blockTime is the one
you modify so the code and description remain consistent.
Uh oh!
There was an error while loading. Please reload this page.
Overview
Run benchmark with 5ms block time
Summary by CodeRabbit