Open da-kami opened 4 years ago
It seems this issue is actually not time related, but it happens when we publish a new order. Might be related to an error happening on publication of the order or when cnd fetches the new orders from nectar.
I just had a transaction drop that happened after a successful swap, after about 2 minutes after a swap execution, that lead to a balance change that lead to new orders being published.
nectar:
Using config file /Users/dakami/CoBloX/repos/nectar/demo/example-config.toml
Aug 12 17:17:45.698 INFO nectar::trace: Initialized tracing with level: TRACE
Aug 12 17:17:45.702 INFO nectar::config::seed: Read in seed from file: /Users/dakami/Library/Application Support/nectar/seed.pem
Aug 12 17:17:46.457 INFO nectar::network: Started with peer-id: 12D3KooWH5U7zEknZCU5rDgz5zLPxRFzKrpe8fWvBVNUAbDRuf5J
Aug 12 17:17:46.457 INFO nectar::network: Started with peer-id: 12D3KooWH5U7zEknZCU5rDgz5zLPxRFzKrpe8fWvBVNUAbDRuf5J
Aug 12 17:17:46.458 INFO libp2p_gossipsub::behaviour: Subscribed to topic: /comit/makers
Aug 12 17:17:46.459 INFO nectar::network: Publishing new order: Sell, 0.09990725 BTC, 1169.879179730625 DAI
Aug 12 17:17:46.459 INFO comit::network::orderbook::orders: created new order with id ff843004-fede-4904-9cd5-6608230e3934
Aug 12 17:17:46.459 INFO nectar::network: Publishing new order: Buy, 0.00094389 BTC, 10 DAI
Aug 12 17:17:46.459 INFO comit::network::orderbook::orders: created new order with id 3185d1c1-d6a0-47e1-a74b-43e3ec4ee777
Aug 12 17:17:46.463 INFO nectar::command::trade: NewListenAddr("/ip4/127.0.0.1/tcp/9940")
Aug 12 17:17:46.464 INFO nectar::command::trade: NewListenAddr("/ip6/::1/tcp/9940")
Aug 12 17:17:46.464 INFO nectar::command::trade: NewListenAddr("/ip4/10.1.20.38/tcp/9940")
Aug 12 17:18:03.039 INFO nectar::command::trade: IncomingConnection { local_addr: "/ip4/127.0.0.1/tcp/9940", send_back_addr: "/ip4/127.0.0.1/tcp/50064" }
Aug 12 17:18:03.114 DEBUG libp2p_core::upgrade::apply: Successfully applied negotiated protocol
Aug 12 17:18:03.116 DEBUG libp2p_core::upgrade::apply: Successfully applied negotiated protocol
Aug 12 17:18:03.117 INFO libp2p_gossipsub::behaviour: New peer connected: PeerId("12D3KooWJdBwGAohCJbaZDFurkFkVkLuXCQmSa7wJ7cVMgujLJRR")
...
Aug 12 17:18:31.529 INFO nectar::network: Publishing new order: Buy, 0.00094389 BTC, 10 DAI
Aug 12 17:18:31.529 INFO comit::network::orderbook::orders: created new order with id b460ef4c-b811-425d-988f-e81f03f0d958
Aug 12 17:18:31.555 INFO nectar::network: Publishing new order: Sell, 0.09990725 BTC, 1169.879179730625 DAI
Aug 12 17:18:31.555 INFO comit::network::orderbook::orders: created new order with id 9dc9f9c5-cc9f-47cd-921c-2e276dd35c2b
Aug 12 17:18:33.469 DEBUG libp2p_core::upgrade::apply: Successfully applied negotiated protocol
Aug 12 17:18:33.471 DEBUG comit::network::orderbook::order_source: fetched 0 orders from 12D3KooWJdBwGAohCJbaZDFurkFkVkLuXCQmSa7wJ7cVMgujLJRR
Aug 12 17:18:33.472 DEBUG libp2p_core::upgrade::apply: Successfully applied negotiated protocol
Aug 12 17:18:33.474 INFO nectar::command::trade: ConnectionClosed { peer_id: PeerId("12D3KooWJdBwGAohCJbaZDFurkFkVkLuXCQmSa7wJ7cVMgujLJRR"), endpoint: Listener { local_addr: "/ip4/127.0.0.1/tcp/9940", send_back_addr: "/ip4/127.0.0.1/tcp/50064" }, num_established: 0, cause: IO(Custom { kind: Other, error: "yamux error: connection is closed" }) }
Setup
System: MacOS Catalina 10.15.5
cnd
nectar
cnd
tonectar
(using nectar's port and localhost IP-adr)Nectar's rate update (and hence order publication) set to 10 minutes.
on nectar branch https://github.com/coblox/nectar/tree/new-orderbook
Behaviour
The connection between Nectar and cnd is just closed after 10 minutes.
Note that this always happens at the moment, not matter if during, after swap execution, or just order fetching. Note that Nectar was set to publish orders only every 10 minutes (fetch rate after 10 minutes and place new order based on it). This might be related, but not necessarily.
Example logs where cnd dials nectar and then just runs fetching orders until connection is closed is below.
cnd:
nectar:
Another example log where it happens after (successful) swap execution:
cnd:
nectar:
Expected Behaviour
A stable connection over long period of time between Nectar and cnd. Nectar should only close the connection if there is a problem.