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

Add support for digest item other type #2425

Merged
merged 4 commits into from
Jun 24, 2022

Conversation

fanyang1988
Copy link
Contributor

The DigestItem type in substrate has a other type:

pub enum DigestItemRef<'a> {
        ///...
	/// Any 'non-system' digest item, opaque to the native code.
	Other(&'a [u8]),
	///...
}

This will be used for some chain based on substrate, and if use this digestitem, the smoldot will failed to sync blocks from it.

This PR fix this problem by add this type to DigestItem.

@fanyang1988 fanyang1988 requested a review from tomaka as a code owner June 22, 2022 12:01
@cla-bot-2021
Copy link

cla-bot-2021 bot commented Jun 22, 2022

User @fanyang1988, please sign the CLA here.

Copy link
Contributor

@tomaka tomaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Just some nit.

src/header.rs Outdated Show resolved Hide resolved
src/header.rs Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Jun 22, 2022

twiggy diff report

Difference in .wasm size before and after this pull request.


 Delta Bytes │ Item
─────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────
       +2297 ┊ smoldot::header::DigestItemRef::scale_encoding::habfb102cc6170922
       +2221 ┊ smoldot::header::decode_item::h039dd64e1adad4f3
       +2128 ┊ smoldot::executor::host::HostVmPrototype::run_vectored::h00336a7c40714737
       -2128 ┊ smoldot::executor::host::HostVmPrototype::run_vectored::ha37e5cb529741eae
       -2120 ┊ smoldot::header::DigestItemRef::scale_encoding::hc0b51d9a08e6b3a7
       +2049 ┊ <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::next::h432f3a3748ed5d5e
       -2049 ┊ <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::next::he340e64beffe3da1
       -1985 ┊ smoldot::header::decode_item::h2698e13b5ccaa48c
       +1924 ┊ <alloc::vec::Vec<T,A> as core::clone::Clone>::clone::hed4e0d859c2ad1b9
       -1872 ┊ <alloc::vec::Vec<T,A> as core::clone::Clone>::clone::hf7efca5ce0a7d0f2
       +1038 ┊ <smoldot::header::DigestItem as core::convert::From<smoldot::header::DigestItemRef>>::from::hd4c13201c3b4cc4e
        -969 ┊ <smoldot::header::DigestItem as core::convert::From<smoldot::header::DigestItemRef>>::from::hac44ddc00bed56dd
        -790 ┊ <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::fold::h58e79f49ba648a2a
        +790 ┊ <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::fold::h8b42abfa55cc78e8
        +771 ┊ <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::fold::h3259c26d93f5b5f7
        -771 ┊ <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::fold::hc42dc7b2c472e926
        +692 ┊ <smoldot::header::DigestItemRef as core::convert::From<&smoldot::header::DigestItem>>::from::h03d6c788f46ff0d1
        -656 ┊ <smoldot::header::DigestItemRef as core::convert::From<&smoldot::header::DigestItem>>::from::hf3bc34bf6d1adedd
        -648 ┊ smoldot::executor::runtime_host::run::h773fc55c97528118
        +648 ┊ smoldot::executor::runtime_host::run::h914460ce1944f8a5
         +60 ┊ ... and 79 more.
        +630 ┊ Σ [99 Total Rows]

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Jun 24, 2022
@mergify mergify bot merged commit 3e7ea83 into paritytech:main Jun 24, 2022
tomaka added a commit to tomaka/substrate-lite-1 that referenced this pull request Jun 24, 2022
mergify bot pushed a commit that referenced this pull request Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge pull request as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants