Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

subscribe_full_pending_txs seems not working #2740

Open
Malefaro opened this issue Feb 15, 2024 · 2 comments
Open

subscribe_full_pending_txs seems not working #2740

Malefaro opened this issue Feb 15, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Malefaro
Copy link

Version

❯ > cargo tree | grep ethers
├── ethers v2.0.13
│   ├── ethers-addressbook v2.0.13
│   │   ├── ethers-core v2.0.13
│   ├── ethers-contract v2.0.13
│   │   ├── ethers-contract-abigen v2.0.13
│   │   │   ├── ethers-core v2.0.13 (*)
│   │   ├── ethers-contract-derive v2.0.13 (proc-macro)
│   │   │   ├── ethers-contract-abigen v2.0.13
│   │   │   │   ├── ethers-core v2.0.13 (*)
│   │   │   ├── ethers-core v2.0.13 (*)
│   │   ├── ethers-core v2.0.13 (*)
│   │   ├── ethers-providers v2.0.13
│   │   │   ├── ethers-core v2.0.13 (*)
│   ├── ethers-core v2.0.13 (*)
│   ├── ethers-etherscan v2.0.13
│   │   ├── ethers-core v2.0.13 (*)
│   ├── ethers-middleware v2.0.13
│   │   ├── ethers-contract v2.0.13 (*)
│   │   ├── ethers-core v2.0.13 (*)
│   │   ├── ethers-etherscan v2.0.13 (*)
│   │   ├── ethers-providers v2.0.13 (*)
│   │   ├── ethers-signers v2.0.13
│   │   │   ├── ethers-core v2.0.13 (*)
│   ├── ethers-providers v2.0.13 (*)
│   └── ethers-signers v2.0.13 (*)

Platform
Linux mech 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Description
I am trying to get full pending transaction using subscribe_full_pending_txs. But stream does not return anything.
subscribe_pending_txs works well but I don't want manually call get_transaction for each pending transaction.
I tried alchemy and infura

I tried this code:

use ethers::prelude::*;
use tracing::{info, Level};

#[tokio::main]
async fn main() {
    tracing_subscriber::fmt().with_max_level(Level::INFO).init();
    let url = std::env::var("WS_URL").unwrap();
    let client = Provider::<Ws>::connect(url).await.unwrap();
    let mut stream = client.subscribe_full_pending_txs().await.unwrap();
    loop {
        let Some(tx) = stream.next().await else {
            break;
        };
        info!(?tx, "tx received");
    }
}

I expected to see this happen:
Receive Transaction objects from stream returned from subscribe_full_pending_txs

Instead, this happened:
After setup tracing I see logs like that:

2024-02-15T10:12:58.469775Z ERROR ethers_providers::rpc::pubsub: failed to deserialize item Error("invalid type: string \"0x3f3bfd5ae30af8aed41dea94e461e1f319254958b4742cc721b2c82dff21a4be\", expected struct Transaction", line: 1, column: 68)

And does not receive anything from this stream.

@Malefaro Malefaro added the bug Something isn't working label Feb 15, 2024
@mattsse
Copy link
Collaborator

mattsse commented Feb 15, 2024

it's possible that the server just ignores the additional bool, which provider are you using?

@Malefaro
Copy link
Author

it's possible that the server just ignores the additional bool, which provider are you using?

I tried alchemy and infura

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants