iotex-core icon indicating copy to clipboard operation
iotex-core copied to clipboard

[api] return an error when the specified height is not supported

Open millken opened this issue 2 years ago • 4 comments

Description

Currently we do not support archive mode. When querying these web3APIs

  • eth_getBalance
  • eth_getCode
  • eth_getTransactionCount
  • eth_getStorageAt
  • eth_call

if a height is specified, the result is returned for the latest height. This PR fixes returning an error if height is not supported

Fixes #4167

Type of change

Please delete options that are not relevant.

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Code refactor or improvement
  • [] Breaking change (fix or feature that would cause a new or changed behavior of existing functionality)
  • [] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [] make test
  • [] fullsync
  • [] Other test (please specify)

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • [] My code follows the style guidelines of this project
  • [] I have performed a self-review of my code
  • [] I have commented my code, particularly in hard-to-understand areas
  • [] I have made corresponding changes to the documentation
  • [] My changes generate no new warnings
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] New and existing unit tests pass locally with my changes
  • [] Any dependent changes have been merged and published in downstream modules

millken avatar Mar 07 '24 08:03 millken

Quality Gate Failed Quality Gate failed

Failed conditions
42.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Mar 07 '24 08:03 sonarqubecloud[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 76.41%. Comparing base (d716bb9) to head (6b36e94). Report is 26 commits behind head on master.

:exclamation: Current head 6b36e94 differs from pull request most recent head 74b82f4. Consider uploading reports for the commit 74b82f4 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4174      +/-   ##
==========================================
- Coverage   76.51%   76.41%   -0.10%     
==========================================
  Files         340      340              
  Lines       29273    28997     -276     
==========================================
- Hits        22397    22159     -238     
+ Misses       5761     5731      -30     
+ Partials     1115     1107       -8     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 07 '24 09:03 codecov[bot]

This fix should be released with archive mode features, because this fix will cause graph-node fail without archive mode.

ququzone avatar Mar 13 '24 12:03 ququzone

Quality Gate Failed Quality Gate failed

Failed conditions
17.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Apr 15 '24 06:04 sonarqubecloud[bot]