Skip to content

perf: optimize redundant log query#5225

Open
bootcodes wants to merge 5 commits intohiero-ledger:mainfrom
bootcodes:4905-remove-redundant-call
Open

perf: optimize redundant log query#5225
bootcodes wants to merge 5 commits intohiero-ledger:mainfrom
bootcodes:4905-remove-redundant-call

Conversation

@bootcodes
Copy link
Copy Markdown
Contributor

@bootcodes bootcodes commented Apr 6, 2026

Description

This PR introduces a fix to store prefetched logs in an object and pass it down into child functions to avoid any redundant API calls.

Related issue(s)

Fixes #4905

Testing Guide

  1. Run tests

Changes from original design (optional)

N/A

Additional work needed (optional)

N/A

Checklist

  • I've assigned an assignee to this PR and related issue(s) (if applicable)
  • I've assigned a label to this PR and related issue(s) (if applicable)
  • I've assigned a milestone to this PR and related issue(s) (if applicable)
  • I've updated documentation (code comments, README, etc. if applicable)
  • I've done sufficient testing (unit, integration, etc.)

Signed-off-by: Thomas Boot <thomas.boot@swirldslabs.com>
@bootcodes bootcodes self-assigned this Apr 6, 2026
@bootcodes bootcodes added the perf performance gains label Apr 6, 2026
@bootcodes bootcodes added this to the 0.77.0 milestone Apr 6, 2026
@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 6, 2026

Not up to standards ⛔

🔴 Issues 2 minor

Alerts:
⚠ 2 issues (≤ 0 issues of at least minor severity)

Results:
2 new issues

Category Results
CodeStyle 2 minor

View in Codacy

🟢 Metrics 8 complexity · 0 duplication

Metric Results
Complexity 8
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Signed-off-by: Thomas Boot <thomas.boot@swirldslabs.com>
@bootcodes bootcodes marked this pull request as ready for review April 7, 2026 06:36
@bootcodes bootcodes requested review from a team as code owners April 7, 2026 06:36
@bootcodes bootcodes requested a review from simzzz April 7, 2026 06:36
Copy link
Copy Markdown
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean work left some feedback

Signed-off-by: Thomas Boot <thomas.boot@swirldslabs.com>
Signed-off-by: Thomas Boot <thomas.boot@swirldslabs.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 92.10526% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/relay/lib/debug.ts 88.00% 5 Missing and 1 partial ⚠️

❌ Your project check has failed because the head coverage (74.42%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (331dc31) and HEAD (2d7fbcf). Click for more details.

HEAD has 19 uploads less than BASE
Flag BASE (331dc31) HEAD (2d7fbcf)
21 2
@@             Coverage Diff             @@
##             main    #5225       +/-   ##
===========================================
- Coverage   95.94%   74.42%   -21.52%     
===========================================
  Files         146      146               
  Lines       25140    25225       +85     
  Branches     2039      965     -1074     
===========================================
- Hits        24120    18774     -5346     
- Misses        998     6416     +5418     
- Partials       22       35       +13     
Files with missing lines Coverage Δ
src/relay/lib/model.ts 92.96% <100.00%> (-1.63%) ⬇️
...vices/ethService/ethCommonService/CommonService.ts 55.80% <100.00%> (-39.53%) ⬇️
src/relay/lib/debug.ts 91.90% <88.00%> (-7.84%) ⬇️

... and 88 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Thomas Boot <thomas.boot@swirldslabs.com>
Copy link
Copy Markdown
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM great work! Couple of codacy warnings tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf performance gains

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[perf] Redundant log fetching (N+1) in debug_traceBlockByNumber

3 participants