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

Backport change to checkpoints format #2219

Merged
merged 4 commits into from
Apr 7, 2022
Merged

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Apr 7, 2022

paritytech/substrate#9284 accidentally modified the checkpoints format. This PR backports this change.

We maintain compatibility with older checkpoints by not actually adding the new field but instead using decode instead of decode_all. Contrary to decode_all, decode succeeds even if there is data remaining after the decoded value, meaning that the additional field will not lead to an error.

This PR also updates the checkpoint in the Polkadot spec. I tested this PR with Westend (that uses an old checkpoint) and Polkadot (that uses a new checkpoint).

Copy link
Contributor

@mergify mergify bot left a comment

Choose a reason for hiding this comment

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

Automatically approving tomaka's pull requests. This auto-approval will be removed once more maintainers are active.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2022

twiggy diff report

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


 Delta Bytes │ Item
─────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
        -615 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::AuthoritySet>::decode::h6e81b20e098f6333
        +615 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::AuthoritySet>::decode::hd5fa21b475a6a5ff
        +555 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::BabeEpoch>::decode::h4e9508a1fad76102
        -555 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::BabeEpoch>::decode::h8451f07c45ee4ec3
        -485 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::PendingChange>::decode::h5d1802388957fd7e
        +485 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::PendingChange>::decode::hec90a7f090f78772
        -467 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::ForkTreeNode<T>>::decode::h881cea6f37472318
        +467 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::ForkTreeNode<T>>::decode::hbe10b62b2fa0e982
        -418 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::ForkTreeNode<T>>::decode::h255932ad5ef03be3
        +418 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::ForkTreeNode<T>>::decode::h66ee4d6e7f189a7c
        -357 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::PersistedEpoch>::decode::h42833c8fea41f164
        +357 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::PersistedEpoch>::decode::h9a159a290e889a0f
        -347 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::PersistedEpochHeader>::decode::h36613fcf15030f96
        +347 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::PersistedEpochHeader>::decode::h7be5a88c53356026
        -292 ┊ <T as parity_scale_codec::decode_all::DecodeAll>::decode_all::ha32e6e93987d342d
        -258 ┊ <T as parity_scale_codec::decode_all::DecodeAll>::decode_all::hfcf1af9bfc31850a
        +256 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::BabeAuthority>::decode::h560ed510626df89d
        -256 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::BabeAuthority>::decode::hefa06c831bf36550
        -256 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::GrandpaAuthority>::decode::h1d32ebbfa08bc530
        +256 ┊ smoldot::chain_spec::light_sync_state::_::<impl parity_scale_codec::codec::Decode for smoldot::chain_spec::light_sync_state::GrandpaAuthority>::decode::h2d2c5cb087f10545
         -60 ┊ ... and 11 more.
        -928 ┊ Σ [31 Total Rows]

@tomaka
Copy link
Contributor Author

tomaka commented Apr 7, 2022

I've opened paritytech/polkadot-sdk#60

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

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

👍

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Apr 7, 2022
@mergify mergify bot merged commit a49039d into paritytech:main Apr 7, 2022
@tomaka tomaka deleted the fix-checkpoint branch April 7, 2022 12:40
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