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

Staking-info command returns a ResourceExhausted error #1277

Open
vishalchangrani opened this issue Nov 23, 2023 · 2 comments
Open

Staking-info command returns a ResourceExhausted error #1277

vishalchangrani opened this issue Nov 23, 2023 · 2 comments
Assignees
Labels
Bug The issue represents a bug, malfunction, regression

Comments

@vishalchangrani
Copy link
Contributor

Instructions

Problem

flow accounts staking-info 0xbf91cf149c03a3b3 -n mainnet

❌ Command Error: error getting total stake for node: client: rpc error: code = ResourceExhausted desc = request is rate limited

Acceptance Criteria

This command should return the staking info.

Context

The error is incorrect. The rate limits are definitely high enough to accommodate to one request per second.
The command however works against a different access node -
$ flow accounts staking-info 0xbf91cf149c03a3b3 --host="access-001.mainnet24.nodes.onflow.org:9000"

If a 50ms sleep is added here https://github.com/onflow/flow-cli/blob/master/internal/accounts/staking-info.go#L120 then the command works against the public access node (access.mainnet.nodes.onflow.org:9000) as well. This indicates that the flow cli times out prematurely and throws an incorrect error after that.

@bluesign
Copy link
Collaborator

I believe we should deal with the "request is rate limited" issue by making sure to retry a few times before giving up on all our calls ( by checking rate limit response info). I think the best spot to incorporate this is within the flow-go-sdk Client.

@vishalchangrani vishalchangrani added Bug The issue represents a bug, malfunction, regression and removed Feedback labels Nov 23, 2023
@bjartek
Copy link
Collaborator

bjartek commented Nov 28, 2023

I totally agree that the client should be smart and know about rate limits and headers and do the right thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The issue represents a bug, malfunction, regression
Projects
None yet
Development

No branches or pull requests

4 participants