Skip to content

Per-transaction triggers #4937

@mversic

Description

@mversic

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.

Sub-issues

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Projects

Status

High priority

Relationships

None yet

Development

No branches or pull requests

Issue actions