Skip to content

client/core: fix btc wallet cfg in simnet tests, other improvements#589

Merged
chappjc merged 8 commits into
decred:masterfrom
itswisdomagain:fix-trade-simnet-tests
Aug 18, 2020
Merged

client/core: fix btc wallet cfg in simnet tests, other improvements#589
chappjc merged 8 commits into
decred:masterfrom
itswisdomagain:fix-trade-simnet-tests

Conversation

@itswisdomagain
Copy link
Copy Markdown
Member

@itswisdomagain itswisdomagain commented Aug 7, 2020

  • Reported by @JoeGruffins, the simnet trade tests suite was using account field in the wallet config map, which was changed to walletname in multi: refactor wallet configuration #533; prevented the btc wallets from being set up on the test clients.
  • Trace level logging for test clients.
  • Mine 1 block more than the required reg fee confirms to ensure fee tx gets required confirms.
  • Improve tryUntil function to delay 250ms between calls to tryFn.
  • Improve code that checks for specific notification in client notification channel.

Comment thread client/core/trade_simnet_test.go Outdated
dcrw.config["account"] = "default"
btcw.config["account"] = btcw.name
dcrw.config["account"] = dcrw.account
btcw.config["walletname"] = btcw.walletName
Copy link
Copy Markdown
Member

@chappjc chappjc Aug 7, 2020

Choose a reason for hiding this comment

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

I need to run this more often, sorry. BTW I'm hoping at least one of the following possible errors you listed is resolved now:

// - error placing order rpc error: 22: coin locked
// clear the dcrdex db and restart the dcrdex harness
// - error placing order not enough to cover requested funds
// use the affected asset harness to send funds to the affected wallet

Coin locking has improved a ton ofc, dcrwallet listunspent is fixed, and we're pulling only utxos from the funding account. There's probably still bugs with all that, but it should be more robust than even a week ago.

Really confused about the signrawtransaction errors that show up randomly now though...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, coin locking/unlocking has improved significantly. Just noticed an instance where dcrdex did not unlock a coin from a failed trade though and subsequent trading attempts with the coin return a rpc error 36: coin <> is locked.

A close examination of the logs below suggests that a couple failed trades were not revoked. The first match in the log is for 9ae7937ae39747044667978628da99231bebd3b9f5185ac1f52377cf5650e9c6 which ended at NewlyMatched (timestamp 00:51:12).

Another match followed (6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625) which completed successfully (timestamp 00:54:18-00:54:46).

Then 2 more matches (3227781362fe63e9efde569a2fd590c76814f614d3284920ae94c5ea6c6da411 and a0483209f9a3da14a6885b7ef8dcf9a4f932c4046ac3f6e9028d84ac20c368c9) ended at NewlyMatched and MakerSwap (timestamps 00:54:48-00:54:54 and 00:54:57-00:55:05) respectively.

Then between 00:55:29 and 01:05:29, the first match (9ae7937a) got revoked, although the revoke_match request could not be sent to the clients because they'd long disconnected. But that's all in my log regarding a revocation, which would explain the coin is locked server errors I started getting at some point.

dcrdex logs
2020-08-08 00:51:06.038 [TRC] MKT: Received order 8fa87deae70f261f31578f7b8763fb5a04cc13997255fc8fbd61d41185403e5f at 2020-08-08 00:51:06.038 +0000 UTC
2020-08-08 00:51:06.122 [TRC] MKT: Received order da482da19194eb15bd9e2865baa09e2dfbbbdfde2ad4b2fa32c185a6d4f2fc38 at 2020-08-08 00:51:06.122 +0000 UTC
2020-08-08 00:51:12.000 [TRC] MKT: Preimage request sent for order da482da19194eb15bd9e2865baa09e2dfbbbdfde2ad4b2fa32c185a6d4f2fc38
2020-08-08 00:51:12.000 [TRC] MKT: Preimage request sent for order 8fa87deae70f261f31578f7b8763fb5a04cc13997255fc8fbd61d41185403e5f
2020-08-08 00:51:12.000 [TRC] MKT: Good preimage received for order da482da19194eb15bd9e2865baa09e2dfbbbdfde2ad4b2fa32c185a6d4f2fc38: 4a443d973a0dd5939fc0cc7818e330a0be44e50580a1f1d921f3282e675d1f9a
2020-08-08 00:51:12.001 [TRC] MKT: Good preimage received for order 8fa87deae70f261f31578f7b8763fb5a04cc13997255fc8fbd61d41185403e5f: 31659b5c4177c1b82c4a22ae800274cafb4f5f81ef3de57f3557a5115693b120
2020-08-08 00:51:12.003 [INF] MKT: Collected 2 valid order preimages, missed 0. Commit checksum: ae2b645c01dcd59ea8faa66006bb20d053deecfd926eef82e21bf86cc8183caf
2020-08-08 00:51:12.003 [INF] MKT: Matching complete for market dcr_btc epoch 266141311: 1 matches (0 partial fills), 1 completed OK (not booked), 1 booked, 1 unbooked, 0 failed
2020-08-08 00:51:12.007 [DBG] MKT: Negotiating 1 matches for epoch 266141311:6000
2020-08-08 00:51:12.008 [WRN] SWAP: Unable to determining optimal fee rate for "dcr", using fallback of 10. Err: -32603: no bucket with the minimum required success percentage found
2020-08-08 00:51:12.010 [DBG] SWAP: Optimal fee rate for "btc": 6
2020-08-08 00:51:12.011 [DBG] SWAP: Negotiate: sending 'match' ack request to user 954b5da2a022fde4945080f88b61c1a906a23fbcfe548be8b795932aeaa24c24 for 1 matches
2020-08-08 00:51:12.011 [DBG] SWAP: Negotiate: sending 'match' ack request to user a4e38f1a4c4b3bd8222e90bfe1a26cf9a30a8e74219479c637f26329d4096a9b for 1 matches
2020-08-08 00:51:12.012 [DBG] SWAP: processMatchAcks: 'match' ack received from 954b5da2a022fde4945080f88b61c1a906a23fbcfe548be8b795932aeaa24c24 for 1 matches
2020-08-08 00:51:12.014 [DBG] SWAP: processMatchAcks: storing valid 'match' ack signature from 954b5da2a022fde4945080f88b61c1a906a23fbcfe548be8b795932aeaa24c24 (maker=true) for match 9ae7937ae39747044667978628da99231bebd3b9f5185ac1f52377cf5650e9c6 (status NewlyMatched)
2020-08-08 00:51:12.014 [DBG] SWAP: processMatchAcks: 'match' ack received from a4e38f1a4c4b3bd8222e90bfe1a26cf9a30a8e74219479c637f26329d4096a9b for 1 matches
2020-08-08 00:51:12.015 [DBG] SWAP: processMatchAcks: storing valid 'match' ack signature from a4e38f1a4c4b3bd8222e90bfe1a26cf9a30a8e74219479c637f26329d4096a9b (maker=false) for match 9ae7937ae39747044667978628da99231bebd3b9f5185ac1f52377cf5650e9c6 (status NewlyMatched)


2020-08-08 00:54:18.232 [TRC] MKT: Received order c71b1526beabb8222e4106700f5e44fa3981ecd3f09b0aa406291c7e3a44f59d at 2020-08-08 00:54:18.232 +0000 UTC
2020-08-08 00:54:18.331 [TRC] MKT: Received order a41110e76884fe103e27d5d2a050f5728cb968cfddd752c1a51b6954915cbc99 at 2020-08-08 00:54:18.331 +0000 UTC
2020-08-08 00:54:24.000 [TRC] MKT: Preimage request sent for order c71b1526beabb8222e4106700f5e44fa3981ecd3f09b0aa406291c7e3a44f59d
2020-08-08 00:54:24.000 [TRC] MKT: Preimage request sent for order a41110e76884fe103e27d5d2a050f5728cb968cfddd752c1a51b6954915cbc99
2020-08-08 00:54:24.001 [TRC] MKT: Good preimage received for order a41110e76884fe103e27d5d2a050f5728cb968cfddd752c1a51b6954915cbc99: 652dd91cc57c82ba925b6d6d587a95ea1e4ef20581465c503bf9d5c5c75baa1a
2020-08-08 00:54:24.001 [TRC] MKT: Good preimage received for order c71b1526beabb8222e4106700f5e44fa3981ecd3f09b0aa406291c7e3a44f59d: 825d289786bbf28440ae2747a3a4d79ad996fad0a19fe92b1b28092a6eac605b
2020-08-08 00:54:24.002 [INF] MKT: Collected 2 valid order preimages, missed 0. Commit checksum: 8e5b3f59f83f5a975ae816351041575ba4f80298cb2c01bce7fd20a0dc95d059
2020-08-08 00:54:24.003 [INF] MKT: Matching complete for market dcr_btc epoch 266141343: 1 matches (0 partial fills), 1 completed OK (not booked), 1 booked, 1 unbooked, 0 failed
2020-08-08 00:54:24.007 [DBG] MKT: Negotiating 1 matches for epoch 266141343:6000
2020-08-08 00:54:24.007 [WRN] SWAP: Unable to determining optimal fee rate for "dcr", using fallback of 10. Err: -32603: no bucket with the minimum required success percentage found
2020-08-08 00:54:24.010 [DBG] SWAP: Optimal fee rate for "btc": 6
2020-08-08 00:54:24.011 [DBG] SWAP: Negotiate: sending 'match' ack request to user fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for 1 matches
2020-08-08 00:54:24.011 [DBG] SWAP: Negotiate: sending 'match' ack request to user 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 for 1 matches
2020-08-08 00:54:24.012 [DBG] SWAP: processMatchAcks: 'match' ack received from fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for 1 matches
2020-08-08 00:54:24.014 [DBG] SWAP: processMatchAcks: storing valid 'match' ack signature from fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d (maker=true) for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625 (status NewlyMatched)
2020-08-08 00:54:24.014 [DBG] SWAP: processMatchAcks: 'match' ack received from 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 for 1 matches
2020-08-08 00:54:24.015 [DBG] SWAP: processMatchAcks: storing valid 'match' ack signature from 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 (maker=false) for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625 (status NewlyMatched)
2020-08-08 00:54:24.290 [DBG] SWAP: handleInit: 'init' received from fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625, order a41110e76884fe103e27d5d2a050f5728cb968cfddd752c1a51b6954915cbc99
2020-08-08 00:54:24.291 [DBG] SWAP: step(user=fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d, match=6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625): ready for user 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 action, status NewlyMatched, next MakerSwapCast
2020-08-08 00:54:24.294 [DBG] SWAP: processInit: valid contract received at 2020-08-08 00:54:24.294 +0000 UTC from fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625, swapStatus NewlyMatched => MakerSwapCast
2020-08-08 00:54:24.295 [DBG] SWAP: processInit: sending contract 'audit' ack request to counterparty 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625
2020-08-08 00:54:29.620 [DBG] ASSET[btc]: Run: Processing new block 45ace13a6455ecea56671bb68ace942c227e3a55b034104a045b9c9ca17e0762
2020-08-08 00:54:29.620 [DBG] ASSET[btc]: Notifying 1 btc asset consumers of new block at height 261
2020-08-08 00:54:30.120 [DBG] SWAP: handleInit: 'init' received from 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625, order c71b1526beabb8222e4106700f5e44fa3981ecd3f09b0aa406291c7e3a44f59d
2020-08-08 00:54:30.120 [DBG] SWAP: step(user=4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662, match=6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625): ready for user fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d action, status MakerSwapCast, next TakerSwapCast
2020-08-08 00:54:30.122 [DBG] SWAP: processInit: valid contract received at 2020-08-08 00:54:30.121 +0000 UTC from 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625, swapStatus MakerSwapCast => TakerSwapCast
2020-08-08 00:54:30.122 [DBG] SWAP: processInit: sending contract 'audit' ack request to counterparty fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625
2020-08-08 00:54:35.669 [DBG] ASSET[dcr]: Run: Processing new block 042c0c74febe9316c4408edd79faf5db3094199dd3420aa08470423749b26f8b
2020-08-08 00:54:35.669 [DBG] ASSET[dcr]: Notifying 1 dcr asset consumers of new block at height 264
2020-08-08 00:54:36.126 [DBG] SWAP: handleRedeem: 'redeem' received from fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625, order a41110e76884fe103e27d5d2a050f5728cb968cfddd752c1a51b6954915cbc99
2020-08-08 00:54:36.126 [DBG] SWAP: step(user=fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d, match=6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625): ready for user 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 action, status TakerSwapCast, next MakerRedeemed
2020-08-08 00:54:36.133 [DBG] SWAP: processRedeem: valid redemption received at 2020-08-08 00:54:36.133 +0000 UTC from fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625, swapStatus TakerSwapCast => MakerRedeemed
2020-08-08 00:54:36.135 [DBG] SWAP: processRedeem: sending 'redeem' ack request to counterparty 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625
2020-08-08 00:54:36.137 [DBG] AUTH: Recorded order c71b1526beabb8222e4106700f5e44fa3981ecd3f09b0aa406291c7e3a44f59d that has finished processing: user=4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662, time=1596848076137, target=<nil>
2020-08-08 00:54:36.162 [DBG] SWAP: handleRedeem: 'redeem' received from 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625, order c71b1526beabb8222e4106700f5e44fa3981ecd3f09b0aa406291c7e3a44f59d
2020-08-08 00:54:36.162 [DBG] SWAP: step(user=4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662, match=6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625): ready for user fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d action, status MakerRedeemed, next MatchComplete
2020-08-08 00:54:41.189 [DBG] SWAP: processRedeem: valid redemption received at 2020-08-08 00:54:41.189 +0000 UTC from 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625, swapStatus MakerRedeemed => MatchComplete
2020-08-08 00:54:41.191 [DBG] SWAP: processRedeem: sending 'redeem' ack request to counterparty fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625
2020-08-08 00:54:41.192 [DBG] AUTH: Recorded order a41110e76884fe103e27d5d2a050f5728cb968cfddd752c1a51b6954915cbc99 that has finished processing: user=fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d, time=1596848081192, target=<nil>
2020-08-08 00:54:41.669 [DBG] ASSET[dcr]: Run: Processing new block 2115b2c13bb2424315e2962482c2c68c416bb443977705f2aca00453bbe36240
2020-08-08 00:54:41.670 [DBG] ASSET[dcr]: Notifying 1 dcr asset consumers of new block at height 265
2020-08-08 00:54:46.620 [DBG] ASSET[btc]: Run: Processing new block 5113c862b734a7b34e8afccf38885917de5167ad2699d678b79b787b940c412f
2020-08-08 00:54:46.620 [DBG] ASSET[btc]: Notifying 1 btc asset consumers of new block at height 262
2020-08-08 00:54:46.621 [DBG] SWAP: Deleting completed match 6622fe589b2b46f28ffe15f2f344bbd625197840bb664828bfa8c85dcd47a625


