From b3cf97940cca0995d59d191204b7efd556264d52 Mon Sep 17 00:00:00 2001 From: Robert Habermeier <rphmeier@gmail.com> Date: Wed, 12 Feb 2020 13:15:49 +0100 Subject: [PATCH] add some more docs on PreRuntime digests (#4896) --- substrate/primitives/runtime/src/generic/digest.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/substrate/primitives/runtime/src/generic/digest.rs b/substrate/primitives/runtime/src/generic/digest.rs index 4d09b587932..9d4fbe48d55 100644 --- a/substrate/primitives/runtime/src/generic/digest.rs +++ b/substrate/primitives/runtime/src/generic/digest.rs @@ -87,6 +87,12 @@ pub enum DigestItem<Hash> { /// the consensus engine can (and should) read them itself to avoid /// code and state duplication. It is erroneous for a runtime to produce /// these, but this is not (yet) checked. + /// + /// NOTE: the runtime is not allowed to panic or fail in an `on_initialize` + /// call if an expected `PreRuntime` digest is not present. It is the + /// responsibility of a external block verifier to check this. Runtime API calls + /// will initialize the block without pre-runtime digests, so initialization + /// cannot fail when they are missing. PreRuntime(ConsensusEngineId, Vec<u8>), /// A message from the runtime to the consensus engine. This should *never* -- GitLab