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

Commit

Permalink
Merge pull request #550 from 0xProject/release/6.1.0-beta
Browse files Browse the repository at this point in the history
Release 6.1.0-beta
  • Loading branch information
fabioberger authored Nov 20, 2019
2 parents cef27ac + bb079a4 commit 2a74919
Show file tree
Hide file tree
Showing 32 changed files with 2,149 additions and 984 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

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.

## v6.1.0-beta

### Features ✅

- Added support for persistence in the browser. Users of the `@0x/mesh-browser` package will now be able to retain orders and other relevant parts of the state when refreshing the page or closing and re-opening the browser. ([#533](https://github.com/0xProject/0x-mesh/pull/533)).

### Bug fixes 🐞

- Fix bug where Mesh nodes were logging receipt and re-sharing with peers duplicate orders already stored in it's DB, if the duplicate order was submitted via JSON-RPC. ([#529](https://github.com/0xProject/0x-mesh/pull/529))
- Add missing `UNEXPIRED` `OrderEventEndState` enum value to both `@0x/mesh-rpc-client` and `@0x/mesh-browser` and missing `STOPPED_WATCHING` value from `@0x/mesh-rpc-client`.
- Fixed a potential memory leak by using the latest version of `github.com/libp2p/go-libp2p-kad-dht` ([#539](https://github.com/0xProject/0x-mesh/pull/539)).
- Changed the default port for `RPC_ADDR` from a random available port to `60557`. _Some_ documentation already assumed `60557` was the default port. Now all documentation has been updated for consistency with this change. ([#542](https://github.com/0xProject/0x-mesh/pull/542)).
- Fixed a potential nil pointer exception in log hooks ([#543](https://github.com/0xProject/0x-mesh/pull/543)).
- Fixed a bug where successful closes of an rpc subscription were being reported as errors ([#544](https://github.com/0xProject/0x-mesh/pull/544)).
- We now log the error and stack trace if an RPC method panics. Before, these errors were swallowed by the panic recovery logic in `go-ethereum`'s `rpc` package. ([#545](https://github.com/0xProject/0x-mesh/pull/545))
- Previously, we used to fast-sync block events missed since a Mesh node was last online. If this was more than 128 blocks ago, the fast-sync would fail if Mesh was not connected to an Ethereum node with the `--archive` flag enabled. We now fast-sync only if less than 128 blocks have elapsed. Otherwise, we simply re-validate all orders and continue processing block events from the latest block. ([#407](https://github.com/0xProject/0x-mesh/issues/407))


## v6.0.1-beta

### Bug fixes 🐞
Expand Down
19 changes: 10 additions & 9 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

[[constraint]]
name = "github.com/syndtr/goleveldb"
branch = "full-wasm-support"
branch = "full-wasm-support-0x-1"
source = "github.com/0xProject/goleveldb"

[[constraint]]
Expand All @@ -78,7 +78,7 @@

[[constraint]]
name = "github.com/libp2p/go-libp2p-kad-dht"
version = "0.2.0"
version = "0.3.0"

[[constraint]]
name = "github.com/libp2p/go-libp2p-connmgr"
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-6.0.1--beta-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
[![Version](https://img.shields.io/badge/version-6.1.0--beta-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
5 changes: 3 additions & 2 deletions browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0x/mesh-browser",
"version": "6.0.1-beta",
"version": "6.1.0-beta",
"description": "TypeScript and JavaScript bindings for running Mesh directly in the browser.",
"main": "./lib/index.js",
"license": "Apache-2.0",
Expand All @@ -25,6 +25,7 @@
"dependencies": {
"@0x/order-utils": "^8.3.0",
"@0x/utils": "^4.5.0",
"base64-arraybuffer": "^0.2.0"
"base64-arraybuffer": "^0.2.0",
"browserfs": "^1.4.3"
}
}
30 changes: 27 additions & 3 deletions browser/ts/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { SignedOrder } from '@0x/order-utils';
import { BigNumber } from '@0x/utils';
import * as BrowserFS from 'browserfs';

import { wasmBuffer } from './generated/wasm_buffer';
import './wasm_exec';

export { SignedOrder } from '@0x/order-utils';
export { BigNumber } from '@0x/utils';

// The interval (in milliseconds) to check whether Wasm is done loading.
const wasmLoadCheckIntervalMs = 100;

// The Go code sets certain global values and this is our only way of
// interacting with it. Define those values and their types here.
declare global {
Expand All @@ -23,6 +21,31 @@ declare global {
const zeroExMesh: ZeroExMesh;
}

// We use the global willLoadBrowserFS variable to signal that we are going to
// initialize BrowserFS.
(window as any).willLoadBrowserFS = true;

BrowserFS.configure(
{
fs: 'IndexedDB',
options: {
storeName: '0x-mesh-db',
},
},
e => {
if (e) {
throw e;
}
// We use the global browserFS variable as a handle for Go/Wasm code to
// call into the BrowserFS API. Setting this variable also indicates
// that BrowserFS has finished loading.
(window as any).browserFS = BrowserFS.BFSRequire('fs');
},
);

// The interval (in milliseconds) to check whether Wasm is done loading.
const wasmLoadCheckIntervalMs = 100;

// Note(albrow): This is currently copied over from core/core.go. We need to keep
// both definitions in sync, so if you change one you must also change the
// other.
Expand Down Expand Up @@ -406,6 +429,7 @@ export enum OrderEventEndState {
FullyFilled = 'FULLY_FILLED',
Cancelled = 'CANCELLED',
Expired = 'EXPIRED',
Unexpired = 'UNEXPIRED',
Unfunded = 'UNFUNDED',
FillabilityIncreased = 'FILLABILITY_INCREASED',
StoppedWatching = 'STOPPED_WATCHING',
Expand Down
22 changes: 21 additions & 1 deletion browser/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ argparse@^1.0.7:
dependencies:
sprintf-js "~1.0.2"

async@^2.1.4:
version "2.6.3"
resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==
dependencies:
lodash "^4.17.14"

babel-code-frame@^6.22.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
Expand Down Expand Up @@ -312,6 +319,14 @@ brorand@^1.0.1:
resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=

browserfs@^1.4.3:
version "1.4.3"
resolved "https://registry.yarnpkg.com/browserfs/-/browserfs-1.4.3.tgz#92ffc6063967612daccdb8566d3fc03f521205fb"
integrity sha512-tz8HClVrzTJshcyIu8frE15cjqjcBIu15Bezxsvl/i+6f59iNCN3kznlWjz0FEb3DlnDx3gW5szxeT6D1x0s0w==
dependencies:
async "^2.1.4"
pako "^1.0.4"

browserify-aes@^1.0.6:
version "1.2.0"
resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48"
Expand Down Expand Up @@ -901,7 +916,7 @@ lodash.values@^4.3.0:
resolved "https://registry.yarnpkg.com/lodash.values/-/lodash.values-4.3.0.tgz#a3a6c2b0ebecc5c2cba1c17e6e620fe81b53d347"
integrity sha1-o6bCsOvsxcLLocF+bmIP6BtT00c=

lodash@^4.17.11, lodash@^4.17.15:
lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
Expand Down Expand Up @@ -1050,6 +1065,11 @@ p-try@^1.0.0:
resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=

pako@^1.0.4:
version "1.0.10"
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732"
integrity sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==

path-exists@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
Expand Down
5 changes: 2 additions & 3 deletions cmd/mesh/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ import (
// in standalone mode (i.e. not in a browser).
type standaloneConfig struct {
// RPCAddr is the interface and port to use for the JSON-RPC API over
// WebSockets. By default, 0x Mesh will listen on localhost and will let the
// OS select a randomly available port.
RPCAddr string `envvar:"RPC_ADDR" default:"localhost:0"`
// WebSockets. By default, 0x Mesh will listen on localhost and port 60557.
RPCAddr string `envvar:"RPC_ADDR" default:"localhost:60557"`
}

func main() {
Expand Down
Loading

0 comments on commit 2a74919

Please sign in to comment.