Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary call when details not requested #842

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

lukelee-sl
Copy link
Member

@lukelee-sl lukelee-sl commented Jan 26, 2023

Signed-off-by: lukelee-sl luke.lee@swirldslabs.com

Description:

Do not make additional calls to the mirror node unnecessarily when showDetails parameter is false. The transaction hash is already available in the result set from the first call to retrieve contractResults.

In the example in issue #827, the block contained 100 contract results. Iterating over them when details were not asked for was needlessly costly.

Related issue(s):

Fixes #840 and #827 (the particular use case in this issue)

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
@lukelee-sl lukelee-sl added the bug Something isn't working label Jan 26, 2023
@lukelee-sl lukelee-sl added this to the 0.16.0 milestone Jan 26, 2023
@lukelee-sl lukelee-sl self-assigned this Jan 26, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov-commenter
Copy link

Codecov Report

Base: 73.90% // Head: 73.76% // Decreases project coverage by -0.14% ⚠️

Coverage data is based on head (ebda69e) compared to base (0506f3b).
Patch coverage: 80.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #842      +/-   ##
==========================================
- Coverage   73.90%   73.76%   -0.14%     
==========================================
  Files          29       29              
  Lines        1774     1776       +2     
  Branches      323      323              
==========================================
- Hits         1311     1310       -1     
- Misses        370      372       +2     
- Partials       93       94       +1     
Impacted Files Coverage Δ
packages/relay/src/lib/eth.ts 82.20% <80.00%> (-0.48%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lukelee-sl lukelee-sl merged commit 1bc0157 into main Jan 26, 2023
@lukelee-sl lukelee-sl deleted the 840-faster-block-results-when-no-details branch January 26, 2023 02:06
lukelee-sl added a commit that referenced this pull request Jan 26, 2023
Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
lukelee-sl added a commit that referenced this pull request Jan 26, 2023
Remove unnecessary call when details not requested (#842)

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Calling eth_getBlockByNumber/eth_getBlockByHash performance improvement when showDetails flag is false
3 participants