- NeoVM is now deployable outside the Neo network
- New Stack isolations included making it better
- Five new stack isolation instructions introduced
Neo Virtual Machine Upgraded
Neo has always been an attraction for developers because of its user-friendly nature as one can code in c#, js, and python. The NeoVM has justified this and developers think it can play a major part in the development of the blockchain infrastructure. Neo has been keen on upgrading it’s VM throughout the months. The first NeoVM was introduced in the 2018 Neo Devconby founder Erik Zhang, and it has been improving ever since.
The latest development allows the NeoVM to be easily deployed outside the Neo network because of its versatility. The major breakthrough happened when Stack isolation was introduced in the upgrade from version 2.2.1 to 2.3.0. Ever since this, it has been a prominent feature.
Stack isolation in simple terms is like upgrading your computer system from DOS to Windows. In DOS system the whole memory is shared by all the programs, thus if one program crashes the whole system might crash. Windows, on the other hand, solves this problem by running the programs in individual instances. The introduction of stack isolation has enabled the system to be more stable and error free because now every smart contract can only access its own stack area.
In version 2.2.1 the running contexts share one calculation stack or evaluation stack but in this instance, the dynamically invoked smart contract sometimes could affect the callers stack during runtime which caused various security issues and the performance wasn’t satisfactory
The latest version however allocates a separate computing and temporary stack for every running context. The previous versions also stored the operational results in the calculation stack but the version 2.3 adds a separate result stack for storing the result. Hence Stack isolation prevents the destruction of caller stack and thus making the execution of smart contracts faster and safer and the system more stable as a whole.
The whole system needed new sets of operation instructions to copy the parameters to the new stack during dynamic invocation. After the run is complete the return value is automatically copied to the callers stack. Five new stack isolation related instructions have been introduced : CALL_I , CALL_E, CALL_ED, CALL_ET, CALL_EDT.
NeoVM is currently at version 2.3.3 in which the interop service was changed from class to portal, hence implementation is now easier even outside neo network. It’s under constant development and maintenance and it will keep on improving. Details regarding further upgrades shall be revealed in Neo devcon 2019.