Module dock_runtime::accumulator
source · Modules
- The module that hosts all the FRAME types needed to add this pallet to a runtime.
Structs
- Accumulator identifier.
- Accumulator owner - DID with the ability to control given accumulator keys, params, etc.
- Can be used to configure the genesis state of this pallet.
- The pallet implementing the on-chain logic.
Enums
- Contains one variant per dispatchable that can be called by an extrinsic.
- Custom dispatch errors of this pallet.
- The event emitted by this pallet.
Traits
- Configuration trait of this pallet.
Type Definitions
- Public key storage is kept separate from accumulator storage and a single key can be used to manage several accumulators. It is assumed that whoever (DID) owns the public key, owns the accumulator as well and only that DID can update accumulator.
- Stores latest accumulator as key value: accumulator id -> (created_at, last_updated_at, Accumulator)
created_at
is the block number when the accumulator was created and is intended to serve as a starting point for anyone looking for all updates to the accumulator.last_updated_at
is the block number when the last update was sent.created_at
andlast_updated_at
together indicate which blocks should be considered for finding accumulator updates. Historical values and updates are persisted as events indexed with the accumulator id. The reason for not storing past values is to save storage in chain state. Another option could have been to store block numbers for the updates so that each block fromcreated_at
doesn’t need to be scanned but even that requires large storage as we expect millions of updates. Just keeping the latest accumulated value allows for any potential on chain verification as well. - ModuleDeprecatedType alias to
Pallet
, to be used byconstruct_runtime
.