Skip to content

Commit

Permalink
Run benchmarks [run-benchmarks schemas,messages,stateful-storage]
Browse files Browse the repository at this point in the history
  • Loading branch information
aramikm committed Oct 25, 2023
1 parent 2130b16 commit 7c90126
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions designdocs/schema_v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# On Chain Message Storage

## Context and Scope
The proposed feature consists of changes that is going to be one (or more) pallet(s) in runtime of a
Substrate based blockchain, and it will be used in all environments including production.

## Problem Statement
After introduction of **Proof of Validity** or **PoV** in runtime weights, all pallets should be
re-evaluated and refactored if necessary to minimize the usage of **PoV**. This is to ensure all
important operations are scalable.
This document tries to propose some changes on **Schemas** pallet to optimize the **PoV** size.

## Goals
- Minimizing Weights including **execution times** and **PoV** size.

## Proposal
Split Schemas into `SchemaInfo` and `payload` would allow lower **PoV** when verifying schema existence
or compatibility.

### Main Storage types
- **SchemaInfos**
- _Type_: `StorageMap<SchemaId, SchemaInfo>`
- _Purpose_: Main structure To store related properties of any schema
index
- **SchemaPayloads**
- _Type_: `StorageMap<SchemaId, BoundedVec<u8>>`
- _Purpose_: Stores the payload or model for each schema


### On Chain Structure
Following is a proposed data structure for storing schema information on chain.
```rust
pub struct SchemaInfo {
/// The type of model (AvroBinary, Parquet, etc.)
pub model_type: ModelType,
/// The payload location
pub payload_location: PayloadLocation,
/// additional control settings for the schema
pub settings: SchemaSettings,
}
```

0 comments on commit 7c90126

Please sign in to comment.