Ethex.market 1.0
We have been working hard to reach this point. Thanks to everyone who has helped test over the past few months. During this period, our smart contract executed 1,000 successful transactions. Users have traded thousands in Ether and tokens directly from wallet to wallet. All with a completely unique blockchain order book and no centralized databases.
During testing we discovered a number of things that will make any DApp challenging to develop. I’ll write about these now in case it’s helpful to other developers.
getLogs is too slow to be useful
Etherscan and Infura are awesome free Ethereum blockchain providers; however, they can make things difficult for great DApps. For instance, the getLogs function on these services can be extremely slow. We have clocked response times of up to 5 seconds for a single query. Sometimes nodes fail to respond at all.
In theory getLogs is extremely useful. Two calls can provide token balances for a particular address. However Ethereum nodes respond to this query by creating a bloom filter based upon topics, then search through 5–6 million blocks for likely candidates. In practice getLogs is storage efficient, but too slow to be used for DApps.
Load balancers confuse current block
When public nodes use load balancers, your client might get two different views of the blockchain. For instance, you might query a provider and find that a new block has arrived. However, when you query the blockchain again, you could be redirected to another machine that hasn’t included that block yet. This means that your client will miss any relevant updates in the new block. It’s difficult to track down why, and this only happens occasionally.
Our solutions
Behind the scenes we have deployed our own provider. We still use public providers as a fall back. In the future we want users to be able to configure their own provider, too.
Our provider caches getLogs then uses a load balancer for other requests or uncached queries. The cache server also makes sure that blockNumber is correct so there isn’t confusion about the current block.
Everything is running quite fast. Try it out, there are some deals on Useful Tokens. Let us know what you think!
What’s next?
We improved many things during the test period and there is much more to do. We have more work to do on the accounts section. Also, we want to do a better job handling multiple languages and currencies. There are some other projects going on here too that we will save for a surprise later. Stay in the loop by subscribing to our mailing list. See you at Ethex 1.1!