Remove the Caliper Flow Control system #1586
Labels
component/core
Related to the core code-base
component/ethereum
Related to the Ethereum adapter
documentation
Related to the documentation
enhancement
New feature or request
test
Caliper has a flow control system referenced only briefly in the documentation as "Caliper test phase control" when talking about the launch command so it's not well documented at all. The 5 phases are
start
andend
properties in the network configuration file sectionEach of these phases currently MUST run and are run by the caliper manager although the following is noted
You can skip the running of a specific phase, so for example for already deployed ethereum contracts, you should run caliper with either the required flow-only options or you can skip with the
--caliper-flow-skip-install
. But none of this is well documented and it certainly isn't obvious.The init phase is strange as because it appears to exist to initialise a connector in the caliper manager process, yet it's not something a worker would call so why would the manager need to initialise the connector ? Well maybe it needs to collect some information that it needs to pass to a worker for example ? Fabric ignores the init request effectively and ethereum does this
I don't know much about the connector but I have to assume it's related only to performing an install as this information is not passed onto workers.
2 Questions therefore
Also note that the code around this flow control is confusing. For example in the ethereum connector and in the connector interface we see the signature
However in the code base, the only place init is called is in the manager
which doesn't occur within a worker process and also doesn't pass a parameter.
I see no reason for an controllable init phase, nor a reason for the manager to call init on a connector if it's only to prime the install phase.
This leads to the final consideration, should caliper install smart contracts at all ? The fabric connector doesn't do it now as it's way to complicated and impossible to cover all the required scenarios. I can't speak for Ethereum but I would have to assume that the install process has/will evolve and caliper hasn't kept up with it and will not continue to be kept upto date especially if it is dependent on external versions of SUTs or clients. In order to reduce maintenance of caliper and to make it consistent. I believe we should remove the ability for caliper to install smart contracts on ethereum, and only benchmark SUTs that are already ready to be benchmarked (ie contracts deployed)
Even if we don't remove install it could still detect a deployed contract and not fail the install phase (but I much prefer the idea of removing install. Caliper shouldn't be about setting up a target SUT).
Start and End phases add no value. It's easy to script doing something before the test, running the test and doing something after the test.
Therefore I propose we remove flow control completely from Caliper and remove the ability to install smart contracts. The only issue here would be the integration tests and the caliper-benchmarks around how these currently do testing as they rely on caliper's ability to install a smart contract in order to setup the test SUT (as well as the start/end phases but that's an easy workaround).
The text was updated successfully, but these errors were encountered: