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

Reconnect peerd if connection is dropped during running swap #426

Merged
merged 32 commits into from
Jun 7, 2022

Conversation

TheCharlatan
Copy link
Member

@TheCharlatan TheCharlatan commented May 5, 2022

This pull request adds code to let the taker, or connecting peerd reconnect to the listener if the connection is dropped, for example by a connection outage. To make the internal ServiceId address of the spawned peerds deterministic I added a single message exchange at the beginning of the connection where the taker/connector informs the maker/listener of its node id, allowing us to re-identify connections.

There are multiple ways by which a disconnect is detected currently. Foremost a disconnect is immediately detected and reported by peerd iff the counterparty suddenly hangs up. If there is a connection issue, such as an internet outage, peerd notices it once it attempts to send a ping to the counterparty. If the ping fails, this is reported as well. Additionally, if swapd encounters an error a message to peerd, it also reports this. Once detected a connection failure is detected, peerd shutsdown. The taker's/connector's farcasterd then has to spawn a new connecting peerd. Swapd caches its failed peerd requests and fires them off again once farcasterd reports back to it the peerd connection might be running again.

Logic to handle multiple re-connection attempts with a back-off period has not been implemented yet.

I am having some trouble testing this cleanly. Ideally I would like to simulate the connection being dropped, for example by an internet outage. @Lederstrumpf @h4sh3d do you have suggestions for simulating this, for example with something like low-level port manipulation?
EDIT: I added a test where I just kill peerd, but this has the effect, that one side is not handling the disconnect cleanly.

@TheCharlatan TheCharlatan marked this pull request as draft May 5, 2022 11:58
@TheCharlatan TheCharlatan changed the title Reconnect swapd Reconnect peerd if connection is dropped during running swap May 5, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 6, 2022

Codecov Report

Merging #426 (b41a750) into main (1aa7a68) will decrease coverage by 0.4%.
The diff coverage is 1.7%.

@@           Coverage Diff           @@
##            main    #426     +/-   ##
=======================================
- Coverage   13.0%   12.7%   -0.4%     
=======================================
  Files         27      27             
  Lines       7915    8089    +174     
