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

[Access] Improve error messages when querying old blocks #6554

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

UlyanaAndrukhiv
Copy link
Contributor

Closes: #4904

Context

This PR improves error messaging on Access nodes for block height-based queries:

  • ExecuteScriptAtBlockHeight,
  • GetBlockByHeight,
  • GetBlockHeaderByHeight,
  • GetEventsForHeightRange,
  • GetAccountAtBlockHeight,
  • GetAccountBalanceAtBlockHeight,
  • GetAccountKeyAtBlockHeight,
  • GetAccountKeysAtBlockHeight.

Errors are now categorized based on the queried height:

  • Below Spork Root Height: Instructs the caller to use a historic node.
  • Below Node’s Root Height: Suggests querying a different Access node (if the node was started after a spork).

Updated and added unit tests to validate the new messaging logic.

@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 41.28%. Comparing base (0dde730) to head (1dca270).

Files with missing lines Patch % Lines
engine/access/rpc/backend/backend_accounts.go 20.00% 4 Missing ⚠️
engine/access/rpc/backend/backend_block_details.go 0.00% 1 Missing ⚠️
engine/access/rpc/backend/backend_block_headers.go 0.00% 1 Missing ⚠️
engine/access/rpc/backend/backend_scripts.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6554   +/-   ##
=======================================
  Coverage   41.28%   41.28%           
=======================================
  Files        2033     2033           
  Lines      145981   146000   +19     
=======================================
+ Hits        60269    60278    +9     
- Misses      79486    79495    +9     
- Partials     6226     6227    +1     
Flag Coverage Δ
unittests 41.28% <75.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@UlyanaAndrukhiv UlyanaAndrukhiv marked this pull request as ready for review October 14, 2024 12:46
engine/access/rpc/backend/backend.go Outdated Show resolved Hide resolved
engine/access/rpc/backend/backend.go Outdated Show resolved Hide resolved
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.

[Access] Improve error messages when querying old blocks
4 participants