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

Release 10.0.0 #929

Merged
merged 61 commits into from
Sep 23, 2020
Merged

Release 10.0.0 #929

merged 61 commits into from
Sep 23, 2020

Conversation

jalextowle
Copy link
Contributor

Description

This PR cuts the v10 release of 0x-mesh. Changes for this release can be found in the CHANGELOG.md file and will also be published on Github. Some highlights that were included in this release are:

  • New database implementations for standalone and browser nodes
  • Performance improvements to ordersync (the initial bootup of Mesh nodes)
  • A new GraphQL API

jalextowle and others added 30 commits June 4, 2020 13:49
* 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
* Adjust the way that local dependencies are linked

* Improved `yarn clean`

* Added `prettier` to Mesh

* Updated cut-release script

* Build dependencies automatically when building a single package

* Make browser integration tests more effecient

* Update CONTRIBUTING.md

* Add some files to .prettierignore

* Change tsconfig for two examples to output to lib

* Add note to CONTRIBUTING.md about TSLint configuration

* Remove  from package.json

* Fixed nits

* Remove `$PKG`

* Fix tsc -b at the root of the project

Co-authored-by: Alex Browne <stephenalexbrowne@gmail.com>
* Strip out all existing database code

* rename meshdb package to db

* Implement first db tests for adding/finding orders

* Add basic support for Orders and MiniHeaders

* Implement and test UpdateOrder

* Implement sorting orders

* Imlpement and test limit and offset

* Implement and test filters for finding orders

* Add fields for parsed MakerAssetData and MakerFeeAssetData

* Add test cases for filtering based on parsed maker asset data

* Implement and test helper methods for filtering based on parsed asset data

* Rename some FilterOpts fields

* Remove unneeded quotes

* Add OF prefix to OrderField constants

* Implement and test MiniHeaders query options

* Implement and test deleting orders with a filter

* Implement and test DeleteOrder

* Refactor db package to use common/types

* Implement and test deleting miniHeaders. Adjust implementation of DeleteOrders

* Update all types. Fix build

* Automatically remove miniHeaders above retention limit

* Add new options for database to configure max mini headers

* Get all blockwatch tests passing 😄

* Add new db options

* Implement and test CountOrders

* Begin fixing some bugs in order watcher tests

* Uncomment all remaining orderwatcher tests (except max expiration)

* Implement and test metadata methods

* Fix bug in sqltypes.BigInt. Get ratelimit tests passing

* Fix some additional tests and unimplemented methods in core

* Implement core.GetStats. Move data dir for most integration tests to /tmp

* Implement new getOrders RPC endpoint

* Re-enable ordersync tests

* Remove expirationwatch package

* Return db.ErrNotFound where appropriate. Remove old TODOs

* Set up basic skeleton for Dexie.js implementation

* Implement most order methods in Dexie.js

Not implemented:

- Query filters
- Multiple sort parameters

* Fix bugs and add support for order queries with one filter

* Add support for multiple filters

* Use checkOrderQuery function for both Dexie and SQL

* Fix bug in SQL implementation involving big numbers

* Add support for multiple sort values in Dexie

* Implement AddMiniHeaders in Dexie

* Implement remaining MiniHeaders methods in Dexie

* Implement Metadata methods in Dexie

* Fix failing TypeScript and Wasm tests

* Fix some build issues

* Fix bug in OrderWatcher

* Fix failing conversion tests

* Fix any remaining failing tests

* Fix linter errors

* Fix build errors

* Update yarn.lock

* Add backwards compatibility layer for FilteredPaginationSubprotocol

* Re-use existing asset data decoder from orderwatcher

* Remove remaining uses of goleveldb

* Improve handling of db closed error

* Rename some identifiers

* Address some low hanging TODOs

* De-dupe and refactor DB test cases

* Change how context is passed in to core.App

* Add missing exit 0 to some clean commands

* Address remaining TODOs in sql_implementation

* Address remaining TODOs in database.ts

* Address remaining TODOs in order_watcher.go

* Minor changes and cleanup

* Fix yarn.lock

* Respond to PR feedback

* Fix bug in database.ts

* Address remaining PR feedback

* Address third round PR feedback

* Address review feedback part 4

* Fix linter
* Optmimize jsutil.InefficientlyConvertToJS

* Add missing build tag

* Update go.mod and go.sum
* Updated `prettier` to ignore all markdown files

* Start running `prettier` on markdown

* Removed `RELEASE_CHANGELOG.md` generation
* Implement removing orders with longest expiration time in SQL

* Implement removing orders with longest expiration time in Dexie

* Implement first pass of setting max expiration time in orderwatcher

* Consider pinned orders correctly regarding max expiration time

* Tweak max expiration time behavior

* Add test for GetCurrentMaxExpirationTime

* Simplify implementation by removing slowCounter and calculating max exp time as needed

* Add clarifying comment

* Account for pinned orders in meshSpecificOrderValidation

* Slightly simplify orderwatch.Watcher.add based on PR feedback

* Include pinned order in TestOrderWatcherDecreaseExpirationTime
* Optimize FindMiniHeaders by using gob encoding for event logs

* Add test for MiniHeaderToCommonType and MiniHeaderFromCommonType

* Rename a variable
Fix issue where initial query for orderInfos can come back empty.
* Add computeOptimalChunkSizes benchmark

* computeABIEncodedSignedOrderByteLength without ABI encoding

* Move unused code to tests

* fmt

* Requested changes

* More requested changes

Co-authored-by: Mason Liang <mason@0x.org>
* Rename all packages/ directories to match package name

* Audit all dependencies vs. devDependencies

* Fix doc generation for browser and browser-lite
* Update removedChecker to use countInterval

* gofmt

* Requested changes

* Revert using errgroup

Co-authored-by: Mason Liang <mason@0x.org>
* Parallelized part of `GetOrders`

* Added an inner context to cut `getOrdersFromPeer` short

* Refactored ordersync to request from a new peer as soon as possible

* Improved ordersync `GetOrders` slightly

* Adjusted `maxPeersInParallel`

* Addressed review feedback from @albrow

* Switched to `sync.RWMutex`

* Addressed lingering review feedback from @albrow
* Add support for storing block metadata for orders in db package

* Set block metadata for orders in order_watcher

* Improve tests for setting last validated block

* Add new fields to Order in database.ts
* Use errgroup

* Fixed data race

* SyncToLatestBlock to prevent race at cleanup

* Re-add logging for errors

* gofmt

* Remove now unneeded SyncToLatestBlock

* Add loop name to logging output

* Use correct names

* Add pointer to golang faq

Co-authored-by: Mason Liang <mason@0x.org>
Co-authored-by: Alex Towle <jalextowle@gmail.com>
#856)

* Name and use isOrderUnexpired

* Use newFillableAmount

* Replace nil with newFillableAmount

* Consolidate checks for rewatchOrder

* Remove checks that are always true

* Move database updates into unexpiration check

* Rename to timeStampIsValid and remove unneeded check

* typos

* time stamp -> timestamp and correct comment

* Clarify comment

Co-authored-by: Alex Browne <stephenalexbrowne@gmail.com>

* fix typo

Co-authored-by: Alex Browne <stephenalexbrowne@gmail.com>

* Remove unused private function

* Remove nil check for non-nil argument

* Rename function

* Re-add comments

* Rename to expirationTimeIsValid

* Expand comment

Co-authored-by: Alex Browne <stephenalexbrowne@gmail.com>

Co-authored-by: Mason Liang <mason@0x.org>
Co-authored-by: Alex Browne <stephenalexbrowne@gmail.com>
* Added simplestack back to Mesh

* Use an in-memory stack for blockwatcher syncing

* Addressed review feedback from @albrow

* Simplified `getSubBlockRanges` in `ethereum/blockwatcher`

* Light refactors of the blockwatcher

* Addressed review feedback from @z2trillion

* Addressed review feedback from @albrow

* Revert "Light refactors of the blockwatcher"

This reverts commit 63caae9.

* Addressed lingering review feedback from @albrow
* Fix database is locked error

* Fix typo
)

* Added logs to ordersync

* Added more debugging logic

* Implemented fix to ordersync

* Removed logs and clarified some logic

* Addressed offline review feedback from @albrow

* Addressed review feedback from @z2trillion and @albrow
* Fixed an issue with `getOrdersFromPeer`

* Addressed review feedback from @albrow
* Added test for missing order events edge case

* Refactored `handleBlockEvents` in anticipation of the fix

* Attempted to fix the missing order events bug

* Minor refactors

* Got the test to pass

* Added another test for the missing block events fix

* Cleaned up the orderwatcher tests

* Added checks for missing events on startup

* Placate the linter

* Addressed review feedback from @albrow and @z2trillion

* Remove unnecessary `RLock` in `ValidateAndStoreValidOrders`

* Fixed a bug with order unexpiry
)

* Added the ability to track the progress of ordersyncing with peers

* Addressed review feedback from @albrow
* Check for already stored orders in a single batch

* Use new method in orderwatcher

* Change return value for GetOrderStatuses to include fillable amount

* Implement GetOrderStatuses in SQL; Update log levels
jalextowle and others added 24 commits July 28, 2020 17:37
* Fixed issue that crashed Mesh node

* Addressed review feedback from @albrow

* Fixed a regression in `FilteredPaginationSubprotocolV0`

* Fixed bug that caused ordersync subprotocols to be selected at random

* Remove debugging logic

* Addressed review feedback from @albrow
* Added a test for orderfilter json encoding

* Added ordersync test for nodes with different filters

* Added ordersync test for receiving first request from old peer

* Fixed ordersync tests with distinct orderfilters

* Added another test case

* Cleaned up in anticipation of review

* Refactored orderfilter tests

* Addressed some review feedback from @albrow

* Apply suggestions from @albrow

Co-authored-by: Alex Browne <stephenalexbrowne@gmail.com>

* Fixed issues caused by suggestions

* Fixed naming

Co-authored-by: Alex Browne <stephenalexbrowne@gmail.com>
* Removed coordinator support

* Prettified the db syncing docs

* Unexported `batchOnchainValidation`
* Add existing miniheaders to simplestack during initialization

* Added a regression test for `blockwatch.New`

* Improved regression test

* Update ethereum/blockwatch/block_watcher_test.go

Co-authored-by: Alex Browne <stephenalexbrowne@gmail.com>

Co-authored-by: Alex Browne <stephenalexbrowne@gmail.com>
…list (#896)

* Reject taker addresses that are nonzero and not on the whitelist

* Addressed review feedback
* Create basic GraphQL server; implement stats query

* Implement order query

* Implement orders query

* Remove JSON-RPC API

* Fix CI

* Change types for some stats fields

* Remove references to JSON-RPC API from cut-release script

* Add GraphQL configuration options

* Update version of GraphiQL

* Use server.Shutdown for GraphQL server

* Use go-bindata to embed schema from text file

* Add graphql config file

* Install go-bindata in deps-no-lockfile

* Stub out remaining types and resolvers

* Switch to using gqlgen

* Set up new gqlgen server

* Re-implement resolvers

* Implement AddOrders

* Implement OrderEvents

* Implement AddOrders in client

* Implement and test Go client GetOrders without options

* Add test for more complicated GetOrders call

* Remove WIP TypeScript client code

* Implement and test Go client GetOrder

* Implement and test Go client GetStats

* Clean up GraphQL integration tests

* Implement basic working client with graphql-codegen

* Switch to using apollo client

* WIP subscriptions support

* Implement and test TypeScript client addOrdersAsync

* Implement and test TypeScript client getOrderAsync

* Implement and test TypeScript client onOrderEvents

* Remove ad hoc subscription test code

* Fix linter errors

* Implement and test TypeScript client getOrdersAsync

* Fix build error

* Remove old code related to typescript tests

* Implement and test TypeScript client rawQueryAsync

* Change env vars used for GraphQL integration tests

* Basic cleanup; remove old code and deps

* Cleanup types and file structure for TypeScript client

* Re-enable browser integration tests

* Add missing TSDoc comments

* Tweak environment variables.

* Remove old Go examples

* Add comment about mesh-bridge

* Update Dockerfiles

* Update documentation and comments

* Remove lingering references to coordinator error codes

* Improve error handling for TypeScript client subscriptions

* Address review feedback

* Fix failing TypeScript GraphQL client tests

* Update links in db_syncing.md

* Address PR feedback

* Throw all GraphQL errors in TypeScript client
…#906)

* Use strings instead of custom scalars in GraphQL schema when possible

* Add additional documentation to GraphQL schema

* Fix TypeScript GraphQL client
* Implemented persistent datastore for peer and dht information in golang

* Implemented persistent key value store for the browser environment

* Finished the persistent storage solution

* Fixed all outstanding discrepancies between the dexie ds implementation and the tests

* Finalized new key store implementation

* Addressed issues uncovered during a personal review

* Addressed review feedback from @recmo

* Changed comment to prompt `ci/circleci:build`
* Added context to `ethereum/blockwatch.Client`

* Started changing approach
* Enable all default linters and fixed all errors

* Enable two more linters

* Added linter for `gofmt`

* Enables the `unparam` linter

* Added `make check`

* Fixed `deadcode` errors after rebase

* Fixed `misspell` errors after rebase

* Fixed `ineffassign` errors after rebase

* Fixed `unparam` errors after rebase

* Fixed `gosimple` errors after rebase

* Fixed `staticcheck` errors after rebase

* Addressed review feedback from @recmo
Bumps [acorn](https://github.com/acornjs/acorn) from 6.3.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](acornjs/acorn@6.3.0...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [jquery](https://github.com/jquery/jquery) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](jquery/jquery@3.4.1...3.5.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Remove unused yarn.lock files

* Added dependabot config that targets the development branch

* Converted dependabot configuration to v2 config

* Remove dependabot v1 config
* Updated deps

* Got standalone nodes to be somewhat functional again

* Fixed "TestPeerDiscovery" for standalone nodes

* Fixed lingering networking issues

* Addressed linter errors

* Updated "go-libp2p" to fix the filters option
* GetOrders => FindOrders

* Added graphql endpoints to MeshWrapper type in Typescript

* Expose dummy endpoints on the Go side of MeshWrapper

* Added testing for the browser GraphQL API

* Squashed some bugs throughout the plumbing pipeline

* DRYed a few things up

* Fixed the browser graphql integration test

* Cleaned up a bit

* Add missing "secondaryRendezvous" to GraphQL schema

* Addressed outstanding "FIXME" comments

* Altered the way that BrowserLink accesses the Mesh wrapper

* Updated "cut-release" make target

* Fixed compiler error after rebase

* Added changelog entry for GraphQL in the browser and fixed style of other v10 entries

* Addressed review feedback from @z2trillion
* Updated an integration test to be version agnostic

* Made the Typescript integration tests version agnostic
Copy link
Contributor

@z2trillion z2trillion left a comment

Choose a reason for hiding this comment

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

looks good


- Reject orders that have taker addresses that are non-zero and are not whitelisted. [#896](https://github.com/0xProject/0x-mesh/pull/896)
- Removed support for Coordinator orders. [#895](https://github.com/0xProject/0x-mesh/pull/895)
- The JSON-RPC is no longer supported by Mesh nodes. Only a GraphQL API is supported. [#858](https://github.com/0xProject/0x-mesh/pull/858)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be up top!

Copy link
Contributor

Choose a reason for hiding this comment

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

Also sounds a bit Dostoyevsky. How about "JSON-RPC supported is removed in favour of the a GraphQL API"/

- Optimized the computation of optimal eth_call batch sizes for order validation. [#846](https://github.com/0xProject/0x-mesh/pull/846)
- Implemented more aggressive pruning for "removed" orders when database utilization is high [#839](https://github.com/0xProject/0x-mesh/pull/839)
- Optimizes conversions from Golang to Javascript. [#820](https://github.com/0xProject/0x-mesh/pull/820)
- Implemented new database solutions for both standalone and browser nodes. [#793](https://github.com/0xProject/0x-mesh/pull/793)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: This reads more like a commit log than a list of features.

Copy link
Contributor Author

@jalextowle jalextowle left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1,5 +1,11 @@
linters:
disable-all: true
disable-all: false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Non-blocking: We should just remove disable-all if possible.

"typeRoots": ["node_modules/@0x/typescript-typings/types", "node_modules/@types"]
},
"include": ["./src/**/*", "./test/**/*"],
"references": [{ "path": "../mesh-browser" }, { "path": "../mesh-graphql-client" }]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Context: For some reason (probably line length), prettier prefers this style over:

"references": [
     {
         "path": "../mesh-browser"
     },
    /* Continued... */
]

Comment on lines +10 to +11
"build:legacy-webpack": "node --max_old_space_size=3072 ./node_modules/.bin/webpack --mode=development --config webpack.legacy.config.js",
"build:graphql-webpack": "node --max_old_space_size=3072 ./node_modules/.bin/webpack --mode=development --config webpack.graphql.config.js",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Non-blocking: It might be possible to make a single yarn command that does the webpack bundling and then pass arguments to that from the build command.

// our smart contracts. It removes the ChainID and ExchangeAddress fields.
func (s *SignedOrder) Trim() wrappers.TrimmedOrder {
return wrappers.TrimmedOrder{
func (s *SignedOrder) Trim() wrappers.LibOrderOrder {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Context: Geth updated the abi-gen tool so that it now uses human readable names for Solidity structs. Previously we aliased the generated (horrible) names to TrimmedOrder, but this didn't seem necessary once LibOrderOrder (the Order type from the LibOrder library in 0x-monorepo) was added.

yarn add @0x/mesh-graphql-client
```

If your project is in [TypeScript](https://www.typescriptlang.org/), add the following to your `tsconfig.json`:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Non-blocking nit: This should be written as: "If your project is written in"

@@ -650,7 +648,7 @@ func setGlobals() {
Signature: common.FromHex("0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33"),
},
Kind: ordervalidator.MeshError,
Status: ordervalidator.ROCoordinatorEndpointNotFound,
Status: ordervalidator.ROEthRPCRequestFailed,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Non-blocking: We may not need this test case anymore. This should be checked on after the release.

@@ -223,7 +223,7 @@ func testFilterValidateOrderJSON(t *testing.T, generateFilter func(int, string,
orderJSON: standardValidOrderJSON,
},
{
note: "order with mispelled makerAddress",
note: "order with misspelled makerAddress",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This cracks me up every time I see it 😂

}
}

// Note(albrow): This version of Mesh does not support database snapshots. Instead, we use the SnapshotID
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Non-blocking nit: "minOrderHash as the value of the SnapshotID field"

}
```

There is one additional environment variable in the [main entrypoint for the
There are some additional environment variable in the [main entrypoint for the
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Non-blocking nit: "variable" => "variables"

@jalextowle jalextowle merged commit 0c1c0f3 into master Sep 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants