6

Does anyone know how events emitted from a contract?

I can't seem to find an authoritative answer while googling and I am kind of worried that they are synchronous.

1 Answer 1

8

Events are emitted when a transaction is mined into a block, in the order they are fired.

When watching a pending transaction, this suggests that filters are only notified of all events when the transaction is completed, but the order of events is preserved.

When [events] are called they cause the arguments to be stored in the transaction’s log - a special data structure in the blockchain. These logs are associated with the address of the contract and will be incorporated into the blockchain...

3
  • 1
    Ok, that clarifies some things. But what happens to the execution of a miner if its transaction log runs out of disk or takes a really long time to complete? Will this miner effectively block the execution for the entire network?
    – Daniel
    May 16, 2016 at 8:11
  • Each log costs gas and ultimately limited by the block gas limit so they are no problem for miners to handle.
    – eth
    May 16, 2016 at 8:19
  • 1
    @Daniel If a miner runs out of disk, it won't successfully mine the block, so some other node will. May 16, 2016 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.