Skip to content
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

zeroex: Add order expiration buffer to zeroex.OrderValdiator #352

Merged
merged 2 commits into from Aug 13, 2019

Conversation

@albrow
Copy link
Member

albrow commented Aug 12, 2019

Fixes #341.

The problem was occurring because we did not respect the expiration buffer when validating incoming messages. This PR fixes the issue and also uses the same function IsExpired in both the expiration watcher and the order validator to avoid these kinds of issues in the future.

@albrow albrow requested a review from fabioberger Aug 12, 2019
@albrow albrow changed the title Add order expiration buffer to zeroex.OrderValdiator zeroex: Add order expiration buffer to zeroex.OrderValdiator Aug 12, 2019
@albrow albrow added the bug label Aug 12, 2019
@@ -167,6 +167,10 @@ var (
Code: "OrderHasInvalidSignature",
Message: "order signature must be valid",
}
ROMaxExpirationExceeded = RejectedOrderStatus{

This comment has been minimized.

Copy link
@albrow

albrow Aug 12, 2019

Author Member

@fabioberger It doesn't exactly feel right to move ROMaxExpirationExceeded and MeshValidation into this package but I couldn't figure out another way to do it without introducing cyclical imports. We need to return something when signedOrder.ExpirationTimeSeconds is too big to fit in int64 and this existing order status fits pretty well. Any alternative ideas?

This comment has been minimized.

Copy link
@fabioberger

fabioberger Aug 12, 2019

Contributor

Agreed. We could also create a dedicated package but this works for now.

@@ -167,6 +167,10 @@ var (
Code: "OrderHasInvalidSignature",
Message: "order signature must be valid",
}
ROMaxExpirationExceeded = RejectedOrderStatus{

This comment has been minimized.

Copy link
@fabioberger

fabioberger Aug 12, 2019

Contributor

Agreed. We could also create a dedicated package but this works for now.

@albrow albrow merged commit e98a324 into development Aug 13, 2019
1 check passed
1 check passed
ci/circleci: build Your tests passed on CircleCI!
Details
@albrow albrow deleted the fix/order-validator-expiration-buffer branch Aug 13, 2019
albrow added a commit that referenced this pull request Aug 14, 2019
albrow added a commit that referenced this pull request Aug 14, 2019
Update CHANGELOG for PR #352
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.