Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe executor's block timer now measures the time spent producing a block and subtracts that elapsed time from the configured block duration when resetting the timer. Tests and test helpers were added to validate that block intervals reflect production time. Changes
Sequence Diagram(s)sequenceDiagram
participant Executor
participant BlockProducer
participant Timer
Executor->>Timer: wait for next tick
Timer-->>Executor: tick
Executor->>Executor: record startTime
Executor->>BlockProducer: ProduceBlock(ctx)
BlockProducer-->>Executor: block produced
Executor->>Executor: elapsed = now - startTime
Executor->>Timer: reset(duration = blockTime - elapsed)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @chatton's task in 1m 18s —— View job Code Review
The fix is correct and well-targeted. The core change in CorrectnessThe fix in start := time.Now()
if err := e.blockProducer.ProduceBlock(e.ctx); err != nil {
e.logger.Error().Err(err).Msg("failed to produce block")
}
// ...
elapsed := time.Since(start)
remaining := e.config.Node.BlockTime.Duration - elapsed
if remaining <= 0 {
remaining = 0
}
blockTimer.Reset(remaining)
Minor Issues1. Lazy mode path is inconsistent — The 2. Missing edge case test — The new 3. Behavior when execution consistently exceeds block time — When if remaining <= 0 {
remaining = 0 // block production exceeded target; fire immediately to catch up
}Test QualityThe
Performance BenchmarksThe benchmark regressions ( SummaryThe fix is correct and addresses a real production issue. The two main improvements worth considering are: (1) covering the |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3137 +/- ##
==========================================
+ Coverage 60.82% 61.00% +0.17%
==========================================
Files 113 113
Lines 11695 11700 +5
==========================================
+ Hits 7114 7137 +23
+ Misses 3777 3753 -24
- Partials 804 810 +6
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.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'EVM Contract Roundtrip'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: 45db47b | Previous: 5a07bc3 | Ratio |
|---|---|---|---|
BenchmarkEvmContractRoundtrip - allocs/op |
183590 allocs/op |
112319 allocs/op |
1.63 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Spamoor Trace Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.
| Benchmark suite | Current: 45db47b | Previous: 5a07bc3 | Ratio |
|---|---|---|---|
SpamoorSmoke - Executor.GetTxs (avg) |
9104 us |
993 us |
9.17 |
SpamoorSmoke - TxPool.GetTxs (avg) |
9017 us |
977.75 us |
9.22 |
This comment was automatically generated by workflow using github-action-benchmark.
julienrbrt
left a comment
There was a problem hiding this comment.
Can we add a changelog entry?
* main: chore: minor deduplication (#3139) refactor(store,cache)!: optimize cache restore as O(1) (#3134) ci: remove spamoor results from benchmark results per PR (#3138) build(deps): Bump rollup from 4.22.4 to 4.59.0 in /docs in the npm_and_yarn group across 1 directory (#3136) fix(block): fix blocktime timer usage (#3137) build(deps): bump core v1.0.0 (#3135)
Overview
While benchmarking, I have a situation in which we have a 250ms block time, ProduceBlock took ~220ms
however the average interval I was seeing was ~470ms
In the call blockTimer.Reset, it is waiting an additional
block_timems on top of the time it took to actually produce the block.This PR subtracts the time it took to produce the block from the value passed to the reset call so it is included in the blocktime.
Summary by CodeRabbit
Bug Fixes
Tests
Documentation