mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 03:31:05 +00:00
Relay-parent digest logs for parachains (#2552)
* add digest item for relay-parent to primitives * add a relay-parent-storage-root digest as a workaround * more docs * deposit log in pallet-parachain-system * even more docs * fix duplicate imports after botched mertge * fix hyperlinks in docs * clean up match Co-authored-by: Bastian Köcher <git@kchr.de> * improve docs * fix typo * add number to the digest item --------- Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -385,6 +385,16 @@ pub mod pallet {
|
||||
)
|
||||
.expect("Invalid relay chain state proof");
|
||||
|
||||
// Deposit a log indicating the relay-parent storage root.
|
||||
// TODO: remove this in favor of the relay-parent's hash after
|
||||
// https://github.com/paritytech/cumulus/issues/303
|
||||
frame_system::Pallet::<T>::deposit_log(
|
||||
cumulus_primitives_core::rpsr_digest::relay_parent_storage_root_item(
|
||||
vfp.relay_parent_storage_root,
|
||||
vfp.relay_parent_number,
|
||||
),
|
||||
);
|
||||
|
||||
// initialization logic: we know that this runs exactly once every block,
|
||||
// which means we can put the initialization logic here to remove the
|
||||
// sequencing problem.
|
||||
|
||||
@@ -1006,3 +1006,18 @@ fn upgrade_version_checks_should_work() {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deposits_relay_parent_storage_root() {
|
||||
BlockTests::new().add_with_post_test(
|
||||
123,
|
||||
|| {},
|
||||
|| {
|
||||
let digest = System::digest();
|
||||
assert!(cumulus_primitives_core::rpsr_digest::extract_relay_parent_storage_root(
|
||||
&digest
|
||||
)
|
||||
.is_some());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user