txpipe / oura

The tail of Cardano
https://txpipe.github.io/oura
Apache License 2.0
256 stars 71 forks source link

"--bearer unix" not working on Linux #3

Closed aronneewart closed 2 years ago

aronneewart commented 2 years ago

Running both Daedalus and cardano-node (standalone) showed the very same results:

--magic \ --bearer unix tcp
mainnet :x: :heavy_check_mark:
764824073 :x: :heavy_check_mark:

Running with --bearer unix threw the same error in all scenarios

# RUST_BACKTRACE=1 ./oura watch /home/aron/.local/share/Daedalus/mainnet/cardano-node.socket --bearer unix --magic mainnet
# RUST_BACKTRACE=1 ./oura watch /home/aron/.local/share/Daedalus/mainnet/cardano-node.socket --bearer unix --magic 764824073

thread '<unnamed>' panicked at 'explicit panic', /cargo/registry/src/github.com-1ecc6299db9ec823/pallas-multiplexer-0.3.2/src/lib.rs:88:17
stack backtrace:
ERROR: "couldn't agree on handshake version for client connection"

and

[arch-des:cardano.node.LocalErrorPolicy:Error:135] [2021-12-15 07:24:48.85 UTC] IP LocalAddress "" ErrorPolicyUnhandledApplicationException (VersionMismatch [NodeToClientV_1,NodeToClientV_2,NodeToClientV_3,NodeToClientV_4,NodeToClientV_5,NodeToClientV_6,NodeToClientV_7,    NodeToClientV_8,NodeToClientV_9] [])

on cardano-node in parallel. Also, to ensure the existence and functionality of the socket file, I connected to it successfully with cardano-wallet serve --node-socket /home/aron/.local/share/Daedalus/mainnet/cardano-node.socket --mainnet

On the other hand tcp worked like a charm :heart:

# RUST_BACKTRACE=1 ./oura watch 127.0.0.1:43210 --bearer tcp --magic mainnet
# RUST_BACKTRACE=1 ./oura watch 127.0.0.1:43210 --bearer tcp --magic 764824073

Oura terminal output started, waiting for chain data
BLOCK:------- █ TX:-- █ RLLBCK { slot: 47986302, hash: c26f248cef52932103e3064b1fe7c99a07de1a8506fb1548e710aadc7386a38e }
BLOCK:6629730 █ TX:-- █ BLOCK  { body size: 1115, issues vkey: 3c54b253f800716634a53e9317847df67b797aa3c34b7bdc284f54a5dc88c160 }
BLOCK:6629730 █ TX:00 █ TX     { fee: 193089, hash: Some("b65463a5fd372170ed9c213f30d928570c4a65a720f4023b01c558ae35a14d4d"), ttl: None }
...

Environment: Arch Linux 5.15.7-arch1-1 x86_64 GNU/Linux

scarmuega commented 2 years ago

@aronneewart thanks for all the detailed info. Seems like the Ouroboros handshake is failing. Oura asks for V10 of the Node-2-Client mini-protocols (a requirement which might be too strict I'm afraid).

Can you share the cardano-node / Daedalus version you're using?

aronneewart commented 2 years ago

How could I forgot that info!

Daedalus 4.6.0
Linux build 20052, Cardano Node 1.30.1, Cardano Wallet 2021.11.11
cardano-node 1.30.1 - linux-x86_64 - ghc-8.10
git rev 0fb43f4e3da8b225f4f86557aed90a183981a64f
scarmuega commented 2 years ago

@aronneewart I was able to reproduce with version 1.30 of cardano-node.

The node-to-client logic on Oura uses a local-state query to fetch the current tip of the node. AFAIK, this query was introduced in NodeToClientV_10, which I believe it ships in cardano-node 1.31.

To fix the issue, I refactored the tip-fetching logic to match the one we use in the node-to-node connection (which uses a hardcoded intersect request just to get the tip response back).

This fix is being shipped in Oura release 0.3.4

aronneewart commented 2 years ago

My God they're already at 1.32.1! Time truly flies quicker under the pandemic. Thanks so much for reviewing the issues!