2020-08-08 00:54:48.384 [TRC] MKT: Received order f15c0e183ae4573fe2c3dac7b2bbeb55464bed9f8b8806f8d7640948e455f3c0 at 2020-08-08 00:54:48.384 +0000 UTC
2020-08-08 00:54:48.447 [TRC] MKT: Received order 4fc559f5c193d4084496e59ae7a569d9a7a28daaaa0f477b19fcd4c4c5f5fd02 at 2020-08-08 00:54:48.447 +0000 UTC
2020-08-08 00:54:54.000 [TRC] MKT: Preimage request sent for order f15c0e183ae4573fe2c3dac7b2bbeb55464bed9f8b8806f8d7640948e455f3c0
2020-08-08 00:54:54.000 [TRC] MKT: Preimage request sent for order 4fc559f5c193d4084496e59ae7a569d9a7a28daaaa0f477b19fcd4c4c5f5fd02
2020-08-08 00:54:54.000 [TRC] MKT: Good preimage received for order f15c0e183ae4573fe2c3dac7b2bbeb55464bed9f8b8806f8d7640948e455f3c0: 7849400c1ca16ef732ab2f80fa26232a6ddbce4e9aef4c6a9f7c575d82319ced
2020-08-08 00:54:54.001 [TRC] MKT: Good preimage received for order 4fc559f5c193d4084496e59ae7a569d9a7a28daaaa0f477b19fcd4c4c5f5fd02: e65ec9d9ec3540e0d7c9085d26ed7cfdac67afed5565535310a9926e5e903479
2020-08-08 00:54:54.003 [INF] MKT: Collected 2 valid order preimages, missed 0. Commit checksum: eadea51c76bb67663faaed9fbaec0f120ed2622989a2401a690ead74d37fc398
2020-08-08 00:54:54.004 [INF] MKT: Matching complete for market dcr_btc epoch 266141348: 1 matches (0 partial fills), 1 completed OK (not booked), 1 booked, 1 unbooked, 0 failed
2020-08-08 00:54:54.007 [DBG] MKT: Negotiating 1 matches for epoch 266141348:6000
2020-08-08 00:54:54.008 [WRN] SWAP: Unable to determining optimal fee rate for "dcr", using fallback of 10. Err: -32603: no bucket with the minimum required success percentage found
2020-08-08 00:54:54.010 [DBG] SWAP: Optimal fee rate for "btc": 10
2020-08-08 00:54:54.012 [DBG] SWAP: Negotiate: sending 'match' ack request to user 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 for 1 matches
2020-08-08 00:54:54.012 [DBG] SWAP: Negotiate: sending 'match' ack request to user fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for 1 matches
2020-08-08 00:54:54.013 [DBG] SWAP: processMatchAcks: 'match' ack received from fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for 1 matches
2020-08-08 00:54:54.014 [DBG] SWAP: processMatchAcks: storing valid 'match' ack signature from fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d (maker=false) for match 3227781362fe63e9efde569a2fd590c76814f614d3284920ae94c5ea6c6da411 (status NewlyMatched)
2020-08-08 00:54:54.014 [DBG] SWAP: processMatchAcks: 'match' ack received from 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 for 1 matches
2020-08-08 00:54:54.015 [DBG] SWAP: processMatchAcks: storing valid 'match' ack signature from 4b4e747bc2a5ad7d0baf6d2b42f6c98033edfdeb20020432f4c7bc7421571662 (maker=true) for match 3227781362fe63e9efde569a2fd590c76814f614d3284920ae94c5ea6c6da411 (status NewlyMatched)



2020-08-08 00:54:57.591 [TRC] MKT: Received order fe9e0c3f19ce8a4f93ef71a97cf4f609afb3f87129563f0849f116a0603a117a at 2020-08-08 00:54:57.591 +0000 UTC
2020-08-08 00:54:57.722 [TRC] MKT: Received order 46aa3325dac457c46c2342c55970e6e8938abf578b98939932eaced50171b019 at 2020-08-08 00:54:57.722 +0000 UTC
2020-08-08 00:55:00.000 [TRC] MKT: Preimage request sent for order 46aa3325dac457c46c2342c55970e6e8938abf578b98939932eaced50171b019
2020-08-08 00:55:00.000 [TRC] MKT: Preimage request sent for order fe9e0c3f19ce8a4f93ef71a97cf4f609afb3f87129563f0849f116a0603a117a
2020-08-08 00:55:00.001 [TRC] MKT: Good preimage received for order fe9e0c3f19ce8a4f93ef71a97cf4f609afb3f87129563f0849f116a0603a117a: 124bead42b6bd509a56d900e51068097e15faf533ec06ab7a72aa0aaeb4f8abc
2020-08-08 00:55:00.001 [TRC] MKT: Good preimage received for order 46aa3325dac457c46c2342c55970e6e8938abf578b98939932eaced50171b019: 0d9dace6e378fe1363c17229858efa252ddb4973a0c11ca672c25beff13b83e9
2020-08-08 00:55:00.002 [INF] MKT: Collected 2 valid order preimages, missed 0. Commit checksum: aa91db2166b6174a3d77e897fcd94c0519d9f3b9b226a37c1dcfb46e4c087cea
2020-08-08 00:55:00.003 [INF] MKT: Matching complete for market dcr_btc epoch 266141349: 1 matches (0 partial fills), 1 completed OK (not booked), 1 booked, 1 unbooked, 0 failed
2020-08-08 00:55:00.007 [DBG] MKT: Negotiating 1 matches for epoch 266141349:6000
2020-08-08 00:55:00.008 [WRN] SWAP: Unable to determining optimal fee rate for "dcr", using fallback of 10. Err: -32603: no bucket with the minimum required success percentage found
2020-08-08 00:55:00.011 [DBG] SWAP: Optimal fee rate for "btc": 10
2020-08-08 00:55:00.012 [DBG] SWAP: Negotiate: sending 'match' ack request to user 9622665526c9d888a8db16fe76da16796958def53deae2d31a759b32a7ceb69f for 1 matches
2020-08-08 00:55:00.012 [DBG] SWAP: Negotiate: sending 'match' ack request to user fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for 1 matches
2020-08-08 00:55:00.013 [DBG] SWAP: processMatchAcks: 'match' ack received from fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for 1 matches
2020-08-08 00:55:00.014 [DBG] SWAP: processMatchAcks: storing valid 'match' ack signature from fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d (maker=false) for match a0483209f9a3da14a6885b7ef8dcf9a4f932c4046ac3f6e9028d84ac20c368c9 (status NewlyMatched)
2020-08-08 00:55:00.014 [DBG] SWAP: processMatchAcks: 'match' ack received from 9622665526c9d888a8db16fe76da16796958def53deae2d31a759b32a7ceb69f for 1 matches
2020-08-08 00:55:00.015 [DBG] SWAP: processMatchAcks: storing valid 'match' ack signature from 9622665526c9d888a8db16fe76da16796958def53deae2d31a759b32a7ceb69f (maker=true) for match a0483209f9a3da14a6885b7ef8dcf9a4f932c4046ac3f6e9028d84ac20c368c9 (status NewlyMatched)
2020-08-08 00:55:00.289 [DBG] SWAP: handleInit: 'init' received from 9622665526c9d888a8db16fe76da16796958def53deae2d31a759b32a7ceb69f for match a0483209f9a3da14a6885b7ef8dcf9a4f932c4046ac3f6e9028d84ac20c368c9, order fe9e0c3f19ce8a4f93ef71a97cf4f609afb3f87129563f0849f116a0603a117a
2020-08-08 00:55:00.289 [DBG] SWAP: step(user=9622665526c9d888a8db16fe76da16796958def53deae2d31a759b32a7ceb69f, match=a0483209f9a3da14a6885b7ef8dcf9a4f932c4046ac3f6e9028d84ac20c368c9): ready for user fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d action, status NewlyMatched, next MakerSwapCast
2020-08-08 00:55:00.294 [DBG] SWAP: processInit: valid contract received at 2020-08-08 00:55:00.293 +0000 UTC from 9622665526c9d888a8db16fe76da16796958def53deae2d31a759b32a7ceb69f for match a0483209f9a3da14a6885b7ef8dcf9a4f932c4046ac3f6e9028d84ac20c368c9, swapStatus NewlyMatched => MakerSwapCast
2020-08-08 00:55:00.294 [DBG] SWAP: processInit: sending contract 'audit' ack request to counterparty fa21acf013cecff681e6adaa7322dfd7598369221671c7781e4d21bd23d3f39d for match a0483209f9a3da14a6885b7ef8dcf9a4f932c4046ac3f6e9028d84ac20c368c9


2020-08-08 00:55:29.620 [DBG] SWAP: checkInaction(failMatch): swap 9ae7937ae39747044667978628da99231bebd3b9f5185ac1f52377cf5650e9c6 failing (maker fault = true) at NewlyMatched
2020-08-08 00:55:29.622 [DBG] AUTH: Recorded order da482da19194eb15bd9e2865baa09e2dfbbbdfde2ad4b2fa32c185a6d4f2fc38 that has finished processing: user=a4e38f1a4c4b3bd8222e90bfe1a26cf9a30a8e74219479c637f26329d4096a9b, time=1596848129622, target=<nil>
2020-08-08 00:55:29.625 [DBG] AUTH: user 954b5da2a022fde4945080f88b61c1a906a23fbcfe548be8b795932aeaa24c24 penalized for rule 1
2020-08-08 00:55:29.625 [INF] SWAP: revoke: sending the 'revoke_match' request to each client for match 9ae7937ae39747044667978628da99231bebd3b9f5185ac1f52377cf5650e9c6
2020-08-08 01:05:29.626 [INF] SWAP: revoke_match request failed for user a4e38f1a4c4b3bd8222e90bfe1a26cf9a30a8e74219479c637f26329d4096a9b (taker)
2020-08-08 01:05:29.626 [INF] SWAP: revoke_match request failed for user 954b5da2a022fde4945080f88b61c1a906a23fbcfe548be8b795932aeaa24c24 (taker)

Copy link
Copy Markdown
Member

@chappjc chappjc Aug 8, 2020

Choose a reason for hiding this comment

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

The rpc error 36: coin <> is locked errors were frustrating me too, but I realized that's because I had restarted the test and/or the btc/dcr wallet harnesses without nuking the dcrdex harness. So the server still had those coins locked in orders from a previous run, but the test didn't realize they were locked on the server. I think this was expected behavior if the server/dcrdex harness isn't also nuked between runs.

But if you think that coins were not unlocked server-side when the orders were revoked, that's worth looking into.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For additional context, another set of 4 trades (3 failures, 1 success) - all failed trades were revoked but I tried re-running the test before the last trade was revoked and got the coin is locked error. Waited a bit, confirmed from dcrdex logs that the last trade was revoked and the tests re-ran without the coin is locked error.

I guess only question is why I had a previous instance where some trades were not revoked. Could be the dcrdex binary I was running is outdated, so will keep an eye on this.

The not enough to cover requested funds error could still occur at any point but it'd more likely mean that the configured account has no funds, rather than the wallet not having funds.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Noticed this incorrect log bit (always (taker)) btw:

dcrdex/server/swap/swap.go

Lines 2068 to 2079 in 8b55845

