Skip to content

Commit

Permalink
Merge pull request #758 from 0xProject/release/9.2.0
Browse files Browse the repository at this point in the history
Release version 9.2.0
  • Loading branch information
albrow committed Mar 17, 2020
2 parents 14c2521 + 3ad1138 commit 016178b
Show file tree
Hide file tree
Showing 34 changed files with 1,193 additions and 913 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

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.0

### Features ✅

- 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)


## v9.1.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.1.0-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
[![Version](https://img.shields.io/badge/version-9.2.0-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
10 changes: 3 additions & 7 deletions RELEASE_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
- [Docker image](https://hub.docker.com/r/0xorg/mesh/tags)
- [README](https://github.com/0xProject/0x-mesh/blob/v9.1.0/README.md)
- [README](https://github.com/0xProject/0x-mesh/blob/v9.2.0/README.md)

## Summary

### Features ✅

- Improved speed and efficiency of peer discovery, especially when using custom order filters [#729](https://github.com/0xProject/0x-mesh/pull/729).
- Added a lightweight package to use for loading Mesh's Wasm binary in a streaming manner [#707](https://github.com/0xProject/0x-mesh/pull/707).

### Bug fixes 🐞

- Fixed an issue where incoming orders could sometimes be dropped by peers [#732](https://github.com/0xProject/0x-mesh/pull/732).
- 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)



47 changes: 11 additions & 36 deletions cmd/cut-release/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ func main() {
log.Fatal(err)
}

generateTypescriptClientDocs()
generateTypescriptBrowserDocs()
generateTypescriptBrowserLiteDocs()
// Generate documentation for the Typescript packages.
cmd = exec.Command("yarn", "docs:md")
cmd.Dir = "."
stdoutStderr, err = cmd.CombinedOutput()
if err != nil {
log.Print(string(stdoutStderr))
log.Fatal(err)
}

createReleaseChangelog(env.Version)
}
Expand All @@ -62,39 +67,6 @@ func createReleaseChangelog(version string) {
}
}

func generateTypescriptClientDocs() {
// Run `yarn docs:md` to generate MD docs
cmd := exec.Command("yarn", "docs:md")
cmd.Dir = "packages/rpc-client"
stdoutStderr, err := cmd.CombinedOutput()
if err != nil {
log.Print(string(stdoutStderr))
log.Fatal(err)
}
}

func generateTypescriptBrowserDocs() {
// Run `yarn docs:md` to generate MD docs
cmd := exec.Command("yarn", "docs:md")
cmd.Dir = "packages/browser"
stdoutStderr, err := cmd.CombinedOutput()
if err != nil {
log.Print(string(stdoutStderr))
log.Fatal(err)
}
}

func generateTypescriptBrowserLiteDocs() {
// Run `yarn docs:md` to generate MD docs
cmd := exec.Command("yarn", "docs:md")
cmd.Dir = "packages/browser-lite"
stdoutStderr, err := cmd.CombinedOutput()
if err != nil {
log.Print(string(stdoutStderr))
log.Fatal(err)
}
}

// Update the version string in all files that must be updated for a new release
func updateHardCodedVersions(version string) {
// Update `packages/rpc-client/package.json`
Expand All @@ -115,6 +87,9 @@ func updateHardCodedVersions(version string) {
regex = `"version": "(.*)"`
updateFileWithRegex(browserPackageJSONPath, regex, newVersionString)
newBrowserLiteDependencyString := fmt.Sprintf(`"@0x/mesh-browser-lite": "^%s"`, version)
// NOTE(jalextowle): `@0x/mesh-browser` uses the local version of `@0x/mesh-browser-lite`
// on the `development` branch. Once the `@0x/mesh-browser-lite` package has been published,
// we need to update dependency in `@0x/mesh-browser` to published version.
regex = `"@0x/mesh-browser-lite": "(.*)"`
updateFileWithRegex(browserPackageJSONPath, regex, newBrowserLiteDependencyString)

Expand Down
7 changes: 3 additions & 4 deletions cmd/mesh-bootstrap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ type Config struct {
// we reach PeerCountLow. Defaults to 110.
PeerCountHigh int `envvar:"PEER_COUNT_HIGH" default:"110"`
// MaxBytesPerSecond is the maximum number of bytes per second that a peer is
// allowed to send before failing the bandwidth check.
// TODO(albrow): Reduce this limit once we have a better picture of what real
// world bandwidth should be. Defaults to 100 MiB.
MaxBytesPerSecond float64 `envvar:"MAX_BYTES_PER_SECOND" default:"104857600"`
// allowed to send before failing the bandwidth check. Defaults to 1 MiB, which
// is roughly 100x expected usage based on real world measurements.
MaxBytesPerSecond float64 `envvar:"MAX_BYTES_PER_SECOND" default:"1048576"`
}

func init() {
Expand Down
14 changes: 14 additions & 0 deletions cmd/mesh/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ func main() {
defer wg.Done()
log.WithField("ws_rpc_addr", config.WSRPCAddr).Info("starting WS RPC server")
rpcServer := instantiateServer(ctx, app, config.WSRPCAddr)
go func() {
selectedRPCAddr, err := waitForSelectedAddress(ctx, rpcServer)
if err != nil {
log.WithError(err).Warn("WS RPC server did not start")
}
log.WithField("address", selectedRPCAddr).Info("started WS RPC server")
}()
if err := rpcServer.Listen(ctx, rpc.WSHandler); err != nil {
wsRPCErrChan <- err
}
Expand All @@ -79,6 +86,13 @@ func main() {
defer wg.Done()
log.WithField("http_rpc_addr", config.HTTPRPCAddr).Info("starting HTTP RPC server")
rpcServer := instantiateServer(ctx, app, config.HTTPRPCAddr)
go func() {
selectedRPCAddr, err := waitForSelectedAddress(ctx, rpcServer)
if err != nil {
log.WithError(err).Warn("HTTP RPC server did not start")
}
log.WithField("address", selectedRPCAddr).Info("started HTTP RPC server")
}()
if err := rpcServer.Listen(ctx, rpc.HTTPHandler); err != nil {
httpRPCErrChan <- err
}
Expand Down
25 changes: 13 additions & 12 deletions cmd/mesh/rpc_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ type rpcHandler struct {
ctx context.Context
}

// waitForSelectedAddress wait for the server to start listening and select an address.
func waitForSelectedAddress(ctx context.Context, rpcServer *rpc.Server) (string, error) {
for rpcServer.Addr() == nil {
select {
case <-ctx.Done():
return "", ctx.Err()
default:
}
time.Sleep(10 * time.Millisecond)
}
return rpcServer.Addr().String(), nil
}

// instantiateServer instantiates a new RPC server with the rpcHandler.
func instantiateServer(ctx context.Context, app *core.App, rpcAddr string) *rpc.Server {
// Initialize the JSON RPC WebSocket server (but don't start it yet).
Expand All @@ -43,18 +56,6 @@ func instantiateServer(ctx context.Context, app *core.App, rpcAddr string) *rpc.
if err != nil {
return nil
}
go func() {
// Wait for the server to start listening and select an address.
for rpcServer.Addr() == nil {
select {
case <-ctx.Done():
return
default:
}
time.Sleep(10 * time.Millisecond)
}
log.WithField("address", rpcServer.Addr().String()).Info("started RPC server")
}()
return rpcServer
}

Expand Down
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.1.0"
version = "9.2.0"
// ordersyncMinPeers is the minimum amount of peers to receive orders from
// before considering the ordersync process finished.
ordersyncMinPeers = 5
Expand Down
10 changes: 6 additions & 4 deletions docs/browser-bindings/browser-lite/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# @0x/mesh-browser-lite - v9.1.0
# @0x/mesh-browser-lite - v9.2.0

## @0x/mesh-browser-lite

This packages provides a set of Typescript and Javascript bindings for running a 0x-mesh node in the browser.
The browser node's Wasm binary is not bundled in this package and is instead expected to be served by the
consumer of the package. This package is lighter-weight than the `@0x/mesh-browser` package and may have faster load times.
This packages provides a set of Typescript and Javascript bindings for running a
0x-mesh node in the browser. The browser node's Wasm binary is not bundled in
this package and is instead expected to be served by the consumer of the package.
This package has a smaller bundle size than the `@0x/mesh-browser` package and
may have faster load times.

## Installation

Expand Down

0 comments on commit 016178b

Please sign in to comment.