-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace order call should be atomic #1805
Comments
raladev
changed the title
replace order call old removes order before new id checking
replace order call removes old order before id checking of new order
Aug 10, 2020
In short: the replace order call should be atomic, atm it is not (remove can succeed, place can fail) |
kilrau
changed the title
replace order call removes old order before id checking of new order
Replace order call should be atomic
Aug 11, 2020
sangaman
added a commit
that referenced
this issue
Aug 12, 2020
This modifies the procedure for replacing an order in the order book. Previously, it would go like this: 1. Remove old order & send order invalidation to peers. 2. Place new order and wait for matching to complete (which may take some time if it involves swap attempts). 3. Send new order to peers. Now it goes: 1. Put the old order on hold, preventing further swaps/matching. 2. Place the new order and wait for matching to complete. 3. Remove the old order from the order book. 4. Send a single packet to peers with new order info and old order id. 5. Peers that receive this packet will remove the old order and add the new one sequentially. Closes #1805.
sangaman
added a commit
that referenced
this issue
Aug 14, 2020
This modifies the procedure for replacing an order in the order book. Previously, it would go like this: 1. Remove old order & send order invalidation to peers. 2. Place new order and wait for matching to complete (which may take some time if it involves swap attempts). 3. Send new order to peers. Now it goes: 1. Put the old order on hold, preventing further swaps/matching. 2. Place the new order and wait for matching to complete. 3. Remove the old order from the order book. 4. Send a single packet to peers with new order info and old order id. 5. Peers that receive this packet will remove the old order and add the new one sequentially. Closes #1805.
sangaman
added a commit
that referenced
this issue
Aug 14, 2020
This modifies the procedure for replacing an order in the order book. Previously, it would go like this: 1. Remove old order & send order invalidation to peers. 2. Place new order and wait for matching to complete (which may take some time if it involves swap attempts). 3. Send new order to peers. Now it goes: 1. Put the old order on hold, preventing further swaps/matching. 2. Place the new order and wait for matching to complete. 3. Remove the old order from the order book. 4. Send a single packet to peers with new order info and old order id. 5. Peers that receive this packet will remove the old order and add the new one sequentially. By default, replaced orders will have the same local order id as the order they are replacing unless a different id is specified. Closes #1805. Closes #1806.
raladev
pushed a commit
that referenced
this issue
Aug 17, 2020
This modifies the procedure for replacing an order in the order book. Previously, it would go like this: 1. Remove old order & send order invalidation to peers. 2. Place new order and wait for matching to complete (which may take some time if it involves swap attempts). 3. Send new order to peers. Now it goes: 1. Put the old order on hold, preventing further swaps/matching. 2. Place the new order and wait for matching to complete. 3. Remove the old order from the order book. 4. Send a single packet to peers with new order info and old order id. 5. Peers that receive this packet will remove the old order and add the new one sequentially. By default, replaced orders will have the same local order id as the order they are replacing unless a different id is specified. Closes #1805. Closes #1806.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps:
6 ALREADY_EXISTS: order with local id 1 already exists
Actual result:
orderbook contains only one order (first) because second one was removed, but new was not placed because id error
Expected result:
orderbook contains 2 orders, order replacement is failed.
The text was updated successfully, but these errors were encountered: