5

In other blockchains I practiced extreme frugality with event data, since it is expensive.
For example only putting an ID into an event which can then be looked up with lookup(ID) -> InterestingData.

Is this also necessary in Substrate?
Is there an incentive to keep event data small?

This is a legit Q, I have no clue.

1 Answer 1

7

For Substrate events are also "expensive". Events are in the state of each block. This means that archive nodes for example need to store all events of all blocks that ever happened. So, if you have data in the state anyway, you should link to it or just put the hash of the data into the event.

Is there an incentive to keep event data small?

Everything that goes to the state and is not part of the main business logic, should be as small as possible. For example the DispatchError was also designed in a way to use as less as possible storage.

Your Answer

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

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