=======================================
- Hits        1030    1024      -6     
- Misses      6885    7065    +180     
Impacted Files Coverage Δ
src/farcasterd/runtime.rs 0.0% <0.0%> (ø)
src/peerd/runtime.rs 0.0% <0.0%> (ø)
src/service.rs 12.9% <0.0%> (-1.4%) ⬇️
src/swapd/runtime.rs 0.0% <0.0%> (ø)
src/syncerd/runtime.rs 0.0% <0.0%> (ø)
src/rpc/request.rs 14.8% <26.7%> (+0.1%) ⬆️
src/rpc/client.rs 67.1% <0.0%> (-2.5%) ⬇️
src/lib.rs 12.0% <0.0%> (-0.7%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1aa7a68...b41a750. Read the comment docs.

@TheCharlatan TheCharlatan marked this pull request as ready for review May 6, 2022 09:56
@TheCharlatan
Copy link
Member Author

I can't reproduce the test failure on my local machine. Seems like the heuristic I am using here to select the correct peerd does not work on the CI.

@TheCharlatan
Copy link
Member Author

@h4sh3d I implemented the approach we discussed on 11.05.2022 and it seems to be working quite nicely. I had to add some more hacky things though to get reliable information on when the spawned thread is terminated. Again the tests completed fine locally. Please also drop some opinions on a reconnect back-off period. Maybe it's even for the best if we just reconnect every n seconds.

@@ -301,7 +315,10 @@ impl Runtime {
&request.get_type()
);
self.messages_sent += 1;
self.sender.send_message(message)?;
if self.peer_sender.send_message(message.clone()).is_err() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use while(...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 34574ec

senders: &mut esb::SenderList<ServiceBus, ServiceId>,
) -> Result<(), Error> {
// If this is the listener-forked peerd, terminate it.
if !self.connect {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this outside the function.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0e97200

@Lederstrumpf
Copy link
Member

Lederstrumpf commented May 15, 2022

Taker log with manual internet cut after Monero funding:

[2022-05-15T14:55:28Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Punish transaction received from walletd
[2022-05-15T14:55:28Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | State transition: AliceState(Reveal) -> AliceState(RefundSigs(xmr_locked(false), buy_pub(false), cancel_seen(false), refund_seen(false)))
[2022-05-15T14:55:29Z WARN  electrum_client::client] call 'transaction_get_raw' failed with EOF while parsing a value at line 1 column 0, retry: 1/1
[2022-05-15T14:55:31Z INFO  electrum_client::client] Succesfully created new client
[2022-05-15T14:55:32Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx Refund not on the mempool
[2022-05-15T14:55:32Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx Lock not on the mempool
[2022-05-15T14:55:32Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx Cancel not on the mempool
[2022-05-15T14:55:42Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx Lock on mempool but hasn't been mined
[2022-05-15T14:56:29Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1092985
[2022-05-15T14:56:47Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1092986
[2022-05-15T14:57:05Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225167
[2022-05-15T14:57:06Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx Lock final with 1 confirmations
[2022-05-15T14:57:06Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Send 0.436535380000 XMR to 5264MhXnMKjDdsqiNekhX5Qpvn5HGBsZ1GfSzfsb6oiyYTAaoC8yqrzeqfy5BLa6mybUUFt4b11KPV8RzTvNmFBiFtNaijB
[2022-05-15T14:57:06Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Watching AccLock on address 5264MhXnMKjDdsqiNekhX5Qpvn5HGBsZ1GfSzfsb6oiyYTAaoC8yqrzeqfy5BLa6mybUUFt4b11KPV8RzTvNmFBiFtNaijB
[2022-05-15T14:57:06Z INFO  farcaster_node::farcasterd::runtime] 0xa953…89ff | Attempting to auto-fund Monero
[2022-05-15T14:57:08Z INFO  farcaster_node::farcasterd::runtime] 0xa953…89ff | Auto-funded Monero with txid: bc1a2884f46a8e14b42dcb1bd240e893f8155db16bf75468eb2db6dc57adf0d6
[2022-05-15T14:57:40Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is down (os error 50)

    Caused by:
        0: error trying to connect: tcp connect error: Network is down (os error 50)
        1: tcp connect error: Network is down (os error 50)
        2: Network is down (os error 50)))
[2022-05-15T14:57:42Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:57:44Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:57:46Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:57:48Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:57:50Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:57:52Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:57:54Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:57:56Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:57:57Z WARN  electrum_client::client] call 'ping' failed with Operation timed out (os error 60), retry: 1/1
[2022-05-15T14:57:58Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:57:59Z WARN  electrum_client::client] re-creating client failed after 2 attempts
[2022-05-15T14:57:59Z ERROR farcaster_node::syncerd::bitcoin_syncer] error ping electrum client in height polling: Syncer(Electrum(AllAttemptsErrored([SharedIOError(Os { code: 60, kind: TimedOut, message: "Operation timed out" })])))
[2022-05-15T14:58:00Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:58:02Z WARN  electrum_client::client] call 'ping' failed with Operation timed out (os error 60), retry: 1/1
[2022-05-15T14:58:02Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:58:04Z WARN  electrum_client::client] re-creating client failed after 2 attempts
[2022-05-15T14:58:04Z ERROR farcaster_node::syncerd::bitcoin_syncer] error ping electrum client in address polling: Syncer(Electrum(AllAttemptsErrored([SharedIOError(Os { code: 60, kind: TimedOut, message: "Operation timed out" })])))
[2022-05-15T14:58:04Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) t in address polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T14:58:04Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) in height polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T14:58:04Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:58:06Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:58:08Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:58:09Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) t in address polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T14:58:09Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) in height polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T14:58:09Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:58:11Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:58:13Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-15T14:58:14Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) t in address polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T14:58:14Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) in height polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T14:58:15Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://stagenet.melo.tools:38081/json_rpc): connection error: Network is down (os error 50)
[2022-05-15T14:58:17Z WARN  electrum_client::client] call 'transaction_get_raw' failed with Operation timed out (os error 60), retry: 1/1
[2022-05-15T14:58:19Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T14:58:19Z ERROR farcaster_node::peerd::runtime] The remote peer has hung up, notifying that peerd has halted: Peer interface error: I/O socket error, generated by underlying socket implementation (POSIX or TCP). Error type is UnexpectedEof
[2022-05-15T14:58:19Z WARN  farcaster_node::peerd::runtime] Exiting peerd receiver runtime
[2022-05-15T14:58:19Z INFO  farcaster_node::peerd::runtime] Attempting to reconnect to remote peerd
[2022-05-15T14:58:20Z INFO  electrum_client::client] Succesfully created new client
[2022-05-15T14:58:20Z INFO  farcaster_node::peerd::runtime] Peerd reconnect successfull, launching peerd receiver runtime
[2022-05-15T14:58:50Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T14:58:52Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1092987
[2022-05-15T14:59:00Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Watching AccLock transaction (bc1a2884f46a8e14b42dcb1bd240e893f8155db16bf75468eb2db6dc57adf0d6)
[2022-05-15T14:59:00Z INFO  farcaster_node::farcasterd::runtime] 0xa953…89ff | Your Monero funding completed
[2022-05-15T14:59:01Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx AccLock final with 1 confirmations
[2022-05-15T14:59:21Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T14:59:51Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:00:22Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:00:53Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:01:24Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages

Corresponding maker log:

[2022-05-15T14:52:59Z INFO  farcaster_node::swapd::runtime] Starting swap: 0xa953d956b8d64cb2a9a94b65cde6057a9d33c5e00418e30474d3ba9565e189ff
[2022-05-15T14:52:59Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Initial state: BobState(Start)
[2022-05-15T14:53:00Z INFO  farcaster_node::service] New service swap<0xa953…89ff> started
[2022-05-15T14:53:00Z INFO  farcaster_node::farcasterd::runtime] Service swap<0xa953…89ff> is now connected
[2022-05-15T14:53:00Z INFO  farcaster_node::farcasterd::runtime] Swap 0xa953…89ff is registered; total 2 swaps are known
[2022-05-15T14:53:00Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-15T14:53:00Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Accepting swap 0xa953…89ff as Maker from Taker remote peer peerd<030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750>
[2022-05-15T14:53:00Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | State transition: BobState(Start) -> BobState(Commit)
[2022-05-15T14:53:01Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Send 0.00001700 BTC to tb1qrq8j0hm9maj4z425tww9mw9xut0czrkdgezywp
[2022-05-15T14:53:01Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Watching Funding transaction with scriptPubkey: OP_0 OP_PUSHBYTES_20 180f27df65df655155545b9c5db8a6e2df810ecd
[2022-05-15T14:53:01Z INFO  farcaster_node::farcasterd::runtime] 0xa953…89ff | Attempting to auto-fund Bitcoin
[2022-05-15T14:53:31Z WARN  farcaster_node::farcasterd::runtime] JSON-RPC error: transport error: Didn't receive response data in time, timed out.
[2022-05-15T14:53:31Z ERROR farcaster_node::farcasterd::runtime] 0xa953…89ff | Auto-funding Bitcoin transaction failed, pushing to cli, use `swap-cli needs-funding Bitcoin` to retrieve address and amount
[2022-05-15T14:53:31Z INFO  farcaster_node::farcasterd::runtime] Connection daemon listens for incoming peer connections on 0.0.0.0:18750
[2022-05-15T14:53:31Z INFO  farcaster_node::farcasterd::runtime] Public offer registered: 0x5064…2881
[2022-05-15T14:54:01Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1092983
[2022-05-15T14:54:18Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1092984
[2022-05-15T14:55:24Z INFO  farcaster_node::swapd::runtime] Received AddressTransaction, processing tx 0aad4e16868628539d42a211875075e366c4da301ae670d657802bd3e2a8afd6
[2022-05-15T14:55:24Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Funding transaction (0aad4e16868628539d42a211875075e366c4da301ae670d657802bd3e2a8afd6) in mempool or blockchain, forward to walletd
[2022-05-15T14:55:24Z INFO  farcaster_node::farcasterd::runtime] 0xa953…89ff | Your Bitcoin funding completed
[2022-05-15T14:55:24Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | State transition: BobState(Commit) -> BobState(Reveal)
[2022-05-15T14:55:24Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Watching Lock transaction (6098a93ce235f0b0ac9ca4689ad6621e1ccef5ee158b6436ce2115d4a033ace0)
[2022-05-15T14:55:24Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Watching Cancel transaction (4444c558f28243bea62b09878fcb38efca44f147e6fbb64287c85a7e4e3c12ef)
[2022-05-15T14:55:24Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Watching Refund transaction (4b874852144175bd080b34186eca0ecd7f5e4e60244b0a0506682bbe2d63dc25)
[2022-05-15T14:55:24Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | State transition: BobState(Reveal) -> BobState(CoreArb)
[2022-05-15T14:55:27Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx Refund not on the mempool
[2022-05-15T14:55:27Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx Lock not on the mempool
[2022-05-15T14:55:27Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx Cancel not on the mempool
[2022-05-15T14:55:28Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Lock transaction received from walletd
[2022-05-15T14:55:28Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Broadcasting Lock tx (6098a93ce235f0b0ac9ca4689ad6621e1ccef5ee158b6436ce2115d4a033ace0)
[2022-05-15T14:55:28Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Watching AccLock on address 5264MhXnMKjDdsqiNekhX5Qpvn5HGBsZ1GfSzfsb6oiyYTAaoC8yqrzeqfy5BLa6mybUUFt4b11KPV8RzTvNmFBiFtNaijB
[2022-05-15T14:55:28Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Watching Buy transaction (49e1b0697b5b84cccfa8b90982f0152b1d8dccb8cd36ff218e0a5c5475f660b3)
[2022-05-15T14:55:28Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Cancel transaction received from walletd
[2022-05-15T14:55:28Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Refund transaction received from walletd
[2022-05-15T14:55:29Z INFO  farcaster_node::syncerd::bitcoin_syncer] Successfully broadcasted: 6098a93ce235f0b0ac9ca4689ad6621e1ccef5ee158b6436ce2115d4a033ace0
[2022-05-15T14:55:38Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx Buy not on the mempool
[2022-05-15T14:55:38Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx Lock on mempool but hasn't been mined
[2022-05-15T14:56:29Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1092985
[2022-05-15T14:56:47Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1092986
[2022-05-15T14:57:04Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225167
[2022-05-15T14:57:06Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx Lock final with 1 confirmations
[2022-05-15T14:58:21Z INFO  farcaster_node::service] New service peerd<030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750> started
[2022-05-15T14:58:26Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T14:58:51Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1092987
[2022-05-15T14:58:57Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T14:58:59Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Watching AccLock transaction (bc1a2884f46a8e14b42dcb1bd240e893f8155db16bf75468eb2db6dc57adf0d6)
[2022-05-15T14:59:00Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | State transition: BobState(CoreArb) -> BobState(BuySig)
[2022-05-15T14:59:27Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T14:59:58Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:00:29Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:01:00Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:01:30Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:02:01Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:02:32Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:03:02Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:03:33Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:04:04Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:04:11Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1092988
[2022-05-15T15:04:12Z INFO  farcaster_node::swapd::runtime] 0xa953…89ff | Tx AccLock final with 2 confirmations
[2022-05-15T15:04:35Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:05:05Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:05:36Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:06:07Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:06:38Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:07:08Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:07:39Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T15:07:44Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1092989
[2022-05-15T15:07:54Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225168
...
[2022-05-15T16:21:37Z ERROR farcaster_node::peerd::runtime] The remote peer has hung up, notifying that peerd has halted: Peer interface error: I/O socket error, generated b
y underlying socket implementation (POSIX or TCP). Error type is UnexpectedEof
[2022-05-15T16:21:37Z ERROR microservices::esb::controller] ESB request processing error: Peer does not respond to ping messages
[2022-05-15T16:21:37Z WARN  farcaster_node::peerd::runtime] Exiting peerd receiver runtime
[2022-05-15T16:21:37Z WARN  farcaster_node::peerd::runtime] Exiting peerd

@Lederstrumpf
Copy link
Member

Alice Taker log when killing her internet connection after Bob Maker funds:

[2022-05-15T20:18:13Z INFO  farcaster_node::config] Loading config file at: farcasterd.toml
[2022-05-15T20:18:13Z INFO  farcaster_node::farcasterd::runtime] farcasterd will attempt to fund automatically
[2022-05-15T20:18:13Z INFO  farcaster_node::service] New service farcasterd started
[2022-05-15T20:18:14Z INFO  farcaster_node::service] New service walletd started
[2022-05-15T20:18:14Z INFO  farcaster_node::farcasterd::runtime] Service walletd is now connected
[2022-05-15T20:18:36Z INFO  peerd] Local node id: 030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa
[2022-05-15T20:18:36Z INFO  peerd] Peerd running in CONNECT mode
[2022-05-15T20:18:36Z INFO  peerd] Connecting to 026b9739e4610c2a7e8d585b5a9b81e243a7baabfacae421e47e7b038665ffebb1@159.100.242.14:18750
[2022-05-15T20:18:36Z INFO  farcaster_node::farcasterd::runtime] Public offer registered: 0x851f…dadc
[2022-05-15T20:18:37Z INFO  farcaster_node::service] New service peerd<026b9739e4610c2a7e8d585b5a9b81e243a7baabfacae421e47e7b038665ffebb1@159.100.242.14:18750> started
[2022-05-15T20:18:37Z INFO  farcaster_node::peerd::runtime] Initializing connection with the remote peer 159.100.242.14:18750
[2022-05-15T20:18:37Z INFO  farcaster_node::farcasterd::runtime] Service peerd<026b9739e4610c2a7e8d585b5a9b81e243a7baabfacae421e47e7b038665ffebb1@159.100.242.14:18750> is now connected
[2022-05-15T20:18:37Z INFO  farcaster_node::farcasterd::runtime] Connection 026b9739e4610c2a7e8d585b5a9b81e243a7baabfacae421e47e7b038665ffebb1@159.100.242.14:18750 is registered; total 1 connections are known
[2022-05-15T20:18:37Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-15T20:18:43Z INFO  farcaster_node::swapd::runtime] Starting swap: 0x70a544285ac024376b1a43ffb4898be8fb8e67949125f4ba03a54007c2ecef7b
[2022-05-15T20:18:43Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Initial state: AliceState(Start)
[2022-05-15T20:18:44Z INFO  farcaster_node::service] New service swap<0x70a5…ef7b> started
[2022-05-15T20:18:44Z INFO  farcaster_node::farcasterd::runtime] Service swap<0x70a5…ef7b> is now connected
[2022-05-15T20:18:44Z INFO  farcaster_node::farcasterd::runtime] Swap 0x70a5…ef7b is registered; total 1 swaps are known
[2022-05-15T20:18:44Z INFO  farcaster_node::farcasterd::runtime] launching syncer with: ["--coin", "Bitcoin", "--network", "Testnet", "--electrum-server", "ssl://blockstream.info:993"]
[2022-05-15T20:18:44Z INFO  farcaster_node::farcasterd::runtime] launching syncer with: ["--coin", "Monero", "--network", "Testnet", "--monero-daemon", "http://49.12.225.195:38081", "--monero-rpc-wallet", "http://localhost:38083", "--monero-lws", "http://49.12.225.195:38884"]
[2022-05-15T20:18:44Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-15T20:18:44Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Proposing to take swap 0x70a5…ef7b to Maker remote peer
[2022-05-15T20:18:44Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | State transition: AliceState(Start) -> AliceState(Commit)
[2022-05-15T20:18:44Z INFO  farcaster_node::syncerd::runtime] Creating new Monero (Testnet) syncer
[2022-05-15T20:18:44Z INFO  farcaster_node::syncerd::runtime] Creating new Bitcoin (Testnet) syncer
[2022-05-15T20:18:44Z INFO  farcaster_node::syncerd::monero_syncer] monero syncer servers: MoneroSyncerServers { monero_daemon: "http://49.12.225.195:38081", monero_rpc_wallet: "http://localhost:38083", monero_lws: Some("http://49.12.225.195:38884") }
[2022-05-15T20:18:45Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225243
[2022-05-15T20:18:45Z INFO  farcaster_node::service] New service Monero (Testnet) syncer started
[2022-05-15T20:18:45Z INFO  farcaster_node::service] New service Bitcoin (Testnet) syncer started
[2022-05-15T20:18:45Z INFO  farcaster_node::farcasterd::runtime] Service Bitcoin (Testnet) syncer is now connected
[2022-05-15T20:18:45Z INFO  farcaster_node::farcasterd::runtime] Syncer Bitcoin (Testnet) syncer is registered; total 1 syncers are known
[2022-05-15T20:18:45Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-15T20:18:46Z INFO  farcaster_node::farcasterd::runtime] Service Monero (Testnet) syncer is now connected
[2022-05-15T20:18:46Z INFO  farcaster_node::farcasterd::runtime] Syncer Monero (Testnet) syncer is registered; total 2 syncers are known
[2022-05-15T20:18:46Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-15T20:18:46Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093127
[2022-05-15T20:18:46Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | State transition: AliceState(Commit) -> AliceState(Reveal)
[2022-05-15T20:18:59Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching Lock transaction (a706fe11b19d5294c313fc451504ededc9519a8f37252d787a013cb8d1f58600)
[2022-05-15T20:18:59Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching Cancel transaction (5d042279ec450d8f6619a03eaf9bc821f7b066acfc38df63e932a52f3b762894)
[2022-05-15T20:18:59Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching Refund transaction (7f873666094632dc0e2d07a0fc08c43f16068313b0b5811a8d9bc5a196094907)
[2022-05-15T20:19:02Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Cancel transaction received from walletd
[2022-05-15T20:19:02Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Punish transaction received from walletd
[2022-05-15T20:19:02Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | State transition: AliceState(Reveal) -> AliceState(RefundSigs(xmr_locked(false), buy_pub(false), cancel_seen(false), refund_seen(false)))
[2022-05-15T20:19:06Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx Cancel not on the mempool
[2022-05-15T20:19:06Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx Refund not on the mempool
[2022-05-15T20:19:06Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx Lock on mempool but hasn't been mined
[2022-05-15T20:19:16Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093128
[2022-05-15T20:19:45Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): connection error: Operation timed out (os error 60)
[2022-05-15T20:19:46Z WARN  electrum_client::client] call 'ping' failed with Operation timed out (os error 60), retry: 1/1
[2022-05-15T20:19:48Z WARN  electrum_client::client] re-creating client failed after 2 attempts
[2022-05-15T20:19:48Z ERROR farcaster_node::syncerd::bitcoin_syncer] error ping electrum client in height polling: Syncer(Electrum(AllAttemptsErrored([SharedIOError(Os { code: 60, kind: TimedOut, message: "Operation timed out" })])))
[2022-05-15T20:19:52Z WARN  electrum_client::client] call 'transaction_get_raw' failed with Operation timed out (os error 60), retry: 1/1
[2022-05-15T20:19:54Z WARN  electrum_client::client] re-creating client failed after 2 attempts
[2022-05-15T20:19:54Z WARN  electrum_client::client] call 'transaction_get_raw' failed with Broken pipe (os error 32), retry: 1/1
[2022-05-15T20:19:56Z WARN  electrum_client::client] re-creating client failed after 2 attempts
[2022-05-15T20:19:56Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) in height polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T20:19:58Z ERROR farcaster_node::peerd::runtime] The ping has failed, probably the connection is down. Will shutdown the receiver runtime and attempt to reconnect
[2022-05-15T20:19:59Z WARN  farcaster_node::peerd::runtime] Exiting peerd receiver runtime
[2022-05-15T20:19:59Z INFO  farcaster_node::peerd::runtime] Attempting to reconnect to remote peerd
[2022-05-15T20:20:01Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) in height polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T20:20:06Z WARN  electrum_client::client] call 'transaction_get_raw' failed with Broken pipe (os error 32), retry: 1/1
[2022-05-15T20:20:08Z WARN  electrum_client::client] re-creating client failed after 2 attempts
[2022-05-15T20:20:08Z WARN  electrum_client::client] call 'transaction_get_raw' failed with Broken pipe (os error 32), retry: 1/1
[2022-05-15T20:20:10Z WARN  electrum_client::client] re-creating client failed after 2 attempts
[2022-05-15T20:20:10Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) in height polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T20:20:11Z WARN  electrum_client::client] call 'ping' failed with Operation timed out (os error 60), retry: 1/1
[2022-05-15T20:20:13Z WARN  electrum_client::client] re-creating client failed after 2 attempts
[2022-05-15T20:20:13Z ERROR farcaster_node::syncerd::bitcoin_syncer] error ping electrum client in address polling: Syncer(Electrum(AllAttemptsErrored([SharedIOError(Os { code: 60, kind: TimedOut, message: "Operation timed out" })])))
[2022-05-15T20:20:13Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) t in address polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T20:20:15Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) in height polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T20:20:18Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) t in address polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T20:20:20Z WARN  electrum_client::client] call 'transaction_get_raw' failed with Broken pipe (os error 32), retry: 1/1
[2022-05-15T20:20:20Z ERROR farcaster_node::syncerd::bitcoin_syncer] failed to spawn electrum rpc client (ssl://blockstream.info:993) in height polling: IOError(Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" })
[2022-05-15T20:20:23Z WARN  farcaster_node::peerd::runtime] reconnect failed attempting again in 1 seconds
[2022-05-15T20:20:32Z INFO  farcaster_node::peerd::runtime] Peerd reconnect successful, launching peerd receiver runtime
[2022-05-15T20:20:33Z INFO  electrum_client::client] Succesfully created new client
[2022-05-15T20:20:54Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093130
[2022-05-15T20:21:24Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093131
[2022-05-15T20:21:47Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093132
[2022-05-15T20:22:29Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225244
[2022-05-15T20:22:30Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx Lock final with 1 confirmations
[2022-05-15T20:22:30Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Send 0.374249270000 XMR to 59sdKhzvh9fB9iDLXD33Ea9ocu64gBvn5eZkbQfSqF3MH93vEi3SEkNSUwtfruGPqWes2aUJUSAKQKZPifZmrAmwC2JUYUa
[2022-05-15T20:22:30Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching AccLock on address 59sdKhzvh9fB9iDLXD33Ea9ocu64gBvn5eZkbQfSqF3MH93vEi3SEkNSUwtfruGPqWes2aUJUSAKQKZPifZmrAmwC2JUYUa
[2022-05-15T20:22:30Z INFO  farcaster_node::farcasterd::runtime] 0x70a5…ef7b | Attempting to auto-fund Monero
[2022-05-15T20:22:33Z INFO  farcaster_node::farcasterd::runtime] 0x70a5…ef7b | Auto-funded Monero with txid: f74a2db357ba3b06896021b69bf1bf3218172449f55795944bd4a4f1f5e60674
[2022-05-15T20:23:15Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225245
[2022-05-15T20:24:06Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093133
[2022-05-15T20:26:44Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093134
[2022-05-15T20:26:48Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093135
[2022-05-15T20:26:53Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching AccLock transaction (f74a2db357ba3b06896021b69bf1bf3218172449f55795944bd4a4f1f5e60674)
[2022-05-15T20:26:53Z INFO  farcaster_node::farcasterd::runtime] 0x70a5…ef7b | Your Monero funding completed
[2022-05-15T20:26:54Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx AccLock final with 2 confirmations
[2022-05-15T20:26:58Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093136
[2022-05-15T20:28:20Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093137
[2022-05-15T20:28:59Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225246
[2022-05-15T20:30:24Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225247
[2022-05-15T20:31:43Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093138
[2022-05-15T20:32:06Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093139
[2022-05-15T20:33:18Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225248
[2022-05-15T20:33:41Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225249
[2022-05-15T20:34:41Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093140

Corresponding Bob Maker log:

[2022-05-15T20:18:46Z INFO  farcaster_node::service] New service swap<0x70a5…ef7b> started
[2022-05-15T20:18:46Z INFO  farcaster_node::farcasterd::runtime] Service swap<0x70a5…ef7b> is now connected
[2022-05-15T20:18:46Z INFO  farcaster_node::farcasterd::runtime] Swap 0x70a5…ef7b is registered; total 1 swaps are known
[2022-05-15T20:18:46Z INFO  farcaster_node::farcasterd::runtime] launching syncer with: ["--coin", "Bitcoin", "--network", "Testnet", "--electrum-server", "ssl://blockstream.info:993"]
[2022-05-15T20:18:46Z INFO  farcaster_node::farcasterd::runtime] launching syncer with: ["--coin", "Monero", "--network", "Testnet", "--monero-daemon", "http://stagenet.melo.tools:38081", "--monero-rpc-wallet", "http://localhost:38083", "--monero-lws", "http://49.12.225.195:38884"]
[2022-05-15T20:18:46Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-15T20:18:46Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Accepting swap 0x70a5…ef7b as Maker from Taker remote peer peerd<030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750>
[2022-05-15T20:18:46Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | State transition: BobState(Start) -> BobState(Commit)
[2022-05-15T20:18:46Z INFO  farcaster_node::syncerd::runtime] Creating new Bitcoin (Testnet) syncer
[2022-05-15T20:18:46Z INFO  farcaster_node::syncerd::runtime] Creating new Monero (Testnet) syncer
[2022-05-15T20:18:46Z INFO  farcaster_node::syncerd::monero_syncer] monero syncer servers: MoneroSyncerServers { monero_daemon: "http://stagenet.melo.tools:38081", monero_rpc_wallet: "http://localhost:38083", monero_lws: Some("http://49.12.225.195:38884") }
[2022-05-15T20:18:46Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225243
[2022-05-15T20:18:46Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Send 0.00002600 BTC to tb1qtn0fuj40vwvy6nxwhazynpj37q55g09eu8c8xy
[2022-05-15T20:18:46Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching Funding transaction with scriptPubkey: OP_0 OP_PUSHBYTES_20 5cde9e4aaf63984d4ccebf44498651f029443cb9
[2022-05-15T20:18:46Z INFO  farcaster_node::farcasterd::runtime] 0x70a5…ef7b | Attempting to auto-fund Bitcoin
[2022-05-15T20:18:46Z INFO  farcaster_node::farcasterd::runtime] 0x70a5…ef7b | Auto-funded Bitcoin with txid: 757f09584c3d85611375de87654e707ac6323f03e92fa80d6b6e4d8633480586
[2022-05-15T20:18:47Z INFO  farcaster_node::service] New service Bitcoin (Testnet) syncer started
[2022-05-15T20:18:47Z INFO  farcaster_node::farcasterd::runtime] Service Bitcoin (Testnet) syncer is now connected
[2022-05-15T20:18:47Z INFO  farcaster_node::farcasterd::runtime] Syncer Bitcoin (Testnet) syncer is registered; total 1 syncers are known
[2022-05-15T20:18:47Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-15T20:18:47Z INFO  farcaster_node::service] New service Monero (Testnet) syncer started
[2022-05-15T20:18:47Z INFO  farcaster_node::farcasterd::runtime] Service Monero (Testnet) syncer is now connected
[2022-05-15T20:18:47Z INFO  farcaster_node::farcasterd::runtime] Syncer Monero (Testnet) syncer is registered; total 2 syncers are known
[2022-05-15T20:18:47Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-15T20:18:47Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093127
[2022-05-15T20:18:58Z INFO  farcaster_node::swapd::runtime] Received AddressTransaction, processing tx 757f09584c3d85611375de87654e707ac6323f03e92fa80d6b6e4d8633480586
[2022-05-15T20:18:58Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Funding transaction (757f09584c3d85611375de87654e707ac6323f03e92fa80d6b6e4d8633480586) in mempool or blockchain, forward to walletd
[2022-05-15T20:18:58Z INFO  farcaster_node::farcasterd::runtime] 0x70a5…ef7b | Your Bitcoin funding completed
[2022-05-15T20:18:58Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | State transition: BobState(Commit) -> BobState(Reveal)
[2022-05-15T20:18:58Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching Lock transaction (a706fe11b19d5294c313fc451504ededc9519a8f37252d787a013cb8d1f58600)
[2022-05-15T20:18:58Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching Cancel transaction (5d042279ec450d8f6619a03eaf9bc821f7b066acfc38df63e932a52f3b762894)
[2022-05-15T20:18:58Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching Refund transaction (7f873666094632dc0e2d07a0fc08c43f16068313b0b5811a8d9bc5a196094907)
[2022-05-15T20:18:58Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | State transition: BobState(Reveal) -> BobState(CoreArb)
[2022-05-15T20:19:02Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Lock transaction received from walletd
[2022-05-15T20:19:02Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Broadcasting Lock tx (a706fe11b19d5294c313fc451504ededc9519a8f37252d787a013cb8d1f58600)
[2022-05-15T20:19:02Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching AccLock on address 59sdKhzvh9fB9iDLXD33Ea9ocu64gBvn5eZkbQfSqF3MH93vEi3SEkNSUwtfruGPqWes2aUJUSAKQKZPifZmrAmwC2JUYUa
[2022-05-15T20:19:02Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching Buy transaction (aeb9bbcf5db67382ca5dbab46bceb3bb7b4edc4ebed618884828a169544ba99b)
[2022-05-15T20:19:02Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Cancel transaction received from walletd
[2022-05-15T20:19:02Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Refund transaction received from walletd
[2022-05-15T20:19:03Z INFO  farcaster_node::syncerd::bitcoin_syncer] Successfully broadcasted: a706fe11b19d5294c313fc451504ededc9519a8f37252d787a013cb8d1f58600
[2022-05-15T20:19:07Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx Buy not on the mempool
[2022-05-15T20:19:07Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx Refund not on the mempool
[2022-05-15T20:19:07Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx Lock not on the mempool
[2022-05-15T20:19:07Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx Cancel not on the mempool
[2022-05-15T20:19:15Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093128
[2022-05-15T20:19:17Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx Lock on mempool but hasn't been mined
[2022-05-15T20:20:04Z ERROR farcaster_node::peerd::runtime] The ping has failed, probably the connection is down. Will shutdown the receiver runtime and attempt to reconnect
[2022-05-15T20:20:04Z WARN  farcaster_node::peerd::runtime] Exiting peerd receiver runtime
[2022-05-15T20:20:04Z WARN  farcaster_node::peerd::runtime] Exiting peerd
[2022-05-15T20:20:19Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093129
[2022-05-15T20:20:21Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093130
[2022-05-15T20:20:32Z INFO  farcaster_node::farcasterd::runtime] Service peerd<030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750> is now connected
[2022-05-15T20:20:32Z WARN  farcaster_node::farcasterd::runtime] Connection 030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750 was already registered; the service probably was relaunched
[2022-05-15T20:20:32Z INFO  farcaster_node::service] New service peerd<030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750> started
[2022-05-15T20:21:23Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093131
[2022-05-15T20:21:32Z ERROR farcaster_node::peerd::runtime] The ping has failed, probably the connection is down. Will shutdown the receiver runtime and attempt to reconnect
[2022-05-15T20:21:32Z WARN  farcaster_node::peerd::runtime] Exiting peerd receiver runtime
[2022-05-15T20:21:32Z WARN  farcaster_node::peerd::runtime] Exiting peerd
[2022-05-15T20:21:47Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093132
[2022-05-15T20:22:28Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225244
[2022-05-15T20:22:29Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx Lock final with 1 confirmations
[2022-05-15T20:23:14Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225245
[2022-05-15T20:24:06Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093133
[2022-05-15T20:26:44Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093134
[2022-05-15T20:26:47Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093135
[2022-05-15T20:26:52Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Watching AccLock transaction (f74a2db357ba3b06896021b69bf1bf3218172449f55795944bd4a4f1f5e60674)
[2022-05-15T20:26:53Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | State transition: BobState(CoreArb) -> BobState(BuySig)
[2022-05-15T20:26:53Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-15T20:26:58Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093136
[2022-05-15T20:26:59Z INFO  farcaster_node::swapd::runtime] 0x70a5…ef7b | Tx AccLock final with 3 confirmations
[2022-05-15T20:28:21Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093137
[2022-05-15T20:28:59Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225246
[2022-05-15T20:30:23Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225247
[2022-05-15T20:31:45Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093138
[2022-05-15T20:32:07Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093139
[2022-05-15T20:33:18Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225248
[2022-05-15T20:33:40Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225249
[2022-05-15T20:34:41Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093140
[2022-05-15T20:36:29Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093141
[2022-05-15T20:37:17Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093142

@Lederstrumpf
Copy link
Member

Same persistent maker as above (hence reconnect), Bob Taker log when killing after funding:

[2022-05-16T09:31:38Z INFO  farcaster_node::config] Loading config file at: farcasterd.toml
[2022-05-16T09:31:38Z INFO  farcaster_node::farcasterd::runtime] farcasterd will attempt to fund automatically
[2022-05-16T09:31:38Z INFO  farcaster_node::service] New service farcasterd started
[2022-05-16T09:31:39Z INFO  farcaster_node::service] New service walletd started
[2022-05-16T09:31:39Z INFO  farcaster_node::farcasterd::runtime] Service walletd is now connected
[2022-05-16T09:34:24Z INFO  peerd] Local node id: 030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa
[2022-05-16T09:34:24Z INFO  peerd] Peerd running in CONNECT mode
[2022-05-16T09:34:24Z INFO  peerd] Connecting to 026b9739e4610c2a7e8d585b5a9b81e243a7baabfacae421e47e7b038665ffebb1@159.100.242.14:18750
[2022-05-16T09:34:24Z INFO  farcaster_node::farcasterd::runtime] Public offer registered: 0xb2e3…a185
[2022-05-16T09:34:25Z INFO  farcaster_node::service] New service peerd<026b9739e4610c2a7e8d585b5a9b81e243a7baabfacae421e47e7b038665ffebb1@159.100.242.14:18750> started
[2022-05-16T09:34:25Z INFO  farcaster_node::peerd::runtime] Initializing connection with the remote peer 159.100.242.14:18750
[2022-05-16T09:34:25Z INFO  farcaster_node::farcasterd::runtime] Service peerd<026b9739e4610c2a7e8d585b5a9b81e243a7baabfacae421e47e7b038665ffebb1@159.100.242.14:18750> is now connected
[2022-05-16T09:34:25Z INFO  farcaster_node::farcasterd::runtime] Connection 026b9739e4610c2a7e8d585b5a9b81e243a7baabfacae421e47e7b038665ffebb1@159.100.242.14:18750 is registered; total 1 connections are known
[2022-05-16T09:34:25Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-16T09:34:31Z INFO  farcaster_node::swapd::runtime] Starting swap: 0x36aa433d2c476a976e3223773c3f599ae4eafd974c9139868664432b6a77c066
[2022-05-16T09:34:31Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Initial state: BobState(Start)
[2022-05-16T09:34:32Z INFO  farcaster_node::service] New service swap<0x36aa…c066> started
[2022-05-16T09:34:32Z INFO  farcaster_node::farcasterd::runtime] Service swap<0x36aa…c066> is now connected
[2022-05-16T09:34:32Z INFO  farcaster_node::farcasterd::runtime] Swap 0x36aa…c066 is registered; total 1 swaps are known
[2022-05-16T09:34:32Z INFO  farcaster_node::farcasterd::runtime] launching syncer with: ["--coin", "Bitcoin", "--network", "Testnet", "--electrum-server", "ssl://blockstream.info:993"]
[2022-05-16T09:34:32Z INFO  farcaster_node::farcasterd::runtime] launching syncer with: ["--coin", "Monero", "--network", "Testnet", "--monero-daemon", "http://49.12.225.195:38081", "--monero-rpc-wallet", "http://localhost:38083", "--monero-lws", "http://49.12.225.195:38884"]
[2022-05-16T09:34:32Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-16T09:34:32Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Proposing to take swap 0x36aa…c066 to Maker remote peer
[2022-05-16T09:34:32Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | State transition: BobState(Start) -> BobState(Commit)
[2022-05-16T09:34:32Z INFO  farcaster_node::syncerd::runtime] Creating new Monero (Testnet) syncer
[2022-05-16T09:34:32Z INFO  farcaster_node::syncerd::runtime] Creating new Bitcoin (Testnet) syncer
[2022-05-16T09:34:32Z INFO  farcaster_node::syncerd::monero_syncer] monero syncer servers: MoneroSyncerServers { monero_daemon: "http://49.12.225.195:38081", monero_rpc_wallet: "http://localhost:38083", monero_lws: Some("http://49.12.225.195:38884") }
[2022-05-16T09:34:32Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225414
[2022-05-16T09:34:33Z INFO  farcaster_node::service] New service Bitcoin (Testnet) syncer started
[2022-05-16T09:34:33Z INFO  farcaster_node::service] New service Monero (Testnet) syncer started
[2022-05-16T09:34:33Z INFO  farcaster_node::farcasterd::runtime] Service Bitcoin (Testnet) syncer is now connected
[2022-05-16T09:34:33Z INFO  farcaster_node::farcasterd::runtime] Syncer Bitcoin (Testnet) syncer is registered; total 1 syncers are known
[2022-05-16T09:34:33Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-16T09:34:33Z INFO  farcaster_node::farcasterd::runtime] Service Monero (Testnet) syncer is now connected
[2022-05-16T09:34:33Z INFO  farcaster_node::farcasterd::runtime] Syncer Monero (Testnet) syncer is registered; total 2 syncers are known
[2022-05-16T09:34:33Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-16T09:34:33Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093791
[2022-05-16T09:34:33Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching Funding transaction with scriptPubkey: OP_0 OP_PUSHBYTES_20 06708e69e0465a56a65a0269ac80381185ff3d57
[2022-05-16T09:34:34Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | State transition: BobState(Commit) -> BobState(Reveal)
[2022-05-16T09:34:34Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Send 0.00003200 BTC to tb1qqecgu60qged9dfj6qf56eqpczxzl702hw8xmqs
[2022-05-16T09:34:34Z INFO  farcaster_node::farcasterd::runtime] 0x36aa…c066 | Attempting to auto-fund Bitcoin
[2022-05-16T09:34:35Z INFO  farcaster_node::farcasterd::runtime] 0x36aa…c066 | Auto-funded Bitcoin with txid: 534cde0928bd045e8bbf97a0931be47aad64c49e0956879dee1a51f9c554e582
[2022-05-16T09:34:44Z INFO  farcaster_node::swapd::runtime] Received AddressTransaction, processing tx 534cde0928bd045e8bbf97a0931be47aad64c49e0956879dee1a51f9c554e582
[2022-05-16T09:34:44Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Funding transaction (534cde0928bd045e8bbf97a0931be47aad64c49e0956879dee1a51f9c554e582) in mempool or blockchain, forward to walletd
[2022-05-16T09:34:44Z INFO  farcaster_node::farcasterd::runtime] 0x36aa…c066 | Your Bitcoin funding completed
[2022-05-16T09:34:48Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching Lock transaction (67169b581f6fb7a2d75e7f43bb4fa0708a83af815f933efddfba3631561320af)
[2022-05-16T09:34:48Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching Cancel transaction (280e25cb40b423d10222dd6634fded24e9d380e2df44b2401f8ca1fdd2c4d1cf)
[2022-05-16T09:34:48Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching Refund transaction (ac7699da1d6ea64cef3be807c1d4c8732abecdaccdcef480b0711d349f65db04)
[2022-05-16T09:34:48Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | State transition: BobState(Reveal) -> BobState(CoreArb)
[2022-05-16T09:34:48Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Lock transaction received from walletd
[2022-05-16T09:34:48Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Broadcasting Lock tx (67169b581f6fb7a2d75e7f43bb4fa0708a83af815f933efddfba3631561320af)
[2022-05-16T09:34:48Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching AccLock on address 57PvirrBJwRQhX2BJhSMa2MNbJEdSoMgxczTJBLzD3aPFAgeYNXFKxmDwCfb8Us72nETxe6DCm3d8CdMbCA1naJ9CEGQikY
[2022-05-16T09:34:48Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching Buy transaction (e6664cb19b72b27fedd822a192b0d34dff2aa12e96e803656365ba9afcbf2e72)
[2022-05-16T09:34:48Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Cancel transaction received from walletd
[2022-05-16T09:34:48Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Refund transaction received from walletd
[2022-05-16T09:34:51Z INFO  farcaster_node::syncerd::bitcoin_syncer] Successfully broadcasted: 67169b581f6fb7a2d75e7f43bb4fa0708a83af815f933efddfba3631561320af
[2022-05-16T09:34:53Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx Cancel not on the mempool
[2022-05-16T09:34:53Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx Lock not on the mempool
[2022-05-16T09:34:53Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx Refund not on the mempool
[2022-05-16T09:34:53Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx Buy not on the mempool
[2022-05-16T09:35:04Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:06Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:08Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:10Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:12Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:14Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:16Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:18Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:20Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:22Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:22Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): connection error: Operation timed out (os error 60)
[2022-05-16T09:35:23Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:24Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:24Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:25Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:26Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:26Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:27Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:28Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:28Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:29Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:30Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:30Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:31Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:31Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:32Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:33Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:33Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:34Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:35Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:35Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:35Z ERROR farcaster_node::peerd::runtime] The ping has failed, probably the connection is down. Will shutdown the receiver runtime and attempt to reconnect
[2022-05-16T09:35:35Z WARN  farcaster_node::peerd::runtime] Exiting peerd receiver runtime
[2022-05-16T09:35:35Z INFO  farcaster_node::peerd::runtime] Attempting to reconnect to remote peerd
[2022-05-16T09:35:35Z WARN  farcaster_node::peerd::runtime] reconnect failed attempting again in 1 seconds
[2022-05-16T09:35:36Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:36Z WARN  farcaster_node::peerd::runtime] reconnect failed attempting again in 2 seconds
[2022-05-16T09:35:37Z ERROR farcaster_node::syncerd::monero_syncer] error polling addresses: Syncer(MoneroRpc(error sending request for url (http://49.12.225.195:38884/get_address_txs): error trying to connect: tcp connect error: Network is unreachable (os error 51)

    Caused by:
        0: error trying to connect: tcp connect error: Network is unreachable (os error 51)
        1: tcp connect error: Network is unreachable (os error 51)
        2: Network is unreachable (os error 51)))
[2022-05-16T09:35:37Z ERROR farcaster_node::syncerd::monero_syncer] error processing height polling: error sending request for url (http://49.12.225.195:38081/json_rpc): error trying to connect: tcp connect error: Network is unreachable (os error 51)
[2022-05-16T09:35:39Z INFO  farcaster_node::peerd::runtime] Peerd reconnect successful, launching peerd receiver runtime
[2022-05-16T09:35:45Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx Lock on mempool but hasn't been mined
[2022-05-16T09:36:28Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093792
[2022-05-16T09:36:55Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093793
[2022-05-16T09:38:05Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225415
[2022-05-16T09:38:05Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx Lock final with 1 confirmations
[2022-05-16T09:38:23Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225416
[2022-05-16T09:40:45Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225417
[2022-05-16T09:41:25Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093794
[2022-05-16T09:41:41Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching AccLock transaction (013bfd7442a1f39f5b933cdeeb5ba257e9adabae5326713e7d91e99e7498d4f0)
[2022-05-16T09:41:42Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | State transition: BobState(CoreArb) -> BobState(BuySig)
[2022-05-16T09:46:46Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225418
[2022-05-16T09:47:48Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093795
[2022-05-16T09:47:49Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx AccLock final with 2 confirmations
[2022-05-16T09:49:38Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093796
[2022-05-16T09:49:41Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093797
[2022-05-16T09:49:53Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225419
[2022-05-16T09:52:51Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093798
[2022-05-16T09:53:11Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093799
[2022-05-16T09:53:45Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093800
[2022-05-16T09:53:53Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093801
[2022-05-16T09:54:28Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093802
[2022-05-16T09:55:44Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093803
[2022-05-16T09:56:06Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225420
[2022-05-16T09:58:49Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093804

Corresponding Alice Maker log:

[2022-05-16T09:30:24Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225414
[2022-05-16T09:34:26Z INFO  farcaster_node::farcasterd::runtime] Service peerd<030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750> is now connected
[2022-05-16T09:34:26Z WARN  farcaster_node::farcasterd::runtime] Connection 030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750 was already registered; the service probably was relaunched
[2022-05-16T09:34:26Z INFO  farcaster_node::service] New service peerd<030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750> started
[2022-05-16T09:34:33Z INFO  farcaster_node::farcasterd::runtime] passing request to walletd from peerd<030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750>
[2022-05-16T09:34:34Z INFO  farcaster_node::swapd::runtime] Starting swap: 0x36aa433d2c476a976e3223773c3f599ae4eafd974c9139868664432b6a77c066
[2022-05-16T09:34:34Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Initial state: AliceState(Start)
[2022-05-16T09:34:34Z INFO  farcaster_node::farcasterd::runtime] Connection daemon listens for incoming peer connections on 0.0.0.0:18750
[2022-05-16T09:34:34Z INFO  farcaster_node::farcasterd::runtime] Public offer registered: 0x7379…4bcc
[2022-05-16T09:34:35Z INFO  farcaster_node::service] New service swap<0x36aa…c066> started
[2022-05-16T09:34:35Z INFO  farcaster_node::farcasterd::runtime] Service swap<0x36aa…c066> is now connected
[2022-05-16T09:34:35Z INFO  farcaster_node::farcasterd::runtime] Swap 0x36aa…c066 is registered; total 147 swaps are known
[2022-05-16T09:34:35Z ERROR microservices::esb::controller] ESB request processing error: transport-level protocol error: service is offline or not responding
[2022-05-16T09:34:35Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Accepting swap 0x36aa…c066 as Maker from Taker remote peer peerd<030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750>
[2022-05-16T09:34:35Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | State transition: AliceState(Start) -> AliceState(Commit)
[2022-05-16T09:34:35Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | State transition: AliceState(Commit) -> AliceState(Reveal)
[2022-05-16T09:34:49Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching Lock transaction (67169b581f6fb7a2d75e7f43bb4fa0708a83af815f933efddfba3631561320af)
[2022-05-16T09:34:49Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching Cancel transaction (280e25cb40b423d10222dd6634fded24e9d380e2df44b2401f8ca1fdd2c4d1cf)
[2022-05-16T09:34:49Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching Refund transaction (ac7699da1d6ea64cef3be807c1d4c8732abecdaccdcef480b0711d349f65db04)
[2022-05-16T09:34:49Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Cancel transaction received from walletd
[2022-05-16T09:34:49Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Punish transaction received from walletd
[2022-05-16T09:34:49Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | State transition: AliceState(Reveal) -> AliceState(RefundSigs(xmr_locked(false), buy_pub(false), cancel_seen(false), refund_seen(false)))
[2022-05-16T09:35:07Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx Refund not on the mempool
[2022-05-16T09:35:07Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx Lock on mempool but hasn't been mined
[2022-05-16T09:35:07Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx Cancel not on the mempool
[2022-05-16T09:35:41Z INFO  farcaster_node::service] New service peerd<030ace071481eb4a3b6be53a90634ac24698182b863acdbd087ca728375b6fabaa@0.0.0.0:18750> started
[2022-05-16T09:35:49Z ERROR farcaster_node::peerd::runtime] Unrecoverable peer error Peer interface error: I/O socket error, generated by underlying socket implementation (POSIX or TCP). Error type is ConnectionReset, halting
[2022-05-16T09:36:30Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093792
[2022-05-16T09:36:43Z ERROR farcaster_node::peerd::runtime] The ping has failed, probably the connection is down. Will shutdown the receiver runtime and attempt to reconnect
[2022-05-16T09:36:43Z WARN  farcaster_node::peerd::runtime] Exiting peerd receiver runtime
[2022-05-16T09:36:43Z WARN  farcaster_node::peerd::runtime] Exiting peerd
[2022-05-16T09:36:57Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093793
[2022-05-16T09:38:06Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225415
[2022-05-16T09:38:14Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx Lock final with 1 confirmations
[2022-05-16T09:38:14Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Send 0.355407620000 XMR to 57PvirrBJwRQhX2BJhSMa2MNbJEdSoMgxczTJBLzD3aPFAgeYNXFKxmDwCfb8Us72nETxe6DCm3d8CdMbCA1naJ9CEGQikY
[2022-05-16T09:38:14Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching AccLock on address 57PvirrBJwRQhX2BJhSMa2MNbJEdSoMgxczTJBLzD3aPFAgeYNXFKxmDwCfb8Us72nETxe6DCm3d8CdMbCA1naJ9CEGQikY
[2022-05-16T09:38:14Z INFO  farcaster_node::farcasterd::runtime] 0x36aa…c066 | Attempting to auto-fund Monero
[2022-05-16T09:38:15Z INFO  farcaster_node::farcasterd::runtime] 0x36aa…c066 | Auto-funded Monero with txid: 013bfd7442a1f39f5b933cdeeb5ba257e9adabae5326713e7d91e99e7498d4f0
[2022-05-16T09:38:24Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225416
[2022-05-16T09:40:46Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225417
[2022-05-16T09:41:27Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093794
[2022-05-16T09:41:55Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Watching AccLock transaction (013bfd7442a1f39f5b933cdeeb5ba257e9adabae5326713e7d91e99e7498d4f0)
[2022-05-16T09:41:55Z INFO  farcaster_node::farcasterd::runtime] 0x36aa…c066 | Your Monero funding completed
[2022-05-16T09:41:56Z INFO  farcaster_node::swapd::runtime] 0x36aa…c066 | Tx AccLock final with 1 confirmations
[2022-05-16T09:46:47Z INFO  farcaster_node::syncerd::syncer_state] Bitcoin incremented height 2225418
[2022-05-16T09:47:50Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093795
[2022-05-16T09:49:39Z INFO  farcaster_node::syncerd::syncer_state] Monero incremented height 1093796

Copy link
Member

@h4sh3d h4sh3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

fn restart_receiver_runtime(
internal_identity: ServiceId,
peer_receiver: PeerReceiver,
thread_flag_tx: std::sync::mpsc::Sender<()>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dying_thread_flag_tx maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0e97200

// The PeerReceiverRuntime failed, attempt to reconnect with the counterpary
// It is safe to unwrap remote_node_addr here, since it is Some(..) if connect=true
let mut connection =
PeerConnection::connect(self.remote_node_addr.clone().unwrap(), &self.local_node);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use expect instead of unwrap

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 0e97200

@h4sh3d
Copy link
Member

h4sh3d commented May 18, 2022

this laid the groundwork for all the peer connection refactoring, as you mentionned previously the next steps should be in separate PRs. IMO its not important if tests don't pass for now

@TheCharlatan
Copy link
Member Author

Not going to work on this further until the deps bump #404 is in.

@zkao zkao marked this pull request as draft May 24, 2022 15:56
Otherwise a borrow is held over another borrow
@TheCharlatan TheCharlatan marked this pull request as ready for review May 31, 2022 14:52
@TheCharlatan TheCharlatan requested a review from h4sh3d May 31, 2022 14:52
@TheCharlatan
Copy link
Member Author

I think I found the correct peerd bridge socket types with a PUSH (connect) / PULL (bind) socket combination, so I'll ask for another round of review now in the hopes that this actually worked out.

@Lederstrumpf
Copy link
Member

Lederstrumpf commented Jun 2, 2022

Here are the logs from 20 parallel swaps yesterday where I disconnected the takers' network connection just after Bob's funding, or Bob's funding attempt (auto-funding failed for the Bob takers - had to fund them manually). 4 swapped successfully - the other 16 refunded. Of the successful swaps, taker was Alice thrice and Bob once, so no clear relation there.
connection_debug_logs.tar.gz

@TheCharlatan
Copy link
Member Author

I've been combing over these logs for some hours now and in the failed swaps it seems like they don't progress beyond AccLock, meaning that Alice is either not funding, or the syncers are not detecting the funding. I found no evidence that messages sent through peerd are not making it through, or that peerd is somehow connected to the problem. In the logs of the refunded swaps, I see that Alice never reaches the state where she has to send BuyProcSig to Bob.

I currently feel like this problem is unrelated to the changes in this PR. Maybe a service used by the Monero syncer is not handling the reconnect properly? I saw that all the swaps are now using the Monero LWS, could it be connected to it?

@zkao
Copy link
Member

zkao commented Jun 3, 2022

I think I found the correct peerd bridge socket types with a PUSH (connect) / PULL (bind) socket combination, so I'll ask for another round of review now in the hopes that this actually worked out.

So my understanding is that the PAIR socket was not appropriate because one does not have control over the peer connection and it might drop, and PAIR socket has undefined behavior in case the connection drops. Is that correct?

@zkao zkao self-requested a review June 3, 2022 11:03
@Lederstrumpf
Copy link
Member

I've been combing over these logs for some hours now and in the failed swaps it seems like they don't progress beyond AccLock, meaning that Alice is either not funding, or the syncers are not detecting the funding. I found no evidence that messages sent through peerd are not making it through, or that peerd is somehow connected to the problem. In the logs of the refunded swaps, I see that Alice never reaches the state where she has to send BuyProcSig to Bob.

I currently feel like this problem is unrelated to the changes in this PR. Maybe a service used by the Monero syncer is not handling the reconnect properly? I saw that all the swaps are now using the Monero LWS, could it be connected to it?

I missed your comment yesterday - apologies. Thanks for taking the time to dig through: your finding does also match what I'm seeing in these logs #462 so far too.
I think the issue is that Alice funds, but the syncers don't pick it up.

I'll try again without the lws backend.

src/peerd/runtime.rs Outdated Show resolved Hide resolved
@zkao
Copy link
Member

zkao commented Jun 3, 2022

the best PR that i've seen by @TheCharlatan by far, thank you.

Copy link
Member

@zkao zkao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work

src/farcasterd/runtime.rs Outdated Show resolved Hide resolved
src/peerd/runtime.rs Outdated Show resolved Hide resolved
@TheCharlatan TheCharlatan requested a review from zkao June 3, 2022 13:12
@TheCharlatan
Copy link
Member Author

So my understanding is that the PAIR socket was not appropriate because one does not have control over the peer connection and it might drop, and PAIR socket has undefined behavior in case the connection drops. Is that correct?

Yes, you got it, but for total clarity I'll explain again in my own words. The PAIR sockets are used for the bridge communication. The binding PAIR socket only receives messages in the peerd Runtime, while the connecting PAIR socket only sends messages it receives from the tcp stream in the peerd PeerReceiverRuntime. If the connecting PAIR socket drops (and thus closes) because the peerd PeerReceiverRuntime encounters some error, connecting a new PAIR socket in a new peerd PeerReceiverRuntime to the original peerd Runtime bind socket leads to undefined behavior. Apparently it is undefined behavior to connect a new PAIR socket to a previously used, but now unconnected PAIR socket bind.

Since the communication through the bridge is unidirectional from the PeerReceiverRuntime to the Runtime, a PUSH / PULL socket pair makes more sense.

Copy link
Member

@zkao zkao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all comments addressed, thank you

@h4sh3d h4sh3d merged commit 0e24e8a into farcaster-project:main Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add separate sequence diagram for peer reconnect procedure of a running swap Handle peer disconnect
5 participants