paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.8k stars 652 forks source link

rpc v2: backpressure chainHead_v1_storage #5741

Open niklasad1 opened 1 week ago

niklasad1 commented 1 week ago

Close https://github.com/paritytech/polkadot-sdk/issues/5589

This PR makes it possible for rpc_v2::Storage::query_iter_paginated to be "backpressured" which is achieved by having a channel where the result is sent back and when this channel is "full" we pause the iteration.

The chainHead_follow has an internal channel which doesn't represent the actual connection and that is set to a very small number (16). Recall that the JSON-RPC server has a dedicate buffer for each connection by default of 64.

Notes

Benchmarks using subxt on localhost

The reason for this is because as Josep explained in the issue is that one is only allowed query five storage items per call and clients has make lots of calls to drive it forward..

paritytech-cicd-pr commented 1 week ago

The CI pipeline was cancelled due to failure one of the required jobs. Job name: test-linux-stable 2/3 Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7365923

niklasad1 commented 4 days ago

bot fmt

command-bot[bot] commented 4 days ago

@niklasad1 https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7424018 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 3-924a0d42-2ead-4f34-a7fa-191f843f1881 to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] commented 4 days ago

@niklasad1 Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7424018 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7424018/artifacts/download.

niklasad1 commented 1 day ago

bot fmt

command-bot[bot] commented 1 day ago

@niklasad1 https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7453031 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 2-61091302-ac86-4924-9a9a-6dc7449838d7 to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] commented 1 day ago

@niklasad1 Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7453031 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7453031/artifacts/download.