Runtime test of Fantom - DAG based smart contract platform
So Fantom aims to provide a smart contract platform that solves the issue of scalability and confirmation time of the existing blockchain technology, and is incidentally one of the most hyped projects around currently. (Readers that are interested in conclusions only are recommended to skip to end)
The inherent issue with blockchain performance is the synchronous nature of block validation. Enter Fantom (and its competitors) which uses the DAG architecture to make transactions asynchronous by not involving all nodes simultaneously and thus achieve near real-time. On top of this Fantom will also provide a smart contract platform for dapp development.
"The FANTOM platform adopts a new protocol known as LachesisProtocol to maintain consensus. Applications built on top of the FANTOM OPERA Chain enjoy instant transactions and near zero transaction costs for all users."
Now let's get under the hood and see what's there. This is convenient since Fantom releases as open source and doesn't hide core code elements in private repositories unlike many other projects.
The FANTOM architecture is divided into three layers. The bottom layer is called the OPERA Core Layer. It is responsible for creating events and maintaining consensus across all nodes via the Lachesis Protocol. The middle layer is called the OPERA Ware Layer. It will provide the functionality for payments, issuing rewards, incentives, and Story data. Finally, the top layer is called the OPERA Application Layer, and will provide publicly available Application Programming Interfaces (APIs) for applications to use features of the OPERA Ware Layer.
A browse through the code reveals that Fantom uses the Ganache and Truffle framework, this supports the open source idea well and is a good foundation to start on. The base code is an ETH clone with the consensus algorithm replaced by Fantom's Lachesis.
The code looks good for a beta version, but as usual we are mostly interested in if things work in reality rather than detailed source code review.
The purpose of our test is to try out the recently released beta version of Lachesis consensus and OPERA Ware Layer. So we start by installing Ganache and Truffle before downloading the github contents and installing the code (no build is needed since it's all java script)
We have no issues installing the code, but it turns out that there is no provision to try out the Fantom Virtual Machine yet, so we run a functional test of the DAG consensus based on EVM.
We have the environment up and running and are ready for a local test. We will use the Truffle audit to run through the functional tests sequentially.
We run trough the 60 tests and get 57 passes and 3 errors, but believe that the errors come from the test machine environment and will update on this once we switch environment and re-run all tests. We see no other issues and the consensus code works well in our opinion.
TL;DR Conlusion: We find that Fantom is well underway in delivering according to their roadmap. The code quality is high standard and the built product works as expected.
Fantom aims to complete the middleware and API in Q3 this year, something we find realistic especially with the chosen frameworks as a foundation to build on. The target for entire project completion is Q2-2020, which we think will be challenging but still possible. Congratulations to everyone that had the chance to invest in Fantom.
For enquiries on crypto related code reviews/tests please contact us on: [email protected]