mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 12:07:57 +00:00
Add runtime support for PreRuntime and Consensus digests (#2757)
* Try to fix runtime panic
Does not work
* Fix trivial typo
* Add runtime support for `PreRuntime` and `Consensus` digests
Fixes c7d1204ce5
* Fix silly compile error.
* Fix overly-long lines
Also remove some in-progress code that would not wind up being useful
anyway.
* Respond to review comments
* delete `unset RUSTC_WRAPPER` from scripts/common.sh
* delete unnecessary `use aura::AURA_ENGINE_ID` from
`node/runtime/src/lib.rs`
* add comments explaining why `PreRuntime` and `Consensus` must be
special-cased in `core/sr-primitives/lib.rs`
* switch to using `$crate::rstd::marker::PhantomData` in
`impl_outer_log!`
* improve documentation of `DigestItem::Seal`
* Fix compilation and add proof that we do not panic
Also fix some warnings.
* Apply suggestions from code review
Mostly for readability
Co-Authored-By: Sergei Pepyakin <s.pepyakin@gmail.com>
* Apply suggestions from code review
Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
* $crate::rstd::marker::PhantomData → Default::default()
The import is still needed, as `Default::default()` can’t be used in
patterns.
* Bump `spec_version`
Also do some reformatting.
This commit is contained in:
committed by
Bastian Köcher
parent
4d476161e2
commit
53e8ad8728
@@ -74,13 +74,14 @@ pub enum DigestItem<Hash, AuthorityId, SealSignature> {
|
||||
/// be generated by the native code of any consensus engine, but this is not
|
||||
/// checked (yet).
|
||||
Consensus(ConsensusEngineId, Vec<u8>),
|
||||
/// Put a Seal on it.
|
||||
/// Put a Seal on it. This is only used by native code, and is never seen
|
||||
/// by runtimes.
|
||||
Seal(ConsensusEngineId, SealSignature),
|
||||
/// A pre-runtime digest.
|
||||
///
|
||||
/// These are messages from the consensus engine to the runtime, although
|
||||
/// the consensus engine can (and should) read them itself to avoid
|
||||
/// code and state duplication. It is erroneous for a runtime to produce
|
||||
/// code and state duplication. It is erroneous for a runtime to produce
|
||||
/// these, but this is not (yet) checked.
|
||||
PreRuntime(ConsensusEngineId, Vec<u8>),
|
||||
/// Any 'non-system' digest item, opaque to the native code.
|
||||
@@ -110,7 +111,8 @@ pub enum DigestItemRef<'a, Hash: 'a, AuthorityId: 'a, SealSignature: 'a> {
|
||||
/// be generated by the native code of any consensus engine, but this is not
|
||||
/// checked (yet).
|
||||
Consensus(&'a ConsensusEngineId, &'a Vec<u8>),
|
||||
/// Put a Seal on it.
|
||||
/// Put a Seal on it. This is only used by native code, and is never seen
|
||||
/// by runtimes.
|
||||
Seal(&'a ConsensusEngineId, &'a SealSignature),
|
||||
/// A pre-runtime digest.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user