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

Unexpected amount of results of state_getKeysPaged JSON RPC request (staking.validators) #2946

Closed
wirednkod opened this issue Oct 29, 2022 · 0 comments · Fixed by #2947
Closed

Comments

@wirednkod
Copy link
Contributor

wirednkod commented Oct 29, 2022

When trying to request the validators list from both light client and polkadotJS the responses' length is different (light client: 2, while polkadotJS; 996).

In order to replicate the following method can be called (unfortunately it is truncated in the logs):

{"id":8,"jsonrpc":"2.0","method":"state_getKeysPaged","params":["0x5f3e4907f716ac89b6347d15ececedca88dcde934c658227ee1dfafcd6e16903",1000,"0x5f3e4907f716ac89b6347d15ececedca88dcde934c658227ee1dfafcd6e16903"]}

PolkadotJS Apps:
Screenshot 2022-10-29 at 3 15 19 PM

Light Client Apps:
Screenshot 2022-10-29 at 3 14 37 PM

Logs from the replication are attached: state_getKeysPaged.txt

Initiated by this issue on Polkadot Staking Dashboard. Based on it, this seems to impact eraStakers, validators, bondedPools and poolMembers entries requests.

@mergify mergify bot closed this as completed in #2947 Oct 31, 2022
mergify bot pushed a commit that referenced this issue Oct 31, 2022
Fix #2946

The behavior of `prefix_proof` is currently buggy. When a node isn't
found in the proof that the remote sent us, we simply discard it instead
of adding it to the list of keys to query at the next iteration.
The consequence is that `state_getKeysPaged` was wrong most the time.

In order to fix this, I had to reorganize the entire function.

There's still an issue because we're asking for too much data, which
leads the remote to shutdown the connection, so queries still
occasionally fail. But this other issue is not the fault of the
`prefix_proof` module, and this PR is only about fixing `prefix_proof`.
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 a pull request may close this issue.

1 participant