onflow / onflow/flow-cli

Staking-info command returns a ResourceExhausted error

Open
#1,277 2 comments 0 reactions 1 assignee View on GitHub

@chasefleming is already working on this.

Since Nov 23, 2023.

Bug
Dominant language
Go
Stars
209
Forks
87
Avg merge
1d 17h
Merged PRs (30d)
3

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.