Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Trigger's execution queue is cleared on a new block #4429

Open
Erigara opened this issue Apr 12, 2024 · 4 comments
Open

[BUG]: Trigger's execution queue is cleared on a new block #4429

Erigara opened this issue Apr 12, 2024 · 4 comments
Labels
Bug Something isn't working Dev defect The defect was found at the development stage. Did not have an impact on users. iroha2-dev The re-implementation of a BFT hyperledger in RUST

Comments

@Erigara
Copy link
Contributor

Erigara commented Apr 12, 2024

Currently it's not possible to create trigger execution chain.
So that events produced in one trigger would be consumed in another trigger (or in the same trigger) in the next block.

Fix itself is pretty simple we need clone matched_ids in impl Clone at core/src/smartcontracts/isi/triggers/set.rs .

But this fix leads to infinite recursion problem.
If trigger produces >1 event it can consume later it execution would grow exponentially.
This would work not only with the single trigger but with any set of triggers which are "calling" each other.

@Erigara Erigara added Bug Something isn't working Dev defect The defect was found at the development stage. Did not have an impact on users. labels Apr 12, 2024
@Erigara
Copy link
Contributor Author

Erigara commented Apr 12, 2024

As discussed with @Mingela iroha now works in permissioned setups so having recussion problems is OK, it's operator responsibility to control this.

Erigara added a commit to Erigara/iroha that referenced this issue Apr 12, 2024
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Erigara added a commit to Erigara/iroha that referenced this issue Apr 12, 2024
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
@Mingela
Copy link
Contributor

Mingela commented Apr 16, 2024

For the public mode the target solution should be designed thoroughly. I object inability of trigger chain calls, that's a huge flexibility/optimization opportunity. Some points to consider:

  • Limiting fuel per block instead/together with per trigger (or cross-trigger 'transaction' in case of a chain of calls) + strategies for overflows (prioritization etc)
    • In the public mode the fuel consumed may be used for the fee calculation though limiting that might make no sense at all, though block capacity is usually limited anyway
  • Configuring execution queue event time to live per network/consuming trigger
  • Endless recursion prevention analysis?
  • Number of events generated to become declining eventually analysis?

@mversic
Copy link
Contributor

mversic commented Apr 17, 2024

this is quite hard to prevent at the time of registering trigger, if not impossible because we don't know what events a trigger will produce when executed. Even if we did we don't know under which conditions an event is produced and whether these conditions will coincide with conditions of another trigger to create positive feedback loop

@mversic
Copy link
Contributor

mversic commented Apr 17, 2024

also, it's possible that positive feedback loop will be self dampening due to changing conditions in the blockchain. So it may only be temporary and not create a problem for blockchain operation

Erigara added a commit to Erigara/iroha that referenced this issue Apr 18, 2024
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
Erigara added a commit that referenced this issue Apr 18, 2024
Signed-off-by: Shanin Roman <shanin1000@yandex.ru>
@nxsaken nxsaken added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Dev defect The defect was found at the development stage. Did not have an impact on users. iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

No branches or pull requests

4 participants