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

[Execution] Return OutOfRange instead of Internal when account block is not cached #4917

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

peterargue
Copy link
Contributor

@peterargue peterargue commented Oct 31, 2023

Closes: #4916

Currently, when an Access node calls GetAccount* with a block that is no longer in the EN's trie, it returns codes.Internal. This PR adds a sentinel and updates the handler to instead return codes.OutOfRange.

This will ensure that the new grpc circuit breaker available on ANs does not incorrectly classify these responses.

engine/execution/rpc/engine.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (3704b14) 52.97% compared to head (f2c1d6d) 55.83%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4917      +/-   ##
==========================================
+ Coverage   52.97%   55.83%   +2.85%     
==========================================
  Files         754      945     +191     
  Lines       68131    88261   +20130     
==========================================
+ Hits        36095    49279   +13184     
- Misses      29316    35273    +5957     
- Partials     2720     3709     +989     
Flag Coverage Δ
unittests 55.83% <55.00%> (+2.85%) ⬆️

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

Files Coverage Δ
engine/execution/scripts/engine.go 40.00% <72.72%> (ø)
engine/execution/rpc/engine.go 53.38% <33.33%> (ø)

... and 195 files with indirect coverage changes

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

Co-authored-by: Leo Zhang <zhangchiqing@gmail.com>
@peterargue peterargue added this pull request to the merge queue Nov 1, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 1, 2023
@peterargue peterargue added this pull request to the merge queue Nov 1, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 1, 2023
@peterargue peterargue added this pull request to the merge queue Nov 1, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 2, 2023
@peterargue peterargue added this pull request to the merge queue Nov 2, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 2, 2023
@peterargue peterargue added this pull request to the merge queue Nov 2, 2023
Merged via the queue into master with commit 18134c5 Nov 2, 2023
36 checks passed
@peterargue peterargue deleted the petera/4916-en-get-account branch November 2, 2023 16:24
peterargue added a commit that referenced this pull request Nov 2, 2023
[Execution] Return OutOfRange instead of Internal when account block is not cached
"this error usually happens if the reference "+
"block for this script is not set to a recent block.",
blockID.String(),
ErrStateCommitmentPruned,
Copy link
Member

Choose a reason for hiding this comment

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

This is not the only place returning this error, queryExecutor.ExecuteScript could also possibly return pruned error, because it's possible state commitment is pruned after this execState.HasState check and before the queryExecutor.ExecuteScript call.

In other words, we also need to handle the pruned error from e.queryExecutor.ExecuteScript

Copy link
Member

Choose a reason for hiding this comment

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

I can handle it in storehouse

This pull request was closed.
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.

[Execution] GetAccountAtBlockID returns Internal error when state commitment not available
4 participants