The problem:
- Smart Contract developers cannot test cross-shard asynchronous calls.
- Smart Contract developers cannot test their contracts properly when working with system VM - delegation, delegation manager, esdt.
- Working with elements such as randomness, scProcessor and other components in integration tests is not as practical or possible as it is on mainnet or testnet.
The current possibilities:
- RUST unit tests
- RUST integration tests
- WhiteBox testing with RUST
- Mandos testing - all until this point - this testing is a single VM with simulated async calls
- MX-PY
- MX-JS
- xSuite
The solution:
To resolve the above-mentioned problems we want to create an environment that can be easily integrated in multiple testing suites using multiple languages. We see that RUST developers would prefer testing in RUST, those who know more Python would write tests in Python and verify those, and others prefer testing in JS/TS.
We would like to create an environment where integration tests could be run in milliseconds, blockchain can be set up easily: custom storage, tokens, deployments (like from mandos), set balance, and set key value.
The basic idea is to create a binary that has full block and transaction processing capabilities, including cross-shard execution, node API, and is as lightweight as possible. Execution of tests should be done in milliseconds.
-
We create a setup of 3+1 TestProcessorNodes (the 3+1 configuration can be parametrized when we start this special binary)
a.TestProcessorNode has block and transaction processing capabilities
b. It is much lighter than a full node, there is no P2P, no consensus, and no round time to wait for blocks.
c. One low-end machine can easily run multiple instances of TestProcessorNode.
d. TestProcessorNode has a block processor, transaction processor, smart contract processor, system VM, blockchain hook, accounts, API. -
The setup has full API capabilities like a normal gateway. Tests written on top of this are easily usable directly as system tests on testnet/devnet/mainnet as well.
-
Full gasSchedule like the public chains.
-
Interaction through REST API so RUST, Python, JS, and TS SDKs can interact with it.