[codex] evmrpc: guard hash trace lookups under timeout#3529
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (25.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3529 +/- ##
==========================================
- Coverage 59.12% 58.28% -0.85%
==========================================
Files 2213 2140 -73
Lines 182774 174405 -8369
==========================================
- Hits 108072 101656 -6416
+ Misses 64985 63714 -1271
+ Partials 9717 9035 -682
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
PR SummaryMedium Risk Overview The hash lookback guard no longer uses Regression tests cover Tendermint-height guarding and semaphore rejection happening before any hash lookup. Reviewed by Cursor Bugbot for commit 261e72f. Bugbot is set up for automated code reviews on this repo. Configure here. |
What changed
debug_traceBlockByHashand hash-baseddebug_traceCallguard work behindprepareTraceContext, so the trace semaphore and timeout apply before hash lookup work begins.blockByHashRespectingWatermarksinstead of going throughBackend.BlockByHash, which reconstructs the EVM block by number.Why
A review noted that hash-based historical trace guards were resolving the block height through
Backend.BlockByHash -> Backend.BlockByNumber, doing expensive block reconstruction before the trace concurrency limit and trace timeout were in effect. The guard only needs the block height, so it can use the Tendermint block metadata directly.Validation
go test ./evmrpc -run 'Test(IsHistoricalDebugTraceBlock|GuardHistoricalDebugTraceHeight|GuardHistoricalDebugTraceByHashUsesTendermintHeight|HashBasedTraceEndpointsAcquireSemaphoreBeforeHashLookup|PrepareTraceContextFailsFastWhenSemaphoreIsFull|PrepareTraceContextReleasesSemaphoreOnCleanup|AcquireTraceSemaphoreCanceledContextDoesNotConsumeSlot)$'go test ./evmrpc -run 'TestTrace(Call|BlockByNumberLookbackLimit|BlockByNumberUnlimitedLookback)$'go test ./evmrpc/tests -run 'TestTraceBlockByHash$'