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

feature request: make request ID generation on client configurable #1524

Open
torkelrogstad opened this issue Feb 9, 2025 · 1 comment
Open

Comments

@torkelrogstad
Copy link

I want to be able to generate my own request IDs on the client. Currently this is done by RequestIdManager, which monotonically increases IDs by 1 for each request. I'm writing a CLI application. This application does precisely one RPC call before exiting. This means that for every invocation of the CLI application the request ID is 0, which is kind of meaningless.

It'd be nice to be able to specify my own request ID creator, in which I could generate a random number that actually would give each request a unique identifier.

torkelrogstad added a commit to LayerTwo-Labs/thunder-rust that referenced this issue Feb 9, 2025
Add capabilities for setting request IDs through header values, which we
include in tracing spans. We then set randomly generated request IDs in
the CLI, such that it's possible to trace requests/responses going
through the system.

This is conceptually very similar to LayerTwo-Labs/bip300301_enforcer#150.

One would think that we could do this with the actual `id` field of the
JSON-RPC bodies. This is not possible, because the `jsonrpsee` library
does not make it possible to configure this.

Upstream issue for this paritytech/jsonrpsee#1524
@niklasad1
Copy link
Member

Sure, I have no objection to add a custom request ID generator.
This should be added in the RequestIdManager and would require some refactoring but shouldn't be that hard.

torkelrogstad added a commit to LayerTwo-Labs/thunder-rust that referenced this issue Feb 10, 2025
Add capabilities for setting request IDs through header values, which we
include in tracing spans. We then set randomly generated request IDs in
the CLI, such that it's possible to trace requests/responses going
through the system.

This is conceptually very similar to LayerTwo-Labs/bip300301_enforcer#150.

One would think that we could do this with the actual `id` field of the
JSON-RPC bodies. This is not possible, because the `jsonrpsee` library
does not make it possible to configure this.

Upstream issue for this paritytech/jsonrpsee#1524
Ash-L2L pushed a commit to LayerTwo-Labs/thunder-rust that referenced this issue Feb 10, 2025
Add capabilities for setting request IDs through header values, which we
include in tracing spans. We then set randomly generated request IDs in
the CLI, such that it's possible to trace requests/responses going
through the system.

This is conceptually very similar to LayerTwo-Labs/bip300301_enforcer#150.

One would think that we could do this with the actual `id` field of the
JSON-RPC bodies. This is not possible, because the `jsonrpsee` library
does not make it possible to configure this.

Upstream issue for this paritytech/jsonrpsee#1524
Ash-L2L pushed a commit to LayerTwo-Labs/plain-bitassets that referenced this issue Feb 21, 2025
Add capabilities for setting request IDs through header values, which we
include in tracing spans. We then set randomly generated request IDs in
the CLI, such that it's possible to trace requests/responses going
through the system.

This is conceptually very similar to LayerTwo-Labs/bip300301_enforcer#150.

One would think that we could do this with the actual `id` field of the
JSON-RPC bodies. This is not possible, because the `jsonrpsee` library
does not make it possible to configure this.

Upstream issue for this paritytech/jsonrpsee#1524
Ash-L2L pushed a commit to LayerTwo-Labs/plain-bitassets that referenced this issue Feb 26, 2025
Add capabilities for setting request IDs through header values, which we
include in tracing spans. We then set randomly generated request IDs in
the CLI, such that it's possible to trace requests/responses going
through the system.

This is conceptually very similar to LayerTwo-Labs/bip300301_enforcer#150.

One would think that we could do this with the actual `id` field of the
JSON-RPC bodies. This is not possible, because the `jsonrpsee` library
does not make it possible to configure this.

Upstream issue for this paritytech/jsonrpsee#1524
Ash-L2L pushed a commit to LayerTwo-Labs/plain-bitassets that referenced this issue Feb 26, 2025
Add capabilities for setting request IDs through header values, which we
include in tracing spans. We then set randomly generated request IDs in
the CLI, such that it's possible to trace requests/responses going
through the system.

This is conceptually very similar to LayerTwo-Labs/bip300301_enforcer#150.

One would think that we could do this with the actual `id` field of the
JSON-RPC bodies. This is not possible, because the `jsonrpsee` library
does not make it possible to configure this.

Upstream issue for this paritytech/jsonrpsee#1524
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

No branches or pull requests

2 participants