Skip to content

Pallet KV: Decrease storage and computational overhead #819

Description

@sameh-farouk

Emitting too much information in events can be wasteful and inefficient, as it may consume unnecessary on-chain storage space. Currently, we emit the value alongside the account id and user key for each event (when creating and deleted key-pair). However, this is redundant since the value can be retrieved from the kv storage by using the account id and the user key. given the value can be up to 2048 bytes, we are paying unnecessary storage costs. from substrate docs:

In general, events inform users or applications such as a block explorer that a change occurred. Events aren't intended to describe differences in state or to contain detailed information. You should use caution in adding more information to an event than is needed because additional information increases storage and computational overhead involved in producing events. If additional information about a change is needed, users can query the chain state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions