feat(rpc): add progressive trace range and checkpoint helpers - #4079
danielntmd wants to merge 4 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## danielntmd/shared-trace-cache-integration #4079 +/- ##
=============================================================================
- Coverage 79.46% 79.45% -0.02%
=============================================================================
Files 469 470 +1
Lines 36160 36268 +108
=============================================================================
+ Hits 28736 28818 +82
- Misses 7415 7441 +26
Partials 9 9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5d92b10 to
5132f3f
Compare
Clarify lifecycle and parameter documentation, allow initial reads with a last-transaction target, and leave VM result completion to the range or full-block caller.
5132f3f to
62964ea
Compare
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
| // | ||
| // See [Cache] for the mutability contract for published traces. | ||
| type Range struct { | ||
| Start, End uint64 |
There was a problem hiding this comment.
nit: please one param per line.
Honestly, in this case makes a lot of sense and it is readable so feel free to ignore. It is mostly a nitpick about keeping the "status quo" style
| transactions []core.Transaction, | ||
| target *TransactionTarget, | ||
| initialReads bool, | ||
| ) (*Range, error) { |
There was a problem hiding this comment.
Why can Range be returned by value?
| if target != nil && (target.Hash == nil || target.Index >= uint64(len(transactions)) || | ||
| !transactions[target.Index].Hash().Equal(target.Hash)) { | ||
| return nil, ErrTargetNotFound | ||
| } |
There was a problem hiding this comment.
another style guide we follow is separating the conditions from the if (or for) statements if they become too big.
Suggestion:
validTarget := <long cond>
if validTarget {
// ...
}| // prefix, typically the chain's head state. | ||
| // - blockNumber: the number of the block being traced. | ||
| func (r *Range) ResumeState( | ||
| parent, classes core.StateReader, |

User description
User description
User description
This PR adds the shared building blocks for tracing a block incrementally.
Progressive Cache Behavior:
Note: State resumption, checkpoint class loading, and execution-error offsets are covered by RPC integration tests in #4080.
PR Type
Enhancement, Tests
Description
Introduce progressive trace caching primitives.
Rangefor incremental block execution.ResumeState.Combine.Add
Completeflag toBlockTrace.Introduce
TransactionTargetfor coverage validation.Mark completed block traces in RPC handlers.
File Walkthrough
3 files
Mark mock trace records as complete in testsTest state resumption and trace range combinationsUpdate tests for completeness and coverage checks6 files
Introduce primitives for incremental progressive block tracingMark block traces from feeder as completeAdd `Complete` flag and `TransactionTarget` logicMark v10 block traces as complete before publishingMark v8 block traces as complete before publishingMark v9 block traces as complete before publishing