-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Emit log on Runtime Code change. #9580
Changes from 8 commits
467aa71
7d89a5b
38abfa5
7123eec
947ed2c
33e440e
717a680
ed0943d
8c03efa
6e99b76
3897dac
4803778
b3df42a
dadea43
b403705
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,6 +118,14 @@ pub enum DigestItem<Hash> { | |
|
||
/// Some other thing. Unsupported and experimental. | ||
Other(Vec<u8>), | ||
|
||
/// An indication for the light clients that the runtime execution | ||
/// environment is updated. | ||
/// | ||
/// Currently this is triggered when: | ||
/// 1. Runtime code blob is changed or | ||
/// 2. `heap_pages` value is changed. | ||
RuntimeCodeOrHeapPagesUpdated, | ||
} | ||
|
||
/// Available changes trie signals. | ||
|
@@ -184,6 +192,8 @@ pub enum DigestItemRef<'a, Hash: 'a> { | |
ChangesTrieSignal(&'a ChangesTrieSignal), | ||
/// Any 'non-system' digest item, opaque to the native code. | ||
Other(&'a Vec<u8>), | ||
/// Runtime code or heap pages updated. | ||
RuntimeCodeOrHeapPagesUpdated, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now the story about heap pages is in flux. AFAIU, there is an interest to get rid of heap pages and or change the semantics at least. In that case, maybe it would be better to split those digests in two: runtime code updated and heap pages updated? Then, if needed we deprecate the heap pages. The alternative would be to leave it as is and then change the semantics of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I preferred There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @thiolliere @bkchr are you guys okay to revert back to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also think that once we remove HeapPages stuff, RuntimeCodeOrHeapPagesUpdated always mean RuntimeCodeUpdated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverted back to |
||
} | ||
|
||
/// Type of the digest item. Used to gain explicit control over `DigestItem` encoding | ||
|
@@ -199,6 +209,7 @@ pub enum DigestItemType { | |
Seal = 5, | ||
PreRuntime = 6, | ||
ChangesTrieSignal = 7, | ||
RuntimeCodeOrHeapPagesUpdated = 8, | ||
} | ||
|
||
/// Type of a digest item that contains raw data; this also names the consensus engine ID where | ||
|
@@ -225,6 +236,7 @@ impl<Hash> DigestItem<Hash> { | |
Self::Seal(ref v, ref s) => DigestItemRef::Seal(v, s), | ||
Self::ChangesTrieSignal(ref s) => DigestItemRef::ChangesTrieSignal(s), | ||
Self::Other(ref v) => DigestItemRef::Other(v), | ||
Self::RuntimeCodeOrHeapPagesUpdated => DigestItemRef::RuntimeCodeOrHeapPagesUpdated, | ||
} | ||
} | ||
|
||
|
@@ -322,6 +334,8 @@ impl<Hash: Decode> Decode for DigestItem<Hash> { | |
DigestItemType::ChangesTrieSignal => | ||
Ok(Self::ChangesTrieSignal(Decode::decode(input)?)), | ||
DigestItemType::Other => Ok(Self::Other(Decode::decode(input)?)), | ||
DigestItemType::RuntimeCodeOrHeapPagesUpdated => | ||
Ok(Self::RuntimeCodeOrHeapPagesUpdated), | ||
} | ||
} | ||
} | ||
|
@@ -457,6 +471,9 @@ impl<'a, Hash: Encode> Encode for DigestItemRef<'a, Hash> { | |
DigestItemType::Other.encode_to(&mut v); | ||
val.encode_to(&mut v); | ||
}, | ||
Self::RuntimeCodeOrHeapPagesUpdated => { | ||
DigestItemType::RuntimeCodeOrHeapPagesUpdated.encode_to(&mut v); | ||
}, | ||
} | ||
|
||
v | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like doc here or doc for the
SetCode
could mention about the log that needs to be deposited.But it is hard to see where to tell about it.