iroha icon indicating copy to clipboard operation
iroha copied to clipboard

Trigger execution model

Open mversic opened this issue 6 months ago • 2 comments

Current execution model is this:

  1. isi produce events (including ExecuteTrigger event)
  2. triggers are matched against events and put into the queue for later execution
  3. after block commit they are executed in the matched order

Consider this case:

  1. register trigger that is activated on Account::MetadataInsert

  2. wait for block to be committed

  3. insert "key" into "alice" metadata

  4. mint "rose" for "alice"

  5. insert "key" into "alice" metadata

  6. wait for block to be committed

In this case trigger is executed twice at the end of the block instead of when actually triggered. This means that by the time trigger reacts to an event, the event is stale.

IMO this execution model is weird and not really reliable.

mversic avatar Aug 05 '24 12:08 mversic