Skip to content

Commit

Permalink
Merge pull request #763 from 0xProject/release/9.2.1
Browse files Browse the repository at this point in the history
Release 9.2.1
  • Loading branch information
jalextowle committed Mar 18, 2020
2 parents 016178b + 70af3f7 commit 8afe758
Show file tree
Hide file tree
Showing 17 changed files with 701 additions and 682 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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.

## v9.2.1

### Bug fixes 🐞

- Fixed a critical bug in the ordersync protocol which resulted in only 50% of existing orders being shared when a new peer joins the network. New orders are shared separately and were unaffected. [#760](https://github.com/0xProject/0x-mesh/pull/760).


## v9.2.0

### Features ✅
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Version](https://img.shields.io/badge/version-9.2.0-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
[![Version](https://img.shields.io/badge/version-9.2.1-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
[![Docs](https://img.shields.io/badge/docs-website-yellow.svg)](https://0x-org.gitbook.io/mesh)
[![Chat with us on Discord](https://img.shields.io/badge/chat-Discord-blueViolet.svg)](https://discord.gg/HF7fHwk)
[![Circle CI](https://img.shields.io/circleci/project/0xProject/0x-mesh/master.svg)](https://circleci.com/gh/0xProject/0x-mesh/tree/master)
Expand Down
7 changes: 3 additions & 4 deletions RELEASE_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
- [Docker image](https://hub.docker.com/r/0xorg/mesh/tags)
- [README](https://github.com/0xProject/0x-mesh/blob/v9.2.0/README.md)
- [README](https://github.com/0xProject/0x-mesh/blob/v9.2.1/README.md)

## Summary

### Features ✅
### Bug fixes 🐞

- Greatly reduced latency for propagating orders, especially for browser nodes [#756](https://github.com/0xProject/0x-mesh/pull/756).
- Added support for `checkGasPrice` StaticCall asset data [#744](https://github.com/0xProject/0x-mesh/pull/744)
- Fixed a critical bug in the ordersync protocol which resulted in only 50% of existing orders being shared when a new peer joins the network. New orders are shared separately and were unaffected. [#760](https://github.com/0xProject/0x-mesh/pull/760).



2 changes: 1 addition & 1 deletion core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const (
estimatedNonPollingEthereumRPCRequestsPer24Hrs = 50000
// logStatsInterval is how often to log stats for this node.
logStatsInterval = 5 * time.Minute
version = "9.2.0"
version = "9.2.1"
// ordersyncMinPeers is the minimum amount of peers to receive orders from
// before considering the ordersync process finished.
ordersyncMinPeers = 5
Expand Down
21 changes: 17 additions & 4 deletions core/ordersync_subprotocols.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,19 @@ func (p *FilteredPaginationSubProtocol) HandleOrderSyncRequest(ctx context.Conte
return nil, fmt.Errorf("FilteredPaginationSubProtocol received request with wrong metadata type (got %T)", req.Metadata)
}
}

// It's possible that none of the orders in the current page match the filter.
// We don't want to respond with zero orders, so keep iterating until we find
// at least some orders that match the filter.
filteredOrders := []*zeroex.SignedOrder{}
var snapshotID string
var currentPage int
for currentPage = metadata.Page; len(filteredOrders) == 0; currentPage += 1 {
currentPage := metadata.Page
for {
select {
case <-ctx.Done():
return nil, ctx.Err()
default:
}
// Get the orders for this page.
ordersResp, err := p.app.GetOrders(currentPage, p.perPage, metadata.SnapshotID)
if err != nil {
Expand All @@ -89,15 +95,22 @@ func (p *FilteredPaginationSubProtocol) HandleOrderSyncRequest(ctx context.Conte
// No more orders left.
break
}
// Filter the orders for this page. If none of them match the filter, we continue
// on to the next page.
// Filter the orders for this page.
for _, orderInfo := range ordersResp.OrdersInfos {
if matches, err := p.orderFilter.MatchOrder(orderInfo.SignedOrder); err != nil {
return nil, err
} else if matches {
filteredOrders = append(filteredOrders, orderInfo.SignedOrder)
}
}
if len(filteredOrders) == 0 {
// If none of the orders for this page match the filter, we continue
// on to the next page.
currentPage += 1
continue
} else {
break
}
}

return &ordersync.Response{
Expand Down
2 changes: 1 addition & 1 deletion docs/browser-bindings/browser-lite/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @0x/mesh-browser-lite - v9.2.0
# @0x/mesh-browser-lite - v9.2.1

## @0x/mesh-browser-lite

Expand Down

0 comments on commit 8afe758

Please sign in to comment.