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

getLogs add support for block tags #518

Closed
wants to merge 4 commits into from

Conversation

dimitrovmaksim
Copy link
Collaborator

Signed-off-by: Maksim Dimitrov dimitrov.maksim@gmail.com

Description:

  1. Fixes getLogs not being able to handle block tags (latest, earliest)
  2. Adds block range limit (default 500). Can be configured with by setting ETH_GET_LOGS_BLOCK_RANGE_LIMIT env variable

Related issue(s):

Fixes #472

Notes for reviewer:

Maybe we should set a max block range limit?

Checklist

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

Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
@codecov-commenter
Copy link

Codecov Report

Base: 76.38% // Head: 76.01% // Decreases project coverage by -0.36% ⚠️

Coverage data is based on head (463aa54) compared to base (4c3191c).
Patch coverage: 67.64% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #518      +/-   ##
==========================================
- Coverage   76.38%   76.01%   -0.37%     
==========================================
  Files          12       12              
  Lines         923      938      +15     
  Branches      144      148       +4     
==========================================
+ Hits          705      713       +8     
- Misses        165      171       +6     
- Partials       53       54       +1     
Impacted Files Coverage Δ
packages/relay/src/lib/eth.ts 83.04% <62.06%> (-1.06%) ⬇️
packages/relay/src/lib/clients/mirrorNodeClient.ts 90.14% <100.00%> (ø)
packages/relay/src/lib/constants.ts 100.00% <100.00%> (ø)
packages/relay/src/lib/errors/JsonRpcError.ts 77.77% <100.00%> (+2.77%) ⬆️

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.

Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
@dimitrovmaksim dimitrovmaksim marked this pull request as ready for review September 14, 2022 08:29
@dimitrovmaksim dimitrovmaksim self-assigned this Sep 14, 2022
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Sep 15, 2022

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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -117,4 +119,9 @@ export const predefined = {
code: -32001,
message: 'Requested resource not found'
}),
'RANGE_TOO_LONG': new JsonRpcError({
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: let's use large instead of long

packages/relay/src/lib/eth.ts Show resolved Hide resolved
packages/relay/src/lib/eth.ts Show resolved Hide resolved
packages/relay/src/lib/eth.ts Show resolved Hide resolved
packages/relay/src/lib/eth.ts Show resolved Hide resolved
packages/relay/src/lib/eth.ts Show resolved Hide resolved
@dimitrovmaksim
Copy link
Collaborator Author

I'll address the comments and open a new PR, because the commits in this one aren't verified as well.

@dimitrovmaksim
Copy link
Collaborator Author

Closing in favour of #532

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eth_getLogs not handling non int block params
3 participants