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

Commit 016178b

Browse files
authored
Merge pull request #758 from 0xProject/release/9.2.0
Release version 9.2.0
2 parents 14c2521 + 3ad1138 commit 016178b

34 files changed

+1193
-913
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
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.
44

5+
## v9.2.0
6+
7+
### Features ✅
8+
9+
- Greatly reduced latency for propagating orders, especially for browser nodes [#756](https://github.com/0xProject/0x-mesh/pull/756).
10+
- Added support for `checkGasPrice` StaticCall asset data [#744](https://github.com/0xProject/0x-mesh/pull/744)
11+
12+
513
## v9.1.0
614

715
### Features ✅

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Version](https://img.shields.io/badge/version-9.1.0-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
1+
[![Version](https://img.shields.io/badge/version-9.2.0-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
22
[![Docs](https://img.shields.io/badge/docs-website-yellow.svg)](https://0x-org.gitbook.io/mesh)
33
[![Chat with us on Discord](https://img.shields.io/badge/chat-Discord-blueViolet.svg)](https://discord.gg/HF7fHwk)
44
[![Circle CI](https://img.shields.io/circleci/project/0xProject/0x-mesh/master.svg)](https://circleci.com/gh/0xProject/0x-mesh/tree/master)

RELEASE_CHANGELOG.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
- [Docker image](https://hub.docker.com/r/0xorg/mesh/tags)
2-
- [README](https://github.com/0xProject/0x-mesh/blob/v9.1.0/README.md)
2+
- [README](https://github.com/0xProject/0x-mesh/blob/v9.2.0/README.md)
33

44
## Summary
55

66
### Features ✅
77

8-
- Improved speed and efficiency of peer discovery, especially when using custom order filters [#729](https://github.com/0xProject/0x-mesh/pull/729).
9-
- 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).
10-
11-
### Bug fixes 🐞
12-
13-
- Fixed an issue where incoming orders could sometimes be dropped by peers [#732](https://github.com/0xProject/0x-mesh/pull/732).
8+
- Greatly reduced latency for propagating orders, especially for browser nodes [#756](https://github.com/0xProject/0x-mesh/pull/756).
9+
- Added support for `checkGasPrice` StaticCall asset data [#744](https://github.com/0xProject/0x-mesh/pull/744)
1410

1511

1612

cmd/cut-release/main.go

+11-36
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,14 @@ func main() {
3434
log.Fatal(err)
3535
}
3636

37-
generateTypescriptClientDocs()
38-
generateTypescriptBrowserDocs()
39-
generateTypescriptBrowserLiteDocs()
37+
// Generate documentation for the Typescript packages.
38+
cmd = exec.Command("yarn", "docs:md")
39+
cmd.Dir = "."
40+
stdoutStderr, err = cmd.CombinedOutput()
41+
if err != nil {
42+
log.Print(string(stdoutStderr))
43+
log.Fatal(err)
44+
}
4045

4146
createReleaseChangelog(env.Version)
4247
}
@@ -62,39 +67,6 @@ func createReleaseChangelog(version string) {
6267
}
6368
}
6469

65-
func generateTypescriptClientDocs() {
66-
// Run `yarn docs:md` to generate MD docs
67-
cmd := exec.Command("yarn", "docs:md")
68-
cmd.Dir = "packages/rpc-client"
69-
stdoutStderr, err := cmd.CombinedOutput()
70-
if err != nil {
71-
log.Print(string(stdoutStderr))
72-
log.Fatal(err)
73-
}
74-
}
75-
76-
func generateTypescriptBrowserDocs() {
77-
// Run `yarn docs:md` to generate MD docs
78-
cmd := exec.Command("yarn", "docs:md")
79-
cmd.Dir = "packages/browser"
80-
stdoutStderr, err := cmd.CombinedOutput()
81-
if err != nil {
82-
log.Print(string(stdoutStderr))
83-
log.Fatal(err)
84-
}
85-
}
86-
87-
func generateTypescriptBrowserLiteDocs() {
88-
// Run `yarn docs:md` to generate MD docs
89-
cmd := exec.Command("yarn", "docs:md")
90-
cmd.Dir = "packages/browser-lite"
91-
stdoutStderr, err := cmd.CombinedOutput()
92-
if err != nil {
93-
log.Print(string(stdoutStderr))
94-
log.Fatal(err)
95-
}
96-
}
97-
9870
// Update the version string in all files that must be updated for a new release
9971
func updateHardCodedVersions(version string) {
10072
// Update `packages/rpc-client/package.json`
@@ -115,6 +87,9 @@ func updateHardCodedVersions(version string) {
11587
regex = `"version": "(.*)"`
11688
updateFileWithRegex(browserPackageJSONPath, regex, newVersionString)
11789
newBrowserLiteDependencyString := fmt.Sprintf(`"@0x/mesh-browser-lite": "^%s"`, version)
90+
// NOTE(jalextowle): `@0x/mesh-browser` uses the local version of `@0x/mesh-browser-lite`
91+
// on the `development` branch. Once the `@0x/mesh-browser-lite` package has been published,
92+
// we need to update dependency in `@0x/mesh-browser` to published version.
11893
regex = `"@0x/mesh-browser-lite": "(.*)"`
11994
updateFileWithRegex(browserPackageJSONPath, regex, newBrowserLiteDependencyString)
12095

cmd/mesh-bootstrap/main.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,9 @@ type Config struct {
119119
// we reach PeerCountLow. Defaults to 110.
120120
PeerCountHigh int `envvar:"PEER_COUNT_HIGH" default:"110"`
121121
// MaxBytesPerSecond is the maximum number of bytes per second that a peer is
122-
// allowed to send before failing the bandwidth check.
123-
// TODO(albrow): Reduce this limit once we have a better picture of what real
124-
// world bandwidth should be. Defaults to 100 MiB.
125-
MaxBytesPerSecond float64 `envvar:"MAX_BYTES_PER_SECOND" default:"104857600"`
122+
// allowed to send before failing the bandwidth check. Defaults to 1 MiB, which
123+
// is roughly 100x expected usage based on real world measurements.
124+
MaxBytesPerSecond float64 `envvar:"MAX_BYTES_PER_SECOND" default:"1048576"`
126125
}
127126

128127
func init() {

cmd/mesh/main.go

+14
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ func main() {
6767
defer wg.Done()
6868
log.WithField("ws_rpc_addr", config.WSRPCAddr).Info("starting WS RPC server")
6969
rpcServer := instantiateServer(ctx, app, config.WSRPCAddr)
70+
go func() {
71+
selectedRPCAddr, err := waitForSelectedAddress(ctx, rpcServer)
72+
if err != nil {
73+
log.WithError(err).Warn("WS RPC server did not start")
74+
}
75+
log.WithField("address", selectedRPCAddr).Info("started WS RPC server")
76+
}()
7077
if err := rpcServer.Listen(ctx, rpc.WSHandler); err != nil {
7178
wsRPCErrChan <- err
7279
}
@@ -79,6 +86,13 @@ func main() {
7986
defer wg.Done()
8087
log.WithField("http_rpc_addr", config.HTTPRPCAddr).Info("starting HTTP RPC server")
8188
rpcServer := instantiateServer(ctx, app, config.HTTPRPCAddr)
89+
go func() {
90+
selectedRPCAddr, err := waitForSelectedAddress(ctx, rpcServer)
91+
if err != nil {
92+
log.WithError(err).Warn("HTTP RPC server did not start")
93+
}
94+
log.WithField("address", selectedRPCAddr).Info("started HTTP RPC server")
95+
}()
8296
if err := rpcServer.Listen(ctx, rpc.HTTPHandler); err != nil {
8397
httpRPCErrChan <- err
8498
}

cmd/mesh/rpc_handler.go

+13-12
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ type rpcHandler struct {
3232
ctx context.Context
3333
}
3434

35+
// waitForSelectedAddress wait for the server to start listening and select an address.
36+
func waitForSelectedAddress(ctx context.Context, rpcServer *rpc.Server) (string, error) {
37+
for rpcServer.Addr() == nil {
38+
select {
39+
case <-ctx.Done():
40+
return "", ctx.Err()
41+
default:
42+
}
43+
time.Sleep(10 * time.Millisecond)
44+
}
45+
return rpcServer.Addr().String(), nil
46+
}
47+
3548
// instantiateServer instantiates a new RPC server with the rpcHandler.
3649
func instantiateServer(ctx context.Context, app *core.App, rpcAddr string) *rpc.Server {
3750
// Initialize the JSON RPC WebSocket server (but don't start it yet).
@@ -43,18 +56,6 @@ func instantiateServer(ctx context.Context, app *core.App, rpcAddr string) *rpc.
4356
if err != nil {
4457
return nil
4558
}
46-
go func() {
47-
// Wait for the server to start listening and select an address.
48-
for rpcServer.Addr() == nil {
49-
select {
50-
case <-ctx.Done():
51-
return
52-
default:
53-
}
54-
time.Sleep(10 * time.Millisecond)
55-
}
56-
log.WithField("address", rpcServer.Addr().String()).Info("started RPC server")
57-
}()
5859
return rpcServer
5960
}
6061

core/core.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const (
6060
estimatedNonPollingEthereumRPCRequestsPer24Hrs = 50000
6161
// logStatsInterval is how often to log stats for this node.
6262
logStatsInterval = 5 * time.Minute
63-
version = "9.1.0"
63+
version = "9.2.0"
6464
// ordersyncMinPeers is the minimum amount of peers to receive orders from
6565
// before considering the ordersync process finished.
6666
ordersyncMinPeers = 5

docs/browser-bindings/browser-lite/README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# @0x/mesh-browser-lite - v9.1.0
1+
# @0x/mesh-browser-lite - v9.2.0
22

33
## @0x/mesh-browser-lite
44

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

911
## Installation
1012

0 commit comments

Comments
 (0)