Fusion VM Code Review - Cryptofinance Blockchain
Share this article
I wasn’t originally going to do this code review on the FUSION Virtual Machine project, as I feel there isn’t enough substance yet; but everyone keeps asking, so let me just share my thoughts at this time. Please bear in mind that like all blockchain code audits, this one is timestamped at the bottom and may be updated to reflect new developments as FUSION gets off the ground.
First off, Java, nothing inherently wrong, but I was hoping for something more optimized, Fusion did state they are planning JVM support though, so this is probably a choice connected to it.
Lack of a detailed readme is a bit disappointing.
I was hoping for a standalone VM implementation, something I could start from the command line and play with, maybe even throw in a basic contract, unfortunately we don’t have this yet, for now we just have code.
The current Fusion VM code review shows no commit history to work off of, so we just have to evaluate what is available in the repository.
No comments unfortunately, we see some interface definitions.
My assumption here is the the communication layer for the built in VM Oracles will use JSON, for now just a stub.
HttpUtils, something I was interested to see an implementation on, but nothing here yet.
Stub. (Stub just means a short form of something.)
OpCodes are instructions that we want to perform, so we first call useGas with the OpCode value, which calls calcGas (which currently returns 0 because it isn’t implemented) which sees if there is enough gas. useGas is defined in the global context, so I assume that each AppVirtualMachine is a single instantiation (confirmed in AppSystemService that it is) otherwise this is unoptimized.
Real implementation is in Virtual Machine, so let’s go find it.
Good error handling, good structure, straightforward implementation.
Conclusion: It’s good code, but it’s standard code. I was definitely hoping for more, this is a fairly straightforward VM implementation with the stubs added for built in Oracles.
For now, this definitely hasn’t sated me, and I’ll be looking forward to doing a deeper FUSION VM code review when they release more substance.
Disclaimer: Crypto Briefing code reviews are performed by auditing what is on display in the master branch of the repo’s made available. This was performed as an educational review and any comments in the article are the opinion of the writer. It is normal for code to change rapidly, hence we timestamp our code reviews so that they present a snapshot at a moment in time. Information contained herein should not be used as any comment or advice on the project as a whole.
Timestamp: April 14th, 2018 at 05:30 GMT