You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
I'm using ethers v0.2.1. When doing heavily parallel RPCs over a websocket connection, there seem to be multiple requests using the same JSONRPC request ID, which leads to messages like "Replacing a pending request with id xxx".
I originally tried to reproduce in a test, but I was never able to. However a program is able to reliably exhibit the problem:
use std::sync::Arc;
use std::error::Error;
use ethers::prelude::*;
async fn do_rpc(ws: Arc<Provider<Ws>>) {
ws.get_chainid().await.unwrap();
}
#[tokio::main]
async fn main() {
let p = Arc::new(Provider::<Ws>::connect("ws://NODE_URL_HERE").await.unwrap());
for _ in 0..8192 {
tokio::task::spawn(do_rpc(p.clone()));
};
}
Beginning of the output when running it:
Replacing a pending request with id 43
Replacing a pending request with id 59
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpcClientError(Canceled(Canceled))', main.rs:6:28
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpcClientError(Canceled(Canceled))', main.rs:6:28
Replacing a pending request with id 152
Replacing a pending request with id 153
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpcClientError(Canceled(Canceled))', main.rs:6:28
Replacing a pending request with id 369
Replacing a pending request with id 405
Replacing a pending request with id 538
Replacing a pending request with id 552
The text was updated successfully, but these errors were encountered:
Hi,
I'm using ethers v0.2.1. When doing heavily parallel RPCs over a websocket connection, there seem to be multiple requests using the same JSONRPC request ID, which leads to messages like "Replacing a pending request with id xxx".
I originally tried to reproduce in a test, but I was never able to. However a program is able to reliably exhibit the problem:
Beginning of the output when running it:
The text was updated successfully, but these errors were encountered: