[Ethereum] Where do contract event logs get stored in the Ethereum architecture

eventslogssolidity

Background on Events:
https://github.com/ethereum/wiki/wiki/Solidity-Features

Events allow the convenient usage of the EVM logging facilities. Events are inheritable members of contracts. When they are called, they cause the arguments to be stored in the transaction's log. Up to three parameters can receive the attribute indexed which will cause the respective arguments to be treated as log topics instead of data. The hash of the signature of the event is always one of the topics. All non-indexed arguments will be stored in the data part of the log.

If not inside the smart contract container, where does the Log data reside?

Best Answer

Logs are part of the transaction receipts. They are generated by the clients when executing transactions and stored alongside the blockchain to allow retrieving them.

Logs are not part of the blockchain itself per se, since they are not required for consensus (they are just historical data), however they are verified by the blockchain as the transaction receipt hashes are stored inside the blocks.

Related Topic