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

Commit

Permalink
Upgrade Mesh to Go 1.14 (#815)
Browse files Browse the repository at this point in the history
* Made changes necessary for native binaries to build

* Document go-ethereum dependecy

* Got go tests to pass

* Updated geth fork to get some wasm tests to pass

* Fixed some build errors and tests

* Documented the `goleveldb` dependency

* Updated goleveldb and go-ws-transport

* All WebAssembly tests are now passing -- with the wrong `wasm_exec.ts`

* Update CI and dockerfiles

* Fix go linting errors

* Fix linting in CI

* Remove vendor step in CI to try to fix linting issues

* Documented the change in vendoring in CI

* Updated goleveldb dep after switching to `IsUndefined` and `IsNull`

* Updated go-ws-transport after switching to `IsUndefined`

* Switched to `IsUndefined` and `IsNull`

* Updated changelog

* Reverted some unnecessary changes

* Moved `allowJs` into `@0x/mesh-browser-lite`'s `tsconfig.json`

* Update to typescript `3.9.3`

* Update geth dependency

* Update `parseTopics` to use the new version from geth

* Addressed review feedback from @albrow

* Updated geth again

* Updated geth another time

* Fixed `wasm_exec.js` after rebase

* Changes to deps after rebuilding

* Updated the contributing guide

* Updated webpack-example dependendencies

* Fixed small inconsistency in contributing guide
  • Loading branch information
jalextowle authored Jun 4, 2020
1 parent 88752af commit 137c140
Show file tree
Hide file tree
Showing 35 changed files with 2,107 additions and 1,887 deletions.
12 changes: 7 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
environment:
BASH_ENV: ~/.nvm/nvm.sh
docker:
- image: circleci/golang:1.13.4-browsers
- image: circleci/golang:1.14.3-browsers
- image: 0xorg/ganache-cli:istanbul
environment:
VERSION: 6.2.4
Expand All @@ -28,13 +28,15 @@ jobs:
- run:
name: Install dependencies
command: make deps-no-lockfile
- run:
name: Vendor Go dependencies as a workaround for https://github.com/golangci/golangci-lint/issues/865
command: go mod vendor
- run:
name: Install Go linter
command: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.22.2
command: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.27.0
- run:
# NOTE(jalextowle): We previously vendored our dependencies to avoid
# this issue: https://github.com/golangci/golangci-lint/issues/825.
# Vendoring caused an issue where the output on CI was not the same as
# that locally, so it has been removed. This should be reevaluated if
# the issue reappears.
name: Run linters
command: make lint
- run:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

## v9.5.0

### Features ✅

- Upgraded to Go 1.14, which contains several WebAssembly performance improvements [#815](https://github.com/0xProject/0x-mesh/pull/815).

## v9.4.0

### Features ✅
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ the dropdown menu in the GitHub UI to select `development`.
## Prerequisites

- [GNU Make](https://www.gnu.org/software/make/) If you are using a Unix-like OS, you probably already have this.
- [Go version 1.13.x](https://golang.org/dl/) (or use [the version manager called "g"](https://github.com/stefanmaric/g)).
- [Go version 1.14.x](https://golang.org/dl/) (or use [the version manager called "g"](https://github.com/stefanmaric/g)).
- [Node.js version >=11](https://nodejs.org/en/download/) (or use the [nvm version manager](https://github.com/creationix/nvm)).
- [Yarn package manager](https://yarnpkg.com/en/).
- [golangci-lint version 1.22.2](https://github.com/golangci/golangci-lint#install).
- [golangci-lint version 1.27.0](https://github.com/golangci/golangci-lint#install-golangci-lint).
- [Python](https://www.python.org/downloads/). (Many OSes already have this).
- [Google Chrome](https://www.google.com/chrome/). If you already have Google Chrome you typically don't need to do anything. On Ubuntu you can run `wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install`.
- A C compiler such as [GCC](https://gcc.gnu.org/) or [Clang](https://clang.llvm.org/). Some OSes will already have this. On Ubuntu you can run `sudo apt-get install build-essential`.
Expand Down
5 changes: 3 additions & 2 deletions db/open_js.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"syscall/js"
"time"

"github.com/0xProject/0x-mesh/packages/browser/go/jsutil"
log "github.com/sirupsen/logrus"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/storage"
Expand All @@ -26,7 +27,7 @@ func Open(path string) (*DB, error) {
// The global willLoadBrowserFS variable indicates whether browserFS will be
// loaded. browserFS has to be explicitly loaded in by JavaScript (and
// typically Webpack) and can't be loaded here.
if willLoadBrowserFS := js.Global().Get("willLoadBrowserFS"); willLoadBrowserFS != js.Undefined() && willLoadBrowserFS.Bool() == true {
if willLoadBrowserFS := js.Global().Get("willLoadBrowserFS"); !jsutil.IsNullOrUndefined(willLoadBrowserFS) && willLoadBrowserFS.Bool() == true {
return openBrowserFSDB(path)
}
// If browserFS is not going to be loaded, fallback to using an in-memory
Expand Down Expand Up @@ -60,7 +61,7 @@ func openBrowserFSDB(path string) (*DB, error) {
if time.Since(start) >= browserFSLoadTimeout {
return nil, errors.New("timed out waiting for BrowserFS to load")
}
if js.Global().Get("browserFS") != js.Undefined() && js.Global().Get("browserFS") != js.Null() {
if !jsutil.IsNullOrUndefined(js.Global().Get("browserFS")) {
log.Info("BrowserFS finished loading")
break
}
Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/mesh-bootstrap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

# mesh-builder produces a statically linked binary
FROM golang:1.13.4-alpine3.10 as mesh-builder
FROM golang:1.14.3-alpine3.11 as mesh-builder


RUN apk update && apk add ca-certificates nodejs-current npm make git dep gcc build-base musl linux-headers
Expand All @@ -16,7 +16,7 @@ ADD . ./
RUN go build ./cmd/mesh-bootstrap

# Final Image
FROM alpine:3.10
FROM alpine:3.11

RUN apk update && apk add ca-certificates --no-cache

Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/mesh-bridge/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

# mesh-builder produces a statically linked binary
FROM golang:1.13.4-alpine3.10 as mesh-builder
FROM golang:1.14.3-alpine3.11 as mesh-builder


RUN apk update && apk add ca-certificates nodejs-current npm make git dep gcc build-base musl linux-headers
Expand All @@ -16,7 +16,7 @@ ADD . ./
RUN go build ./cmd/mesh-bridge

# Final Image
FROM alpine:3.10
FROM alpine:3.11

RUN apk update && apk add ca-certificates --no-cache

Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/mesh/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#

# mesh-builder produces a statically linked binary
FROM golang:1.13.4-alpine3.10 as mesh-builder
FROM golang:1.14.3-alpine3.11 as mesh-builder


RUN apk update && apk add ca-certificates nodejs-current npm make git dep gcc build-base musl linux-headers
Expand All @@ -16,7 +16,7 @@ ADD . ./
RUN go build ./cmd/mesh

# Final Image
FROM alpine:3.10
FROM alpine:3.11

RUN apk update && apk add ca-certificates --no-cache

Expand Down
20 changes: 15 additions & 5 deletions ethereum/wrappers/coordinator_registry.go

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

1,305 changes: 543 additions & 762 deletions ethereum/wrappers/dev_utils.go

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions ethereum/wrappers/dev_utils_aliases.go

This file was deleted.

Loading

0 comments on commit 137c140

Please sign in to comment.