You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having a set of accounts and their keys, do some operations
Operation is a submitting of a transaction(s) to the Iroha Peer. Each operation should have a unique key, like MintOwnAsset. Different operations might have different complexity.
The set of operations should cover all possible Instructions, Expressions and Values. Each operation separately shouldn't necessarily cover all of them, but the whole set of operations should.
Note: the set of operations should be wisely constrained - we don't actually need to check all possible combinations, because their amount seems vast.
Advanced: cover WASM executables, triggers registration and execution. Since it looks more complex than "just generate random transaction" and may require to store intermediate state, it could be stored via Metadata of some entities I guess.
It is fine if some of the generated transactions will be rejected - it is important to handle failure cases during development as well.
The tool might be run as a long-running process that does operations with a specified interval. In this case, each operation should have its own probability weight which affects the probability of operation occurring. They should have it due to the difference between their complexity and probability in the "real world". Also it should be possible to override weights on startup via CLI arguments and/or configuration file.
Weights design proposal: lets assume we have a set of operations:
MintOwnAsset - 5
RegisterAccount - 1
AllowOtherAccountToTransferMyAssets - 0.2
In this case, the actual probability for MintOwnAsset will be 5 / (5 + 1 + 0.2) ~= 80.6%, for RegisterAccount - 1 / (5 + 1 + 0.2) ~= 16%, and so on.
Call sample:
./iroha2_longevity long-running \
--config ./config.json \
--interval 2.5s \
# override probability of some operation
--probability:MintOwnAsset 0
The tool might be run to perform the only one specified operation. During development of Iroha-related tools, we might need to generate some specific action instead of bombing Iroha with all kinds of stuff.
Call sample:
./iroha2_longevity once --config ./config.json --operation MintOwnAsset
Nice to have
Documentation for each operation and a list of entities it covers. For example, MintOrBurnAssetDependingOnValue might touch Instruction::If, Value::Query, Expression::Less entities. It might be useful to search for the exact operation by the entity it covers. The documentation might have any format, even CLI would be nice.
Checklist
Here is the checklist of different entities that should be covered. It might be used as an on-going TODO list during development of the tool.
Please write the operation key near the entity so it will be easier to track them.
Requirements
Having a set of accounts and their keys, do some operations
Operation is a submitting of a transaction(s) to the Iroha Peer. Each operation should have a unique key, like
MintOwnAsset
. Different operations might have different complexity.The set of operations should cover all possible
Instruction
s,Expression
s andValue
s. Each operation separately shouldn't necessarily cover all of them, but the whole set of operations should.Note: the set of operations should be wisely constrained - we don't actually need to check all possible combinations, because their amount seems vast.
Advanced: cover WASM executables, triggers registration and execution. Since it looks more complex than "just generate random transaction" and may require to store intermediate state, it could be stored via
Metadata
of some entities I guess.It is fine if some of the generated transactions will be rejected - it is important to handle failure cases during development as well.
The tool might be run as a long-running process that does operations with a specified interval. In this case, each operation should have its own probability weight which affects the probability of operation occurring. They should have it due to the difference between their complexity and probability in the "real world". Also it should be possible to override weights on startup via CLI arguments and/or configuration file.
Weights design proposal: lets assume we have a set of operations:
MintOwnAsset
- 5RegisterAccount
- 1AllowOtherAccountToTransferMyAssets
- 0.2In this case, the actual probability for
MintOwnAsset
will be5 / (5 + 1 + 0.2) ~= 80.6%
, forRegisterAccount
-1 / (5 + 1 + 0.2) ~= 16%
, and so on.Call sample:
./iroha2_longevity long-running \ --config ./config.json \ --interval 2.5s \ # override probability of some operation --probability:MintOwnAsset 0
The tool might be run to perform the only one specified operation. During development of Iroha-related tools, we might need to generate some specific action instead of bombing Iroha with all kinds of stuff.
Call sample:
Nice to have
MintOrBurnAssetDependingOnValue
might touchInstruction::If
,Value::Query
,Expression::Less
entities. It might be useful to search for the exact operation by the entity it covers. The documentation might have any format, even CLI would be nice.Checklist
Here is the checklist of different entities that should be covered. It might be used as an on-going TODO list during development of the tool.
Please write the operation key near the entity so it will be easier to track them.
Instruction
:Register
Unregister
Mint
Burn
Transfer
If
Pair
Sequence
Fail
SetKeyValue
RemoveKeyValue
Grant
Revoke
ExecuteTrigger
Expression
:Add
Subtract
Multiply
Divide
Mod
RaiseTo
Greater
Less
Equal
Not
And
Or
If
Raw
Query
Contains
ContainsAll
ContainsAny
Where
ContextValue
Value
:U32
U128
Bool
String
Name
Fixed
Vec
LimitedMetadata
Id
Identifiable
PublicKey
Parameter
SignatureCheckCondition
TransactionValue
PermissionToken
Hash
Block
Some cases
The account mints or burns its asset depending on the asset's value. See https://github.com/hyperledger/iroha/blob/908f09f01ae89d52e0f99d0653865ee098c5fdde/client/benches/tps/lib.rs#L222-L233
The account registers another account and allows it to burn and to transfer its assets. See https://github.com/hyperledger/iroha/blob/908f09f01ae89d52e0f99d0653865ee098c5fdde/client/benches/tps/lib.rs#L152-L168
Additional context
We develop https://github.com/soramitsu/iroha2-block-explorer-backend & https://github.com/soramitsu/iroha2-block-explorer-web. We struggle with a lack of data within Iroha. There are so many cases and possible data we should consider. We cannot continue development without a tool described in this issue.
The text was updated successfully, but these errors were encountered: