Skip to content
Permalink
Browse files

Merge pull request #400 from 0xProject/refactor/removeExpiryConstraint

core: Remove maxOrderExpirationDuration constraint
  • Loading branch information
albrow committed Sep 12, 2019
2 parents bd0ceab + 0a242bd commit f29a927350097c6ef6112fa089e4a44b2acb01ce
Showing with 6 additions and 16 deletions.
  1. +6 −0 CHANGELOG.md
  2. +0 −16 core/validation.go
@@ -2,6 +2,12 @@

This changelog is a work in progress and may contain notes for versions which have not actually been released. Check the [Releases](https://github.com/0xProject/0x-mesh/releases) page to see full release notes and more information about the latest released versions.

## v4.1.0-beta

### Features ✅

- Removed the max expiration limit for orders. The only remaining expiration constraint is that the unix timestamp does not overflow int64 (i.e., is not larger than 9223372036854775807). ([#400](https://github.com/0xProject/0x-mesh/pull/400))

## v4.0.1-beta

### Bug fixes 🐞
@@ -2,8 +2,6 @@ package core

import (
"fmt"
"math/big"
"time"

"github.com/0xProject/0x-mesh/constants"
"github.com/0xProject/0x-mesh/db"
@@ -15,10 +13,6 @@ import (
"github.com/xeipuuv/gojsonschema"
)

// maxOrderExpirationDuration is the maximum duration between the current time and the expiration
// set on an order that will be accepted by Mesh.
const maxOrderExpirationDuration = 9 * 30 * 24 * time.Hour // 9 months

var errMaxSize = fmt.Errorf("message exceeds maximum size of %d bytes", zeroex.MaxOrderSizeInBytes)

// JSON-schema schemas
@@ -143,16 +137,6 @@ func (app *App) validateOrders(orders []*zeroex.SignedOrder) (*zeroex.Validation
})
continue
}
maxExpiration := big.NewInt(time.Now().Add(maxOrderExpirationDuration).Unix())
if order.ExpirationTimeSeconds.Cmp(maxExpiration) > 0 {
results.Rejected = append(results.Rejected, &zeroex.RejectedOrderInfo{
OrderHash: orderHash,
SignedOrder: order,
Kind: zeroex.MeshValidation,
Status: zeroex.ROMaxExpirationExceeded,
})
continue
}
if err := validateOrderSize(order); err != nil {
if err == errMaxSize {
results.Rejected = append(results.Rejected, &zeroex.RejectedOrderInfo{

0 comments on commit f29a927

Please sign in to comment.
You can’t perform that action at this time.