sendRevReq := func(user account.AccountID, isMaker bool, req *msgjson.Message, params *msgjson.RevokeMatch) {
ack := &messageAcker{
user: user,
match: match,
params: params,
isMaker: isMaker,
// isAudit: false,
}
// Expire function to unregister the outstanding request.
expireFunc := func() {
s.rmLiveAckers(req.ID)
log.Infof("revoke_match request failed for user %v (taker)", user)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I mostly only nuke and restart dcrdex harness without visiting the btc/dcr harnesses. Could it be the dcr/btc wallets still consider the coins locked from before dcrdex re-run? iirc, dcrdex on launch unlocks all coins to start afresh.

In any case, I got the coin is locked error again, so issue's still on master. This time, a failed trade also failed to revoke, match ended at MakerSwapCast.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unless the dcrdex psql db is nuked, it will relock order coins on startup. There's no way the server would have coins locked from non-existent orders. I never get this in the wild or in interactive simnet tests anyway.

When you say failed to revoke, does that mean the server didn't revoke it after broadcast timeout, or did one or both of maker or taker fail to revoke it? That's another thing I never see in practice, so repro is needed to be sure it's not just a test harness thing. That said, it could very well be the recent "retiring inactive trade" function getting in the way.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  • iirc, the dcrdex harness script nukes the simnet test db before restarting the binary.
  • re failed to revoke, the server did not revoke, at least there was no log message to that effect on dcrdex (for some failed trades anyways), something to watch more closely, I guess.

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 7, 2020

I'm consistently needing to mine an extra block to get the node to include the fee payment txns. i.e. In (*tClient).connectDEX after client.core.Register:

	// The node might not include it if it hasn't processed it in mempool yet.
	time.Sleep(500 * time.Millisecond)

	// mine drc block(s) to mark fee as paid
	err = mineBlocks(dcr.BipID, regRes.ReqConfirms+1)  // note the +1

Even with a really long sleep before mineBlocks, the txn often will just not get included.

@itswisdomagain
Copy link
Copy Markdown
Member Author

Weird stuff with getting the fee tx mined, I've noticed (and I think @JoeGruffins too) the fee tx issues. Would commit that +1 to play safe for now.

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 8, 2020

BTW, I suspect maxTradeDuration is too short because of the whole median of last 11 blocks thing on btc, maybe some other reasons too.

@itswisdomagain
Copy link
Copy Markdown
Member Author

itswisdomagain commented Aug 8, 2020

Retesting this branch now (with more verbose logging on the clients), and seeing fee tx rejected issues because of high fee:

2020-08-08 00:40:37.030 [INF] CORE: Attempting registration fee payment for SsnWKGHyKKuTt7sfQjEQ65XEm6VfXWbwGPo of 100000000 units of dcr                                      
2020-08-08 00:40:37.031 [WRN] CORE[dcr]: Unable to get optimal fee rate, using fallback of 2000000: -32603: no bucket with the minimum required success percentage found       
2020-08-08 00:40:37.038 [DBG] CORE[dcr]: Change output size = 36, addr = SsjMAhhLL1EqsHFiLgMA3UHaAWHhEJswwcg                                                                   
2020-08-08 00:40:37.043 [DBG] CORE[dcr]: 4 signature cycles to converge on fees for tx c7c6f8dbf70c17a67a507c54b55bb0413e3c95a3804cd3b605f4d0491f40db48: min rate = 2000000, actual fee rate = 2007968 (504000000 for 251 bytes), change = true                                                                                                               
2020-08-08 00:40:37.044 [DBG] COMMS: Sending close 1000 (normal) message.                                                                                                      
    TestTrading: trade_simnet_test.go:176: error starting clients: error paying registration fee: -1: rejected transaction c7c6f8dbf70c17a67a507c54b55bb0413e3c95a3804cd3b605f4d0491f40db48: transaction c7c6f8dbf70c17a67a507c54b55bb0413e3c95a3804cd3b605f4d0491f40db48 has 504000000 fee which is above the allowHighFee check threshold amount of 25100000

I'm yet to try with #590 though.

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 8, 2020

The high 2000000 DCR fallback fee is resolved in #565, which was merged not 12 hrs ago. Probably rebase. Old dexc.db with the high fee rate won't be fixed automatically though.

@itswisdomagain
Copy link
Copy Markdown
Member Author

Another thing to maybe try re fee tx confirmation requiring mining an additional block is:

// - occasional issue with fee payment confirmation
// restart dcr-harness and dcrdex-harness. stop dcrdex before dcr harness

If that solves it, then perhaps it's a simnet issue. Regardless, if mining an additional block kills the issue, then we can mark that resolved.

@itswisdomagain
Copy link
Copy Markdown
Member Author

BTW, I suspect maxTradeDuration is too short because of the whole median of last 11 blocks thing on btc, maybe some other reasons too.

I haven't had issues with this though, will bump to 2 minutes to be safe. It's a max value after all, wouldn't wait up to 2 minutes if it doesn't have to, but could mean waiting longer than necessary to detect a failed test.

maxTradeDuration does not deal with refunds too, there's a refundWaitTimeout = 30 seconds for that in checkAndWaitForRefunds. checkAndWaitForRefunds is executed separately after a trade is monitored to a desired point, and the monitoring of trade progression is what uses maxTradeDuration.

Ah, increasing the wait time before mining blocks for swaps and redeems from 1 to 5 seconds could be a reason for trade monitoring taking longer than a minute.

@itswisdomagain itswisdomagain force-pushed the fix-trade-simnet-tests branch from 6b4bea6 to 8c65c85 Compare August 8, 2020 03:00
@itswisdomagain itswisdomagain changed the title client/core: fix btc wallet cfg in simnet tests client/core: fix btc wallet cfg in simnet tests, other improvements Aug 8, 2020
@JoeGruffins
Copy link
Copy Markdown
Member

The test are failing for me. Results of five tries:

results
--- FAIL: TestTrading (126.82s)
    --- FAIL: TestTrading/success (122.66s)
        trade_simnet_test.go:204: client 1 reported 1 incomplete trades for order d53b7945 after 2m0s
FAIL
exit status 1
--- FAIL: TestTrading (130.86s)
    --- FAIL: TestTrading/success (125.70s)
        trade_simnet_test.go:204: client 2 reported 1 incomplete trades for order ba09e39b after 2m0s
FAIL
  1. and 4.
--- FAIL: TestTrading (6.27s)
    --- FAIL: TestTrading/no_maker_redeem (1.12s)
        trade_simnet_test.go:237: client2 place buy order error: rpc error: 36: coin {txid = e99b2c6367a7e33686e6c36c938e36fb2924ebdaf5741513b76ce658433af6e9, vout = 1} is locked
FAIL

Restart stimnet harness
5.

--- FAIL: TestTrading (127.90s)
    --- FAIL: TestTrading/success (122.74s)
        trade_simnet_test.go:204: client 1 reported 1 incomplete trades for order c5f61ac4 after 2m0s
FAIL
exit status 1

@itswisdomagain
Copy link
Copy Markdown
Member Author

@JoeGruffins, more log messages will be helpful, will like to know where the trades are getting stuck.

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 10, 2020

It fails for me the same way as for @JoeGruffins, although I think the coin lock error is just because of how the harness was being used (not wiping the server's postgresql db in between fresh client and/or wallets).

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 10, 2020

Note that when #587 goes in shortly, the dcr wallet pass will be "abc" also, so might as well switch that to head off the conflict.

@JoeGruffins
Copy link
Copy Markdown
Member

more log messages

test logs
2020-08-11 13:17:36.624 [INF] TEST: === SETUP
2020-08-11 13:17:36.624 [DBG] CORE: new client core created
2020-08-11 13:17:36.624 [INF] TEST: [client 1] core created
2020-08-11 13:17:36.624 [INF] CORE: started DEX client core
2020-08-11 13:17:37.663 [INF] TEST: [client 1] core initialized
2020-08-11 13:17:37.695 [INF] CORE[btc]: Setting up new btc wallet at localhost:20557/wallet/delta.
2020-08-11 13:17:37.695 [TRC] CORE[btc]: fallback fees set at 100 Satoshis/byte
2020-08-11 13:17:37.797 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:37.797 [INF] CORE: Created btc wallet. Balance available = 8400000000 / locked = 0, Deposit address = moALLUThrhEhyznwCLftvgx6Y5TrUq383N
2020-08-11 13:17:37.797 [INF] TEST: [client 1] connected btc wallet
2020-08-11 13:17:37.821 [TRC] CORE[dcr]: fallback fees set at 20 atoms/byte
2020-08-11 13:17:37.821 [INF] CORE[dcr]: Setting up new DCR wallet at 127.0.0.1:19581 with TLS certificate "/home/joe/dextest/dcr/trading1/rpc.cert".
2020-08-11 13:17:37.828 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:37.828 [INF] CORE: Created dcr wallet. Balance available = 8199982503 / locked = 0, Deposit address = SsbVcsr9qMvcTFxauNPsEyH6T5xaS2T7xWH
2020-08-11 13:17:37.828 [INF] TEST: [client 1] connected dcr wallet
2020-08-11 13:17:37.932 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-11 13:17:37.932 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-11 13:17:37.932 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-11 13:17:37.932 [DBG] COMMS: Sending close 1000 (normal) message.
2020-08-11 13:17:37.932 [WRN] CORE: notify: |WARNING| (conn) DEX disconnected - DEX at 127.0.0.1:17273 has disconnected
2020-08-11 13:17:37.932 [DBG] CORE: Connection closed for 127.0.0.1:17273.
2020-08-11 13:17:37.991 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-11 13:17:37.991 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-11 13:17:37.991 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-11 13:17:37.994 [INF] CORE: Attempting registration fee payment for SsoFtubsqCf57ZVqBkbzBSJZZ3XFnEPynWS of 100000000 units of dcr
2020-08-11 13:17:37.999 [DBG] CORE[dcr]: Change output size = 36, addr = SsiAtQETNpjjEGSMFZ4JdUDEV464wRvqAWL
2020-08-11 13:17:38.000 [DBG] CORE[dcr]: 2 signature cycles to converge on fees for tx 95a9a14ae4af19275e4d5d356c219aa70d76ab75404482bb847d9bc4606134a9: min rate = 11, actual fee rate = 11 (2772 for 252 bytes), change = true
2020-08-11 13:17:38.001 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:38.001 [INF] CORE: notify: |SUCCESS| (feepayment) Fee payment in progress - Waiting for 1 confirmations before trading at 127.0.0.1:17273
2020-08-11 13:17:38.001 [INF] TEST: [client 1] connected DEX 127.0.0.1:17273
2020-08-11 13:17:38.005 [INF] TEST: [client 1] mined 1 dcr blocks for fee payment confirmation
2020-08-11 13:17:38.005 [INF] TEST: [client 1] waiting 12s for fee confirmation notice
2020-08-11 13:17:38.826 [TRC] CORE: processing tip change for dcr
2020-08-11 13:17:38.826 [DBG] CORE: Registration fee txn 95a9a14ae4af19275e4d5d356c219aa70d76ab75404482bb847d9bc4606134a9:0 now has 1 confirmations.
2020-08-11 13:17:38.826 [INF] CORE: Notifying dex 127.0.0.1:17273 of fee payment.
2020-08-11 13:17:38.832 [DBG] CORE: Authenticated connection to 127.0.0.1:17273, 0 active matches
2020-08-11 13:17:38.832 [INF] CORE: notify: |SUCCESS| (feepayment) Account registered - You may now trade at 127.0.0.1:17273
2020-08-11 13:17:38.832 [INF] TEST: [client 1] fee payment confirmed
2020-08-11 13:17:38.832 [DBG] CORE: new client core created
2020-08-11 13:17:38.832 [INF] TEST: [client 2] core created
2020-08-11 13:17:38.832 [INF] CORE: started DEX client core
2020-08-11 13:17:39.870 [INF] TEST: [client 2] core initialized
2020-08-11 13:17:39.894 [TRC] CORE[dcr]: fallback fees set at 20 atoms/byte
2020-08-11 13:17:39.894 [INF] CORE[dcr]: Setting up new DCR wallet at 127.0.0.1:19582 with TLS certificate "/home/joe/dextest/dcr/trading2/rpc.cert".
2020-08-11 13:17:39.901 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:39.901 [INF] CORE: Created dcr wallet. Balance available = 8199994467 / locked = 0, Deposit address = SsZ9c7of6m5icvRShPbiAK2rKYFDjT6B6Vw
2020-08-11 13:17:39.901 [INF] TEST: [client 2] connected dcr wallet
2020-08-11 13:17:39.918 [INF] CORE[btc]: Setting up new btc wallet at localhost:20556/wallet/gamma.
2020-08-11 13:17:39.918 [TRC] CORE[btc]: fallback fees set at 100 Satoshis/byte
2020-08-11 13:17:40.023 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:40.023 [INF] CORE: Created btc wallet. Balance available = 8400000000 / locked = 0, Deposit address = muMWPf8MpFnPfy8276RzFgG1cVmKX3otrc
2020-08-11 13:17:40.023 [INF] TEST: [client 2] connected btc wallet
2020-08-11 13:17:40.045 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-11 13:17:40.045 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-11 13:17:40.045 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-11 13:17:40.045 [DBG] COMMS: Sending close 1000 (normal) message.
2020-08-11 13:17:40.045 [DBG] CORE: Connection closed for 127.0.0.1:17273.
2020-08-11 13:17:40.050 [WRN] CORE: notify: |WARNING| (conn) DEX disconnected - DEX at 127.0.0.1:17273 has disconnected
2020-08-11 13:17:40.128 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-11 13:17:40.128 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-11 13:17:40.128 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-11 13:17:40.131 [INF] CORE: Attempting registration fee payment for SssfTGcL3Njjum26QVcYeAq7AA2SNNNZSut of 100000000 units of dcr
2020-08-11 13:17:40.132 [WRN] CORE[dcr]: Unable to get optimal fee rate, using fallback of 20: -4: no bucket with the minimum required success percentage found
2020-08-11 13:17:40.137 [DBG] CORE[dcr]: Change output size = 36, addr = SspMMkmxxVrXcEdHRUAoiHkR3S96uj3CGTy
2020-08-11 13:17:40.140 [DBG] CORE[dcr]: 3 signature cycles to converge on fees for tx 34874c28b6d2e93af3694acca0303bc2022099c3320e6755c68a3205c2f3322a: min rate = 20, actual fee rate = 20 (5040 for 251 bytes), change = true
2020-08-11 13:17:40.143 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:40.143 [INF] CORE: notify: |SUCCESS| (feepayment) Fee payment in progress - Waiting for 1 confirmations before trading at 127.0.0.1:17273
2020-08-11 13:17:40.143 [INF] TEST: [client 2] connected DEX 127.0.0.1:17273
2020-08-11 13:17:40.149 [INF] TEST: [client 2] mined 1 dcr blocks for fee payment confirmation
2020-08-11 13:17:40.149 [INF] TEST: [client 2] waiting 12s for fee confirmation notice
2020-08-11 13:17:40.826 [TRC] CORE: processing tip change for dcr
2020-08-11 13:17:40.898 [TRC] CORE: processing tip change for dcr
2020-08-11 13:17:40.899 [DBG] CORE: Registration fee txn 34874c28b6d2e93af3694acca0303bc2022099c3320e6755c68a3205c2f3322a:0 now has 1 confirmations.
2020-08-11 13:17:40.899 [INF] CORE: Notifying dex 127.0.0.1:17273 of fee payment.
2020-08-11 13:17:40.903 [DBG] CORE: Authenticated connection to 127.0.0.1:17273, 0 active matches
2020-08-11 13:17:40.903 [INF] CORE: notify: |SUCCESS| (feepayment) Account registered - You may now trade at 127.0.0.1:17273
2020-08-11 13:17:40.903 [INF] TEST: [client 2] fee payment confirmed
2020-08-11 13:17:40.903 [INF] TEST: === SETUP COMPLETED

2020-08-11 13:17:40.903 [INF] TEST: [client 1] unlocking wallets
2020-08-11 13:17:41.415 [INF] TEST: [client 1] updating balances
2020-08-11 13:17:41.416 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:41.416 [INF] TEST: [client 1] dcr available 80.999797, locked 2.999975
2020-08-11 13:17:41.418 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:41.418 [INF] TEST: [client 1] btc available 84.000000, locked 0.000000
2020-08-11 13:17:41.418 [INF] TEST: [client 2] unlocking wallets
2020-08-11 13:17:41.929 [INF] TEST: [client 2] updating balances
2020-08-11 13:17:41.930 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:41.930 [INF] TEST: [client 2] dcr available 80.999894, locked 5.000000
2020-08-11 13:17:41.932 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:41.932 [INF] TEST: [client 2] btc available 84.000000, locked 0.000000
2020-08-11 13:17:41.967 [DBG] CORE[dcr]: funding 1200000000 atom order with coins [71ad79aee5eabc5ab533e16ecef3fa830af7081c7429d12b5b8545b6fd61bbdc:1]
2020-08-11 13:17:41.974 [DBG] CORE: notify: |POKE| (order) Order placed - selling 12.00000000 dcr (4c2ea273) - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:41.974 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:41.974 [INF] TEST: [client 1] placed order selling 12.00000000 dcr at 0.00015000 btc/dcr (4c2ea273)
2020-08-11 13:17:42.000 [DBG] CORE: notify: |POKE| (order) Preimage sent - match cycle has begun for order 4c2ea273 - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:42.002 [INF] CORE: Standing order 4c2ea273 did not match and is now booked.
2020-08-11 13:17:42.002 [TRC] CORE: notify: |DATA| (order) Order booked - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:42.084 [DBG] CORE[btc]: funding 180000 Satoshis order with coins [b5d50752d4612eccdcec7adaa8eace9a05eeb5d8fa7c5ac0bfd2b5ddaa4497fc:0]
2020-08-11 13:17:42.092 [DBG] CORE: notify: |POKE| (order) Order placed - buying 12.00000000 dcr (dd1aacb5) - Order: dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be
2020-08-11 13:17:42.093 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:42.094 [INF] TEST: [client 2] placed order buying 12.00000000 dcr at 0.00015000 btc/dcr (dd1aacb5)
2020-08-11 13:17:42.094 [INF] TEST: [client 2] Waiting 12s for matches on order dd1aacb5
2020-08-11 13:17:42.094 [INF] TEST: [client 1] Waiting 12s for matches on order 4c2ea273
2020-08-11 13:17:48.001 [DBG] CORE: notify: |POKE| (order) Preimage sent - match cycle has begun for order dd1aacb5 - Order: dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be
2020-08-11 13:17:48.015 [DBG] CORE: Registering match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf (Maker) in status NewlyMatched
2020-08-11 13:17:48.015 [DBG] CORE: Registering match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be (Taker) in status NewlyMatched
2020-08-11 13:17:48.016 [INF] CORE: Starting negotiation for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be with swap fee rate = 2, quantity = 1200000000
2020-08-11 13:17:48.016 [DBG] CORE: Trade order dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be matched with 1 orders: +1200000000 filled, total fill 1200000000 / 1200000000 (100.0%)
2020-08-11 13:17:48.016 [DBG] CORE: notify: |POKE| (order) Matches made - Buy order on dcr-btc 100.0% filled (dd1aacb5) - Order: dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be
2020-08-11 13:17:48.016 [INF] TEST: [client 2] 1 match(es) received for order dd1aacb5
2020-08-11 13:17:48.016 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:17:48.016 [INF] TEST: [client 2] Taker on match 28e2ea72, amount 12.00000000 dcr
2020-08-11 13:17:48.266 [INF] CORE: Starting negotiation for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf with swap fee rate = 10, quantity = 1200000000
2020-08-11 13:17:48.266 [DBG] CORE: Trade order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf matched with 1 orders: +1200000000 filled, total fill 1200000000 / 1200000000 (100.0%)
2020-08-11 13:17:48.266 [DBG] CORE: notify: |POKE| (order) Matches made - Sell order on dcr-btc 100.0% filled (4c2ea273) - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:48.266 [INF] TEST: [client 1] 1 match(es) received for order 4c2ea273
2020-08-11 13:17:48.266 [DBG] CORE: Swappable match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf (Maker)
2020-08-11 13:17:48.266 [INF] TEST: [client 1] Maker on match 28e2ea72, amount 12.00000000 dcr
2020-08-11 13:17:48.275 [DBG] CORE[dcr]: Change output size = 36, addr = Ssnk5CLhUQoHyFh66Z3QQpqgcebAESoMhW8
2020-08-11 13:17:48.280 [DBG] CORE[dcr]: 3 signature cycles to converge on fees for tx 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e: min rate = 10, actual fee rate = 10 (2490 for 249 bytes), change = true
2020-08-11 13:17:48.282 [INF] CORE: Broadcasted transaction with 1 swap contracts for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf. Fee rate = 10. Receipts: [060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0]
2020-08-11 13:17:48.282 [DBG] CORE: Storing change coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:1
2020-08-11 13:17:48.282 [DBG] CORE: Saving change coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:1 (dcr) to DB for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:48.282 [INF] CORE: Contract coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0 (dcr), value = 1200000000, refundable at 2020-08-11 04:18:48 +0000 UTC (script = 6382012088c020acc0f780deb9ed11d7d0e438e2691daf68e99b9219727db61578351e5eb52d6c8876a91445d249788abbfa99e0a93efcabcb63dc6d9bcd776704281c325fb17576a914b401a90ec337c59e4f2f97559362b1b43f4aff076888ac)
2020-08-11 13:17:48.282 [TRC] CORE: Contract coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0 secret = 32a96ded3e2e132d948e9ff48933fe9335ff31ebd8617f647c426c33659d52ea
2020-08-11 13:17:48.286 [DBG] CORE: notify: |POKE| (order) Swaps initiated - Sent swaps worth 12.00000000 dcr on order 4c2ea273 - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:48.287 [INF] CORE: Audited contract (dcr: 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0) paying to SsaiTEA1p5vLa4Mx9Ujt5Cs5YaNcVFotHee for order dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be...
2020-08-11 13:17:48.288 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:17:48.288 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:17:48.516 [INF] TEST: [client 2] NOW =====> MakerSwapCast
2020-08-11 13:17:48.516 [INF] TEST: [client 1] NOW =====> MakerSwapCast
2020-08-11 13:17:48.516 [INF] TEST: [client 1] updated dcr balance diff with -12.000000
2020-08-11 13:17:48.522 [INF] TEST: [client 2] Mined 1 blocks for Maker's swap, match 28e2ea72
2020-08-11 13:17:48.826 [TRC] CORE: processing tip change for dcr
2020-08-11 13:17:48.826 [INF] CORE: Contract for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a with swap coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0 (dcr) has an expiry time of 2020-08-11 04:18:48 +0000 UTC (59s), not yet expired.
2020-08-11 13:17:48.826 [TRC] CORE: Match not ready for action as Maker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:17:48.899 [TRC] CORE: processing tip change for dcr
2020-08-11 13:17:48.899 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:17:48.900 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:17:57.991 [DBG] CORE: Ticking 1 trades
2020-08-11 13:17:57.991 [TRC] CORE: Match not ready for action as Maker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:00.128 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:00.129 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:18:00.129 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:17.991 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:17.991 [TRC] CORE: Match not ready for action as Maker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:20.128 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:20.129 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:18:20.129 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:31.991 [TRC] COMMS: got pinged, and ponged the server
2020-08-11 13:18:34.128 [TRC] COMMS: got pinged, and ponged the server
2020-08-11 13:18:37.991 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:37.991 [INF] CORE: Contract for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a with swap coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0 (dcr) has an expiry time of 2020-08-11 04:18:48 +0000 UTC (10s), not yet expired.
2020-08-11 13:18:37.991 [TRC] CORE: Match not ready for action as Maker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:40.128 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:40.130 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:18:40.130 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:57.991 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:57.991 [DBG] CORE: Refundable match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf (Maker)
2020-08-11 13:18:57.991 [INF] CORE: Failed match, no valid counterswap received from Taker, refunding dcr contract 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0
2020-08-11 13:18:57.993 [WRN] CORE[dcr]: Unable to get optimal fee rate, using fallback of 20: -4: no bucket with the minimum required success percentage found
2020-08-11 13:18:57.998 [WRN] CORE: notify: |WARNING| (order) Matches Refunded - Refunded 12.00000000 dcr on order 4c2ea273 - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:18:58.000 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:19:00.128 [DBG] CORE: Ticking 1 trades
2020-08-11 13:19:00.129 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:19:00.129 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:19:17.991 [DBG] CORE: Ticking 1 trades
2020-08-11 13:19:17.991 [INF] CORE: Retiring inactive order 4c2ea27340a2ac482020-08-11 13:17:36.624 [INF] TEST: === SETUP
2020-08-11 13:17:36.624 [DBG] CORE: new client core created
2020-08-11 13:17:36.624 [INF] TEST: [client 1] core created
2020-08-11 13:17:36.624 [INF] CORE: started DEX client core
2020-08-11 13:17:37.663 [INF] TEST: [client 1] core initialized
2020-08-11 13:17:37.695 [INF] CORE[btc]: Setting up new btc wallet at localhost:20557/wallet/delta.
2020-08-11 13:17:37.695 [TRC] CORE[btc]: fallback fees set at 100 Satoshis/byte
2020-08-11 13:17:37.797 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:37.797 [INF] CORE: Created btc wallet. Balance available = 8400000000 / locked = 0, Deposit address = moALLUThrhEhyznwCLftvgx6Y5TrUq383N
2020-08-11 13:17:37.797 [INF] TEST: [client 1] connected btc wallet
2020-08-11 13:17:37.821 [TRC] CORE[dcr]: fallback fees set at 20 atoms/byte
2020-08-11 13:17:37.821 [INF] CORE[dcr]: Setting up new DCR wallet at 127.0.0.1:19581 with TLS certificate "/home/joe/dextest/dcr/trading1/rpc.cert".
2020-08-11 13:17:37.828 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:37.828 [INF] CORE: Created dcr wallet. Balance available = 8199982503 / locked = 0, Deposit address = SsbVcsr9qMvcTFxauNPsEyH6T5xaS2T7xWH
2020-08-11 13:17:37.828 [INF] TEST: [client 1] connected dcr wallet
2020-08-11 13:17:37.932 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-11 13:17:37.932 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-11 13:17:37.932 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-11 13:17:37.932 [DBG] COMMS: Sending close 1000 (normal) message.
2020-08-11 13:17:37.932 [WRN] CORE: notify: |WARNING| (conn) DEX disconnected - DEX at 127.0.0.1:17273 has disconnected
2020-08-11 13:17:37.932 [DBG] CORE: Connection closed for 127.0.0.1:17273.
2020-08-11 13:17:37.991 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-11 13:17:37.991 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-11 13:17:37.991 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-11 13:17:37.994 [INF] CORE: Attempting registration fee payment for SsoFtubsqCf57ZVqBkbzBSJZZ3XFnEPynWS of 100000000 units of dcr
2020-08-11 13:17:37.999 [DBG] CORE[dcr]: Change output size = 36, addr = SsiAtQETNpjjEGSMFZ4JdUDEV464wRvqAWL
2020-08-11 13:17:38.000 [DBG] CORE[dcr]: 2 signature cycles to converge on fees for tx 95a9a14ae4af19275e4d5d356c219aa70d76ab75404482bb847d9bc4606134a9: min rate = 11, actual fee rate = 11 (2772 for 252 bytes), change = true
2020-08-11 13:17:38.001 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:38.001 [INF] CORE: notify: |SUCCESS| (feepayment) Fee payment in progress - Waiting for 1 confirmations before trading at 127.0.0.1:17273
2020-08-11 13:17:38.001 [INF] TEST: [client 1] connected DEX 127.0.0.1:17273
2020-08-11 13:17:38.005 [INF] TEST: [client 1] mined 1 dcr blocks for fee payment confirmation
2020-08-11 13:17:38.005 [INF] TEST: [client 1] waiting 12s for fee confirmation notice
2020-08-11 13:17:38.826 [TRC] CORE: processing tip change for dcr
2020-08-11 13:17:38.826 [DBG] CORE: Registration fee txn 95a9a14ae4af19275e4d5d356c219aa70d76ab75404482bb847d9bc4606134a9:0 now has 1 confirmations.
2020-08-11 13:17:38.826 [INF] CORE: Notifying dex 127.0.0.1:17273 of fee payment.
2020-08-11 13:17:38.832 [DBG] CORE: Authenticated connection to 127.0.0.1:17273, 0 active matches
2020-08-11 13:17:38.832 [INF] CORE: notify: |SUCCESS| (feepayment) Account registered - You may now trade at 127.0.0.1:17273
2020-08-11 13:17:38.832 [INF] TEST: [client 1] fee payment confirmed
2020-08-11 13:17:38.832 [DBG] CORE: new client core created
2020-08-11 13:17:38.832 [INF] TEST: [client 2] core created
2020-08-11 13:17:38.832 [INF] CORE: started DEX client core
2020-08-11 13:17:39.870 [INF] TEST: [client 2] core initialized
2020-08-11 13:17:39.894 [TRC] CORE[dcr]: fallback fees set at 20 atoms/byte
2020-08-11 13:17:39.894 [INF] CORE[dcr]: Setting up new DCR wallet at 127.0.0.1:19582 with TLS certificate "/home/joe/dextest/dcr/trading2/rpc.cert".
2020-08-11 13:17:39.901 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:39.901 [INF] CORE: Created dcr wallet. Balance available = 8199994467 / locked = 0, Deposit address = SsZ9c7of6m5icvRShPbiAK2rKYFDjT6B6Vw
2020-08-11 13:17:39.901 [INF] TEST: [client 2] connected dcr wallet
2020-08-11 13:17:39.918 [INF] CORE[btc]: Setting up new btc wallet at localhost:20556/wallet/gamma.
2020-08-11 13:17:39.918 [TRC] CORE[btc]: fallback fees set at 100 Satoshis/byte
2020-08-11 13:17:40.023 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:40.023 [INF] CORE: Created btc wallet. Balance available = 8400000000 / locked = 0, Deposit address = muMWPf8MpFnPfy8276RzFgG1cVmKX3otrc
2020-08-11 13:17:40.023 [INF] TEST: [client 2] connected btc wallet
2020-08-11 13:17:40.045 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-11 13:17:40.045 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-11 13:17:40.045 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-11 13:17:40.045 [DBG] COMMS: Sending close 1000 (normal) message.
2020-08-11 13:17:40.045 [DBG] CORE: Connection closed for 127.0.0.1:17273.
2020-08-11 13:17:40.050 [WRN] CORE: notify: |WARNING| (conn) DEX disconnected - DEX at 127.0.0.1:17273 has disconnected
2020-08-11 13:17:40.128 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-11 13:17:40.128 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-11 13:17:40.128 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-11 13:17:40.131 [INF] CORE: Attempting registration fee payment for SssfTGcL3Njjum26QVcYeAq7AA2SNNNZSut of 100000000 units of dcr
2020-08-11 13:17:40.132 [WRN] CORE[dcr]: Unable to get optimal fee rate, using fallback of 20: -4: no bucket with the minimum required success percentage found
2020-08-11 13:17:40.137 [DBG] CORE[dcr]: Change output size = 36, addr = SspMMkmxxVrXcEdHRUAoiHkR3S96uj3CGTy
2020-08-11 13:17:40.140 [DBG] CORE[dcr]: 3 signature cycles to converge on fees for tx 34874c28b6d2e93af3694acca0303bc2022099c3320e6755c68a3205c2f3322a: min rate = 20, actual fee rate = 20 (5040 for 251 bytes), change = true
2020-08-11 13:17:40.143 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:40.143 [INF] CORE: notify: |SUCCESS| (feepayment) Fee payment in progress - Waiting for 1 confirmations before trading at 127.0.0.1:17273
2020-08-11 13:17:40.143 [INF] TEST: [client 2] connected DEX 127.0.0.1:17273
2020-08-11 13:17:40.149 [INF] TEST: [client 2] mined 1 dcr blocks for fee payment confirmation
2020-08-11 13:17:40.149 [INF] TEST: [client 2] waiting 12s for fee confirmation notice
2020-08-11 13:17:40.826 [TRC] CORE: processing tip change for dcr
2020-08-11 13:17:40.898 [TRC] CORE: processing tip change for dcr
2020-08-11 13:17:40.899 [DBG] CORE: Registration fee txn 34874c28b6d2e93af3694acca0303bc2022099c3320e6755c68a3205c2f3322a:0 now has 1 confirmations.
2020-08-11 13:17:40.899 [INF] CORE: Notifying dex 127.0.0.1:17273 of fee payment.
2020-08-11 13:17:40.903 [DBG] CORE: Authenticated connection to 127.0.0.1:17273, 0 active matches
2020-08-11 13:17:40.903 [INF] CORE: notify: |SUCCESS| (feepayment) Account registered - You may now trade at 127.0.0.1:17273
2020-08-11 13:17:40.903 [INF] TEST: [client 2] fee payment confirmed
2020-08-11 13:17:40.903 [INF] TEST: === SETUP COMPLETED

2020-08-11 13:17:40.903 [INF] TEST: [client 1] unlocking wallets
2020-08-11 13:17:41.415 [INF] TEST: [client 1] updating balances
2020-08-11 13:17:41.416 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:41.416 [INF] TEST: [client 1] dcr available 80.999797, locked 2.999975
2020-08-11 13:17:41.418 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:41.418 [INF] TEST: [client 1] btc available 84.000000, locked 0.000000
2020-08-11 13:17:41.418 [INF] TEST: [client 2] unlocking wallets
2020-08-11 13:17:41.929 [INF] TEST: [client 2] updating balances
2020-08-11 13:17:41.930 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:41.930 [INF] TEST: [client 2] dcr available 80.999894, locked 5.000000
2020-08-11 13:17:41.932 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:41.932 [INF] TEST: [client 2] btc available 84.000000, locked 0.000000
2020-08-11 13:17:41.967 [DBG] CORE[dcr]: funding 1200000000 atom order with coins [71ad79aee5eabc5ab533e16ecef3fa830af7081c7429d12b5b8545b6fd61bbdc:1]
2020-08-11 13:17:41.974 [DBG] CORE: notify: |POKE| (order) Order placed - selling 12.00000000 dcr (4c2ea273) - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:41.974 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:41.974 [INF] TEST: [client 1] placed order selling 12.00000000 dcr at 0.00015000 btc/dcr (4c2ea273)
2020-08-11 13:17:42.000 [DBG] CORE: notify: |POKE| (order) Preimage sent - match cycle has begun for order 4c2ea273 - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:42.002 [INF] CORE: Standing order 4c2ea273 did not match and is now booked.
2020-08-11 13:17:42.002 [TRC] CORE: notify: |DATA| (order) Order booked - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:42.084 [DBG] CORE[btc]: funding 180000 Satoshis order with coins [b5d50752d4612eccdcec7adaa8eace9a05eeb5d8fa7c5ac0bfd2b5ddaa4497fc:0]
2020-08-11 13:17:42.092 [DBG] CORE: notify: |POKE| (order) Order placed - buying 12.00000000 dcr (dd1aacb5) - Order: dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be
2020-08-11 13:17:42.093 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:17:42.094 [INF] TEST: [client 2] placed order buying 12.00000000 dcr at 0.00015000 btc/dcr (dd1aacb5)
2020-08-11 13:17:42.094 [INF] TEST: [client 2] Waiting 12s for matches on order dd1aacb5
2020-08-11 13:17:42.094 [INF] TEST: [client 1] Waiting 12s for matches on order 4c2ea273
2020-08-11 13:17:48.001 [DBG] CORE: notify: |POKE| (order) Preimage sent - match cycle has begun for order dd1aacb5 - Order: dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be
2020-08-11 13:17:48.015 [DBG] CORE: Registering match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf (Maker) in status NewlyMatched
2020-08-11 13:17:48.015 [DBG] CORE: Registering match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be (Taker) in status NewlyMatched
2020-08-11 13:17:48.016 [INF] CORE: Starting negotiation for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be with swap fee rate = 2, quantity = 1200000000
2020-08-11 13:17:48.016 [DBG] CORE: Trade order dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be matched with 1 orders: +1200000000 filled, total fill 1200000000 / 1200000000 (100.0%)
2020-08-11 13:17:48.016 [DBG] CORE: notify: |POKE| (order) Matches made - Buy order on dcr-btc 100.0% filled (dd1aacb5) - Order: dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be
2020-08-11 13:17:48.016 [INF] TEST: [client 2] 1 match(es) received for order dd1aacb5
2020-08-11 13:17:48.016 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:17:48.016 [INF] TEST: [client 2] Taker on match 28e2ea72, amount 12.00000000 dcr
2020-08-11 13:17:48.266 [INF] CORE: Starting negotiation for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf with swap fee rate = 10, quantity = 1200000000
2020-08-11 13:17:48.266 [DBG] CORE: Trade order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf matched with 1 orders: +1200000000 filled, total fill 1200000000 / 1200000000 (100.0%)
2020-08-11 13:17:48.266 [DBG] CORE: notify: |POKE| (order) Matches made - Sell order on dcr-btc 100.0% filled (4c2ea273) - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:48.266 [INF] TEST: [client 1] 1 match(es) received for order 4c2ea273
2020-08-11 13:17:48.266 [DBG] CORE: Swappable match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf (Maker)
2020-08-11 13:17:48.266 [INF] TEST: [client 1] Maker on match 28e2ea72, amount 12.00000000 dcr
2020-08-11 13:17:48.275 [DBG] CORE[dcr]: Change output size = 36, addr = Ssnk5CLhUQoHyFh66Z3QQpqgcebAESoMhW8
2020-08-11 13:17:48.280 [DBG] CORE[dcr]: 3 signature cycles to converge on fees for tx 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e: min rate = 10, actual fee rate = 10 (2490 for 249 bytes), change = true
2020-08-11 13:17:48.282 [INF] CORE: Broadcasted transaction with 1 swap contracts for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf. Fee rate = 10. Receipts: [060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0]
2020-08-11 13:17:48.282 [DBG] CORE: Storing change coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:1
2020-08-11 13:17:48.282 [DBG] CORE: Saving change coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:1 (dcr) to DB for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:48.282 [INF] CORE: Contract coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0 (dcr), value = 1200000000, refundable at 2020-08-11 04:18:48 +0000 UTC (script = 6382012088c020acc0f780deb9ed11d7d0e438e2691daf68e99b9219727db61578351e5eb52d6c8876a91445d249788abbfa99e0a93efcabcb63dc6d9bcd776704281c325fb17576a914b401a90ec337c59e4f2f97559362b1b43f4aff076888ac)
2020-08-11 13:17:48.282 [TRC] CORE: Contract coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0 secret = 32a96ded3e2e132d948e9ff48933fe9335ff31ebd8617f647c426c33659d52ea
2020-08-11 13:17:48.286 [DBG] CORE: notify: |POKE| (order) Swaps initiated - Sent swaps worth 12.00000000 dcr on order 4c2ea273 - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:48.287 [INF] CORE: Audited contract (dcr: 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0) paying to SsaiTEA1p5vLa4Mx9Ujt5Cs5YaNcVFotHee for order dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be...
2020-08-11 13:17:48.288 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:17:48.288 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:17:48.516 [INF] TEST: [client 2] NOW =====> MakerSwapCast
2020-08-11 13:17:48.516 [INF] TEST: [client 1] NOW =====> MakerSwapCast
2020-08-11 13:17:48.516 [INF] TEST: [client 1] updated dcr balance diff with -12.000000
2020-08-11 13:17:48.522 [INF] TEST: [client 2] Mined 1 blocks for Maker's swap, match 28e2ea72
2020-08-11 13:17:48.826 [TRC] CORE: processing tip change for dcr
2020-08-11 13:17:48.826 [INF] CORE: Contract for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a with swap coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0 (dcr) has an expiry time of 2020-08-11 04:18:48 +0000 UTC (59s), not yet expired.
2020-08-11 13:17:48.826 [TRC] CORE: Match not ready for action as Maker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:17:48.899 [TRC] CORE: processing tip change for dcr
2020-08-11 13:17:48.899 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:17:48.900 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:17:57.991 [DBG] CORE: Ticking 1 trades
2020-08-11 13:17:57.991 [TRC] CORE: Match not ready for action as Maker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:00.128 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:00.129 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:18:00.129 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:17.991 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:17.991 [TRC] CORE: Match not ready for action as Maker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:20.128 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:20.129 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:18:20.129 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:31.991 [TRC] COMMS: got pinged, and ponged the server
2020-08-11 13:18:34.128 [TRC] COMMS: got pinged, and ponged the server
2020-08-11 13:18:37.991 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:37.991 [INF] CORE: Contract for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a with swap coin 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0 (dcr) has an expiry time of 2020-08-11 04:18:48 +0000 UTC (10s), not yet expired.
2020-08-11 13:18:37.991 [TRC] CORE: Match not ready for action as Maker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:40.128 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:40.130 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:18:40.130 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:18:57.991 [DBG] CORE: Ticking 1 trades
2020-08-11 13:18:57.991 [DBG] CORE: Refundable match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf (Maker)
2020-08-11 13:18:57.991 [INF] CORE: Failed match, no valid counterswap received from Taker, refunding dcr contract 060bed4d2d1c86955c3ab8d934f186173d10022c28ba2d7677b02d428c303f2e:0
2020-08-11 13:18:57.993 [WRN] CORE[dcr]: Unable to get optimal fee rate, using fallback of 20: -4: no bucket with the minimum required success percentage found
2020-08-11 13:18:57.998 [WRN] CORE: notify: |WARNING| (order) Matches Refunded - Refunded 12.00000000 dcr on order 4c2ea273 - Order: 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:18:58.000 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 13:19:00.128 [DBG] CORE: Ticking 1 trades
2020-08-11 13:19:00.129 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:19:00.129 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:19:17.991 [DBG] CORE: Ticking 1 trades
2020-08-11 13:19:17.991 [INF] CORE: Retiring inactive order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:19:20.128 [DBG] CORE: Ticking 1 trades
2020-08-11 13:19:20.130 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:19:20.130 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:19:25.991 [TRC] COMMS: got pinged, and ponged the server
2020-08-11 13:19:28.128 [TRC] COMMS: got pinged, and ponged the server
2020-08-11 13:19:37.991 [DBG] CORE: Ticking 0 trades
2020-08-11 13:19:40.128 [DBG] CORE: Ticking 1 trades
2020-08-11 13:19:40.129 [DBG] CORE: Match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a not yet swappable: current confs = 0, required confs = 1
2020-08-11 13:19:40.129 [TRC] CORE: Match not ready for action as Taker: 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a
2020-08-11 13:19:48.016 [INF] TEST: [client 2] incomplete trade: order dd1aacb5, match 581f2766, status MakerSwapCast, side Taker
--- FAIL: TestTrading (131.39s)
    --- FAIL: TestTrading/success (127.11s)
        trade_simnet_test.go:204: client 2 reported 1 incomplete trades for order dd1aacb5 after 2m0s
FAIL
exit status 1
FAIL	decred.org/dcrdex/client/core	131.443s
server logs
2020-08-11 13:17:37.990 [DBG] COMM: New websocket client 127.0.0.1                  
2020-08-11 13:17:37.990 [TRC] COMM: Starting websocket messaging with peer 127.0.0.1                                                                                                                                                          
2020-08-11 13:17:37.993 [INF] AUTH: Created new user account 80170cad3b8d6521fd2b5348ebfff358ef8752d70a1c70691f4337c29d0c6b55 with fee address SsoFtubsqCf57ZVqBkbzBSJZZ3XFnEPynWS
2020-08-11 13:17:38.101 [DBG] ASSET[dcr]: Run: Processing new block 000da987173c764d52a7a477eefcb4aff6c54eab00b169374cab6dba970bbbad
2020-08-11 13:17:38.101 [DBG] ASSET[dcr]: Notifying 1 dcr asset consumers of new block at height 195
2020-08-11 13:17:38.829 [INF] AUTH: New user registered: acct 80170cad3b8d6521fd2b5348ebfff358ef8752d70a1c70691f4337c29d0c6b55, paid 100000000 to SsoFtubsqCf57ZVqBkbzBSJZZ3XFnEPynWS
2020-08-11 13:17:38.832 [DBG] AUTH: User 80170cad3b8d6521fd2b5348ebfff358ef8752d70a1c70691f4337c29d0c6b55 connected from 127.0.0.1 with 0 pending requests and 0 pending responses/notifications.
2020-08-11 13:17:39.102 [DBG] ASSET[dcr]: Run: Processing new block 000a7c46072667f263ede5dd350d0ed69c53693fc0466729d9d71d9d94717403
2020-08-11 13:17:39.102 [DBG] ASSET[dcr]: Notifying 1 dcr asset consumers of new block at height 196
2020-08-11 13:17:40.045 [DBG] COMM: New websocket client 127.0.0.1         
2020-08-11 13:17:40.045 [TRC] COMM: Starting websocket messaging with peer 127.0.0.1
2020-08-11 13:17:40.045 [INF] COMM: Sending 0 queued outgoing messages for 127.0.0.1.
2020-08-11 13:17:40.045 [DBG] COMM: Sent 1 and dropped 0 messages to 127.0.0.1 before shutdown.
2020-08-11 13:17:40.045 [TRC] COMM: Websocket output handler done for peer 127.0.0.1
2020-08-11 13:17:40.045 [DBG] COMM: Sending close 1000 (normal) message.
2020-08-11 13:17:40.045 [TRC] COMM: Disconnected websocket client 127.0.0.1
2020-08-11 13:17:40.128 [DBG] COMM: New websocket client 127.0.0.1       
2020-08-11 13:17:40.128 [TRC] COMM: Starting websocket messaging with peer 127.0.0.1
2020-08-11 13:17:40.130 [INF] AUTH: Created new user account e2f3c6e031c00560c3d2d78eec9e000b71c1519084b186285a9d5280775eb64a with fee address SssfTGcL3Njjum26QVcYeAq7AA2SNNNZSut
2020-08-11 13:17:40.901 [INF] AUTH: New user registered: acct e2f3c6e031c00560c3d2d78eec9e000b71c1519084b186285a9d5280775eb64a, paid 100000000 to SssfTGcL3Njjum26QVcYeAq7AA2SNNNZSut
2020-08-11 13:17:40.904 [DBG] AUTH: User e2f3c6e031c00560c3d2d78eec9e000b71c1519084b186285a9d5280775eb64a connected from 127.0.0.1 with 0 pending requests and 0 pending responses/notifications.
2020-08-11 13:17:41.102 [DBG] ASSET[dcr]: Notifying 1 dcr asset consumers of new block at height 198
2020-08-11 13:17:41.971 [TRC] MKT: Received order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf at 2020-08-11 04:17:41.971 +0000 UTC
2020-08-11 13:17:42.000 [TRC] MKT: Preimage request sent for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:42.000 [TRC] MKT: Good preimage received for order 4c2ea27340a2ac48b341d61a5f1b0e563262abf827aea0ecacb2a73db33bd7cf: 52c8b9fe2a31d4ae4359938ceba97acbacc6819491fd3844f535c811d70ebfc0
2020-08-11 13:17:42.001 [INF] MKT: Collected 1 valid order preimages, missed 0. Commit checksum: 8e165440bde1d213c09f4b5e7a1a36871ffb848662e15979ff5a1eb7b45bce35
2020-08-11 13:17:42.001 [INF] MKT: Matching complete for market dcr_btc epoch 266186576: 0 matches (0 partial fills), 0 completed OK (not booked), 1 booked, 0 unbooked, 0 failed
2020-08-11 13:17:42.090 [TRC] MKT: Received order dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be at 2020-08-11 04:17:42.09 +0000 UTC
2020-08-11 13:17:48.000 [TRC] MKT: Preimage request sent for order dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be
2020-08-11 13:17:48.001 [TRC] MKT: Good preimage received for order dd1aacb599584b9bcdbcce4560aa61ee0c9a58e4cbeb19c1194538ae97e733be: 5280428451326303a8f6595d779242eaf699a0519ed0ab7f2f682e68a2a71e75
2020-08-11 13:17:48.003 [INF] MKT: Collected 1 valid order preimages, missed 0. Commit checksum: 540049012bef1071e7068ef3b263f7e2d391ebf34880ed15ee4bba022cc7710d
2020-08-11 13:17:48.003 [INF] MKT: Matching complete for market dcr_btc epoch 266186577: 1 matches (0 partial fills), 1 completed OK (not booked), 0 booked, 1 unbooked, 0 failed
2020-08-11 13:17:48.008 [DBG] MKT: Negotiating 1 matches for epoch 266186577:6000
2020-08-11 13:17:48.008 [WRN] SWAP: Unable to determining optimal fee rate for "dcr", using fallback of 10. Err: -32603: no bucket with the minimum required success percentage found
2020-08-11 13:17:48.013 [DBG] SWAP: Optimal fee rate for "btc": 2
2020-08-11 13:17:48.014 [DBG] SWAP: Negotiate: sending 'match' ack request to user 80170cad3b8d6521fd2b5348ebfff358ef8752d70a1c70691f4337c29d0c6b55 for 1 matches
2020-08-11 13:17:48.014 [DBG] SWAP: Negotiate: sending 'match' ack request to user e2f3c6e031c00560c3d2d78eec9e000b71c1519084b186285a9d5280775eb64a for 1 matches
2020-08-11 13:17:48.015 [DBG] SWAP: processMatchAcks: 'match' ack received from 80170cad3b8d6521fd2b5348ebfff358ef8752d70a1c70691f4337c29d0c6b55 for 1 matches
2020-08-11 13:17:48.016 [DBG] SWAP: processMatchAcks: storing valid 'match' ack signature from 80170cad3b8d6521fd2b5348ebfff358ef8752d70a1c70691f4337c29d0c6b55 (maker=true) for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20c
fba7c397a (status NewlyMatched)
2020-08-11 13:17:48.016 [DBG] SWAP: processMatchAcks: 'match' ack received from e2f3c6e031c00560c3d2d78eec9e000b71c1519084b186285a9d5280775eb64a for 1 matches
2020-08-11 13:17:48.017 [DBG] SWAP: processMatchAcks: storing valid 'match' ack signature from e2f3c6e031c00560c3d2d78eec9e000b71c1519084b186285a9d5280775eb64a (maker=false) for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20
cfba7c397a (status NewlyMatched)
2020-08-11 13:17:48.283 [DBG] SWAP: handleInit: 'init' received from 80170cad3b8d6521fd2b5348ebfff358ef8752d70a1c70691f4337c29d0c6b55 for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a, order 4c2ea27340a2ac48b341d6
1a5f1b0e563262abf827aea0ecacb2a73db33bd7cf
2020-08-11 13:17:48.283 [DBG] SWAP: step(user=80170cad3b8d6521fd2b5348ebfff358ef8752d70a1c70691f4337c29d0c6b55, match=28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c397a): ready for user e2f3c6e031c00560c3d2d78eec9e000b71c151
9084b186285a9d5280775eb64a action, status NewlyMatched, next MakerSwapCast
2020-08-11 13:17:48.285 [DBG] SWAP: processInit: valid contract received at 2020-08-11 04:17:48.284 +0000 UTC from 80170cad3b8d6521fd2b5348ebfff358ef8752d70a1c70691f4337c29d0c6b55 for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b
4cae20cfba7c397a, swapStatus NewlyMatched => MakerSwapCast
2020-08-11 13:17:48.285 [DBG] SWAP: processInit: sending contract 'audit' ack request to counterparty e2f3c6e031c00560c3d2d78eec9e000b71c1519084b186285a9d5280775eb64a for match 28e2ea724486e7c3ef46f78028bb945c96326e36669dd88b4cae20cfba7c3
97a
2020-08-11 13:17:49.102 [DBG] ASSET[dcr]: Run: Processing new block 00049e951b7df7089916a0384a9dc9d1e06f01aab589caa14099d8091c60a6bf
2020-08-11 13:17:49.102 [DBG] ASSET[dcr]: Notifying 1 dcr asset consumers of new block at height 199
2020-08-11 13:18:31.991 [TRC] COMM: got pong from 127.0.0.1:46980
2020-08-11 13:18:34.128 [TRC] COMM: got pong from 127.0.0.1:47012
2020-08-11 13:19:25.991 [TRC] COMM: got pong from 127.0.0.1:46980
2020-08-11 13:19:28.128 [TRC] COMM: got pong from 127.0.0.1:47012
2020-08-11 13:19:48.021 [ERR] COMM: Websocket receive error from peer 127.0.0.1: websocket: close 1006 (abnormal closure): unexpected EOF
2020-08-11 13:19:48.021 [TRC] COMM: Websocket output handler done for peer 127.0.0.1
2020-08-11 13:19:48.021 [ERR] COMM: Websocket receive error from peer 127.0.0.1: websocket: close 1006 (abnormal closure): unexpected EOF
2020-08-11 13:19:48.021 [INF] COMM: Sending 0 queued outgoing messages for 127.0.0.1.
2020-08-11 13:19:48.021 [DBG] COMM: Sent 8 and dropped 0 messages to 127.0.0.1 before shutdown.
2020-08-11 13:19:48.021 [INF] COMM: Sending 0 queued outgoing messages for 127.0.0.1.
2020-08-11 13:19:48.022 [DBG] COMM: Sent 9 and dropped 0 messages to 127.0.0.1 before shutdown.
2020-08-11 13:19:48.022 [DBG] COMM: Sending close 1000 (normal) message.
2020-08-11 13:19:48.022 [DBG] COMM: Sending close 1000 (normal) message.
2020-08-11 13:19:48.021 [TRC] COMM: Websocket output handler done for peer 127.0.0.1
2020-08-11 13:19:48.022 [TRC] COMM: Disconnected websocket client 127.0.0.1
2020-08-11 13:19:48.022 [TRC] COMM: Disconnected websocket client 127.0.0.1

Copy link
Copy Markdown
Member

@buck54321 buck54321 left a comment

Choose a reason for hiding this comment

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

Sorry for not checking in #533. These changes look good, but I did run into a nil pointer at

tracker, _, _ := client.dc().findOrder(oid)
tracker.mtx.RLock()

logs

2020-08-11 15:15:12.842 [INF] TEST: [client 1] NOW =====> MatchComplete
2020-08-11 15:15:12.842 [INF] TEST: [client 1] updated btc balance diff with +0.001800
2020-08-11 15:15:12.849 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 15:15:13.028 [INF] TEST: [client 2] NOW =====> MatchComplete
2020-08-11 15:15:13.031 [INF] TEST: [client 2] Mined 1 blocks for Taker's redeem, match 917e0b54
2020-08-11 15:15:13.623 [TRC] CORE: processing tip change for btc
2020-08-11 15:15:13.776 [DBG] CORE: Ticking 1 trades
2020-08-11 15:15:13.776 [INF] CORE: Retiring inactive order 827657d470c58f2ffb6c5c2c09a535112029a28edcc5b0bd14e6c4235f36b884
2020-08-11 15:15:13.964 [TRC] CORE: processing tip change for btc
2020-08-11 15:15:14.031 [INF] TEST: [client 1] updating balances
2020-08-11 15:15:14.039 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 15:15:14.039 [INF] TEST: [client 1] dcr available 70.999947, locked 3.000000
2020-08-11 15:15:14.047 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 15:15:14.047 [INF] TEST: [client 1] btc available 84.001477, locked 0.000000
2020-08-11 15:15:14.047 [INF] TEST: [client 1] dcr balance change -12.00002490 is in expected range of -13.00000000 - -12.00000000
2020-08-11 15:15:14.047 [INF] TEST: [client 1] btc balance change 0.00147700 is in expected range of -0.99820000 - 0.00180000
2020-08-11 15:15:14.047 [INF] TEST: [client 2] updating balances
2020-08-11 15:15:14.053 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 15:15:14.053 [INF] TEST: [client 2] dcr available 94.999934, locked 3.000000
2020-08-11 15:15:14.060 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-11 15:15:14.060 [INF] TEST: [client 2] btc available 83.998195, locked 0.000000
2020-08-11 15:15:14.060 [INF] TEST: [client 2] btc balance change -0.00180492 is in expected range of -1.00180000 - -0.00180000
2020-08-11 15:15:14.060 [INF] TEST: [client 2] dcr balance change 11.99996150 is in expected range of 11.00000000 - 12.00000000
2020-08-11 15:15:14.060 [INF] TEST: [client 2] checking if refunds are necessary
2020-08-11 15:15:14.060 [INF] TEST: [client 1] checking if refunds are necessary
panic: runtime error: invalid memory address or nil pointer dereference

goroutine 3700 [running]:
sync.(*RWMutex).RLock(...)
	/usr/local/go/src/sync/rwmutex.go:48
decred.org/dcrdex/client/core.checkAndWaitForRefunds(0xbdfc80, 0xc001c53b40, 0xf22d20, 0xc001236500, 0x40, 0xc0007fbfa8, 0x5d579e)
	/home/buck/programs/dcrdex/client/core/trade_simnet_test.go:501 +0x277

daemon string
account string // for dcr wallets
walletName string // for btc wallets
pass []byte
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After to the changes in #587 (merged today), the wallet password could actually be a constant = "abc".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thinking of leaving it variable for now, should differing wallet passes become a thing again sometime; more so as wallet passes really should be wallet-specific even though the value might be the same across wallets.

Comment thread client/core/trade_simnet_test.go
@itswisdomagain
Copy link
Copy Markdown
Member Author

itswisdomagain commented Aug 13, 2020

@JoeGruffins It appears the issue with your failing tests has to do with Maker's swap not getting the required confirms for taker to broadcast the counterswap. I've seen this before but not sure what the cause really is. There is a test log entry after Maker's swap was broadcasted that shows that a block was mined to confirm the Maker's swap: [client 2] Mined 1 blocks for Maker's swap, match 28e2ea72.

I'm guessing this might be related to the issue @chappjc reported earlier re needing to mine an extra block to get the node to include the fee payment txns. If so, mining +1 blocks should get the tests passing for you, but something to try first is restarting your asset harnesses (if they've been running for a while before you ran the tests).

UPDATE:
I've rebased over master to take advantage of the mining fixes introduced in #604. That should get tests passing for you @chappjc.

@itswisdomagain itswisdomagain force-pushed the fix-trade-simnet-tests branch from d2c2f0a to 7430a2e Compare August 14, 2020 10:19
@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 14, 2020

Much closer now that it's on the mining fix commit. But I got one of the unsigned txn errors for the first time.

2020-08-14 11:49:06.260 [ERR] CORE[dcr]: incomplete raw transaction signatures (raw tx: 0100000001c23921e8d014e20998c350fffcd2207cee35e9f01bbb94f7d4210a714fdc0f230000000000ffffffff0100ca9a3b00000000000017a914e2b69c4ea4aaa4ead1f39fba873b14ff7b2001f987000000000000000001f67c86470000000000000000ffffffff00): 
2020-08-14 11:49:06.260 [ERR] CORE: notify: |ERROR| (order) Swap error - Error encountered sending a swap output(s) worth 10.00000000 dcr on order 7240c64e - Order: 7240c64ea539c883eea955692d860419ddc3cdf92848395786171e1385ccf58c
2020-08-14 11:49:06.260 [ERR] CORE: route 'match' request handler error: runMatches - {tick of order 7240c64ea539c883eea955692d860419ddc3cdf92848395786171e1385ccf58c failed: 127.0.0.1:17273 tick: {swapMatches order 7240c64ea539c883eea955692d860419ddc3cdf92848395786171e1385ccf58c - {error sending swap transaction: incomplete raw tx signatures}}}

Sadly, I wasn't rebased on #590 so I didn't get details from walletjson.SignRawTransactionResult.Errors. Gonna get on that and try again.

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 14, 2020

Oh, does this need a fix up now that #548 is merged? I'm seeing:

2020-08-14 11:54:51.514 [INF] TEST: [client 1] btc available 84.001784, locked 0.001784
2020-08-14 11:54:51.515 [INF] TEST: [client 1] dcr balance change 0.00000000 is in expected range of 0.00000000 - 0.00000000
    trade_simnet_test.go:224: client 1 balance check error: btc balance change not in expected range 0.00000000 - 0.00000000, got 0.00178385

Another issue is I'm seeing [ERR] CORE: blocking notification channel. It's seems your test rig needs to be receiving on the feed it got from NotificationFeed()?

@chappjc

This comment has been minimized.

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 14, 2020

Sorry about that last comment about the coin locked error, it was just the dcrdex server harness not reset. However, I hit the balance error again, so I expect it's just because the balance fixes from #548 went in.

2020-08-14 12:04:49.269 [INF] TEST: [client 1] btc available 84.005348, locked 0.000000
2020-08-14 12:04:49.269 [INF] TEST: [client 1] dcr balance change -5.00002500 is in expected range of -6.00000000 - -5.00000000
    trade_simnet_test.go:236: client 1 balance check error: btc balance change not in expected range 0.00000000 - 0.00000000, got 0.00178062
--- FAIL: TestTrading (16.19s)
    --- FAIL: TestTrading/no_maker_redeem (11.98s)

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 14, 2020

Captured the signrawtransaction error (which did not fail the test btw for some reason).

2020-08-14 12:14:36.262 [ERR] CORE[dcr]: Signing d7ab942d85d6021fa45ca7e2e3276900d695577a3ebf1885944c50aeb98f1ae2:0, seq = 4294967295, sigScript = , failed: wallet.SignTransaction: wallet locked
2020-08-14 12:14:36.262 [ERR] CORE[dcr]: incomplete raw transaction signatures (input tx: 0100000001e21a8fb9ae504c948518bf3e7a5795d6006927e3e2a75ca41f02d6852d94abd70000000000ffffffff0100ca9a3b00000000000017a9143c388051675dbf0583d5f554bdc9c5acc175430787000000000000000001f67c86470000000000000000ffffffff00 / incomplete signed tx: 0100000001e21a8fb9ae504c948518bf3e7a5795d6006927e3e2a75ca41f02d6852d94abd70000000000ffffffff0100ca9a3b00000000000017a9143c388051675dbf0583d5f554bdc9c5acc175430787000000000000000001f67c86470000000000000000ffffffff00): 

wallet.SignTransaction: wallet locked hmm...
Was that part of the test? It didn't FAIL the test it was running because of it.

@itswisdomagain
Copy link
Copy Markdown
Member Author

wallet.SignTransaction: wallet locked hmm...
Was that part of the test? It didn't FAIL the test it was running because of it.

Yeah, wallets are sometimes locked during the test to prevent sending swaps.

if finalStatus == order.NewlyMatched {
// Lock wallets to prevent Maker from sending swap as soon as the orders are matched.
for _, client := range clients {
if err = client.lockWallets(); err != nil {
return fmt.Errorf("client %d lock wallet error: %v", client.id, err)
}
}
}

@itswisdomagain itswisdomagain force-pushed the fix-trade-simnet-tests branch from 7430a2e to 9976921 Compare August 15, 2020 11:10
Comment on lines 422 to 442
switch {
case side == order.Maker && status == order.MakerSwapCast,
side == order.Taker && status == order.TakerSwapCast:
assetToMine, swapOrRedeem = tracker.wallets.fromAsset, "swap"
// Record expected balance changes if we've just sent a swap.
// Do NOT mine blocks until counter-party captures status change.
recordBalanceChanges(tracker.wallets.fromAsset.ID, true, match.Match.Quantity, match.Match.Rate)

case side == order.Maker && status == order.TakerSwapCast,
side == order.Taker && status == order.MakerSwapCast:
// Mine block for counter-party's swap. This enables us to
// proceed with the required follow-up action.
// Our toAsset == counter-party's fromAsset.
assetToMine, swapOrRedeem = tracker.wallets.toAsset, "swap"

case side == order.Maker && status == order.MakerRedeemed,
side == order.Taker && status == order.MatchComplete:
recordBalanceChanges(tracker.wallets.toAsset.ID, false, match.Match.Quantity, match.Match.Rate)
// Mine blocks for redemption since counter-party does not wait
// for redeem tx confirmations before performing follow-up action.
assetToMine, swapOrRedeem = tracker.wallets.toAsset, "redeem"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Relating to the conversation here #589 (comment).

A previous commit moved swap, redeem tx mining to the counter-party's trade monitoring goroutine. That ensured that party A's swap or redeem is only mined after party B's trade monitoring goroutine has had the chance to handle the status change. In cases where party B should not follow up, we set trade.failErr on party B's trade before mining party A's tx.

As mentioned in the referenced conversation, the exception to the above approach is Taker redeeming Maker's swap without needing to wait for Maker's redeem to get any confs. This sometimes results in Taker redeeming Maker's swap as soon as it is notified of Maker's redeem, and BEFORE Taker's trade monitoring goroutine captures the MakerRedeemed status and mines Maker's redeem tx. In one instance where this happened, Maker's balance did not reflect the income from redeem and caused the test to fail with a balance check error.

Redemption txs are now mined immediately by the issuing party since the counter-party may not wait for the redeem tx to get confirmed before performing their counter-redeem and end up not mining the initial redeem.

I think this needs some more fleshing out but this approach makes sense and works well for now. Delay swap mining to enable counter-party check if they should act or not, while mining redeems right away as a wait doesn't really help no one.

Copy link
Copy Markdown
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

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

Result from five tests:

results
  1. Pass

2020-08-17 10:34:25.711 [DBG] CORE[btc]: funding 180000 Satoshis order with coins [9f3cc0d8a1838d01af91af658967175698a1cf456e8149ed7c6d8157b412313d:1]
--- FAIL: TestTrading (5.61s)
    --- FAIL: TestTrading/success (1.15s)
        trade_simnet_test.go:203: client2 place buy order error: rpc error: error code 36: coin {txid = 9f3cc0d8a1838d01af91af658967175698a1cf456e8149ed7c6d8157b412313d, vout = 1} is locked
FAIL

restart server
3. Pass

restart server
4. Pass

restart server
5.

--- FAIL: TestTrading (164.73s)
    --- FAIL: TestTrading/no_maker_swap (1.58s)
        trade_simnet_test.go:213: client 2 re-connect DEX error: error paying registration fee: incomplete raw tx signatures
FAIL
exit status 1
FAIL    decred.org/dcrdex/client/core   164.820s

More logs for the second failure:

test logs
2020-08-17 10:46:25.772 [INF] TEST: Trades ended at MatchComplete.

2020-08-17 10:46:25.772 [INF] TEST: [client 1] unlocking wallets
2020-08-17 10:46:26.286 [INF] TEST: [client 1] reconnecting DEX for at fault client
2020-08-17 10:46:26.286 [DBG] COMMS: Sending close 1000 (normal) message.
2020-08-17 10:46:26.287 [WRN] CORE: notify: |WARNING| (conn) DEX disconnected - DEX at 127.0.0.1:17273 has disconnected
2020-08-17 10:46:26.287 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.287 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.287 [DBG] CORE: Connection closed for 127.0.0.1:17273.
2020-08-17 10:46:26.318 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-17 10:46:26.318 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.318 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.318 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-17 10:46:26.318 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-17 10:46:26.318 [DBG] COMMS: Sending close 1000 (normal) message.
2020-08-17 10:46:26.318 [DBG] CORE: Connection closed for 127.0.0.1:17273.
2020-08-17 10:46:26.318 [WRN] CORE: notify: |WARNING| (conn) DEX disconnected - DEX at 127.0.0.1:17273 has disconnected
2020-08-17 10:46:26.318 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.318 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.388 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-17 10:46:26.388 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.388 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.388 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-17 10:46:26.388 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-17 10:46:26.393 [INF] CORE: Attempting registration fee payment for SscdPSSrBhdBDzRfS7Dz2pgdRj1v6s9UJxd of 100000000 units of dcr
2020-08-17 10:46:26.394 [WRN] CORE[dcr]: Unable to get optimal fee rate, using fallback of 20: -32603: no bucket with the minimum required success percentage found
2020-08-17 10:46:26.398 [DBG] CORE[dcr]: Change output size = 36, addr = Ssr3vkTJWJvT8k7abBPhYhmVzz5KWgAJTQx
2020-08-17 10:46:26.403 [DBG] CORE[dcr]: 4 signature cycles to converge on fees for tx 3e49978825c7523888639c8282b73db524cc3ec1360df636cebee03c324b01a1: min rate = 20, actual fee rate = 20 (5040 for 251 bytes), change = true
2020-08-17 10:46:26.405 [ERR] CORE: error saving account: failed to create account bucket
2020-08-17 10:46:26.407 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-17 10:46:26.407 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.407 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.407 [INF] CORE: notify: |SUCCESS| (feepayment) Fee payment in progress - Waiting for 1 confirmations before trading at 127.0.0.1:17273
2020-08-17 10:46:26.407 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.407 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.407 [INF] TEST: [client 1] connected DEX 127.0.0.1:17273
2020-08-17 10:46:26.416 [INF] TEST: [client 1] mined 1 dcr blocks for fee payment confirmation
2020-08-17 10:46:26.416 [INF] TEST: [client 1] waiting 12s for fee confirmation notice
2020-08-17 10:46:26.727 [TRC] CORE: processing tip change for dcr
2020-08-17 10:46:26.728 [DBG] CORE: Registration fee txn 3e49978825c7523888639c8282b73db524cc3ec1360df636cebee03c324b01a1:0 now has 1 confirmations.
2020-08-17 10:46:26.728 [INF] CORE: Notifying dex 127.0.0.1:17273 of fee payment.
2020-08-17 10:46:26.737 [DBG] CORE: Authenticated connection to 127.0.0.1:17273, 0 active matches
2020-08-17 10:46:26.737 [INF] CORE: notify: |SUCCESS| (feepayment) Account registered - You may now trade at 127.0.0.1:17273
2020-08-17 10:46:26.737 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.737 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.737 [INF] TEST: [client 1] fee payment confirmed
2020-08-17 10:46:26.737 [INF] TEST: [client 1] updating balances
2020-08-17 10:46:26.738 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-17 10:46:26.738 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.738 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.738 [INF] TEST: [client 1] dcr available 10.998856, locked 12.999975
2020-08-17 10:46:26.741 [TRC] CORE: notify: |DATA| (balance) balance updated
2020-08-17 10:46:26.741 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.741 [ERR] CORE: blocking notification channel
2020-08-17 10:46:26.741 [INF] TEST: [client 1] btc available 84.005908, locked 0.000000
2020-08-17 10:46:26.741 [INF] TEST: [client 2] unlocking wallets
2020-08-17 10:46:26.815 [TRC] CORE: processing tip change for dcr
2020-08-17 10:46:27.254 [INF] TEST: [client 2] reconnecting DEX for at fault client
2020-08-17 10:46:27.255 [DBG] COMMS: Sending close 1000 (normal) message.
2020-08-17 10:46:27.255 [WRN] CORE: notify: |WARNING| (conn) DEX disconnected - DEX at 127.0.0.1:17273 has disconnected
2020-08-17 10:46:27.255 [ERR] CORE: blocking notification channel
2020-08-17 10:46:27.255 [DBG] CORE: Connection closed for 127.0.0.1:17273.
2020-08-17 10:46:27.281 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-17 10:46:27.281 [ERR] CORE: blocking notification channel
2020-08-17 10:46:27.281 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-17 10:46:27.281 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-17 10:46:27.281 [DBG] COMMS: Sending close 1000 (normal) message.
2020-08-17 10:46:27.282 [DBG] CORE: Connection closed for 127.0.0.1:17273.
2020-08-17 10:46:27.285 [WRN] CORE: notify: |WARNING| (conn) DEX disconnected - DEX at 127.0.0.1:17273 has disconnected
2020-08-17 10:46:27.285 [ERR] CORE: blocking notification channel
2020-08-17 10:46:27.340 [INF] CORE: notify: |SUCCESS| (conn) DEX connected - DEX at 127.0.0.1:17273 has connected
2020-08-17 10:46:27.340 [ERR] CORE: blocking notification channel
2020-08-17 10:46:27.341 [DBG] CORE: Broadcast timeout = 1m0s, ticking every 20s
2020-08-17 10:46:27.341 [INF] CORE: Connected to DEX server at 127.0.0.1:17273 and listening for messages.
2020-08-17 10:46:27.343 [INF] CORE: Attempting registration fee payment for SsdUPBW84hgJFJZzMfhtvvNzAW991FgVP99 of 100000000 units of dcr
2020-08-17 10:46:27.344 [WRN] CORE[dcr]: Unable to get optimal fee rate, using fallback of 20: -32603: no bucket with the minimum required success percentage found
2020-08-17 10:46:27.348 [ERR] CORE[dcr]: incomplete raw transaction signatures (raw tx: 01000000015116f082624a51ef469c2ee4e10d4e70567773f4662879e1f3d98e6458ff9e440100000000ffffffff0100e1f5050000000000001976a914641176b296190766b3176a9572f2c01e0912917888ac000000000000000001b85feb0b0000000000000000ffffffff00): 
2020-08-17 10:46:27.348 [DBG] COMMS: Sending close 1000 (normal) message.
2020-08-17 10:46:27.348 [WRN] CORE: notify: |WARNING| (conn) DEX disconnected - DEX at 127.0.0.1:17273 has disconnected
2020-08-17 10:46:27.348 [ERR] CORE: blocking notification channel
--- FAIL: TestTrading (164.73s)
    --- FAIL: TestTrading/no_maker_swap (1.58s)
        trade_simnet_test.go:213: client 2 re-connect DEX error: error paying registration fee: incomplete raw tx signatures
FAIL
exit status 1
FAIL    decred.org/dcrdex/client/core   164.820s
server
2020-08-17 10:46:25.457 [DBG] ASSET[btc]: Notifying 1 btc asset consumers of new block at height 270
2020-08-17 10:46:25.461 [DBG] SWAP: Deleting completed match f250c34921a3dd25d9de2a82e6b411a0ec8d241791ef59785571f3079ce698a9
2020-08-17 10:46:26.287 [TRC] COMM: Websocket output handler done for peer 127.0.0.1
2020-08-17 10:46:26.287 [INF] COMM: Sending 0 queued outgoing messages for 127.0.0.1.
2020-08-17 10:46:26.287 [DBG] COMM: Sent 11 and dropped 0 messages to 127.0.0.1 before shutdown.
2020-08-17 10:46:26.287 [DBG] COMM: Sending close 1000 (normal) message.
2020-08-17 10:46:26.287 [TRC] COMM: Disconnected websocket client 127.0.0.1
2020-08-17 10:46:26.317 [DBG] COMM: New websocket client 127.0.0.1
2020-08-17 10:46:26.317 [TRC] COMM: Starting websocket messaging with peer 127.0.0.1
2020-08-17 10:46:26.318 [TRC] COMM: Websocket output handler done for peer 127.0.0.1
2020-08-17 10:46:26.318 [INF] COMM: Sending 0 queued outgoing messages for 127.0.0.1.
2020-08-17 10:46:26.318 [DBG] COMM: Sent 1 and dropped 0 messages to 127.0.0.1 before shutdown.
2020-08-17 10:46:26.318 [DBG] COMM: Sending close 1000 (normal) message.
2020-08-17 10:46:26.318 [TRC] COMM: Disconnected websocket client 127.0.0.1
2020-08-17 10:46:26.387 [DBG] COMM: New websocket client 127.0.0.1
2020-08-17 10:46:26.388 [TRC] COMM: Starting websocket messaging with peer 127.0.0.1
2020-08-17 10:46:26.392 [INF] AUTH: Created new user account 9d13acb95569b9fc7124af8bfb3ef5a36ccbf4f1479c32022a358cb12fb5c27f with fee address SscdPSSrBhdBDzRfS7Dz2pgdRj1v6s9UJxd
2020-08-17 10:46:26.732 [INF] AUTH: New user registered: acct 9d13acb95569b9fc7124af8bfb3ef5a36ccbf4f1479c32022a358cb12fb5c27f, paid 100000000 to SscdPSSrBhdBDzRfS7Dz2pgdRj1v6s9UJxd
2020-08-17 10:46:26.738 [DBG] AUTH: User 9d13acb95569b9fc7124af8bfb3ef5a36ccbf4f1479c32022a358cb12fb5c27f connected from 127.0.0.1 with 0 pending requests and 0 pending responses/notifications.
2020-08-17 10:46:27.255 [TRC] COMM: Websocket output handler done for peer 127.0.0.1
2020-08-17 10:46:27.255 [INF] COMM: Sending 0 queued outgoing messages for 127.0.0.1.
2020-08-17 10:46:27.255 [DBG] COMM: Sent 11 and dropped 0 messages to 127.0.0.1 before shutdown.
2020-08-17 10:46:27.255 [DBG] COMM: Sending close 1000 (normal) message.
2020-08-17 10:46:27.255 [TRC] COMM: Disconnected websocket client 127.0.0.1
2020-08-17 10:46:27.281 [DBG] COMM: New websocket client 127.0.0.1
2020-08-17 10:46:27.281 [TRC] COMM: Starting websocket messaging with peer 127.0.0.1
2020-08-17 10:46:27.281 [TRC] COMM: Websocket output handler done for peer 127.0.0.1
2020-08-17 10:46:27.282 [INF] COMM: Sending 0 queued outgoing messages for 127.0.0.1.
2020-08-17 10:46:27.282 [DBG] COMM: Sent 1 and dropped 0 messages to 127.0.0.1 before shutdown.
2020-08-17 10:46:27.282 [DBG] COMM: Sending close 1000 (normal) message.
2020-08-17 10:46:27.282 [TRC] COMM: Disconnected websocket client 127.0.0.1
2020-08-17 10:46:27.340 [DBG] COMM: New websocket client 127.0.0.1
2020-08-17 10:46:27.340 [TRC] COMM: Starting websocket messaging with peer 127.0.0.1
2020-08-17 10:46:27.343 [INF] AUTH: Created new user account 411246f10d237b2600afc7a0e1f468ac72bd9a9188fc2a9da6b81bcc3e2f0285 with fee address SsdUPBW84hgJFJZzMfhtvvNzAW991FgVP99
2020-08-17 10:46:27.348 [TRC] COMM: Websocket output handler done for peer 127.0.0.1
2020-08-17 10:46:27.348 [INF] COMM: Sending 0 queued outgoing messages for 127.0.0.1.
2020-08-17 10:46:27.348 [DBG] COMM: Sent 2 and dropped 0 messages to 127.0.0.1 before shutdown.
2020-08-17 10:46:27.348 [DBG] COMM: Sending close 1000 (normal) message.
2020-08-17 10:46:27.348 [TRC] COMM: Disconnected websocket client 127.0.0.1
2020-08-17 10:46:27.364 [ERR] COMM: Websocket receive error from peer 127.0.0.1: websocket: close 1006 (abnormal closure): unexpected EOF
2020-08-17 10:46:27.364 [TRC] COMM: Websocket output handler done for peer 127.0.0.1
2020-08-17 10:46:27.364 [INF] COMM: Sending 0 queued outgoing messages for 127.0.0.1.
2020-08-17 10:46:27.364 [DBG] COMM: Sent 4 and dropped 0 messages to 127.0.0.1 before shutdown.
2020-08-17 10:46:27.364 [DBG] COMM: Sending close 1000 (normal) message.
2020-08-17 10:46:27.364 [TRC] COMM: Disconnected websocket client 127.0.0.1
2020-08-17 10:46:27.510 [DBG] ASSET[dcr]: Notifying 1 dcr asset consumers of new block at height 266
2020-08-17 10:46:31.462 [INF] SWAP: revoke_match request failed for user 94f71bfc8bac48c04a38d31ed1f1272a66df01b80e6e678627be5f43a1d6b591 (taker)
2020-08-17 10:46:37.468 [INF] SWAP: revoke_match request failed for user 94f71bfc8bac48c04a38d31ed1f1272a66df01b80e6e678627be5f43a1d6b591 (taker)
2020-08-17 10:46:37.468 [INF] SWAP: revoke_match request failed for user c7cdd268810909fa724a54b692b44b2b7d8b9a7fd7cb0f46a50636423855379a (taker)

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 17, 2020

Those locked coin errors are expected with no server reinit (pg db wipe), but I think the "incomplete raw tx signatures", which we've determined seems to always be "wallet locked" in these tests is interesting. Do the beginning of the tests need to proactively unlock just in case the test starts with a locked wallet?

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 17, 2020

This PR's test are passing for me now with the recent changes. I also tested it with the updated harnesses in #607, which are needed for dcrwallet master as of today. However:

  • I don't think this test can be reliably run back-to-back as available balances change and I think initial wallet lock states can be messed up. If that's expected, let's document that.
  • Seeing the following error in the logs bothers me: [ERR] CORE: blocking notification channel. If that's expected, why?

@itswisdomagain
Copy link
Copy Markdown
Member Author

Those locked coin errors are expected with no server reinit (pg db wipe)

irrc, the server unlocks those coins after the trade completes successfully or fails, so nuking the db and restarting the server shouldn't be a necessity. Except when running tests back to back, coins locked by the server in a previous test might still be locked because the server hasn't revoked the failed trades yet. How long should it take for a trade with no action from maker/taker to get revoked btw?

Do the beginning of the tests need to proactively unlock just in case the test starts with a locked wallet?

Before placing orders for any of the trade tests, the wallets are all unlocked. The only time the wallets are locked is when a test requires a trade to end at NewlyMatched. The next test begins again by unlocking the wallets before placing orders.

// Unlock wallets to place orders.
// Also update starting balances for wallets to enable accurate
// balance change assertion after the test completes.
for _, client := range clients {
if err := client.unlockWallets(); err != nil {
return fmt.Errorf("client %d unlock wallet error: %v", client.id, err)
}
if client.atFault {
client.log("reconnecting DEX for at fault client")
err := client.connectDEX(context.Background())
if err != nil {
return fmt.Errorf("client %d re-connect DEX error: %v", client.id, err)
}
}
if err := client.updateBalances(); err != nil {
return fmt.Errorf("client %d balance update error: %v", client.id, err)
}
}
c1OrderID, err := client1.placeOrder(qty, rate)
if err != nil {
return fmt.Errorf("client1 place %s order error: %v", sellString(client1.isSeller), err)
}
c2OrderID, err := client2.placeOrder(qty, rate)
if err != nil {
return fmt.Errorf("client2 place %s order error: %v", sellString(client2.isSeller), err)
}
if finalStatus == order.NewlyMatched {
// Lock wallets to prevent Maker from sending swap as soon as the orders are matched.
for _, client := range clients {
if err = client.lockWallets(); err != nil {
return fmt.Errorf("client %d lock wallet error: %v", client.id, err)
}
}
}

I don't think this test can be reliably run back-to-back as available balances change and I think initial wallet lock states can be messed up. If that's expected, let's document that.

Documented in the test go file:

// - error placing order not enough to cover requested funds
// use the affected asset harness to send funds to the affected wallet

But might be better to even have the test fund the wallets as part of the setup steps. Check the balance, if below what's needed to run all tests, fund, if funding fails, test fails.

Seeing the following error in the logs bothers me: [ERR] CORE: blocking notification channel. If that's expected, why?

@buck54321 mentioned this before, need to drain the notification channel, will add a commit to that effect.

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 18, 2020

Thanks for noting that the funding issue is documented, it's OK for now just to have the test only be guaranteed to run on the try, but hopefully we can fix that in the future. I'm pretty sure the fee payment confirmation issue is resolved though.

Regarding the feed, we might make a TODO to allow closing the feeds, but for now let's drain the feed constantly to avoid all these error logs.

If @JoeGruffins is no longer getting errors on the first run, I'm good to merge.

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 18, 2020

There seem to be at least two races on the Match.Status and MetaData.Proof.RefundCoin fields.

  • The match.MetaData.Proof.RefundCoin == nil inside checkAndWaitForRefunds racing with proof.RefundCoin = []byte(refundCoin) inside *trackedTrade) refundMatches
  • The match.Match.Status inside monitorTradeForTestOrder racing with something else (failed to restore stack), two places there I think

Comment thread client/core/trade_simnet_test.go Outdated
@itswisdomagain
Copy link
Copy Markdown
Member Author

I remember now that I noticed wrong mutex locks in the test file sometime ago that I was planning to correct. Should be fixed now.

@itswisdomagain
Copy link
Copy Markdown
Member Author

Just encountered a scenario where Core retired an order before the server revoked a match for that order (the only match actually):

2020-08-18 15:43:16.103 [INF] CORE: Retiring inactive order 3e696e4165bfc629de55771a74d81724884046f76c562b8fdce217fd42afde25

2020-08-18 15:43:35.054 [ERR] CORE: route 'revoke_match' request handler error: no order found with id 3e696e4165bfc629de55771a74d81724884046f76c562b8fdce217fd42afde25

The only implications I see is that Proof.IsRevoked won't be set for the revoked match and core won't send a notification to that effect.

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 18, 2020

Hmm, we should tweak the "Retiring inactive order" message to include the status and whatever else went into decision. Do you know why it was inactive according to Core if it had not yet been revoked? Was it refunded, I guess?

@itswisdomagain
Copy link
Copy Markdown
Member Author

itswisdomagain commented Aug 18, 2020

Yeah, was refunded, I believe. Another set of tests produced these logs (I already cleared the log for the previous one).

2020-08-18 15:50:57.355 [DBG] CORE: Refundable match 7cc849d6f1bd3c408c919f7d29b12ffdb018af37d1d257b7e5eaad8c6326185f for order 49e6944723b9f4dcc6038032fa6f32ea08d7b5b02d46668498468bf2a0a0dfd5 (Taker)
...
2020-08-18 15:50:57.385 [WRN] CORE: notify: |WARNING| (order) Matches Refunded - Refunded 5.00000000 dcr on order 49e69447 - Order: 49e6944723b9f4dcc6038032fa6f32ea08d7b5b02d46668498468bf2a0a0dfd5
...
2020-08-18 15:50:58.026 [DBG] CORE: Match 7cc849d6f1bd3c408c919f7d29b12ffdb018af37d1d257b7e5eaad8c6326185f not swappable: failErr = take no further action, revoked = false
2020-08-18 15:50:58.026 [DBG] CORE: Match 7cc849d6f1bd3c408c919f7d29b12ffdb018af37d1d257b7e5eaad8c6326185f not redeemable: failErr = take no further action, RefundCoin = 14249c5eebb7e638a020febd5bd76b686072bb58986286f34398e3cf9884cc2d00000000
...
2020-08-18 15:51:17.355 [INF] CORE: Retiring inactive order 49e6944723b9f4dcc6038032fa6f32ea08d7b5b02d46668498468bf2a0a0dfd5
...
2020-08-18 15:51:30.059 [ERR] CORE: route 'revoke_match' request handler error: no order found with id 49e6944723b9f4dcc6038032fa6f32ea08d7b5b02d46668498468bf2a0a0dfd5

Trade ended at TakerSwapCast, Maker didn't redeem, Taker refunded after locktime expired and then revoke_match was sent shortly after, order not found.

Looking just a little further in the logs, Maker's order was not retired before the revoke_match request came in (it was refunded before the revoke_match request but core had not gotten around to retiring the order):

2020-08-18 15:51:25.470 [INF] CORE: Failed match, unable to redeem Taker's swap, refunding btc contract 639df5abc10196084c87201862413204d7d00247a2f057a7b43b4cc4d6f4bebb:0
2020-08-18 15:51:25.499 [WRN] CORE: notify: |WARNING| (order) Matches Refunded - Refunded 0.00125000 btc on order f8579097 - Order: f8579097ef35f9d68713b466da953f0532676c71621bbd19e3f5f2c2d9acbe7d
...
2020-08-18 15:51:30.059 [ERR] CORE: route 'revoke_match' request handler error: no order found with id 49e6944723b9f4dcc6038032fa6f32ea08d7b5b02d46668498468bf2a0a0dfd5 (taker)
2020-08-18 15:51:30.062 [WRN] CORE: notify: |WARNING| (order) Match revoked - Match f8579097 has been revoked - Order: f8579097ef35f9d68713b466da953f0532676c71621bbd19e3f5f2c2d9acbe7d (maker)

I think in a real-life setting, the revoke_match request will be received before any swaps can be refunded so not really an issue then.

@chappjc
Copy link
Copy Markdown
Member

chappjc commented Aug 18, 2020

Makes sense. The inaction timeouts that trigger the revoke would be many many orders of magnitude less than the contract expiry. That the thinking?

- log available and locked balance amounts
- increase delay for mining swap and redeem txs to allow other client sufficient
time to process the swap or redeem action _before_ responding with follow up action
Introduced a tClient.monitorNotificationFeed method to persistently drain
core's NotificationFeed channel to prevent blocking notification feed errors.

The added method records all received notifications in a slice to be searched/
scanned subsequently when looking for a particular notification.
@itswisdomagain
Copy link
Copy Markdown
Member Author

Makes sense. The inaction timeouts that trigger the revoke would be many many orders of magnitude less than the contract expiry. That the thinking?

Yes.

@itswisdomagain itswisdomagain force-pushed the fix-trade-simnet-tests branch from fedda84 to b1f61a4 Compare August 18, 2020 16:10
@itswisdomagain
Copy link
Copy Markdown
Member Author

itswisdomagain commented Aug 18, 2020

I just rebased over master to get the merged changes from #590 and #607 in. Would be helpful if @JoeGruffins (or anyone else) re-encounters the incomplete tx signature error. #607 necessary for running this PR against dcrwallet master.

Copy link
Copy Markdown
Member

@chappjc chappjc left a comment

Choose a reason for hiding this comment

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

Working reliably now on dcrwallet master.

We can continue to improve this or address issues that @JoeGruffins runs into with repeated runs in future work. But now we need to unblock #513 ASAP

@chappjc chappjc merged commit 5bbd7e6 into decred:master Aug 18, 2020
@itswisdomagain itswisdomagain deleted the fix-trade-simnet-tests branch August 18, 2020 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants