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

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 77.41935% with 7 lines in your changes missing coverage. Please review.

Project coverage is 41.13%. Comparing base (ce74abc) to head (bf32c98).

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.12%   41.13%           
=======================================
  Files        2031     2031           
  Lines      179589   179611   +22     
=======================================
+ Hits        73862    73875   +13     
- Misses      99521    99528    +7     
- Partials     6206     6208    +2     
Flag Coverage Δ
unittests 41.13% <77.41%> (+<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
Copy link
Collaborator

@Guitarheroua Guitarheroua left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Guitarheroua Guitarheroua added this pull request to the merge queue Oct 22, 2024
Merged via the queue into onflow:master with commit 14c5eee Oct 22, 2024
55 checks passed
@Guitarheroua Guitarheroua deleted the UlyanaAndrukhiv/4904-improve-error-messages-for-old-blocks branch October 22, 2024 14:55
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