-
Notifications
You must be signed in to change notification settings - Fork 0
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
client/core: monotonic OrderBook state updates #4
base: master
Are you sure you want to change the base?
Conversation
Could go even further and sanity check lower |
// May want to re-implement strict sequence checking. Might use these tests | ||
// again. | ||
// { | ||
// label: "Unbook sell order with outdated sequence value", | ||
// orderBook: makeOrderBook( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I see relevant comment here from long time ago, but it doesn't quite answer why these were commented out in the first place ... Anyway, these tests work reasonably well with my changes - which is a good sign :)
30c855f
to
866a8cb
Compare
client/orderbook/orderbook_test.go
Outdated
note: makeUnbookOrderNote(5, "ob", [32]byte{'d'}), | ||
expected: nil, | ||
wantErr: true, | ||
note: makeUnbookOrderNote(5, "ob", [32]byte{'b'}), | ||
expected: makeOrderBook( | ||
2, | ||
"ob", | ||
[]*Order{ | ||
makeOrder([32]byte{'b'}, msgjson.SellOrderNum, 10, 1, 2), | ||
makeOrder([32]byte{'c'}, msgjson.SellOrderNum, 10, 2, 5), | ||
}, | ||
make([]*cachedOrderNote, 0), | ||
true, | ||
), | ||
wantErr: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this "Unbook sell order with future sequence value" test seems to have worked because it was failing due to unknown id error, not the one the name claims to test, note, I changed order ID d
->b
(it fails like this on master)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed other similar issues (expectation mismatch) I found in these tests too.
2910c73
to
4318f03
Compare
I've been running this PR on mainnet, and occasionally I see notes from future:
... and so it goes until disconnect 1 min later (not sure if disconect is accidental, or if it's intentional once order book goes stale):
then it reconnects and continues to work without obvious issues. Full log: notes-from-future.txt So, was relaxing constraint to allow future notifications the most practical way to address it at the time ? If it ain't part of design #1 + #2 + #4 will hopefully fix it (along with ghost orders and whatnot). |
ad9d264
to
e298e04
Compare
f9959eb
to
a66bbae
Compare
e3c487c
to
333e9f6
Compare
Should prevent: