Releases: 0xProject/0x-mesh
Version 6.0.0-beta
Summary
Breaking changes 🛠
Note: This release will require wiping your Mesh's DB before upgrading. The DB location defaults to ./0x_mesh/db
.
- Renamed env config from
ETHEREUM_NETWORK_ID
toETHEREUM_CHAIN_ID
sincenetwork
is a misnomer here and what we actually care about is thechainID
. Most chains have the same id for their p2p network and chain. From the ones we support, the only outlier is Ganache, for which you will now need to supply1337
instead of50
(Learn more: https://medium.com/@pedrouid/chainid-vs-networkid-how-do-they-differ-on-ethereum-eec2ed41635b) (#485) - Rejected order code
OrderForIncorrectNetwork
has been changed toOrderForIncorrectChain
(#485) - Removed
RPC_PORT
environment variable. The newRPC_ADDR
environment variable allows specifying both the interface and port (#487). - Due to security concerns and new rate limiting mechanisms, the default bind address for the RPC API has changed from
0.0.0.0
tolocalhost
. Users who previously did not setRPC_PORT
may need to now manually setRPC_ADDR
to enable other applications to access the RPC API. If you are using Docker Compose, we recommend using links. If you do need to setRPC_ADDR
to bind on0.0.0.0
, please be aware of the security implications and consider protecting access to Mesh via a third-party firewall. (See #444 and #487 for more details). - Changed the
EXPIRED
event such that it is emitted when an order is expired according to the latest block timestamp, not anymore based on UTC time. (#490) - Removed the
EXPIRATION_BUFFER_SECONDS
env config since we no longer compute order expiration using UTC time. (#490)
Features ✅
- Implemented a new strategy for limiting the amount of database storage used by Mesh and removing orders when the database is full. This strategy involves a dynamically adjusting maximum expiration time. When the database is full, Mesh will enforce a maximum expiration time for all incoming orders and remove any existing orders with an expiration time too far in the future. If conditions change and there is enough space in the database again, the max expiration time will slowly increase. This is a short term solution which solves the immediate issue of finite storage capacities and does a decent job of protecting against spam. We expect to improve and possibly replace it in the future. See #450 for more details.
- Added support for a new feature called "order pinning" (#474). Pinned orders will not be affected by any DDoS prevention or incentive mechanisms (including the new dynamic max expiration time feature) and will always stay in storage until they are no longer fillable. By default, all orders which are submitted via either the JSON-RPC API or the
addOrdersAsync
function in the TypeScript bindings will be pinned. - Re-enabled bandwidth-based peer banning with a workaround to deal with erroneous spikes #478.
- Added an
UNEXPIRED
order event kind which is emitted for orders that were previously considered expired but due to a block-reorg causing the latest block timestamp to be earlier than the previous latest block timestamp, are no longer expired. (#490) - Added support for decoding Axie Infinity
Transfer
andApprove
ERC721 events which differ from the ERC721 standard. (#494)
Bug fixes 🐞
- Improved the aggressiveness at which we permanently delete orders that have been flagged for removal. Previously we would wait for the cleanup job to handle this (once an hour), but that meant many removed orders would accumulate. We now prune them every 5 minutes. (#471)
- Fixed a bug in the Go RPC client which resulted in errors when receving order events with at least one contract event (#496).
Version 5.1.0-beta
Summary
Features ✅
- The
getStats
RPC endpoint now includes a new field which accounts for the number of orders that have been marked as "removed" but not yet permanently deleted (#461). - Improved historical order sharing using round-robin algorithm instead of random selection (#454). This will reduce the warm-up time for receiving existing orders when first joining the network.
- Added ERC1155 assetData support (#453). This includes order watching and order events for orders involving ERC1155 tokens.
- Added Ability to specify custom contract addresses via the
CUSTOM_ADDRESSES
environment variable or thecustomAddresses
field in the TypeScript bindings (#445).
Bug fixes 🐞
- Temporarily disabled bandwidth-based peer banning (#448). A bug in libp2p was occasionally causing observed bandwidth usage to spike to unrealistic levels, which can result in peers being erroneously banned. We decided to temporarily stop banning peers while we're working with the libp2p team to resolve the issue.
Version 5.0.0-beta
Summary
Breaking changes 🛠
- Removes the
txHashes
key in theOrderEvent
s emitted from theorders
JSON-RPC subscription and replaced it withcontractEvents
, an array of decoded order-relevant contract events. Parsing these events allows callers to find every discrete order fill/cancel event. (#420) - Renames the
Kind
key inOrderEvent
toEndState
to better elucidate that it represents the aggregate change to the orders state since it was last re-validated. As an end state, it does not capture any possible intermediate states the order might have been in since the last re-validation. Intermediate states can be inferred from thecontractEvents
included (#420)
Features ✅
- Removed the max expiration limit for orders. The only remaining expiration constraint is that the unix timestamp does not overflow int64 (i.e., is not larger than 9223372036854775807). (#400)
Bug fixes 🐞
- Fixed bug where we weren't updating an orders
fillableTakerAssetAmount
in the DB when orders were being partially filled or when their fillability increased due to a block re-org. (#439) - Made
verbosity
field optional in the TypeScriptConfig
type. (#410) - Fixed issue where we weren't re-validating orders potentially impacted by the balance increase of the recipient of an ERC20 or ERC721 transfer. (#416)
Version 4.0.1-beta
Summary
This release fixes a DB transaction deadlock issue that was introduced in v4.0.0-beta. The issue was causing Mesh to fail to send or process new messages, effectively hanging.
Bug fixes 🐞
- Fixed a DB transaction deadlock accidentally introduced in the v4.0.0-beta release. (#403)
Version 4.0.0-beta
Summary
This release includes what we are calling "minimum viable" browser support! We've published an NPM package as well as a guide for how to run Mesh in the browser.
There are still some big limitations and important features/improvements that we are planning to add in the near future:
- Persistence. When running Mesh in a browser, only your peer ID is persisted between refreshes. Any other data (including Ethereum blocks, orders, and information about other peers in the network) is not persisted and will be lost if you refresh the page. This is good enough for testing but it would obviously be better if data is persistent. A lot of work has already been done here and we will either use LevelDB on top of IndexedDB or just use IndexedDB directly.
- Browser-to-browser communication. In the current version of Mesh, browser nodes can communicate directly with standalone nodes, but can only communicate to other browser nodes via a relay. As we have mentioned before in talks and various documents, we plan to use WebRTC to allow direct browser-to-browser communication. This will increase decentralization and reduce the load on relay hosts.
- Performance. CPU usage is higher than we are comfortable with right now, typically hovering between 50% and 100%. Profiling reveals that most of the CPU usage is coming from a package in libp2p called
secio
which handles signing and verifying messages. We have a few ideas for how to improve efficiency here, mostly around changing the size and frequency of messages between peers. Some new features just released in Go version 1.13 should help here too. - Bundle size. The Wasm bytecode is just over 30MB uncompressed and the resulting Webpack bundle comes in at ~40MB uncompressed. This can be compressed to ~9MB with Gzip and ~7MB with Brotli. It should take a few seconds to download for most desktop/laptop users and we feel it is a pretty good starting point. But it's also something we can potentially improve with more aggressive dead code elimination and third-party tools for optimizing Wasm bytecode.
Breaking changes 🛠
- Renamed the environment variable
P2P_LISTEN_PORT
toP2P_TCP_PORT
(#366). This makes it possible to configure Mesh to use both the TCP and Websocket transports by listening on different ports.
Features ✅
- Enabled WebSocket transport for bootstrap nodes and all other nodes (#361, #363, #366). By default the WebSocket transport listens on port
60559
but this can be changed via theP2P_WEBSOCKETS_PORT
environment variable. - Created TypeScript bindings and an NPM package for running Mesh directly in the browser (#369). Documentation for the NPM package and a guide for running Mesh in the browser can be found at https://0x-org.gitbook.io/mesh/.
- Added ability to use custom bootstrap list via the
BOOTSTRAP_LIST
environment variable (#374). Typically this should only be used for testing/debugging. - Added WebAssembly/Browser support to packages that previously did not support it (#358, #359, #366).
- Order hash calculations are now cached, which slightly improves performance (#365).
- Refactored
BlockWatch
so that it can be used without usingLevelDB
for Ethereum block storage. (#355)
Bug fixes 🐞
- Fixed two related bugs: One where order expiration events would be emitted multiple times and another that meant subsequent fill/cancel events for orders deemed expired were not emitted. Fills/cancels for expired orders will continue to be emitted if they occur within ~4 mins (i.e. 20 blocks) of the expiration (#385).
- Fixed a data race-condition in OrderWatcher that could have caused order collection updates to be overwritten in the DB. (#386)
- Fixed a bug where
fillableTakerAssetAmount
andlastUpdated
were not always being properly updated in the DB. (#386) - Fixed some issues with key prefixes for certain types not being applied correctly to logs (#375).
- Fixed an issue where order hashes were not being correctly logged (#368).
- Mesh will now properly shut down if the database is unexpectedly closed (#370).
Version 3.0.1-beta
Bug fixes 🐞
- Fixed bug where block number would sometimes be converted to hex with a leading zero, an invalid hex value per the Ethereum JSON-RPC specification. (#353)
- Fixed bug which resulted in orders that were close to expiring being re-added and removed multiple times, resulting in multiple ADDED and EXPIRED events for the same order (#352).
Version 3.0.0-beta
Breaking changes 🛠
- Modified Mesh's validation logic to reject and consider invalid any partially fillable orders. While this is
technically a breaking change, partially fillable orders are rare in the wild and we don't expect this will
affect many users. (#333) - Lowercased
GetStatsAsync
method togetStatsAsync
in TS client
Bug fixes 🐞
Version 2.0.0-beta
Breaking changes 🛠
- Modified how
mesh_addOrders
treats orders that are already stored on the Mesh node. Previously, they would be rejected with codeOrderAlreadyStored
. Now, if the order is stored and fillable, it will be accepted. If it is stored but unfillable, it will be rejected withOrderAlreadyStoredAndUnfillable
. We additionally added aisNew
property to the accepted orderInfos returned, so that callers can discern which orders Mesh already knew about. (#316)
Features ✅
- Added backup bootstrap nodes provided by the libp2p community
- Improved log formatting and reduced verbosity in a few cases (#314, #287)
- Reduced AdvertiseBootDelay for bootstrap nodes
- Implemented a check that will alerts you when switching to a different Ethereum network ID. (#301) -- special thanks to @hrharder!
- Made environment variable parsing more generous by automatically removing quotes if needed (#306)
- Improved tests by adding timeouts and closing resources where appropriate (#310, #309, #308)
- Increased robustness by removing panics and failing more gracefully (#312)
- RPC server is now started while block event backfilling is happening under the hood instead of waiting for it to complete (#318)
- Added a
mesh_getStats
endpoint which returns a host of useful information about the state of the Mesh node (e.g., number of fillable order stored, number of peers, peerID, etc...) (#322)
Bug fixes 🐞
Version 1.0.6-beta
This release fixes several bugs:
- Uninitialized TxHashes map & accidental inclusion of null address txHash in order events (#280)
- Concurrent read/write issue in OrderWatcher's EventDecoder (#278)
- Non-unique logging keys causing Elastic Search indexing issues (#275)
It also includes a reduction in the delay before which bootstrap nodes advertise themselves as relays from 15mins to 30sec.
Version 1.0.5-beta
This version introduces a temporary hack in order to help some Mesh nodes find their public IP address under certain circumstances.