Cache or Queue
Shorthand
Discussion participants: Kamil Salakhiev, 武宮誠, Andrei Lebedev
We will design MST differently for Iroha2. As @lebdron suggests we will store pending transactions in blocks. They will be executed only when enough signatures are collected.
This is more convenient way to get statuses of transactions and keep all nodes in sync regarding MST transactions they have
武宮誠 :
It’s a bad design, It’s much better to keep things in a pending cache and have them disappear if they don’t get enough signatories in time.
Otherwise, if you have a situation like on sora net with a transaction fee, then no one will pay the fee if the transaction is not validated and you just filled up blocks for free. The other way is to charge to put every signatory in the blockchain. This can work, but is not so friendly.
Let’s think about this some more
Cache is volatile. If node was restarted we will not be able to fetch accounts pending transactions
what about TTL for transactions?
Cache will be a frontend to transactions stored in blocks. This will ensure that all nodes have a consistent state
Cache is a WorldStateView or another cache?
Another cache
武宮誠 :
Just sync. Anyway, I thought about it and storing on chain is not an option. If you take a transaction fee for that, then just one signatory can make your account go to 0, which defeats the purpose of multisig. The MST cache in Iroha allowing automatic collation of transactions is actually one of the best features of Iroha now and Iroha2 will definitely continue this.
You need 2 temporary caches. Pending transactions and pending MST transactions. Blocks are created from pending transactions cache. MST transactions sit in the cache until they expire or until they get signatures needed from signatories, which will then enable them to move to the pending transactions cache and be put into a block
Without an MST transactions cache, multisig has to be done interactively with the clients, which is really terrible for app devs. Instead in Iroha, you can just send your signature to the server and the Iroha nodes will automagically collect all the signatures from clients and then confirm the transaction once the conditions are met.