Conversation
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @alpe's task in 1m 9s —— View job Code Review
Overall AssessmentA solid start for phase1 benchmarks. The
|
| Area | Status |
|---|---|
| Go benchmark structure | Good |
| Mock setup | Good |
| Test case coverage | Needs expansion |
| CI workflow isolation | Improve |
| Output file placement | Minor inconsistency |
| Documentation/comments | Add a few clarifying comments |
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 initiates the first phase of performance benchmarking for EVM contract operations within the 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
Ignored Files
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
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alex/bench_e2e_start #3081 +/- ##
========================================================
- Coverage 61.14% 61.13% -0.02%
========================================================
Files 113 113
Lines 11444 11444
========================================================
- Hits 6998 6996 -2
- Misses 3657 3658 +1
- Partials 789 790 +1
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:
|
There was a problem hiding this comment.
Code Review
This pull request introduces benchmarks for the ProduceBlock function. The overall structure is good, but there are a couple of areas for improvement to ensure the benchmarks are robust and deterministic. I've pointed out that using time.Now() can lead to non-deterministic tests and should be replaced with a fixed time. More critically, the mock setup for GetNextBatch uses a static timestamp, which could cause benchmark failures if timestamp monotonicity is required for blocks. I've suggested a fix to generate an increasing timestamp for each block produced in the benchmark loop.
| mockSeq.EXPECT().GetNextBatch(mock.Anything, mock.AnythingOfType("sequencer.GetNextBatchRequest")). | ||
| Return(&coreseq.GetNextBatchResponse{ | ||
| Batch: &coreseq.Batch{Transactions: txs}, | ||
| Timestamp: time.Now(), | ||
| BatchData: txs, | ||
| }, nil) |
There was a problem hiding this comment.
The mock for GetNextBatch is configured to return a response with Timestamp: time.Now(). This timestamp is evaluated only once when the mock expectation is set up. Consequently, every call to ProduceBlock within the benchmark loop will receive the same timestamp. If there is a requirement for block timestamps to be monotonically increasing, this will cause ProduceBlock to fail after the first iteration.
To fix this, use RunAndReturn to generate a new, increasing timestamp for each call. This ensures the benchmark correctly simulates the production of a sequence of valid blocks.
| mockSeq.EXPECT().GetNextBatch(mock.Anything, mock.AnythingOfType("sequencer.GetNextBatchRequest")). | |
| Return(&coreseq.GetNextBatchResponse{ | |
| Batch: &coreseq.Batch{Transactions: txs}, | |
| Timestamp: time.Now(), | |
| BatchData: txs, | |
| }, nil) | |
| var blockNum uint64 | |
| mockSeq.EXPECT().GetNextBatch(mock.Anything, mock.AnythingOfType("sequencer.GetNextBatchRequest")). | |
| RunAndReturn(func(_ context.Context, _ coreseq.GetNextBatchRequest) (*coreseq.GetNextBatchResponse, error) { | |
| blockNum++ | |
| timestamp := gen.StartTime.Add(time.Duration(blockNum) * cfg.Node.BlockTime.Duration) | |
| return &coreseq.GetNextBatchResponse{ | |
| Batch: &coreseq.Batch{Transactions: txs}, | |
| Timestamp: timestamp, | |
| BatchData: txs, | |
| }, nil | |
| }) |
| gen := genesis.Genesis{ | ||
| ChainID: "bench-chain", | ||
| InitialHeight: 1, | ||
| StartTime: time.Now().Add(-time.Hour), |
There was a problem hiding this comment.
Overview