Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

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

Merged
merged 2 commits into from
Aug 13, 2019

Conversation

albrow
Copy link
Contributor

@albrow 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 August 12, 2019 21:27
@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 Something isn't working label Aug 12, 2019
@@ -167,6 +167,10 @@ var (
Code: "OrderHasInvalidSignature",
Message: "order signature must be valid",
}
ROMaxExpirationExceeded = RejectedOrderStatus{
Copy link
Contributor Author

@albrow albrow Aug 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@albrow albrow merged commit e98a324 into development Aug 13, 2019
@albrow albrow deleted the fix/order-validator-expiration-buffer branch August 13, 2019 00:55
albrow added a commit that referenced this pull request Aug 14, 2019
albrow added a commit that referenced this pull request Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

validation: Previously Expired Orders Re-Added
2 participants