Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate header type and storage type #1627

Closed
Tracked by #1703
svyatonik opened this issue Nov 11, 2022 · 1 comment · Fixed by #1701
Closed
Tracked by #1703

Separate header type and storage type #1627

svyatonik opened this issue Nov 11, 2022 · 1 comment · Fixed by #1701
Assignees

Comments

@svyatonik
Copy link
Contributor

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;
 ...
}
@svyatonik
Copy link
Contributor Author

I'm prioritizing this issue, since we're now changing the "scope" of our pallets to specific case. So would be better to have this asap.

The same thing may be done for the parachains pallet (would require head parser configuration for every parachain)

@svyatonik svyatonik self-assigned this Dec 2, 2022
svyatonik pushed a commit that referenced this issue Jul 17, 2023
Bumps [scale-info](https://github.com/paritytech/scale-info) from 2.1.2 to 2.2.0.
- [Release notes](https://github.com/paritytech/scale-info/releases)
- [Changelog](https://github.com/paritytech/scale-info/blob/master/CHANGELOG.md)
- [Commits](https://github.com/paritytech/scale-info/commits)

---
updated-dependencies:
- dependency-name: scale-info
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant