cosmos / cosmos-sdk

:chains: A Framework for Building High Value Public Blockchains :sparkles:
https://cosmos.network/
Apache License 2.0
6.24k stars 3.61k forks source link

EPIC: Events #13074

Open tac0turtle opened 2 years ago

tac0turtle commented 2 years ago

Summary

Events have been used by many applications for internal state machine actions and external clients. There has been confusion on where events should be used and where they should not. Recently we saw Juno halt due to a misunderstanding of how events are emitted and thus incorrect reliance of nondeterministic ordering of events in the cosmos-sdk. While events are non deterministic it is unclear at which stage they are non-deterministic.

Problem Definition

It is unclear who events are for and what is the safest way to use them?

Work Breakdown

Things we can do today:

Related/Future Work:

migueldingli1997 commented 7 months ago

Hi, has there been any development around this? I have a use-case where I'm thinking of iterating over the events generated by modules (at BeginBlock) in my custom module's BeginBlock, and would like to understand if this is not recommended.

(I've posted this as a forum post on Discord as well just in case that's a better place for this)

migueldingli1997 commented 7 months ago

Hi, has there been any development around this? I have a use-case where I'm thinking of iterating over the events generated by modules (at BeginBlock) in my custom module's BeginBlock, and would like to understand if this is not recommended.

(I've posted this as a forum post on Discord as well just in case that's a better place for this)

The replies I've gotten from Discord indicate that the order of events can differ between one node and another, and so these should ideally be sorted if we're going to iterate over them.