hyperledger / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
434 stars 277 forks source link

[BUG]: Trigger is not callable by multiple users (stable) #4418

Closed Erigara closed 4 weeks ago

Erigara commented 4 months ago

THIS ISSUE ALREADY FIXED ON LATEST iroha2-dev branch, however we should consider backport.

On the iroha2-stable branch, it's possible to call trigger only by single user.

This happens because ExecuteTriggerEventFilter allows accept only single account.

Solution would be to accept either single user or any user (permission to execute should be checked by executor).

mversic commented 4 months ago

has this backport been requested by anyone?

Erigara commented 4 months ago

yes, it was requested by CBDC team (after discussion with @Stukalov-A-M).

AlexStroke commented 2 months ago

Scenario to check and automation:

  1. Register the domain "kingdom".
  2. Register the account "bob@kingdom".
  3. Register the trigger "trigger$kingdom" to mint the asset "rose#wonderland".
  4. Execute the trigger "trigger$kingdom" by the user "alice@wonderland".
  5. Grant the permission token "CanExecuteUserTrigger" to "bob@kingdom".
  6. Execute the trigger "trigger$kingdom" by the user "bob@kingdom".
  7. Revoke the permission token "CanExecuteUserTrigger" from "bob@kingdom".
  8. Attempt to execute the trigger "trigger$kingdom" again by the user "bob@kingdom".