Skip to content

Separate header type and storage type #1627

Closed
@svyatonik

Description

@svyatonik

GRANDPA and parachains finality pallets are accepting the chain header/head and storing it directly in the runtime. For most of cases (including ours) we may only store the storage root, thus decreasing the occupied runtime storage + message transactions bandwidth (?).

The implementation may look like:

trait HeaderArtifacts {
  type Artifacts;
  fn into(header: Header) -> Self::Artifacts;
}

struct StorageRootArtifact;
impl HeaderArtifacts for StorageRootArtifact {
  type Artifacts = H256;
  fn into(header: Header) -> H256 {
    *header.storage_root()  
  }
}

...

impl pallet_grandpa::Config for Runtime {
 ...
 type Artifacts = StorageRootArtifact;
 ...
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions