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

Upgrade Mesh to Go 1.14 #815

Merged
merged 30 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
27c5ade
Made changes necessary for native binaries to build
jalextowle May 29, 2020
0b861db
Document go-ethereum dependecy
jalextowle May 29, 2020
801215e
Got go tests to pass
jalextowle May 29, 2020
e14aeb4
Updated geth fork to get some wasm tests to pass
jalextowle May 29, 2020
2647b9c
Fixed some build errors and tests
jalextowle May 29, 2020
1b6ab9c
Documented the `goleveldb` dependency
jalextowle May 29, 2020
16d18ac
Updated goleveldb and go-ws-transport
jalextowle May 30, 2020
4ef91cf
All WebAssembly tests are now passing -- with the wrong `wasm_exec.ts`
jalextowle Jun 1, 2020
481e7c4
Update CI and dockerfiles
jalextowle Jun 2, 2020
1d4262a
Fix go linting errors
jalextowle Jun 2, 2020
793e20d
Fix linting in CI
jalextowle Jun 2, 2020
a3d560c
Remove vendor step in CI to try to fix linting issues
jalextowle Jun 2, 2020
1d2ad5a
Documented the change in vendoring in CI
jalextowle Jun 2, 2020
d32d72a
Updated goleveldb dep after switching to `IsUndefined` and `IsNull`
jalextowle Jun 2, 2020
82514c7
Updated go-ws-transport after switching to `IsUndefined`
jalextowle Jun 2, 2020
ead2bc5
Switched to `IsUndefined` and `IsNull`
jalextowle Jun 2, 2020
2f714c5
Updated changelog
jalextowle Jun 2, 2020
fb6ba01
Reverted some unnecessary changes
jalextowle Jun 2, 2020
65ba523
Moved `allowJs` into `@0x/mesh-browser-lite`'s `tsconfig.json`
jalextowle Jun 2, 2020
792ac54
Update to typescript `3.9.3`
jalextowle Jun 2, 2020
51ff0b3
Update geth dependency
jalextowle Jun 3, 2020
7b0fc1d
Update `parseTopics` to use the new version from geth
jalextowle Jun 3, 2020
8e1573e
Addressed review feedback from @albrow
jalextowle Jun 3, 2020
c6b6d6d
Updated geth again
jalextowle Jun 3, 2020
8ab2fb4
Updated geth another time
jalextowle Jun 3, 2020
0c4102d
Fixed `wasm_exec.js` after rebase
jalextowle Jun 4, 2020
8e1a07d
Changes to deps after rebuilding
jalextowle Jun 4, 2020
e9c3669
Updated the contributing guide
jalextowle Jun 4, 2020
d295df2
Updated webpack-example dependendencies
jalextowle Jun 4, 2020
01e6515
Fixed small inconsistency in contributing guide
jalextowle Jun 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a particular reason that we used goreleaser at @albrow. I decided to use the script that was provided by golangci, but I'm happy to change this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The golangci team probably just changed their recommendation. This looks fine to me.

- 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 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albrow Is there a reason not to check IsNull here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never set it to null at any point. But it doesn't really hurt to check anyways so I'm okay with this change.

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