eos42 / Chintai-issues

A github to collect issues for the Chintai dApp
https://jungle.chintai.io
3 stars 4 forks source link

Transactions timing out when consuming multiple orders. #3

Closed PhillipHamnett closed 6 years ago

PhillipHamnett commented 6 years ago

Fletch153 commented 3 days ago No description provided.

@Fletch153 Fletch153 added the bug label 3 days ago @Fletch153

Fletch153 commented 3 days ago We need to consider MINIMUM and MAXIMUM amount of orders also. If the maximum amount of orders we can process is 50, then it needs to be in the realms of 50 x MINIMUM. We also need to account for orders that have been half fulfilled and are left hanging around in the book.

@PhillipHamnett

PhillipHamnett commented 3 days ago Do you mean minimum and maximum amount of orders per account?

What is the maximum number of orders that can be consumed by a single order?

@PhillipHamnett PhillipHamnett added this to To do in MVP via automation 2 days ago @PhillipHamnett PhillipHamnett assigned PhillipHamnett and Fletch153 2 days ago @PhillipHamnett PhillipHamnett added the priority high label 2 days ago @PhillipHamnett PhillipHamnett referenced this issue 2 days ago Closed Test if one stake order fulfills many lease orders #30 @acoutts

acoutts commented 2 days ago I am getting this error now when trying to match even a single order, on my local testnet.

Using commit: 452b2ee

Console output:

2018-08-23T00:56:17.437 thread-0 http_plugin.cpp:472 handle_exception ] FC Exception encountered while processing chain.push_transaction 2018-08-23T00:56:17.438 thread-0 http_plugin.cpp:473 handle_exception ] Exception Details: 3080006 deadline_exception: Transaction took too long deadline exceeded {"now":"2018-08-23T00:56:17.436","deadline":"2018-08-23T00:56:17.436","start":"2018-08-23T00:56:17.406"} thread-0 transaction_context.cpp:293 checktime pending console output: stake cpu = 0.0000 EOS stake net = 0.0000 EOS stake cpu = 0.0000 EOS stake net = 0.0000 EOS stake cpu = 0.0000 EOS stake net = 0.0000 EOS stake cpu = 0.0000 EOS stake net = 0.0000 EOS stake cpu = 0.0000 EOS stake net = 0.0000 EOS stake cpu = 0.0000 EOS stake net = 0.0000 EOS stake cpu = 0.0000 EOS stake net = 0.0000 EOS stake cpu = 0.0000 EOS stake net = 0.0000 EOS stake cpu = 0.0000 EOS stake net = 0.0000 EOS stake cpu = 0.0000 EOS stake net = 0.0000 EOS

{"console":"stake cpu = 0.0000 EOS\nstake net = 0.0000 EOS\nstake cpu = 0.0000 EOS\nstake net = 0.0000 EOS\nstake cpu = 0.0000 EOS\nstake net = 0.0000 EOS\nstake cpu = 0.0000 EOS\nstake net = 0.0000 EOS\nstake cpu = 0.0000 EOS\nstake net = 0.0000 EOS\nstake cpu = 0.0000 EOS\nstake net = 0.0000 EOS\nstake cpu = 0.0000 EOS\nstake net = 0.0000 EOS\nstake cpu = 0.0000 EOS\nstake net = 0.0000 EOS\nstake cpu = 0.0000 EOS\nstake net = 0.0000 EOS\nstake cpu = 0.0000 EOS\nstake net = 0.0000 EOS\n"}
thread-0  apply_context.cpp:61 exec_one

Animated GIF of the orderbook setup and my order submission: 2018-08-22 20 56 06

@PhillipHamnett PhillipHamnett moved this from To do to In progress in MVP 2 days ago @PhillipHamnett PhillipHamnett moved this from In progress to To do in MVP 2 days ago @PhillipHamnett PhillipHamnett moved this from To do to In progress in MVP 2 days ago @PhillipHamnett

PhillipHamnett commented a day ago This problem is caused by the size of the orderbook. The for loop has to go through each order that would match, even if that order has already been fulfilled. The time taken to check if an order has quantity_left of zero is also not insignificant. Therefore the more orders that are in the system , the quicker the system breaks with transactions taking too long. For me, matching a single transaction failed once there were over 250 orders in the book.

@PhillipHamnett

PhillipHamnett commented a day ago A solution is to keep fulfilled orders separate from unfulfilled or semi-fulfilled orders. I will try and implement that now

austinium2002 commented 6 years ago

Only two orders could be fulfilled at a time.