City of Zion has recently released the latest major update to the neo-python project, a Python-based node and software development kit (SDK) for the NEO blockchain. Neo-python allows users to run their own peer-to-peer (P2P) nodes as well as build, deploy and run NEO smart contracts. The changelog for the latest version, v0.8.0, can be found below along with descriptions of the major changes, or alongside the neo-python documentation here.

New Features

  • Implemented sendtoaddress RPC method (#556)

The sendtoaddress RPC method has been implemented into the neo-python JSON RPC API by developer @dethos. This method allows registered NEO assets to be transferred to a specified address via a remote procedure call.

City of Zion developer @jseagrave21 used the sendtoaddress implementation as a foundation to add the sendfrom and sendmany RPC methods, which have passed review by neo-python Maintainer @ixje and are expected to be present in the next update. These methods allow transfers from a specified address within a wallet containing multiple addresses and bulk transfers respectively.

  • Implemented Stack Isolation (NEP-8)

The NEO Enhancement Proposal for stack isolation (NEP-8) has been implemented into neo-python. The proposal was for the NeoVM evaluation stack (acts as memory) to be isolated, increasing the security of dynamic invocations (where one smart contract can execute another smart contract that is not known until runtime). Stack isolation could also enable new features in the future.

Bug Fixes

  • Fix issue resetting storage between Smart Contract invocations

Prior to this fix, previously persisted blocks may not have been accurate, which caused balance inaccuracies for NEO and GAS. These balance mismatches were being caused by the resetting of storages during failed smart contract invocations, as identified by @jseagrave21. Developer @localhuman provided the fix, which can be found here.

It should be noted that balances were never at risk, even when using neo-python to attempt to transfer funds, as these transfers would be rejected by the public chain. As some data was stored incorrectly, those upgrading to the latest version will need to resync their chain. Using np-bootstrap will speed up the resync.

  • Fix unhandled deferred errors
  • Fix Blockchain.DeregisterBlockchain not clearing all static variables

General Changes

  • Update seed list to include NGD nodes
  • Gracefully handle network packet deserialization failures
  • Update block importing and exporting functionality.

This change added more functionality that allows developers to export or import set ranges of blocks, in addition to speeding up the process.

  • Update Mainnet bootstrap files
  • Update to smart contract compiler version v0.5.3

The compiler was updated to provide compatibility with the NEP-8 stack isolation implementation.

  • Default ApplicationConfiguration.AcceptIncomingPeers to False, if config value is not present
  • Disable prompt.py test cases due to high time consumption and unreliable results.
  • Migrate the existing test cases, which depend on BlockchainFixtureTestCase and WalletFixtureTestCase, to a privnet. Reduction of the fixtures’ size to about 7MB.

Noted to be an important update for developers, the discover neo unittest now takes only 2 minutes, rather than 17.5 minutes per test. Running the test suite is now far more efficient which allows developers to faster verify correctness of new features they want to add. Details can be found here.

  • Ensure non-zero send value in prompt.py
  • Add send-zero provision and improved test coverage to sendtoaddress

The non-zero send provision is an important change that prevents users from spamming RPC servers with requests to send 0 NEO or GAS. Instead of these requests being processed, causing wasted computing power and taking up space in the node mempool, these requested will be rejected.

The latest version of neo-python can be downloaded here. Those looking to contribute to the project are recommended to join the #python channel on the NEO Discord or to visit the current open issues.

More information on City of Zion can be found at the links below.