-
Notifications
You must be signed in to change notification settings - Fork 91
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
core: handle epoch order messages. #188
Conversation
This updates the epoch queue to track the current epoch and implements the associated epoch order handler.
f3248bf
to
aaec0db
Compare
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.
It looks like the EpochQueue methods may need to lock for most or all of the function.
client/core/core.go
Outdated
match := false | ||
for _, mkt := range dc.markets { | ||
if mkt.Display() == note.MarketID { | ||
match = true |
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.
Could just return here and get rid of the match variable. Regarding it being an error, let me see if I understand: If Core is only setup for market X, but messages for market Y come in, that means the client has somehow registered on the orderbook
route (which include the epoch order notes) for market Y or the server is misbehaving and sending messages that weren't what the client registered for. Does that sound right? In the first case, that's clearly an Core error, but in the second that's the server messing up.
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.
I'd say both cases outlined apply, and they're both errors, no?
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.
I should be breaking after setting match
however.
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.
Oh, right, the check below is for !match
.
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.
updated the commit, would like to squash it if it's all good now.
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.
TBH, I prefer not squashing until the review is approved, if at all. It helps reviewers follow changes, and github squashes for us on merge.
I just remove commit descriptions that don't describe a net effect of the PR, although I welcome squash commit messages in comments.
fa20c3f
to
f8579cd
Compare
f8579cd
to
76406db
Compare
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.
OK. We will probably scrutinize some more in #189, so I'm good with this for now.
This adds the
epoch_order
notification handler to the client core.